edsnlp.pipes.ner.scores.base_score
SimpleScoreMatcher
[source]
Bases: ContextualMatcher
Matcher component to extract a numeric score
Parameters
PARAMETER | DESCRIPTION |
---|---|
nlp | The pipeline object TYPE: |
label | The name of the extracted score TYPE: |
regex | A list of regexes to identify the score TYPE: |
attr | Whether to match on the text ('TEXT') or on the normalized text ('NORM') TYPE: |
value_extract | Regex with capturing group to get the score value TYPE: |
score_normalization | Function that takes the "raw" value extracted from the
TYPE: |
window | Number of token to include after the score's mention to find the score's value TYPE: |
ignore_excluded | Whether to ignore excluded spans when matching TYPE: |
ignore_space_tokens | Whether to ignore space tokens when matching TYPE: |
flags | Regex flags to use when matching TYPE: |
score_name | Deprecated, use DEFAULT: |
label | Label name to use for the TYPE: |
span_setter | How to set matches on the doc DEFAULT: |
process
[source]
Extracts, if available, the value of the score. Normalizes the score via the provided self.score_normalization
method.
Parameters
PARAMETER | DESCRIPTION |
---|---|
doc | Document to process TYPE: |
YIELDS | DESCRIPTION |
---|---|
Span | Matches with, if found, an added |