Spaces:
Runtime error
Runtime error
Commit
·
eaf9808
1
Parent(s):
b04b719
Update app.py
Browse files
app.py
CHANGED
@@ -21,11 +21,11 @@ def get_lists(file):
|
|
21 |
|
22 |
return word_tokenized_text, word_tokenized_text_lower, sent_tokenized_text, sent_tokenized_text_lower
|
23 |
|
24 |
-
words, words_lower,
|
25 |
|
26 |
-
def search_engine(
|
27 |
-
sentences_lower =
|
28 |
-
sentences =
|
29 |
if round == False:
|
30 |
target= gr.Textbox() #input("Inserisci una o più parole da cercare.\n")
|
31 |
else:
|
@@ -55,7 +55,7 @@ def search_engine(inputs=[sentences_lower, sentences], round=False):
|
|
55 |
def sentence_builder(cerca_una_parola, place, activity_list, morning):
|
56 |
return f"""The {cerca_una_parola}s went to the {place} where they {" and ".join(activity_list)} until the {"morning" if morning else "night"}"""
|
57 |
|
58 |
-
demo = gr.Interface(search_engine, inputs=
|
59 |
'''
|
60 |
demo = gr.Interface(
|
61 |
sentence_builder,
|
|
|
21 |
|
22 |
return word_tokenized_text, word_tokenized_text_lower, sent_tokenized_text, sent_tokenized_text_lower
|
23 |
|
24 |
+
words, words_lower, SENTENCES, SENTENCES_LOWER = get_lists(file)
|
25 |
|
26 |
+
def search_engine(target, round=False):
|
27 |
+
sentences_lower = SENTENCES_LOWER
|
28 |
+
sentences = SENTENCES
|
29 |
if round == False:
|
30 |
target= gr.Textbox() #input("Inserisci una o più parole da cercare.\n")
|
31 |
else:
|
|
|
55 |
def sentence_builder(cerca_una_parola, place, activity_list, morning):
|
56 |
return f"""The {cerca_una_parola}s went to the {place} where they {" and ".join(activity_list)} until the {"morning" if morning else "night"}"""
|
57 |
|
58 |
+
demo = gr.Interface(search_engine, inputs="text", outputs="text")
|
59 |
'''
|
60 |
demo = gr.Interface(
|
61 |
sentence_builder,
|