0

I'm working on a NLP project, and right now, I'm stuck on detecting antonyms for certain phrases that aren't in their "standard" forms (like verbs, adjectives, nouns) instead of present-participles, past tense, or something to that effect. For instance, if I have the phrase "arriving" or "arrived", I need to convert it to "arrive". Similarly, "came" should be "come". Lastly, “dissatisfied” should be “dissatisfy”. Can anyone help me out with this? I have tried several stemmers and lemmanizers in NLTK with Python, to no avail; most of them don’t produce the correct root. I’ve also thought about the ConceptNet semantic network and other dictionary APIs, but it seems far too complicated for what I need. Any advice is helpful. Thanks!

Joshua Crotts
  • 69
  • 1
  • 8

1 Answers1

1

If you know you'll be working with a limited set, you could create a dictionary.

Example :

look_up = {'arriving' : 'arrive',
        'arrived' : 'arrive',
        'came' : 'come',
        'dissatisfied' : 'dissatisfy'}

test = 'arrived'
print (look_up [test])
bashBedlam
  • 1,402
  • 1
  • 7
  • 11
  • The issue is I won’t be working with a limited data set; it’s random sentences that while I know ahead of time, I can’t make a huge dictionary for every possible word. – Joshua Crotts May 26 '20 at 23:35
  • Any idea why lemmatization does fail? I am decently surprised, really! DId you try using the longest common onset? Maybe try Spacys lemmatizer instead. – CLpragmatics May 27 '20 at 16:06