Last active
August 27, 2018 02:24
-
-
Save jibinpb/f31db47d7b6ff784f54b49eabe273e03 to your computer and use it in GitHub Desktop.
spaCy Test Entity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"ename": "ModuleNotFoundError", | |
"evalue": "No module named 'spacy'", | |
"output_type": "error", | |
"traceback": [ | |
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", | |
"\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", | |
"\u001b[1;32m<ipython-input-1-0aa661bc63a2>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[1;31m# python -m spacy download en_core_web_sm\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 4\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mspacy\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 5\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;31m# Load English tokenizer, tagger, parser, NER and word vectors\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", | |
"\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'spacy'" | |
] | |
} | |
], | |
"source": [ | |
"# pip install spacy\n", | |
"# python -m spacy download en_core_web_sm\n", | |
"\n", | |
"import spacy\n", | |
"\n", | |
"# Load English tokenizer, tagger, parser, NER and word vectors\n", | |
"nlp = spacy.load('en_core_web_sm')\n", | |
"\n", | |
"# Process whole documents\n", | |
"text = (u\"buy Sunteck Realty; target of Rs 508: Edelweiss\")\n", | |
"doc = nlp(text)" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.6.5" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment