Genel olarak pozitif, negatif ve nötr dilin ölçümü anlamına gelen duygu analizi fikir madenciliği (opinion mining) olarak da anılır. Bu analiz ürünlerden, reklamlardan, lokasyonlardan, reklamlardan ve hatta rakiplerden ortaya çıkan müşteri düşüncelerini açığa çıkarır. Müşterilerin hoşlandığı veya hoşlanmadığı ürünlerin tespitinde bu analiz önemli rol oynayarak, ürün gamı ve ürünün kalitesi buna göre şekillenmektedir. Diğer bir deyişle, firmalar müşterilerin ne hissettiğini ve düşündüğünü bilmesi gerekir. Bunun yanısıra duygu analizi (sentiment analysis) kendisine bir çok farklı alanda uygulama alanı bulmaktadır. Bunların bir kaçı şöyledir;
Duygu analizi çalışmalarında duygu sözlükleri adı verilen “lexicon” lardan yaygın bir şekilde yararlandığı görülmektedir. Analizde kullanılan metin NRC lexiconu açısından analiz edilmiştir. NRC lexiconu hesaplamalı dil bilimci Saif Mohammad tarafından geliştirilmiş olup bu leksikon sözlüğünde pozitif ve negatif duyguları (sentiments) içeren 8 his (emotion) bulunmaktadır. Bu hisler şöyledir;
Yukarıdan bahsedilen NRC leksikon testi, metindeki cümleler baz alınarak pozitif ve negatif duygu grubunda yapıldıktan sonra bu duygu grubu içinde yer alan 6 his için de yapılarak grafik olarak aşağıda sunulacaktır.
NRC leksikon testi yapıldıktan sonra ayrıca cümle bazında polarite (polarity) testi de yapılarak pozitif ve negatif duygulardan hangisinin metne hakim olduğu ortaya konulacaktır.
Aşağıda üzerinde örnek uygulama yapılacak 142 cümleden oluşan metin, “https://www.gutenberg.org/files/57646/57646-0.txt” web adresli açık kaynak kütüphanesinden alınmıştır. Yararlanılan metin, M. S. Wellby’in “Through Unknown Tibet” adlı eserinin 18’inci bölümünden alınarak özgün bir örnek uygulama yapılmıştır.
"We were now reduced to twenty-eight animals, and we knew our muleteers to be so careless and untrustworthy a lot, that we resolved that henceforth one of us should always remain with them and the mules—never, in fact, let them out of our sight. This would ensure the animals being properly cared for, and would be a prevention against the muleteers forming any scheme for desertion. We decided, too, to make very easy marches. We continued to see snow mountains in all directions, and somehow or other managed to steer our way amongst them, either east or north-east, over valleys and plains or stony nullahs, but we were most unfortunate as to finding good grass. It must have been too early in the year, for in many places it was just beginning to sprout. Owing to the heavy loss to our transport we could only march some four or five miles the next day, which brought us to a big fresh-water lake, completely frozen over, resembling a large white sheet. Here we resolved to lighten our loads, and left on the ground a number of cartridges, horse shoes, cooking utensils, clothes, candles, etc., besides giving the mules and ponies a feast of forty pounds of flour made into bread. Some old pistols, rather heavy ones, which we had brought with us as presents for natives, we allowed the men to carry themselves, on the condition that should we require them as presents we would buy them back from them, otherwise they might retain them for ever. Every one, too, carried a certain number of cartridges, the men doing so under the proviso that we would lend them a rifle when game was close to camp. To celebrate the occasion we christened this lake Lake Lighten. The size of this frozen water was deceptive. Our direction took us over a portion of it which we reckoned to be about a mile across, but in reality this turned out to be six miles. On the other side we found good grass, and in a snug corner a very tiny fresh-water lake, or what we should call at home a duck-pond. Here were geese, antelope, and kyang, so we were able to make a substantial addition to our larder, which at that time was in the same state as Mother Hubbard's cupboard. This spot, too, became famous in its way for two events. First, it was here discovered that one of our carbines had been left behind the day before, and the men were so unwilling that none would go back to fetch it. To do more than they were obliged to do was quite against their grain. Secondly, another mule had to be shot, for he was too weak to rise and march. The next day another pony met the same fate, and we began to think our ammunition was more useful for this purpose than for killing game, which, as a rule, was scarce. Our march took us another six miles over the ice, and on the way we narrowly escaped losing one of the best mules, who dropped his hind legs in a crack; luckily, he was extricated unhurt, but he might easily have broken a leg. On the 13th of June we camped by another salt lake. From the top of a pass we had been rewarded with a very fine view of it, for the water under a cloudless sky was of a wonderfully bright blue, backed as it was by massive snow mountains, but detestable when near for its uselessness. As we marched along its banks, the heat was intense, the maximum thermometer registering 105° in the sun, and although there was no fresh water to be seen, we found some by digging, though not enough to satisfy our mules, and on making our tea, its constituency was, to say the least of it, thick; perhaps Esau's description of it was nearer the mark, for he said it was like jam. On warm days like this we were always glad to discard our heavy boots, and coats, while our little terrier Ruby could only lie and pant for breath. Such heat in the Chang at a height of between fifteen and sixteen thousand feet may seem to some people incredible. Its effect upon our animals was most disastrous, sapping their strength in no small degree, and on this account we decided in future to make an earlier march.In this little nullah we found three stones which from the way they were placed showed that they had been used for a fireplace, but not at any very recent date, more likely two or three years ago. This was the first sign of mankind since leaving Lanak La, and had probably been made by some nomads who had wandered in this direction. We here consumed two more of our remaining three bags of bhoussa, thereby still more lightening our loads.According to our intention, camp was astir at 3.30 A.M., and we were well off before 5 o'clock, and even at that hour it was so warm that our gloves were not even wanted. It was a grand morning, and as we faced the glorious rising sun, we were blinded by its brilliancy and found it most difficult at first to see precisely where we were going. After passing into a fairly grassy valley, the home of the kyang, we descended to a fresh-water lake. At the time when the caravan was approaching this water, we were both some distance off, shooting and taking observations, and blamed ourselves afterwards at having left the muleteers. These men knew the animals had been short of water lately, yet took no step to prevent the calamity which naturally occurred at the sight of a clean fresh-water lake. They, poor brutes, forgetful of the loads on their backs, with one accord made a simultaneous rush to satisfy their thirst. The water, although only two or three feet deep, concealed a treacherous bottom of several feet of soft mud and as they plunged in further and deeper, a general collapse ensued, and the mules and ponies lay in a heap unable to extricate themselves, with a good chance too of being drowned. Nor did any of our baggage benefit by the soaking it received. Each animal as he lay had to be unloaded separately, no easy undertaking, and then pulled out of the mud on his side by head and tail, by four or five men. Furthermore the weight of each load was considerably increased by this disaster, and as the going along the edge of the water was not of the best, there were more stragglers than ever into our new camp, two of them not even getting in at all. Around the lake were several antelope, while geese and Brahmini ducks were fairly plentiful.There appeared to be no outlet, and from the nature of the soil for some distance round the lake, we judged that its size varied in accordance with the rainfall. From this lake two routes were open to us, one running in a somewhat northerly direction through a good, grassy, watered valley, which we should have liked to have taken; but as the other route led almost due east, we took it, and perhaps made a wrong decision, for we came to a dried-up country, with small salt lakes, and had to dig deep in a dry river bed for water. The antelope we had slain made its mark upon the men, for the quantities of meat they ate made them lazy and late in making a start the next morning. As we moved off at six o'clock, there was a light mist hanging over the land, with no breath of wind to dissolve it, a pretty sure sign of a hot day. We began ascending for some miles, and then dipped into a dry river bed. This looked a likely place to find water again by digging, and as fair grass grew around, we decided to halt. We had only marched seven miles, yet there were stragglers, and four loads had to be abandoned. This loss we could ill afford, so agreed to halt another day, when we could send back some of our stoutest mules and recover the baggage. We had no fear whatever of a stranger turning up during the night and running off with some of the goods. As we intended remaining another day at this spot, it was indispensable that we should contrive some means for watering the animals properly. We found water flowing three or four feet below the surface, but a single hole was very quickly emptied, and then we had to wait until it had refilled, so that watering in this kind of way would have taken half the day. Every one, therefore, was set to work to dig water-holes. We carried with us a large waterproof sheet, and having made a trench in the sand, in the shape of a trough, we spread the sheet over it, and then filled it up from the various holes. In this way the mules and ponies could come and drink as often and as much as they liked, and they probably would have drunk more than they did, had not the water been somewhat saltish, with certain purging qualities. We also set about lessening the loads again, and many of the articles which we had imagined before to be absolutely necessary were here discarded. Two of our five little tents were abandoned, and we took the opportunity of photographing our last entire camp. Other things, too, were left, for our animals were dying at an alarming rate. Out of our original thirty-nine only twenty-one remained, including the riding pony of Shahzad Mir. Our own riding days had before this come to an end. Yet we had only come 150 miles from Lanak La, but our hopes of coming across nomads, from whom we might either purchase yak or exchange some of our own worn-out mules, strengthened us in our determination not to entertain for a moment the idea of turning back. The men, too, were so confident that we should ere long fall in with nomads that they became lavish with their rations. Instead of continuing the practice of doling their allowance out to them every three or four days, they had latterly been permitted to have the full run of it, after being made well aware how long the rations should last if they never exceeded the amount agreed upon. This plan was instituted because in spite of all our endeavours to regulate the consumption of food, yet in the dead of night they would undo and take out whatever extra they fancied, even when the foolhardiness of such a procedure was carefully explained to them. Nevertheless, we reaped one advantage from their avarice, namely, that the loads grew lighter in a shorter time than they otherwise would have done. One man, Mahomed Rahim, annoyed at being upbraided for his laziness and sulky temperament, threatened to turn back. This we gave him full permission to do, much to his astonishment, and on second thoughts he withdrew his threat, and even our own persuasion would not induce him to go. During our halt we were able to overhaul all the luggage. Some of it had suffered from the immersion in the lake, notably the contents of our dispatch box, for all our papers inside it had had a thorough soaking, and each one had to be put under a stone to be dried again, and to save it from being blown away by the strong wind. About half a mile from our camp was a solitary hill rising up between eight and nine hundred feet above the level of the camp. I climbed over the rocks to the summit of this to spy out the land, and see which would be the most favourable route to take. South-east of us lay a fine range of snow mountains, and I reckoned that if we could manage to steer just north of these, there would be no more difficulty about water to annoy us. All the ranges, large and small, seemed to run east and west, and it struck me how much more difficult, for this reason, it would be to traverse Tibet from north to south. Directly south of us, some sixty or eighty miles off, was another magnificent snow range with enormous white peaks. Some six or eight miles south-east was a dark blue salt lake, with two other smaller ones nestling close to it, and in the nullah immediately south of us grew grass which, for this country, was rich. Far away to the north again loomed another mighty snow range. Our own way eastwards, as far as I could make out, would take us past a small lake, and then, skirting round some low hills, turned up a nullah half left, where there seemed, through my glasses, to be good grass. On account of the heat we delayed our march till early in the afternoon. During a part of the morning we tested the skill of our muleteers in rifle shooting. We thought that, should we come across nomads who showed any signs of hostility, our men would have more confidence in their arms, and perhaps would not show the white feather. None of them could hit an empty bottle at forty yards, so the confidence in their aim received rather a demoralising shock. Two days after leaving this camp, we crossed over an easy pass of some 17,000 feet high, and about the top of this found a small white butterfly and a yellow flower, the first we had seen, and it was satisfactory to think that our flower press had not been carried along all this way for nothing, for it nearly shared the same fate as other things thrown away. A few miles further on, we camped in a grassy nullah, close by some heavy, craggy rocks. Finding the morning again too hot for the mules to march, we shouldered our rifles and set forth in search of game, and to try and find out the lay of the country ahead. We had completely run out of meat and had no wish to slay our single sheep, which for many days had marched along with us, the sole survivor of our flock. He had now become inured to hardships, was never fatigued, and was looked upon as our very last reserve in case of starvation. Although we actually found no game, yet we saw tracks of antelope, kyang, and one or two entire skeletons of yak. We were rewarded for our tramp in another way, when, from some high ground, we saw below us a fresh-water lake with rich grass growing around it, and we wondered why nomads did not go and live there if they knew of the spot. We hurried back to camp with the good news, so as to march to such a paradise as soon as possible, and halt there another day, to give our animals the opportunity of thoroughly enjoying the luxurious spot. Poor brutes, strive as hard as they might, there had been more casualties amongst them and we were reduced to nineteen, less than half our original number. On arrival at this lake, we found the centre portion of it was frozen over. By the edge of the water were a number of geese; but they might as well have been living in another country altogether, for they would give us no chance of shooting them, and we began to meditate the slaughter of our pet sheep, when, coming over the crest of a grassy rise, we spotted a herd of antelope. They were certainly timid, but, with a lucky longish shot, Malcolm knocked one over, saving us from hunger and our dear old sheep from an unmerited death. How often we looked at our living mutton with hungry feelings, it is hard to say, and how often an antelope just saved him from the slaughter-house would be equally hard to relate. We admired him, too, for his pluck and endurance, for he had long outstayed every other member of the flock. Our affection for him was great, and we even meditated his triumphal entry into China, and he would undoubtedly have accomplished it, had not an unforeseen mishap later on demanded his flesh and blood. Poor beast, if he had only known how we admired him, he would willingly have given us a dinner long ago. It was a great treat for all to get good water clear and fresh, for latterly the water we had been digging up had been mostly muddy and saltish. We were blessed with a perfect day for repose, the mules and ponies grazed along the edge of the lake, sometimes standing up to their fetlocks in the still water, a day of thorough enjoyment to them. All their swellings and sores too were doctored up and the shoeing looked to. Considering what they had undergone, their backs were in a very satisfactory state. Tents and clothes were mended and a general clear-up was organised, so much so that about midday, we and Ruby were bathing in the lake itself, and although the lake was partly frozen over with ice, and we were living at a height of nearly 16,000 feet, the water was quite enjoyable, and we could remain splashing about in it for half an hour, and afterwards bask naked in the sun. So much pleasure did we derive from this bath that we ordered all the men down for tubbing. They went, certainly, but the amount of washing they executed would not have been sufficient for some people. A climate like this at such a height struck us as truly marvellous. After seventeen degrees of frost by night, we found ourselves basking in the open in a temperature of 106 degrees, showing a variation of ninety degrees in the twenty-four hours. At 7 P.M. again, the thermometer registered as much as forty-eight degrees Fahr. Our route, as far as we could make out, lay over a large open plain with but scanty grass, and far off we could see a hill standing out alone conspicuously, a useful landmark for us to march on to. Without a distinct feature to make for, the caravan would very often zigzag down a broad valley and perhaps cover a mile or two more of ground than was necessary. We were off before 5 o'clock, with a keen morning air in our faces, but after a couple of hours the heat became so unbearable that we would fain have halted. We had, however, to march ten miles before we could find a spot at all suitable, where, too, we had to resort to digging for water. Around here we shot sand-grouse, excellent food. Owing to the impossibility of marching with the sun so powerful, we decided to make two short marches each day, one of three hours in the very early morning, and the second during the afternoon. The drawbacks to this method were the uncertainty of finding grass and water twice in one day, and the fatigue involved in doubling the work of collecting the animals and loading and unloading them. But to march ten miles straight away in one morning as we had just done would have been suicidal. We reckoned that by making these two short marches, we should cover rather more ground each day, about twelve miles. Whilst resting the animals, that they might recover from the results of the hot morning's march, we sent Esau on in front to spy out the land, who brought back the favourable news that lakes and grass were ahead of us, and no mountains to climb. It was bitterly cold as we moved off at 4.30, but no doubt a bracing morning for our animals, but as soon as the sun rose, the heat again made itself unpleasant, and we were glad to find a suitable camp before 8 o'clock. One of the mules, a big black one, could only carry his load a few yards, and had to be shot. Although at the end of the first march we had found a good halting place in a clean gravel-bedded nullah, with running water from the snow mountains, and fair grass, yet the second march ended by moonlight with no grass at all, and two of the ponies were left behind. Our second attempt at a double march failed. During the early morning we hit off a rivulet, which, as we continued to follow it, increased in volume, but on issuing from the nullah into a large open plain, this rivulet became a river, some ten yards across, and two feet deep, and wound away northwards. As our course took us due east, we reluctantly had to leave it, with the hope of meeting it again further on, and of finding its size still larger, so that we might be able to map out its course for a considerable distance. For some time afterwards we could see a silver streak in the distance, and beyond it an enormous range of snow mountains. As soon as we left the river and marched east, our route lay across a sandy gravel plain, and our chances of ever finding water and grass again seemed very small, when, fortunately, from one of the hills I climbed, I noticed a hidden dip in the ground, with grass, and here, as usual, water was found by digging. The number of our animals was still decreasing, and the strength of the survivors was growing weaker and weaker. We had to economise every cupful of grain, for that was the way we always doled it out. There were six bags remaining, in all about 480 pounds, and we reckoned that each bag would last out for eight marching days if we gave to each animal two cupfuls of grain _per diem._ There were only sixteen survivors. One of the mules showed an obstinate and mutinous frame of mind, for when loaded with his fair due, he absolutely refused to march; as soon as we gave him a light load, he trotted along gaily and felt no effects from the march. He was about the fattest and strongest mule we had, thereby convincing us that his inability to carry his proper amount of baggage was a mere sham, and in order that he should not get the better of us, we gave his grain to others who did his work, until he saw the folly of his obstinacy. On viewing the country from a neighbouring hill, I found that if we marched due east we should meet with obstacles in the shape of innumerable steep nullahs of red, sandy soil, but that by marching north-east we should travel over undulating grassy ground skirting round a small range of hills. This latter route we decided upon, with the hopes of marching due east again before very long. We also made up our minds to try and find a good camp where we could halt for two days, so that during that time we could send off men north and south, with food to last them, in order to search for signs of people. Even if the men were not successful in their object, still we reflected that the animals would be gaining strength and a complete rest all the while. At 3.45 A.M., 23rd June, Camp 36, we were drinking our cocoa with chupatty in the open, without feeling any discomfort from the cold, preparatory to marching. We required neither gloves nor coats, and we almost imagined we were about to start for an early morning shoot in the Indian plains. For the next two days we made successful double marches, inasmuch as there were no transport disasters. As usual, we dug for water, and found it brackish for our labours. Towards the end of the second day, we came to a small nullah with beautifully green grass, and two tiny pools of water almost fresh. Imprinted on the moist sandy soil were marks of kyang, antelope, and yak. Evidently we had hit upon a favourite drinking resort of game, and accordingly pitched our tents just out of sight but close to the pools, expecting to get as much food as we wanted, for it was no easy matter to keep ourselves supplied in meat. Although we stopped here a day, the only game that came for his drink was a cock sand-grouse, who suffered the penalty of death for his intrusion, while just above the camp was an old hen, who sat undisturbed upon her nest. We should have had to be a good deal hungrier than we were before we could have found it in our hearts to kill her."
R’da yapılan analiz sonucunda, her bir leksikonun cümle düzeyindeki toplamları aşağıda gösterilmiştir.
NRC leksikonundaki 6 hissin metindeki yüzdesel yoğunluğu ise aşağıda grafikte gösterilmiştir. Burada, 6 his içinde güven (trust) hissinin öne çıktığı göze çarpmaktadır.
NCR leksikonuna göre metinde cümle bazlı pozitif ve negatif his grubunun skalası aşağıdaki grafikte özetlenmiş olup, pozitif hislerin ağırlıkta olduğu görülmektedir.
NRC leksikon testi yapıldıktan sonra cümle bazlı olarak polarite testi de yapılmıştır. Zıtlık anlamına gelen polarite testinde elde edilen sonuçlar -1 ile +1 arasındaki skalada değerlendirilir. Yeşil olan skorlar pozitif hissi, kırmızı olanlar ise negatiflik hissini göstermektedir. Aşağıdaki linkten cümle bazlı polarite testine ulaşabilirsiniz.
Pdf dokümanını indirmek için buraya tıklayınız : POLARİTE TESTİ
R’da 27 Şubat 2021 tarihinde duygu analizi üzerine yaptığım “R’da Duygu Analizi Üzerine Vaka Çalışmaları: Case Studies on Sentiment Analysis in R” adlı çalışmaya aşağıdaki linkten ulaşabilirsiniz.
Yapılan bu çalışmaların, özellikle keşifsel veri analizi (exploratory data analysis), metin madenciliği (text mining) ve nitel araştırma alanına önemli bir katkı sunacağı inancındayım.
Faydalı olması dileğiyle…
- Saif Mohammad and Peter Turney. “Emotions Evoked by Common Words and Phrases: Using Mechanical Turk to Create an Emotion Lexicon.” In Proceedings of the NAACL-HLT 2010 Workshop on Computational Approaches to Analysis and Generation of Emotion in Text, June 2010, LA, California. See: http://saifmohammad.com/WebPages/lexicons.html
- Christopher SG Khoo and Sathik Basha Johnkhan. (2017). Lexicon-based sentiment analysis: Comparative evaluation of six sentiment lexicons. Journal of Information Science, 44(4):491-
- NRC-Canada-2014: Detecting Aspects and Sentiment in Customer Reviews, Svetlana Kiritchenko, Xiaodan Zhu, Colin Cherry, and Saif M. Mohammad. In Proceedings of the eighth international workshop on Semantic Evaluation Exercises (SemEval-2014), August 2014, Dublin, Ireland.
- NRC-Canada-2014: Recent Improvements in Sentiment Analysis of Tweets, Xiaodan Zhu, Svetlana Kiritchenko, and Saif M. Mohammad. In Proceedings of the eighth international workshop on Semantic Evaluation Exercises (SemEval-2014), August 2014, Dublin, Ireland.
- Proceeding COLING ’04 Proceedings of the 20th international conference on Computational Linguistics, Determining the sentiment of opinions, Geneva, Switzerland — August 23 – 27, 2004. Article No. 1367
- Marina Sokolova , Guy Lapalme, Verbs speak loud: verb categories in learning polarity and strength of opinions, Proceedings of the Canadian Society for computational studies of intelligence, 21st conference on Advances in artificial intelligence, p.320-331, May 28-30, 2008, Windsor, Canada
Not: Emeğe saygı adına, yapılan çalışmanın başka bir mecrada ya da ortamda paylaşılması halinde alındığı yer adının belirtilmesini rica ederim.