Spaces:
Sleeping
Sleeping
Update text_converter.py
Browse filesAdd "or" with similarity > min entailment to line 100
- text_converter.py +1 -1
text_converter.py
CHANGED
@@ -97,7 +97,7 @@ def generate_similar_sentence(input_text, min_reading_level, max_reading_level,
|
|
97 |
result_index = i
|
98 |
elif ((reading_level < min_reading_level and abs(reading_level - min_reading_level) < closeness) \
|
99 |
or (reading_level > max_reading_level and abs(reading_level - max_reading_level) < closeness)) and \
|
100 |
-
(similarity > generated_text_scores[result_index][0]):
|
101 |
closeness = abs(reading_level - min_reading_level) if reading_level < min_reading_level else abs(reading_level - max_reading_level)
|
102 |
result_index = i
|
103 |
|
|
|
97 |
result_index = i
|
98 |
elif ((reading_level < min_reading_level and abs(reading_level - min_reading_level) < closeness) \
|
99 |
or (reading_level > max_reading_level and abs(reading_level - max_reading_level) < closeness)) and \
|
100 |
+
(similarity > generated_text_scores[result_index][0] or similarity > min_entailment):
|
101 |
closeness = abs(reading_level - min_reading_level) if reading_level < min_reading_level else abs(reading_level - max_reading_level)
|
102 |
result_index = i
|
103 |
|