What is spaCy(v2):

Features

Installation Steps:

$ pip install -U spacy

Download the Model:

$ python -m spacy download en_core_web_sm
or
$ python -m spacy download en

How to Use:

>>> import spacy
>>> nlp = spacy.load("en_core_web_sm")
or
>>> nlp = spacy.load("en")

What is Named-entity recognition:

Example:

$ python
>>> import spacy
>>> nlp = spacy.load("en")
>>> text = "But Google is starting from behind. The company made a late push\ninto hardware, and Apple’s Siri, available on iPhones, and Amazon’s Alexa\nsoftware, which runs on its Echo and Dot devices, have clear leads in\nconsumer adoption."
>>> doc = nlp(text)
>>> for ent in doc.ents:
... print(ent.text, ent.start_char, ent.end_char, ent.label_)
...
Google 4 10 ORG
Apple’s Siri 84 96 ORG
iPhones 111 118 ORG
Amazon 124 130 ORG
Echo and Dot 167 179 ORG
>>>
output

Visualizing named entities:

import spacy 
from spacy import displacy
text = """But Google is starting from behind. The company made a late push into hardware, and Apple’s Siri, available on iPhones, and Amazon’s Alexa software, which runs on its Echo and Dot devices, have clear leads in consumer adoption."""
nlp = spacy.load("en")
doc = nlp(text)
displacy.serve(doc, style="ent")

Artificial Intelligence and Data Science