azaninello commited on
Commit
eaf9808
·
1 Parent(s): b04b719

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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, sentences, sentences_lower = get_lists(file)
25
 
26
- def search_engine(inputs=[sentences_lower, sentences], round=False):
27
- sentences_lower = inputs[0]
28
- sentences = inputs[1]
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=[sentences_lower, sentences, False], outputs="text")
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,