The Process: Transforming SpaCy’s Docs (2018)
Natural language processing is an interdisciplinary field, and developers come to spaCy with vastly different backgrounds, perspectives, and problems to solve; we have to create useful documentation without relying on the notion of a “typical spaCy user.” import spacy
# load a statistical model for English
nlp = process a string of text and create a document object
doc = nlp(u”The hysterical concern over how to pay for Bernie’s plans is hilarious”)# iterate over the named entities predicted by the statistical model
for ent in doc.ents:
print(‘Entity found:’, ent.text, ent.label_)# Entity found: Bernie ORG
Machine learning is very experimental, and, to be honest, those of us working in it don’t always know exactly what we’re doing. For many users, the most important type of performance documentation we can provide is a set of repeatable benchmarks, so that our models can be compared directly against results from other researchers.
Source: increment.com