You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
textblob.np_extractors don't work properly in some cases. As we have below code:
from textblob import TextBlob
from textblob.np_extractors import ConllExtractor, FastNPExtractor
extcr = ConllExtractor()
while True:
ipt = input("type a setence > ")
if ipt == "q":
break
blobs = TextBlob(ipt, np_extractor=extcr)
print(blobs.noun_phrases)
then run a test:
type a setence > Adam saw a white cat sitting on the tree.
['adam', 'white cat'] # lost tree
type a setence > As soon as he passed the aisle, the other one took his seat, and lit up a cigarette.
[] # lost aisle, other one, seat, cigarette
type a setence > As soon as Adam passed the aisle, the other one took his seat, and lit up a cigarette.
['adam passed'] # wrong noun passed, lost aisle, other one, seat, cigarette
type a setence > As soon as Adam passed the cat, the other one took his seat, and lit up a cigarette.
['adam passed'] # wrong noun passed, lost cat, other one, seat, cigarette
type a setence > As soon as he passed the cat, the other one took his seat, and lit up a cigarette.
[] # lost cat, other one, seat, cigarette
Using textblob version: 0.18.0.post0
The text was updated successfully, but these errors were encountered:
I found out that in textblob noun phrases need to be at least two words except names. Is there any configuration to customize this feature?
Besides, there are still problems
type a setence > As soon as he passed the narrow aisle, the other one took his empty seat, and lit up a half-used cigarette
['narrow aisle', 'empty seat']
type a setence > As soon as he passed the narrow aisle, the other one took his empty seat, and lit up a half used cigarette
['narrow aisle', 'empty seat']
type a setence > As soon as he passed the narrow aisle, the other one took his empty seat, and lit up a handmade cigarette
['narrow aisle', 'empty seat', 'handmade cigarette']
type a setence > Adam saw a white cat sitting on the blooming cherry tree.
['adam', 'white cat', 'blooming cherry tree']
type a setence > Adam saw two white cats sitting on the blooming cherry tree
['adam', 'blooming cherry tree']
textblob.np_extractors don't work properly in some cases. As we have below code:
then run a test:
Using textblob version: 0.18.0.post0
The text was updated successfully, but these errors were encountered: