Spaces:
Running
Running
Alexander Nikolaev
commited on
Commit
•
d46b8e0
1
Parent(s):
7b1ddd7
Update WordMatching.py
Browse files- WordMatching.py +2 -2
WordMatching.py
CHANGED
@@ -76,7 +76,7 @@ def get_best_path_from_distance_matrix(word_distance_matrix):
|
|
76 |
mapped_indices.append(
|
77 |
(solver.Value(estimated_words_order[word_idx])))
|
78 |
|
79 |
-
return np.array(mapped_indices, dtype=
|
80 |
except:
|
81 |
return []
|
82 |
|
@@ -88,7 +88,7 @@ def get_resulting_string(mapped_indices: np.array, words_estimated: list, words_
|
|
88 |
number_of_real_words = len(words_real)
|
89 |
for word_idx in range(number_of_real_words):
|
90 |
position_of_real_word_indices = np.where(
|
91 |
-
mapped_indices == word_idx)[0].astype(
|
92 |
|
93 |
if len(position_of_real_word_indices) == 0:
|
94 |
mapped_words.append(WORD_NOT_FOUND_TOKEN)
|
|
|
76 |
mapped_indices.append(
|
77 |
(solver.Value(estimated_words_order[word_idx])))
|
78 |
|
79 |
+
return np.array(mapped_indices, dtype=int)
|
80 |
except:
|
81 |
return []
|
82 |
|
|
|
88 |
number_of_real_words = len(words_real)
|
89 |
for word_idx in range(number_of_real_words):
|
90 |
position_of_real_word_indices = np.where(
|
91 |
+
mapped_indices == word_idx)[0].astype(int)
|
92 |
|
93 |
if len(position_of_real_word_indices) == 0:
|
94 |
mapped_words.append(WORD_NOT_FOUND_TOKEN)
|