Posts

Showing posts from October, 2018

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 ...

Python Env Issues and Workaroud Ubuntu 16 LTS

   https://www.digitalocean.com/community/tutorials/how-to-install-and-use-tensorflow-on-ubuntu-16-04  https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-ubuntu-16-04  https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-ubuntu-16-04 1.Installing Python Ubuntu 16 comes with Python 2.7 and 3.5 both. To install pip3...    sudo apt-get install python3-pip pip3 -V pip3 install --upgrade pip   2.Virtual Env    a)sudo -H pip3 install virtualenv b) virtualenv -p /usr/bin/python3 menv35  c) source ~/venv35/bin/activate d) python -m pip install --upgrade pip   Ub untu18 https://linoxide.com/linux-how-to/setup-python-virtual-environment-ubuntu/ 2# Centos python python -m pip install --upgrade pip   3. Anaconda Issues.........     anaconda sucks...when o...

Remote Jupyter Notebook

Hi, If you are working on Jupyter and need to access the notebook remotely during local development..You may need a simple access without certs, pwds... Lets see how to do it.. One good link is below... https://jupyter-notebook.readthedocs.io/en/stable/public_server.html. If you don’t already have one, create a config file for the notebook using the following command line: $ jupyter notebook --generate-config In the  ~/.jupyter  directory, edit the notebook config file,  jupyter_notebook_config.py . By default, the notebook config file has all fields commented out. The minimum set of configuration options that you should uncomment and edit in  jupyter_notebook_config.py  is the following: # Set options for certfile, ip, password, and toggle off # browser auto-opening c . NotebookApp . certfile = u '/absolute/path/to/your/certificate/mycert.pem' c . NotebookApp . keyfile = u '/absolute/path/to/your/certificate/mykey.key' # Set ip to '*...