Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -39,15 +39,6 @@ def summarize(input):
|
|
39 |
summary_translated = translate(summary_origin,'en','fr')
|
40 |
return summary_origin, summary_translated[0]
|
41 |
|
42 |
-
# def reset_input():
|
43 |
-
# return ""
|
44 |
-
|
45 |
-
# def text_reset():
|
46 |
-
# return "","",""
|
47 |
-
|
48 |
-
# def ner_reset():
|
49 |
-
# return "",""
|
50 |
-
|
51 |
def merge_tokens(tokens):
|
52 |
merged_tokens = []
|
53 |
for token in tokens:
|
@@ -142,11 +133,10 @@ with playground:
|
|
142 |
|
143 |
with gr.Column(scale=1):
|
144 |
text_pipeline_button = gr.Button(value="Start Process", variant="primary")
|
145 |
-
# text_reset_button = gr.Button(value="Clear")
|
146 |
|
147 |
with gr.Row():
|
148 |
with gr.Column():
|
149 |
-
source_text = gr.Textbox(label="Text to summarize", lines=
|
150 |
with gr.Column():
|
151 |
summary_textoutput = gr.Textbox(lines=3, placeholder="", label="Text Summarization")
|
152 |
translated_textbox = gr.Textbox(lines=3, placeholder="", label="Translated Result")
|
@@ -160,7 +150,6 @@ with playground:
|
|
160 |
], inputs=[source_text], outputs=[summary_textoutput, translated_textbox], run_on_click=True, cache_examples=True, fn=summarize)
|
161 |
|
162 |
text_pipeline_button.click(summarize, inputs=[source_text], outputs=[summary_textoutput, translated_textbox])
|
163 |
-
# text_reset_button.click(text_reset, outputs=[source_text,summary_textoutput,translated_textbox])
|
164 |
|
165 |
## ================================================================================================================================
|
166 |
## Find entities
|
@@ -176,15 +165,14 @@ with playground:
|
|
176 |
|
177 |
with gr.Column(scale=1):
|
178 |
ner_pipeline_button = gr.Button(value="Start Process", variant="primary")
|
179 |
-
# ner_reset_button = gr.Button(value="Clear")
|
180 |
|
181 |
with gr.Row():
|
182 |
with gr.Column():
|
183 |
-
ner_text_input = gr.Textbox(label="Text to find entities", lines=
|
184 |
|
185 |
with gr.Column():
|
186 |
ner_text_output = gr.HighlightedText(label="Text with entities")
|
187 |
-
Ner_Clear_button = gr.ClearButton(components=[ner_text_input,
|
188 |
|
189 |
with gr.Row():
|
190 |
with gr.Column():
|
@@ -194,7 +182,6 @@ with playground:
|
|
194 |
], inputs=[ner_text_input], outputs=[ner_text_output], run_on_click=True, cache_examples=True, fn=ner)
|
195 |
|
196 |
ner_pipeline_button.click(ner, inputs=[ner_text_input], outputs=[ner_text_output])
|
197 |
-
# ner_reset_button.click(ner_reset, outputs=[ner_text_input, ner_text_output])
|
198 |
|
199 |
create_playground_footer()
|
200 |
|
|
|
39 |
summary_translated = translate(summary_origin,'en','fr')
|
40 |
return summary_origin, summary_translated[0]
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
def merge_tokens(tokens):
|
43 |
merged_tokens = []
|
44 |
for token in tokens:
|
|
|
133 |
|
134 |
with gr.Column(scale=1):
|
135 |
text_pipeline_button = gr.Button(value="Start Process", variant="primary")
|
|
|
136 |
|
137 |
with gr.Row():
|
138 |
with gr.Column():
|
139 |
+
source_text = gr.Textbox(label="Text to summarize", lines=13)
|
140 |
with gr.Column():
|
141 |
summary_textoutput = gr.Textbox(lines=3, placeholder="", label="Text Summarization")
|
142 |
translated_textbox = gr.Textbox(lines=3, placeholder="", label="Translated Result")
|
|
|
150 |
], inputs=[source_text], outputs=[summary_textoutput, translated_textbox], run_on_click=True, cache_examples=True, fn=summarize)
|
151 |
|
152 |
text_pipeline_button.click(summarize, inputs=[source_text], outputs=[summary_textoutput, translated_textbox])
|
|
|
153 |
|
154 |
## ================================================================================================================================
|
155 |
## Find entities
|
|
|
165 |
|
166 |
with gr.Column(scale=1):
|
167 |
ner_pipeline_button = gr.Button(value="Start Process", variant="primary")
|
|
|
168 |
|
169 |
with gr.Row():
|
170 |
with gr.Column():
|
171 |
+
ner_text_input = gr.Textbox(label="Text to find entities", lines=5)
|
172 |
|
173 |
with gr.Column():
|
174 |
ner_text_output = gr.HighlightedText(label="Text with entities")
|
175 |
+
Ner_Clear_button = gr.ClearButton(components=[ner_text_input, ner_text_output], value="Clear")
|
176 |
|
177 |
with gr.Row():
|
178 |
with gr.Column():
|
|
|
182 |
], inputs=[ner_text_input], outputs=[ner_text_output], run_on_click=True, cache_examples=True, fn=ner)
|
183 |
|
184 |
ner_pipeline_button.click(ner, inputs=[ner_text_input], outputs=[ner_text_output])
|
|
|
185 |
|
186 |
create_playground_footer()
|
187 |
|