Spaces:
Sleeping
Sleeping
Javierss
commited on
Commit
·
0865965
1
Parent(s):
632d744
Change log to strans only
Browse files
game.py
CHANGED
@@ -212,15 +212,18 @@ class Semantrix:
|
|
212 |
|
213 |
similarity = self.model.similarity(self.secret, word)
|
214 |
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
|
|
|
|
|
|
224 |
|
225 |
# Remove the word from the score list if it is repeated
|
226 |
if repeated == -1:
|
|
|
212 |
|
213 |
similarity = self.model.similarity(self.secret, word)
|
214 |
|
215 |
+
if self.model_type == "word2vec":
|
216 |
+
score = round(similarity * 10, 2)
|
217 |
+
else:
|
218 |
+
log_similarity = np.log10(similarity * 10) if similarity > 0 else 0
|
219 |
+
score = round(
|
220 |
+
np.interp(
|
221 |
+
log_similarity,
|
222 |
+
[0, np.log10(10)],
|
223 |
+
[0, 10],
|
224 |
+
),
|
225 |
+
2,
|
226 |
+
)
|
227 |
|
228 |
# Remove the word from the score list if it is repeated
|
229 |
if repeated == -1:
|