Spaces:
Runtime error
Runtime error
Updating func name
Browse files
app.py
CHANGED
|
@@ -45,7 +45,7 @@ model.to('cpu')
|
|
| 45 |
p = pipeline("automatic-speech-recognition")
|
| 46 |
|
| 47 |
|
| 48 |
-
def
|
| 49 |
synonyms = []
|
| 50 |
for syn in wn.synsets(word):
|
| 51 |
for lm in syn.lemmas():
|
|
@@ -85,7 +85,7 @@ def calculate_diversity(text):
|
|
| 85 |
if not comp.isalpha():
|
| 86 |
continue
|
| 87 |
try:
|
| 88 |
-
if cosine_similarity(w2v[anc].reshape(1, -1), w2v[comp].reshape(1, -1)) > .7 or comp in
|
| 89 |
vocab.append(comp)
|
| 90 |
except KeyError:
|
| 91 |
continue
|
|
|
|
| 45 |
p = pipeline("automatic-speech-recognition")
|
| 46 |
|
| 47 |
|
| 48 |
+
def wn_syns(word):
|
| 49 |
synonyms = []
|
| 50 |
for syn in wn.synsets(word):
|
| 51 |
for lm in syn.lemmas():
|
|
|
|
| 85 |
if not comp.isalpha():
|
| 86 |
continue
|
| 87 |
try:
|
| 88 |
+
if cosine_similarity(w2v[anc].reshape(1, -1), w2v[comp].reshape(1, -1)) > .7 or comp in wn_syns(anc):
|
| 89 |
vocab.append(comp)
|
| 90 |
except KeyError:
|
| 91 |
continue
|