edsnlp.pipes.qualifiers.base
BaseTokenQualifierResults dataclass [source]
Base dataclass to store qualification informations for each token. Specific qualifier pipes should inherit from this class and add specific fields as needed
BaseEntQualifierResults dataclass [source]
Base dataclass to store qualification informations for each entity. Specific qualifier pipes should inherit from this class and add specific fields as needed
BaseQualifierResults dataclass [source]
Base dataclass to store qualification informations for all tokens and entities.
RuleBasedQualifier [source]
Bases: BaseSpanAttributeClassifierComponent
Implements the ConText algorithm (eq. NegEx for negations) for detecting contextual attributes text.
Parameters
| PARAMETER | DESCRIPTION |
|---|---|
nlp | The pipeline object. TYPE: |
attr | spaCy's attribute to use: a string with the value "TEXT" or "NORM", or a dict with the key 'term_attr' we can also add a key for each regex. TYPE: |
span_getter | Which entities should be classified. By default, TYPE: |
on_ents_only | Whether to look for matches around detected entities only. Useful for faster inference in downstream tasks.
TYPE: |
explain | Whether to keep track of cues for each entity. TYPE: |
**terms | Terms to look for. TYPE: |
get_cues [source]
Extract cues (ex: ne/pas for negations) from the document.
Parameters
| PARAMETER | DESCRIPTION |
|---|---|
doc | The document to process. TYPE: |
spans | Optional list of spans to limit the search around. If None, will search in the whole document. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
List[Span] | List of detected cues |