Spaces:
Runtime error
Runtime error
fixing bugs
Browse files
app.py
CHANGED
|
@@ -50,7 +50,9 @@ model.to('cpu')
|
|
| 50 |
|
| 51 |
p = pipeline("automatic-speech-recognition")
|
| 52 |
|
| 53 |
-
|
|
|
|
|
|
|
| 54 |
def wn_syns(word):
|
| 55 |
synonyms = []
|
| 56 |
for syn in wn.synsets(word):
|
|
@@ -399,16 +401,14 @@ def speech_to_text(speech, target):
|
|
| 399 |
return text.lower(), {'Pronunciation Score': compute_score(text, target) / 100}, phon(target)
|
| 400 |
|
| 401 |
def speech_to_score(speech):
|
| 402 |
-
|
| 403 |
-
|
| 404 |
|
| 405 |
def my_i_func(text):
|
| 406 |
return {"original": "", "interpretation": [('', 0.0), ('what', -0.2), ('great', 0.3), ('day', 0.5), ('', 0.0)]}
|
| 407 |
|
| 408 |
def gen_syns(word, level):
|
| 409 |
-
with open('balanced_synonym_data.json') as f:
|
| 410 |
word = word.strip(" ")
|
| 411 |
-
data = json.loads(f.read())
|
| 412 |
school_to_level = {"Elementary Level":'1', "Middle School Level":'2', "High School Level":'3', "College Level":'4'}
|
| 413 |
pins = wn_syns(word)
|
| 414 |
reko = []
|
|
|
|
| 50 |
|
| 51 |
p = pipeline("automatic-speech-recognition")
|
| 52 |
|
| 53 |
+
with open('balanced_synonym_data.json') as f:
|
| 54 |
+
data = json.loads(f.read())
|
| 55 |
+
|
| 56 |
def wn_syns(word):
|
| 57 |
synonyms = []
|
| 58 |
for syn in wn.synsets(word):
|
|
|
|
| 401 |
return text.lower(), {'Pronunciation Score': compute_score(text, target) / 100}, phon(target)
|
| 402 |
|
| 403 |
def speech_to_score(speech):
|
| 404 |
+
text = p(speech)["text"]
|
| 405 |
+
return reading_difficulty(text), text
|
| 406 |
|
| 407 |
def my_i_func(text):
|
| 408 |
return {"original": "", "interpretation": [('', 0.0), ('what', -0.2), ('great', 0.3), ('day', 0.5), ('', 0.0)]}
|
| 409 |
|
| 410 |
def gen_syns(word, level):
|
|
|
|
| 411 |
word = word.strip(" ")
|
|
|
|
| 412 |
school_to_level = {"Elementary Level":'1', "Middle School Level":'2', "High School Level":'3', "College Level":'4'}
|
| 413 |
pins = wn_syns(word)
|
| 414 |
reko = []
|