//- 💫 DOCS > API > TAGGER

include ../../_includes/_mixins

p Annotate part-of-speech tags on #[code Doc] objects.

+h(2, "load") Tagger.load
    +tag classmethod

p Load the statistical model from the supplied path.

+table(["Name", "Type", "Description"])
    +row
        +cell #[code path]
        +cell #[code Path]
        +cell The path to load from.

    +row
        +cell #[code vocab]
        +cell #[code Vocab]
        +cell The vocabulary. Must be shared by the documents to be processed.

    +row
        +cell #[code require]
        +cell bool
        +cell Whether to raise an error if the files are not found.

    +footrow
        +cell return
        +cell #[code Tagger]
        +cell The newly constructed object.

+h(2, "init") Tagger.__init__
    +tag method

p Create a #[code Tagger].

+table(["Name", "Type", "Description"])
    +row
        +cell #[code vocab]
        +cell #[code Vocab]
        +cell The vocabulary. Must be shared with documents to be processed.

    +row
        +cell #[code model]
        +cell #[thinc.linear.AveragedPerceptron]
        +cell The statistical model.

    +footrow
        +cell return
        +cell #[code Tagger]
        +cell The newly constructed object.

+h(2, "call") Tagger.__call__
    +tag method

p Apply the tagger, setting the POS tags onto the #[code Doc] object.

+table(["Name", "Type", "Description"])
    +row
        +cell #[code doc]
        +cell #[code Doc]
        +cell The tokens to be tagged.

    +footrow
        +cell return
        +cell #[code None]
        +cell -

+h(2, "pipe") Tagger.pipe
    +tag method

p Tag a stream of documents.

+table(["Name", "Type", "Description"])
    +row
        +cell #[code stream]
        +cell -
        +cell The sequence of documents to tag.

    +row
        +cell #[code batch_size]
        +cell int
        +cell The number of documents to accumulate into a working set.

    +row
        +cell #[code n_threads]
        +cell int
        +cell
            |  The number of threads with which to work on the buffer in
            |  parallel.

    +footrow
        +cell yield
        +cell #[code Doc]
        +cell Documents, in order.

+h(2, "update") Tagger.update
    +tag method

p Update the statistical model, with tags supplied for the given document.

+table(["Name", "Type", "Description"])
    +row
        +cell #[code doc]
        +cell #[code Doc]
        +cell The example document for the update.

    +row
        +cell #[code gold]
        +cell #[code GoldParse]
        +cell Manager for the gold-standard tags.

    +footrow
        +cell return
        +cell int
        +cell Number of tags predicted correctly.
