Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASTE giving triplets with duplicated opinions and polarities #327

Open
BKleinman opened this issue Jun 29, 2023 · 2 comments
Open

ASTE giving triplets with duplicated opinions and polarities #327

BKleinman opened this issue Jun 29, 2023 · 2 comments

Comments

@BKleinman
Copy link

PyABSA Version (Required)

PyABSA 2.3.1
Torch 2.0.1+cu117
Transformers 4.30.2

Code To Reproduce (Required)

from pyabsa import AspectSentimentTripletExtraction as ASTE

triplet_extractor = ASTE.AspectSentimentTripletExtractor("multilingual")

triplet_extractor = ASTE.AspectSentimentTripletExtractor("multilingual")

textList = []
import csv
with open("C:\Users\userName\Desktop\Row64Stuff\Data\Data.csv") as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
for row in csv_reader:
textList.append(row)

results = []
for text in textList:
result = triplet_extractor.predict(text)
if result != []:
results.append(result[-1])
else:
pass

Full Console Output (Required)

Example of one output:
'sentence': 'The ranked system of this game is actually such a freaking abysmal joke, from the mmr system, lack of transparency, trolls, duoq abusers, destructive lp gains, and matchmaking algorithm.',
'Triplets': [
{'Aspect': 'ranked system', 'Opinion': 'abysmal joke,', 'Polarity': 'Negative'},
{'Aspect': 'ranked system', 'Opinion': 'lack of transparency,', 'Polarity': 'Negative'},
{'Aspect': 'ranked system', 'Opinion': 'destructive', 'Polarity': 'Negative'},
{'Aspect': 'mmr system,', 'Opinion': 'abysmal joke,', 'Polarity': 'Negative'},
{'Aspect': 'mmr system,', 'Opinion': 'lack of transparency,', 'Polarity': 'Negative'},
{'Aspect': 'mmr system,', 'Opinion': 'destructive', 'Polarity': 'Negative'},
{'Aspect': 'lp gains,', 'Opinion': 'abysmal joke,', 'Polarity': 'Negative'},
{'Aspect': 'lp gains,', 'Opinion': 'lack of transparency,', 'Polarity': 'Negative'},
{'Aspect': 'lp gains,', 'Opinion': 'destructive', 'Polarity': 'Negative'},
{'Aspect': 'matchmaking algorithm.', 'Opinion': 'abysmal joke,', 'Polarity': 'Negative'},
{'Aspect': 'matchmaking algorithm.', 'Opinion': 'lack of transparency,', 'Polarity': 'Negative'},
{'Aspect': 'matchmaking algorithm.', 'Opinion': 'destructive', 'Polarity': 'Negative'}

Describe the bug

When the model predicts the outputs for each sentence I feed into the model - it produces each detected aspect with every opinion and polarity detected even if those opinions and polarities are not relevant to the specific aspect.

Expected behavior

I was hoping for each opinion and polarity to be attached to the relevant aspect as opposed to every aspect detected by the model.

@yangheng95
Copy link
Owner

yangheng95 commented Jul 4, 2023

Probably this is a performance problem of the original model which I adapt from (according to the license). So, maybe you can contact the author to solve this problem. I will be happy to keep this model up-to-date with https://github.com/CCChenhao997/EMCGCN-ASTE

@BKleinman
Copy link
Author

It seems that it is functioning correctly on the hugging face website (https://huggingface.co/spaces/yangheng/Multilingual-Aspect-Based-Sentiment-Analysis). Is there any difference between that model and this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants