Spaces:
Running
Running
a-v-bely
commited on
Commit
·
80cd1fd
1
Parent(s):
28dab52
Only one replace
Browse files
utilities_language_bert/rus_main_workflow_bert.py
CHANGED
@@ -217,7 +217,7 @@ def main_workflow(
|
|
217 |
for i, sentence in enumerate(current_text_sentences):
|
218 |
for task in RESULT_TASKS:
|
219 |
if task.sentence_text == sentence:
|
220 |
-
sentence = sentence.replace(task.original_text, f'__________({tasks_counter})')
|
221 |
VARIANTS.append(task.variants)
|
222 |
tasks_counter += 1
|
223 |
TEXT_WITH_GAPS.append(sentence)
|
|
|
217 |
for i, sentence in enumerate(current_text_sentences):
|
218 |
for task in RESULT_TASKS:
|
219 |
if task.sentence_text == sentence:
|
220 |
+
sentence = sentence.replace(task.original_text, f'__________({tasks_counter})', 1)
|
221 |
VARIANTS.append(task.variants)
|
222 |
tasks_counter += 1
|
223 |
TEXT_WITH_GAPS.append(sentence)
|
utilities_language_w2v/rus_main_workflow_w2v.py
CHANGED
@@ -227,7 +227,7 @@ def main_workflow(
|
|
227 |
tasks_counter = 1
|
228 |
for i, sentence in enumerate(current_text_sentences):
|
229 |
for task in filter(lambda t: t.sentence_number == i, RESULT_TASKS):
|
230 |
-
sentence = sentence.replace(task.original_text, f'__________({tasks_counter})')
|
231 |
VARIANTS.append(task.variants)
|
232 |
tasks_counter += 1
|
233 |
TEXT_WITH_GAPS.append(sentence)
|
|
|
227 |
tasks_counter = 1
|
228 |
for i, sentence in enumerate(current_text_sentences):
|
229 |
for task in filter(lambda t: t.sentence_number == i, RESULT_TASKS):
|
230 |
+
sentence = sentence.replace(task.original_text, f'__________({tasks_counter})', 1)
|
231 |
VARIANTS.append(task.variants)
|
232 |
tasks_counter += 1
|
233 |
TEXT_WITH_GAPS.append(sentence)
|