DependencyParser

Annotate syntactic dependencies on Doc objects.

DependencyParser.load

Load the statistical model from the supplied path.

NameTypeDescription
pathPathThe path to load from.
vocabVocabThe vocabulary. Must be shared by the documents to be processed.
requireboolWhether to raise an error if the files are not found.
returnDependencyParserThe newly constructed object.

DependencyParser.__init__

Create a DependencyParser.

NameTypeDescription
vocabVocabThe vocabulary. Must be shared with documents to be processed.
modelThe statistical model.
returnDependencyParserThe 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.
returnNone-

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.
yieldDocDocuments, in order.

DependencyParser.update

Update the statistical model.

NameTypeDescription
docDocThe example document for the update.
goldGoldParseThe gold-standard annotations, to calculate the loss.
returnintThe 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.
returnStepwiseStateA state object, to step through the annotation process.