Guest User

Untitled

a guest
Jun 20th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. sentence = str(news_df.iloc[1].full_text)
  2. sentence_nlp = nlp(sentence)
  3.  
  4. # print named entities in article
  5. print([(word, word.ent_type_) for word in sentence_nlp if word.ent_type_])
  6.  
  7. # visualize named entities
  8. displacy.render(sentence_nlp, style='ent', jupyter=True)
Add Comment
Please, Sign In to add comment