Spaces:
Sleeping
Sleeping
Commit
·
e60cc65
1
Parent(s):
d075bff
Added labels, changes the format of the entities
Browse files
app.py
CHANGED
|
@@ -26,6 +26,7 @@ def get_named_entities(ocr_text: str):
|
|
| 26 |
entities.append(entity)
|
| 27 |
|
| 28 |
print("ENTITIES ", entities)
|
|
|
|
| 29 |
|
| 30 |
return entities
|
| 31 |
|
|
@@ -65,9 +66,9 @@ with gr.Blocks() as demo:
|
|
| 65 |
lang = gr.Dropdown(choices, value="eng")
|
| 66 |
btn = gr.Button("Run")
|
| 67 |
with gr.Column():
|
| 68 |
-
text_out = gr.TextArea()
|
| 69 |
with gr.Column():
|
| 70 |
-
ner = gr.TextArea()
|
| 71 |
|
| 72 |
btn.click(fn=run, inputs=[image_in, lang], outputs=[text_out, ner])
|
| 73 |
|
|
|
|
| 26 |
entities.append(entity)
|
| 27 |
|
| 28 |
print("ENTITIES ", entities)
|
| 29 |
+
entities = "/n".join(entities)
|
| 30 |
|
| 31 |
return entities
|
| 32 |
|
|
|
|
| 66 |
lang = gr.Dropdown(choices, value="eng")
|
| 67 |
btn = gr.Button("Run")
|
| 68 |
with gr.Column():
|
| 69 |
+
text_out = gr.TextArea(label="OCR output")
|
| 70 |
with gr.Column():
|
| 71 |
+
ner = gr.TextArea(label="Named entities")
|
| 72 |
|
| 73 |
btn.click(fn=run, inputs=[image_in, lang], outputs=[text_out, ner])
|
| 74 |
|