Negation issue
Closed this issue · 2 comments
travisbrady commented
I'm reading the paper and the negation makes intuitive sense. But the implementation of negate_sequence appears to be potentially broken to me. The results below are confusing.
For example, I understand why "drop" becomes "not_drop", but why do out, of and school?
Thank you.
negate_sequence("Hi Bob. Don't drop out of school. It's not a good idea")
Out[4]:
['hi',
'bob',
"don't",
'not_drop',
'not_out',
'not_of',
'not_school',
"it's",
'not',
'not_a',
'not_good',
'not_idea']
vivekn commented
Hi Travis,
The way I've implemented it here is it will negate till encountering a punctuation mark or till a second negation term. Well, it is a heuristic to negate the words in the vicinity of the negation term, that has decent results. As you can see it captures "not_good" in the phrase "not a good idea". But, I agree, there is still some room for improvement.
Vivek
travisbrady commented
Ahh, ok. That makes sense. Thank you.