From text to tokens – the NLP pipeline
In this section, we will demonstrate how to construct an NLP pipeline using the open-source Python library spaCy. The textacy library builds on spaCy and provides easy access to spaCy attributes and additional functionality.
Refer to the notebook nlp_pipeline_with_spaCy
for the following code samples, installation instruction, and additional details.
NLP pipeline with spaCy and textacy
spaCy is a widely used Python library with a comprehensive feature set for fast text processing in multiple languages. The usage of the tokenization and annotation engines requires the installation of language models. The features we will use in this chapter only require the small models; the larger models also include word vectors that we will cover in Chapter 16, Word Embeddings for Earnings Calls and SEC Filings.
With the library installed and linked, we can instantiate a spaCy language model and then apply it to the document. The result...