Skip to content

Contextual[source]

The eds.contextual_qualifier pipeline component qualifies spans based on contextual information.

Parameters

PARAMETER DESCRIPTION
nlp

The spaCy pipeline object.

TYPE: PipelineProtocol DEFAULT: None

name

The name of the component.

TYPE: Optional[str] DEFAULT: "contextual_qualifier"

span_getter

The function or callable to get spans from the document.

TYPE: SpanGetterArg

patterns

A dictionary of patterns to match in the text. Each pattern dictionary should follow the structure of the ClassPatternsContext data class.

ClassPatternsContext
PARAMETER DESCRIPTION
terms

Terms to match.

TYPE: Optional[Patterns] DEFAULT: None

regex

Regular expressions to match.

TYPE: Optional[Patterns] DEFAULT: None

context_words

Number of words to consider as context.

TYPE: Union[NonNegativeInt, Tuple[NonNegativeInt, NonNegativeInt]] DEFAULT: 0

context_sents

Number of sentences to consider as context.

TYPE: Union[NonNegativeInt, Tuple[NonNegativeInt, NonNegativeInt]] DEFAULT: 1

attr

Attribute to match on.

TYPE: str DEFAULT: 'TEXT'

regex_flags

Flags for regular expressions.

TYPE: Union[RegexFlag, int] DEFAULT: 0

ignore_excluded

Whether to ignore excluded tokens.

TYPE: bool DEFAULT: False

ignore_space_tokens

Whether to ignore space tokens.

TYPE: bool DEFAULT: False

TYPE: Dict[str, Dict[Union[str, int], ClassPatternsContext]]