Skip to content

Instantly share code, notes, and snippets.

@Linus-Albertus
Last active March 8, 2020 15:24
Show Gist options
  • Save Linus-Albertus/c9048dcfc18c67bb07bc01d78d396e35 to your computer and use it in GitHub Desktop.
Save Linus-Albertus/c9048dcfc18c67bb07bc01d78d396e35 to your computer and use it in GitHub Desktop.
doc_review = nlp(review)
for sent in doc_review.sentences: # recorremos cada oración
for dep in sent.dependencies: # recorremos cada palabra
if dep[1] == 'amod': # el subíndice 1 indica que se trata de la clase funcional
print(dep[0].text, dep[2].text) # uso del atributo .text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment