Sentiment analysis
Asked Answered
G

4

7

while performing sentiment analysis, how can I make the machine understand that I'm referring apple (the iphone), instead of apple (the fruit)?

Thanks for the advise !

Graft answered 17/2, 2013 at 18:54 Comment(2)
yeap.. in terms of coding.. Im using Python.. Please advise thanks!Graft
You could probably use word embeddings to identify context.Visualize
L
4

Well, there are several methods,

I would start with checking Capital letter, usually, when referring to a name, first letter is capitalized.

Before doing sentiment analysis, I would use some Part-of-speech and Named Entity Recognition to tag the relevant words.

Stanford CoreNLP is a good text analysis project to start with, it will teach you the basic concepts.

Example from CoreNLP:

enter image description here

You can see how the tags can help you.

And check out more info

Lambency answered 17/2, 2013 at 19:5 Comment(3)
Thank You so much for the guide, Ofiris. I'll study into it. Much thanks ! :)Graft
yup I read abt nltk.. considered the best? i seee.. well i'm doing twitter sentiment analysis on product's brand. considered new in python. and not so strong in programming. appreciate ur guidance. The effective approach would be performing POS tagging n the named entitiy recognition to filter up the irrelevant tweets, then perform classification using naive bayes classifier? found many articles doing it in different approaches, but i'm kinda confused..Graft
Top NLTK questions, Hope that will help you understand the basics approaches.Lambency
K
3

As described by Ofiris, NER is only one way to do solve your problem. I feel it's more effective to use word embedding to represent your words. In that way machine automatically recognize the context of the word. As an example "Apple" is mostly coming together with "eat" and But if the given input "Apple" is present with "mobile" or any other word in that domain, Machine will understand it's "iPhone apple" instead of "apple fruit". There are 2 popular ways to generate word embeddings such as word2vec and fasttext. Gensim provides more reliable implementations for both word2vec and fasttext.

https://radimrehurek.com/gensim/models/word2vec.html https://radimrehurek.com/gensim/models/fasttext.html

Kenlee answered 13/4, 2020 at 13:6 Comment(0)
R
0

In presence of dates, famous brands, vip or historical figures you can use a NER (named entity recognition) algorithm; in such case, as suggested by Ofiris, the Stanford CoreNLP offers a good Named entity recognizer.

For a more general disambiguation of polysemous words (i.e., words having more than one sense, such as "good") you could use a POS tagger coupled with a Word Sense Disambiguation (WSD) algorithm. An example of the latter can be found HERE, but I do not know any freely downloadable library for this purpose.

Rhizogenic answered 15/12, 2016 at 15:48 Comment(0)
S
0

This problem has already been solved by many open source pre-trained NER models. Anyways you can try retraining an existing NER models to finetune them to solve this issue. You can find an demo of NER results as done by Spacy NER here.

enter image description here

Staffman answered 13/4, 2020 at 13:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.