Javierss commited on
Commit
0865965
·
1 Parent(s): 632d744

Change log to strans only

Browse files
Files changed (1) hide show
  1. game.py +12 -9
game.py CHANGED
@@ -212,15 +212,18 @@ class Semantrix:
212
 
213
  similarity = self.model.similarity(self.secret, word)
214
 
215
- log_similarity = np.log10(similarity * 10) if similarity > 0 else 0
216
- score = round(
217
- np.interp(
218
- log_similarity,
219
- [0, np.log10(10)],
220
- [0, 10],
221
- ),
222
- 2,
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: