azaninello commited on
Commit
6460fc9
1 Parent(s): ab6fc81

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -3
app.py CHANGED
@@ -8,6 +8,20 @@ from nltk.probability import FreqDist
8
  from simplemma import text_lemmatizer
9
  nltk.download('punkt')
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  file = "text.txt"
12
 
13
  def get_lists(file):
@@ -87,7 +101,7 @@ def sentence_builder(cerca_una_parola, place, activity_list, morning):
87
  return f"""The {cerca_una_parola}s went to the {place} where they {" and ".join(activity_list)} until the {"morning" if morning else "night"}"""
88
 
89
  demo = gr.Interface(search_engine, inputs="text", outputs="text")
90
- '''
91
  demo = gr.Interface(
92
  sentence_builder,
93
  [
@@ -104,7 +118,8 @@ demo = gr.Interface(
104
  ["cat", "zoo", ["ate"], True],
105
  ],
106
  )
107
- '''
108
 
109
  if __name__ == "__main__":
110
- demo.launch()
 
 
8
  from simplemma import text_lemmatizer
9
  nltk.download('punkt')
10
 
11
+ def update(name):
12
+ return f"Welcome to Gradio, {name}!"
13
+
14
+ with gr.Blocks() as demo:
15
+ gr.Markdown("Start typing below and then click **Run** to see the output.")
16
+ with gr.Row():
17
+ inp = gr.Textbox(placeholder="What is your name?")
18
+ out = gr.Textbox()
19
+ btn = gr.Button("Run")
20
+ btn.click(fn=update, inputs=inp, outputs=out)
21
+
22
+ demo.launch()
23
+
24
+ '''
25
  file = "text.txt"
26
 
27
  def get_lists(file):
 
101
  return f"""The {cerca_una_parola}s went to the {place} where they {" and ".join(activity_list)} until the {"morning" if morning else "night"}"""
102
 
103
  demo = gr.Interface(search_engine, inputs="text", outputs="text")
104
+
105
  demo = gr.Interface(
106
  sentence_builder,
107
  [
 
118
  ["cat", "zoo", ["ate"], True],
119
  ],
120
  )
121
+
122
 
123
  if __name__ == "__main__":
124
+ demo.launch()
125
+ '''