Spaces:
Sleeping
Sleeping
Commit
·
5524775
1
Parent(s):
7486b42
Added checkbox
Browse files
app.py
CHANGED
|
@@ -23,7 +23,7 @@ def get_named_entities(ocr_text: str):
|
|
| 23 |
|
| 24 |
for token in sentence:
|
| 25 |
for entity in token.get_spans("ner"):
|
| 26 |
-
print("ENT ",
|
| 27 |
entities.append(entity)
|
| 28 |
|
| 29 |
print("ENTITIES ", entities)
|
|
@@ -70,6 +70,8 @@ with gr.Blocks() as demo:
|
|
| 70 |
text_out = gr.TextArea(label="OCR output")
|
| 71 |
with gr.Column():
|
| 72 |
ner = gr.TextArea(label="Named entities")
|
|
|
|
|
|
|
| 73 |
|
| 74 |
btn.click(fn=run, inputs=[image_in, lang], outputs=[text_out, ner])
|
| 75 |
|
|
|
|
| 23 |
|
| 24 |
for token in sentence:
|
| 25 |
for entity in token.get_spans("ner"):
|
| 26 |
+
print("ENT ", str(entity))
|
| 27 |
entities.append(entity)
|
| 28 |
|
| 29 |
print("ENTITIES ", entities)
|
|
|
|
| 70 |
text_out = gr.TextArea(label="OCR output")
|
| 71 |
with gr.Column():
|
| 72 |
ner = gr.TextArea(label="Named entities")
|
| 73 |
+
with gr.Column():
|
| 74 |
+
gr.CheckboxGroup(ner, label="Named entities")
|
| 75 |
|
| 76 |
btn.click(fn=run, inputs=[image_in, lang], outputs=[text_out, ner])
|
| 77 |
|