chartbeat-labs / textacy

NLP, before and after spaCy
https://textacy.readthedocs.io
Other
2.21k stars 249 forks source link

subject_verb_object_triples error #244

Closed Mansayy closed 5 years ago

Mansayy commented 5 years ago

Hey! The code is working only for a particular sentence but it is not working for any other sentence. Below is the code that I am running:

SOV

import spacy import textacy nlp = spacy.load('en') text1 = nlp(u'Startup companies create jobs and support innovation. Hilary supports entrepreneurship.') text2 = nlp(u'Subijanto, a spokesman for Forestry Ministry said Indonesia was committed to protecting the tigers, which live within Sumatra. ') attach

text_ext1 = textacy.extract.subject_verb_object_triples(text1) text_ext2 = textacy.extract.subject_verb_object_triples(text2) a1=list(text_ext1) a2=list(text_ext2) print(a1) print(a2) print("EOF")

I am getting the output for text1 but nothing for text2. I have attached the output as displayed on my terminal. Please let me know what I am doing wrong.