Spaces:
Running
Running
togokah
commited on
Commit
·
27025bf
1
Parent(s):
4e57705
Upd bert version
Browse files
utilities_language_bert/esp_sentence_bert.py
CHANGED
@@ -232,12 +232,14 @@ class TASK:
|
|
232 |
if len(inflected_distractors) < num_distractors:
|
233 |
self.bad_target_word = True
|
234 |
else:
|
|
|
235 |
self.inflected_distractors = inflected_distractors
|
236 |
|
237 |
def sample_distractors(self, num_distractors):
|
238 |
if not self.bad_target_word:
|
239 |
num_distractors = min(self.distractors_number, num_distractors) if num_distractors >= 4 else num_distractors
|
240 |
-
self.
|
|
|
241 |
|
242 |
def compile_task(self, max_num_distractors):
|
243 |
len_distractors = len(self.inflected_distractors)
|
|
|
232 |
if len(inflected_distractors) < num_distractors:
|
233 |
self.bad_target_word = True
|
234 |
else:
|
235 |
+
self.distractors_number = num_distractors
|
236 |
self.inflected_distractors = inflected_distractors
|
237 |
|
238 |
def sample_distractors(self, num_distractors):
|
239 |
if not self.bad_target_word:
|
240 |
num_distractors = min(self.distractors_number, num_distractors) if num_distractors >= 4 else num_distractors
|
241 |
+
self.inflected_distractors = sample(self.inflected_distractors[:min(self.distractors_number, 10)],
|
242 |
+
num_distractors)
|
243 |
|
244 |
def compile_task(self, max_num_distractors):
|
245 |
len_distractors = len(self.inflected_distractors)
|
utilities_language_w2v/esp_main_workflow_w2v.py
CHANGED
@@ -30,7 +30,6 @@ def main_workflow(
|
|
30 |
target_words: str,
|
31 |
num_distractors: int,
|
32 |
save_name: str,
|
33 |
-
distractor_model,
|
34 |
global_bad_target_words=BAD_USER_TARGET_WORDS):
|
35 |
"""
|
36 |
This is the main course of the program.
|
@@ -50,7 +49,6 @@ def main_workflow(
|
|
50 |
:param num_distractors: how many distractors does the user want the task to contain
|
51 |
:param save_name: user specifies name to save file in cloud
|
52 |
:param global_bad_target_words:global_bad_target_words
|
53 |
-
:param distractor_model which semantic model is used to find distractors
|
54 |
:return: Dictionary with output data: filename, amount_mode, text_with_gaps, tasks_as_list, correct_answers,
|
55 |
student_out, teacher_out, total_out, original_text
|
56 |
"""
|
|
|
30 |
target_words: str,
|
31 |
num_distractors: int,
|
32 |
save_name: str,
|
|
|
33 |
global_bad_target_words=BAD_USER_TARGET_WORDS):
|
34 |
"""
|
35 |
This is the main course of the program.
|
|
|
49 |
:param num_distractors: how many distractors does the user want the task to contain
|
50 |
:param save_name: user specifies name to save file in cloud
|
51 |
:param global_bad_target_words:global_bad_target_words
|
|
|
52 |
:return: Dictionary with output data: filename, amount_mode, text_with_gaps, tasks_as_list, correct_answers,
|
53 |
student_out, teacher_out, total_out, original_text
|
54 |
"""
|