Update app.py
Browse files
app.py
CHANGED
@@ -15,9 +15,7 @@ On October 5, CNBC reported that LG Energy Solution Ltd (KRX:373220), one of the
|
|
15 |
|
16 |
ner_examples = [[
|
17 |
text1,
|
18 |
-
"brand, date, quantity, car kind"
|
19 |
-
0.5,
|
20 |
-
False
|
21 |
]]
|
22 |
|
23 |
def merge_entities(entities):
|
@@ -60,15 +58,14 @@ def process(
|
|
60 |
with gr.Blocks(title="NER Task") as ner_interface:
|
61 |
input_text = gr.Textbox(label="Text input", placeholder="Enter your text here")
|
62 |
labels = gr.Textbox(label="Labels", placeholder="Enter your labels here (comma separated)", scale=2)
|
63 |
-
|
64 |
-
|
65 |
output = gr.HighlightedText(label="Predicted Entities")
|
66 |
submit_btn = gr.Button("Submit")
|
67 |
examples = gr.Examples(
|
68 |
ner_examples,
|
69 |
fn=process,
|
70 |
-
|
71 |
-
inputs=[input_text, labels],
|
72 |
outputs=output,
|
73 |
cache_examples=True
|
74 |
)
|
|
|
15 |
|
16 |
ner_examples = [[
|
17 |
text1,
|
18 |
+
"brand, date, quantity, car kind"
|
|
|
|
|
19 |
]]
|
20 |
|
21 |
def merge_entities(entities):
|
|
|
58 |
with gr.Blocks(title="NER Task") as ner_interface:
|
59 |
input_text = gr.Textbox(label="Text input", placeholder="Enter your text here")
|
60 |
labels = gr.Textbox(label="Labels", placeholder="Enter your labels here (comma separated)", scale=2)
|
61 |
+
threshold = 0.5
|
62 |
+
nested_ner = False
|
63 |
output = gr.HighlightedText(label="Predicted Entities")
|
64 |
submit_btn = gr.Button("Submit")
|
65 |
examples = gr.Examples(
|
66 |
ner_examples,
|
67 |
fn=process,
|
68 |
+
inputs=[input_text, labels, threshold, nested_ner],
|
|
|
69 |
outputs=output,
|
70 |
cache_examples=True
|
71 |
)
|