Skip to content
Discussion options

You must be logged in to vote

You can get the raw scores from the tagger's internal model:

nlp = spacy.load("en_core_web_sm")
doc = nlp("This is a sentence.")
nlp.get_pipe("tagger").model.predict([doc])

The scores for each token correspond to the labels in nlp.get_pipe("tagger").labels.

There's a bit of cython, but the pair of predict / set_annotations methods should help you understand the internals:

def predict(self, docs):
"""Apply the pipeline's model to a batch of docs, without modifying them.
docs (Iterable[Doc]): The documents to predict.
RETURNS: The models prediction for each document.
DOCS: https://spa…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@dglopes
Comment options

@adrianeboyd
Comment options

@dglopes
Comment options

@dglopes
Comment options

Answer selected by dglopes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / tagger Feature: Part-of-speech tagger
2 participants