Spacy NER Example
1. In your virtual env..install spacy pip install --upgrade spacy. 2. Install Jupyter too,...as visualization is handy python -m pip install jupyter 3. Load default model for spacy python -m spacy download en 4. Invoke Jupyter jupyter notebook --no-browser --NotebookApp.token='' --ip='*' 5. Updating existing model to include a NER. Uber is not detected by default model. Let's add it. -----------------------------------------------------------------------------------------------NoteBook-- import spacy import random from spacy import displacy nlp = spacy.load('en') train_data = [("Uber blew through $1 million", {'entities': [(0, 4, 'ORG'),(17, 28, 'MONEY')]})] for text,_ in train_data: doc=nlp(text) displacy.render(doc, style='ent', jupyter=True) # If u use display.serve it will try to serve at port 5k # We see Uber is not picked up...let use the train_data to ...