DependencyParser

Annotate syntactic dependencies on Doc objects.

DependencyParser.__init__

Create a DependencyParser.

NameTypeDescription
vocabVocabThe vocabulary. Must be shared with documents to be processed.
modelThe statistical model.
returnsDependencyParserThe newly constructed object.

DependencyParser.__call__

Apply the dependency parser, setting the heads and dependency relations onto the Doc object.

NameTypeDescription
docDocThe document to be processed.
returnsNone-

DependencyParser.pipe

Process a stream of documents.

NameTypeDescription
stream-The sequence of documents to process.
batch_sizeintThe number of documents to accumulate into a working set.
n_threadsint The number of threads with which to work on the buffer in parallel.
yieldsDocDocuments, in order.

DependencyParser.update

Update the statistical model.

NameTypeDescription
docDocThe example document for the update.
goldGoldParseThe gold-standard annotations, to calculate the loss.
returnsintThe loss on this example.

DependencyParser.step_through

Set up a stepwise state, to introspect and control the transition sequence.

NameTypeDescription
docDocThe document to step through.
returnsStepwiseStateA state object, to step through the annotation process.