segram.nlp.pipeline.annotator module

class segram.nlp.pipeline.annotator.Annotator(vocab: ~spacy.vocab.Vocab, name: str = 'attribute_ruler', *, validate: bool = False, scorer: ~typing.Callable | None = <function attribute_ruler_score>)[source]

Bases: AttributeRuler

Annotator class adding token flags used in semantic grammar analysis.

It is implemented as spacy.pipeline.AttributeRuler subclass and uses standard token POS and DEP attributes to define a set of custom semantic grammar flags.

classmethod from_patterns(nlp: Language, name: str, *, patterns: Mapping[str, str], **kwds: Any) Self[source]

Initialize from a patterns packahe resource.