Spaces:
Sleeping
Sleeping
Update src/main.py
Browse files- src/main.py +7 -7
src/main.py
CHANGED
|
@@ -12,8 +12,8 @@ def index():
|
|
| 12 |
global dataset, vocabulary_list, dict_2000_tokens, nlp, dict_docs_spacy
|
| 13 |
|
| 14 |
dataset, vocabulary_list = dg.load_data()
|
| 15 |
-
|
| 16 |
-
|
| 17 |
|
| 18 |
return render_template('index.html')
|
| 19 |
|
|
@@ -21,11 +21,11 @@ def index():
|
|
| 21 |
def result():
|
| 22 |
if request.method == 'POST':
|
| 23 |
sentence = request.form['inputSentence']
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
gloss_list = sentence.split()
|
| 29 |
#print('gloss before synonym:', gloss_list_lower)
|
| 30 |
#gloss_list = [sp.find_synonyms(gloss, nlp, dict_docs_spacy, dict_2000_tokens) for gloss in gloss_list_lower]
|
| 31 |
#print('synonym list:', gloss_list)
|
|
|
|
| 12 |
global dataset, vocabulary_list, dict_2000_tokens, nlp, dict_docs_spacy
|
| 13 |
|
| 14 |
dataset, vocabulary_list = dg.load_data()
|
| 15 |
+
dict_2000_tokens = dataset["gloss"].unique()
|
| 16 |
+
nlp, dict_docs_spacy = sp.load_spacy_values()
|
| 17 |
|
| 18 |
return render_template('index.html')
|
| 19 |
|
|
|
|
| 21 |
def result():
|
| 22 |
if request.method == 'POST':
|
| 23 |
sentence = request.form['inputSentence']
|
| 24 |
+
eng_to_asl_translator = NlpSpacyBaseTranslator(sentence=sentence)
|
| 25 |
+
generated_gloss = eng_to_asl_translator.translate_to_gloss()
|
| 26 |
+
gloss_list_lower = [gloss.lower() for gloss in generated_gloss.split() if gloss.isalnum() ]
|
| 27 |
+
gloss_list = gloss_list_lower
|
| 28 |
+
#gloss_list = sentence.split()
|
| 29 |
#print('gloss before synonym:', gloss_list_lower)
|
| 30 |
#gloss_list = [sp.find_synonyms(gloss, nlp, dict_docs_spacy, dict_2000_tokens) for gloss in gloss_list_lower]
|
| 31 |
#print('synonym list:', gloss_list)
|