diff --git a/src/augmenty/span/entities.py b/src/augmenty/span/entities.py index 4634111..517adcd 100644 --- a/src/augmenty/span/entities.py +++ b/src/augmenty/span/entities.py @@ -239,7 +239,7 @@ def create_ent_augmenter_v1( i.e. ["Kenneth", "Enevoldsen"], 2) a string of the desired entity i.e. "Kenneth Enevoldsen", this will be split using the tokenizer of the nlp pipeline, or 3) Span object with the desired entity, here all information will be passed on except for the dependency tree. - replace_consistency: Should an entity always be replaced with the same entity? + replace_consistency: Should an entity always be replaced with the same entity? resolve_dependencies: Attempts to resolve the dependency tree by setting head of the original entitity aa the head of the first token in the new entity. The remainder is the passed as diff --git a/src/augmenty/token/insert.py b/src/augmenty/token/insert.py index 0710d05..4031ef8 100644 --- a/src/augmenty/token/insert.py +++ b/src/augmenty/token/insert.py @@ -269,7 +269,8 @@ def __insert( if context_window: span = doc[ max(0, t.i - context_window) : min( # type: ignore - len(doc), t.i + context_window # type: ignore + len(doc), + t.i + context_window, # type: ignore ) ] elif doc.has_annotation("SENT_START"): diff --git a/src/augmenty/token/replace.py b/src/augmenty/token/replace.py index edbeb38..1c3dea1 100644 --- a/src/augmenty/token/replace.py +++ b/src/augmenty/token/replace.py @@ -58,9 +58,9 @@ def create_token__dict_replace_augmenter_v1( Args: level: Probability to replace token given that it is in synonym dictionary. replace: A dictionary of words and a list of their replacement (e.g. synonyms) or a dictionary denoting replacement based on pos tag. - ignore_casing: When doing the lookup should the model ignore casing? + ignore_casing: When doing the lookup should the model ignore casing? getter: A getter function to extract the POS-tag. - keep_titlecase: Should the model keep the titlecase of the replaced word. + keep_titlecase: Should the model keep the titlecase of the replaced word. Returns: The augmenter. diff --git a/tests/test_all_augmenters.py b/tests/test_all_augmenters.py index 193ae08..54ef6fc 100644 --- a/tests/test_all_augmenters.py +++ b/tests/test_all_augmenters.py @@ -100,10 +100,10 @@ def is_pronoun(token: Token) -> bool: ), ], ) -def test_augmenters(aug: Callable, args: dict, examples, nlp: Language, level: float): # noqa # type: ignore +def test_augmenters(aug: str, args: dict, examples, nlp: Language, level: float): # noqa # type: ignore args["level"] = level - aug = augmenty.load(aug, **args) - augmented_examples = [e for ex in examples for e in aug(nlp=nlp, example=ex)] + augmenter = augmenty.load(aug, **args) + augmented_examples = [e for ex in examples for e in augmenter(nlp=nlp, example=ex)] def test_check_untested():