spaCy container objects
At the beginning of this chapter, we saw a list of container objects including Doc, Token, Span, and Lexeme. In this section, we’ll see the properties of container objects in detail.
Using container objects, we can access the linguistic properties that spaCy assigns to text. A container object is a logical representation of text units such as a document, a token, or a slice of a document.
Container objects in spaCy follow the natural structure of the text: a document is composed of sentences and sentences are composed of tokens. We most widely use Doc, Token, and Span objects in development, which represent a document, a single token, and a phrase, respectively. A container can contain other containers – for instance, a document contains tokens and spans.
Let’s explore each class and its useful properties one by one.
Doc
We created Doc objects in our code to represent the text, so you might have already figured out that Doc...