From 8bea951e8117d77bfd866418c095e30f53c03e0f Mon Sep 17 00:00:00 2001 From: yeem <82357993+mgobrain@users.noreply.github.com> Date: Thu, 4 Apr 2024 17:55:27 -0400 Subject: [PATCH] Update transformation.py resolved TODO (orig not declared) --- .../transformations/lost_in_translation/transformation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nlaugmenter/transformations/lost_in_translation/transformation.py b/nlaugmenter/transformations/lost_in_translation/transformation.py index 971799997..8b93fee1b 100644 --- a/nlaugmenter/transformations/lost_in_translation/transformation.py +++ b/nlaugmenter/transformations/lost_in_translation/transformation.py @@ -75,13 +75,15 @@ def shell( ): # repeated encode_decode cycles # according to self.how + # preserve original input for comparison, scoring + orig = text if how == "random": # choose a random transformation from the given set for i in range(layers): target = random.choice(langs) text = self.encode_decode(text, target, max_length, device) if min_score > 0: - # TODO: Unresolved reference orig. (Needs to be fix) + # check to see if similarity falls below minimum score if self.similarity(orig, text, scorer) < min_score: break else: