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

Why extracted attribute words are so rare using the pat algorithm? #9

Open
fishfree opened this issue Apr 23, 2021 · 2 comments
Open

Comments

@fishfree
Copy link

When I execute emfdscore input.csv pat-all-sent.csv pat emfd all sentiment , the input.csv is merged from 350 discourses, but superisingly the output attribute word include only one word "remained"! Are there some bugs?

@fhopp
Copy link
Collaborator

fhopp commented Apr 23, 2021

The PAT feature is still being developed further, but attributes are detected via spacy SDP engine, and there might not be that many attributes in your input.csv. Try it with the template_input.csv

@fishfree
Copy link
Author

@fhopp I tried with the template_input.csv, it still only output one attribute word "remains".
I checked the source code. But I'm not familar with NLP, so I don't know how Spacy categorize attribute words? Could you please give some example words?

            if token.text == 'is':
                try:
                    children = list(token.children)
                    word = children[1].lower()
                    if word in emfd.keys():
                        cc_processed[find_ent(str(children[0]),entities)]['attribute_words'].append(word)
                        cc_processed[find_ent(str(children[0]),entities)]['attribute_scores'].append(emfd[word])
                except:
                    pass

            if token.dep_ == 'attr':
                word = token.head.text.lower()
                if word in emfd.keys():
                    for child in token.children:
                        try:
                            cc_processed[find_ent(str(child), entities)]['attribute_words'].append(word)
                            cc_processed[find_ent(str(child), entities)]['attribute_scores'].append(emfd[word])
                        except:
                            pass   

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