spaCy - Industrial-Strength Natural Language Processing in Python

spaCy is a free open-source library featuring state-of-the-art speed and accuracy and a powerful Python API.

spaCy - Industrial-Strength Natural Language Processing in Python

1 references

spaCy.io

使用 Python+spaCy 进行简易自然语言处理 - 掘金

2 examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# LIGHTNING_TOUR.PY
# Install: pip install spacy && python -m spacy download en
import spacy

# Load English tokenizer, tagger, parser, NER and word vectors
nlp = spacy.load('en')

# Process whole documents
text = open('customer_feedback_627.txt').read()
doc = nlp(text)

# Find named entities, phrases and concepts
for entity in doc.ents:
print(entity.text, entity.label_)

# Determine semantic similarities
doc1 = nlp(u'the fries were gross')
doc2 = nlp(u'worst fries ever')
doc1.similarity(doc2)

# Hook in your own deep learning models
nlp.add_pipe(load_my_model(), before='parser')