Spaces:
Runtime error
Runtime error
Added quality of life improvement when entering synonyms
Browse files
app.py
CHANGED
|
@@ -408,6 +408,7 @@ def my_i_func(text):
|
|
| 408 |
|
| 409 |
def gen_syns(word, level):
|
| 410 |
with open('balanced_synonym_data.json') as f:
|
|
|
|
| 411 |
data = json.loads(f.read())
|
| 412 |
school_to_level = {"Elementary Level":'1', "Middle School Level":'2', "Highschool Level":'3', "College Level":'4'}
|
| 413 |
pins = wn_syns(word)
|
|
@@ -439,7 +440,7 @@ with gr.Blocks(title="Automatic Literacy and Speech Assesmen") as demo:
|
|
| 439 |
audio_file = gr.Audio(source="microphone",type="filepath")
|
| 440 |
grade1 = gr.Button("Grade Your Speech")
|
| 441 |
with gr.Group():
|
| 442 |
-
gr.Markdown("Reading Level Based Synonyms")
|
| 443 |
words = gr.Textbox(label="Word For Synonyms")
|
| 444 |
lvl = gr.Dropdown(choices=["Elementary Level", "Middle School Level", "High School Level", "College Level" ], label="Intended Reading Level For Synonym")
|
| 445 |
get_syns = gr.Button("Get Synonyms")
|
|
|
|
| 408 |
|
| 409 |
def gen_syns(word, level):
|
| 410 |
with open('balanced_synonym_data.json') as f:
|
| 411 |
+
word = word.strip(" ")
|
| 412 |
data = json.loads(f.read())
|
| 413 |
school_to_level = {"Elementary Level":'1', "Middle School Level":'2', "Highschool Level":'3', "College Level":'4'}
|
| 414 |
pins = wn_syns(word)
|
|
|
|
| 440 |
audio_file = gr.Audio(source="microphone",type="filepath")
|
| 441 |
grade1 = gr.Button("Grade Your Speech")
|
| 442 |
with gr.Group():
|
| 443 |
+
gr.Markdown("Reading Level Based Synonyms | Enter only one word at a time")
|
| 444 |
words = gr.Textbox(label="Word For Synonyms")
|
| 445 |
lvl = gr.Dropdown(choices=["Elementary Level", "Middle School Level", "High School Level", "College Level" ], label="Intended Reading Level For Synonym")
|
| 446 |
get_syns = gr.Button("Get Synonyms")
|