@deprecated_factory(
"score",
"eds.score",
default_config=DEFAULT_CONFIG,
assigns=["doc.ents", "doc.spans"],
)
@Language.factory(
"eds.score",
default_config=DEFAULT_CONFIG,
assigns=["doc.ents", "doc.spans"],
)
def create_component(
nlp: Language,
name: str,
score_name: str,
regex: List[str],
after_extract: str,
score_normalization: Union[str, Callable[[Union[str, None]], Any]],
attr: str,
window: int,
flags: Union[re.RegexFlag, int],
ignore_excluded: bool,
):
return Score(
nlp,
score_name=score_name,
regex=regex,
after_extract=after_extract,
score_normalization=score_normalization,
attr=attr,
flags=flags,
window=window,
ignore_excluded=ignore_excluded,
)