Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,13 @@ def summarize(input):
|
|
28 |
|
29 |
def reset_input():
|
30 |
return ""
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
def merge_tokens(tokens):
|
33 |
merged_tokens = []
|
34 |
for token in tokens:
|
@@ -76,7 +82,7 @@ def create_tabs_header(topic, description, references):
|
|
76 |
""")
|
77 |
|
78 |
with gr.Column(scale=1):
|
79 |
-
test_pipeline_button = gr.Button(value="Process")
|
80 |
return test_pipeline_button
|
81 |
|
82 |
with playground:
|
@@ -129,7 +135,7 @@ with playground:
|
|
129 |
], inputs=[source_text], outputs=[summary_textoutput, translated_textbox], run_on_click=True, cache_examples=True, fn=summarize)
|
130 |
|
131 |
text_pipeline_button.click(summarize, inputs=[source_text], outputs=[summary_textoutput, translated_textbox])
|
132 |
-
text_reset_button.click(
|
133 |
|
134 |
with gr.TabItem("Name Entity"):
|
135 |
with gr.Row():
|
@@ -141,7 +147,8 @@ with playground:
|
|
141 |
""")
|
142 |
|
143 |
with gr.Column(scale=1):
|
144 |
-
ner_pipeline_button = gr.Button(value="Process")
|
|
|
145 |
|
146 |
with gr.Row():
|
147 |
with gr.Column():
|
@@ -158,6 +165,7 @@ with playground:
|
|
158 |
], inputs=[ner_text_input], outputs=[ner_text_output], run_on_click=True, cache_examples=True, fn=ner)
|
159 |
|
160 |
ner_pipeline_button.click(ner, inputs=[ner_text_input], outputs=[ner_text_output])
|
|
|
161 |
|
162 |
create_playground_footer()
|
163 |
|
|
|
28 |
|
29 |
def reset_input():
|
30 |
return ""
|
31 |
+
|
32 |
+
def text_reset():
|
33 |
+
return "","",""
|
34 |
+
|
35 |
+
def ner_reset():
|
36 |
+
return "",""
|
37 |
+
|
38 |
def merge_tokens(tokens):
|
39 |
merged_tokens = []
|
40 |
for token in tokens:
|
|
|
82 |
""")
|
83 |
|
84 |
with gr.Column(scale=1):
|
85 |
+
test_pipeline_button = gr.Button(value="Start Process", variant="primary")
|
86 |
return test_pipeline_button
|
87 |
|
88 |
with playground:
|
|
|
135 |
], inputs=[source_text], outputs=[summary_textoutput, translated_textbox], run_on_click=True, cache_examples=True, fn=summarize)
|
136 |
|
137 |
text_pipeline_button.click(summarize, inputs=[source_text], outputs=[summary_textoutput, translated_textbox])
|
138 |
+
text_reset_button.click(text_reset, outputs=[source_text,summary_textoutput,translated_textbox])
|
139 |
|
140 |
with gr.TabItem("Name Entity"):
|
141 |
with gr.Row():
|
|
|
147 |
""")
|
148 |
|
149 |
with gr.Column(scale=1):
|
150 |
+
ner_pipeline_button = gr.Button(value="Start Process", variant="primary")
|
151 |
+
ner_reset_button = gr.Button(value="Clear")
|
152 |
|
153 |
with gr.Row():
|
154 |
with gr.Column():
|
|
|
165 |
], inputs=[ner_text_input], outputs=[ner_text_output], run_on_click=True, cache_examples=True, fn=ner)
|
166 |
|
167 |
ner_pipeline_button.click(ner, inputs=[ner_text_input], outputs=[ner_text_output])
|
168 |
+
ner_reset_button.click(ner_reset, outputs=[ner_text_input, ner_text_output])
|
169 |
|
170 |
create_playground_footer()
|
171 |
|