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
import spacy
import truecase
text = truecase.get_true_case('ball,wanna get your train out ? I wanna play soccer ball . .')
print(text)
spacy.util.fix_random_seed(326)
nlp = spacy.load("en_core_web_sm")
doc = nlp(text)
cleaned = [t.text if t.ent_type_ not in ['GPE', 'PERSON', 'ORG'] else t.ent_type_ for t in doc]
print(cleaned)
Run it multiple times: for i in {1..5}; do python temp.py; done
I get random results:
Ball, wanNA get your train out? I wanNA play Soccer ball . .
['PERSON', ',', 'PERSON', 'get', 'your', 'train', 'out', '?', 'I', 'wanNA', 'play', 'Soccer', 'ball', '.', '.']
Ball, wanNA get your train out? I wanNA play soccer ball . .
['PERSON', ',', 'PERSON', 'get', 'your', 'train', 'out', '?', 'I', 'PERSON', 'play', 'soccer', 'ball', '.', '.']
Ball, wanNA get your train out? I wanNA play Soccer ball . .
['PERSON', ',', 'PERSON', 'get', 'your', 'train', 'out', '?', 'I', 'wanNA', 'play', 'Soccer', 'ball', '.', '.']
Ball, wanNA get your train out? I wanNA play soccer ball . .
['PERSON', ',', 'PERSON', 'get', 'your', 'train', 'out', '?', 'I', 'PERSON', 'play', 'soccer', 'ball', '.', '.']
Ball, wanNA get your train out? I wanNA play soccer ball . .
['PERSON', ',', 'PERSON', 'get', 'your', 'train', 'out', '?', 'I', 'PERSON', 'play', 'soccer', 'ball', '.', '.']
How to reproduce the behaviour
Here is the minimal script:
Run it multiple times:
for i in {1..5}; do python temp.py; done
I get random results:
Your Environment
The text was updated successfully, but these errors were encountered: