Wrong matching results coming by Phrase matcher #13134
Unanswered
chauhannaman98
asked this question in
Help: Other Questions
Replies: 1 comment
-
Hi @chauhannaman98! So you're attempting to classify those texts based on sets of keywords, right? Can you provide a fully reproducible minimal example? I think there are easier and more efficient ways to go about this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am having a list of keywords(50-100 keywords or set words) for 9 categories and and running a phrase matcher from Spacy to check the sample text against each category's keywords with they get a match with that. So, the solution shall assign the category the text belongs to using the phrase-matcher here.
Keywords list:
Problem:
Results I get:
For weakness category, ['strength'] and ['strength','weakness'] as matches. This issue is with other categories too. Strength comes up all almost 70% of the test results as first match.
I am using Spacy 3.6.0 and en-core-web-lg with Python 3.10.
claim_subcat(txt)
method takes lemmatized text without punctuations as parameter and returns the list of matched categories.extract_claim
takes keywords and text and returns True if matches are more than 0, else False.What I expect:
Text = "I am a very hard working person with good public speaking skills."
shall give meitem_name = ['strength']
on callingclaim_subcat
method.Text = "I procrastinate and often insecure."
shall give meitem_name = ['weakness']
on callingclaim_subcat
method.Beta Was this translation helpful? Give feedback.
All reactions