<jupyter_start><jupyter_text>Exercise 17 : Other Visualizations (Dependency Parse Tree and Named Entities) Depict the sentence, "God helps those who help themselves." using dependency parse tree. Visualize named entities of the text corpus: "Once upon a time there lived a saint named <NAME>. His chief disciple <NAME> also known as <NAME>anda is the founder of Ramakrishna Mission and Ramakrishna Math."<jupyter_code>#!pip install spacy
#!python -m spacy download en
import spacy
from spacy import displacy
import en_core_web_sm
nlp = en_core_web_sm.load()
doc = nlp('God helps those who help themselves.')
displacy.render(doc, style='dep', jupyter=True)
text = 'Once upon a time there lived a saint named <NAME>. \
        His chief disciple <NAME> also known as <NAME>anda \
        is the founder of Ramakrishna Mission and Ramakrishna Math.'
doc2 = nlp(text)
displacy.render(doc2, style='ent', jupyter=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08280254777070063, 'fraction_numerical': 0.004246284501061571, 'mean_word_length': 5.163398692810458, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '121200', 'license': 'MIT', 'n_tokens_mistral': 297, 'n_tokens_neox': 287, 'n_words': 117, 'path': 'Lesson2/Exercise28.ipynb', 'repo_name': 'TrainingByPackt/Introduction-to-Natural-Language-Processing', 'size': '1014'}