Open chetanniradwar opened 3 years ago
what worked for me was:
aspects = ['design', 'processor']
my_aspect = []
for word in review_text:
for aspect in aspects:
if(similarity_score(aspect, word) > threshold):
my_aspect.append(aspect)
task = nlp(text=review_text, aspects=my_aspect)
aspect_sent = task.examples
for aspect in aspect_sent:
absa.summary(aspect)
@Megham-Garg Where similarity_score()
method is defined? which library I have to import for similarity_ score()
?
I have written my own method using the concept of cosine similarity. You can use that or you may like to use some other method like euclidean distance based on the dataset you are dealing with.
I am running the Readme file example.
When I run this:
absa.summary(design)
I am getting right output i.e.Sentiment.positive for "design" Scores (neutral/negative/positive): [0.028 0.057 0.915]
But when I run this
absa.summary(processor)
I am getting negative sentiment with a score above 0.9. Instead, I should get a neutral sentiment as the "processor" aspect is not included in the text. There is no sentence talking about the processor (performance). If I want to do it such that the aspects which are not included in the text should be assigned a neutral sentiment instead of positive or negative how to do it? Please If anyone has the idea or code for that add it here.