Spaces:
Sleeping
Sleeping
Commit
·
b0192e5
1
Parent(s):
6084ae2
added description and example
Browse files
app.py
CHANGED
@@ -12,6 +12,18 @@ import tempfile
|
|
12 |
from inference.model_inference import Inference
|
13 |
from configs import *
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
def get_MEIRa_clusters(doc_name, text, model_type):
|
17 |
model_str = MODELS[model_type]
|
@@ -117,7 +129,7 @@ with gr.Blocks() as demo:
|
|
117 |
fn=coref_visualizer,
|
118 |
inputs=[
|
119 |
gr.Textbox(lines=1, placeholder="Enter document name:"),
|
120 |
-
gr.Textbox(lines=
|
121 |
gr.Radio(choices=options, label="Select an Option"),
|
122 |
],
|
123 |
outputs=[
|
@@ -126,7 +138,15 @@ with gr.Blocks() as demo:
|
|
126 |
html_button,
|
127 |
json_button,
|
128 |
],
|
129 |
-
title="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
)
|
131 |
|
132 |
demo.launch(debug=True)
|
|
|
12 |
from inference.model_inference import Inference
|
13 |
from configs import *
|
14 |
|
15 |
+
DESC_MD = """
|
16 |
+
|
17 |
+
### This space is a demo for [Major Entity Identification (MEI)](https://arxiv.org/abs/2406.14654). MEI takes entities as additional input and aims to detect the mentions that refer only to these entities.
|
18 |
+
|
19 |
+
### Place the text in the text box with a single phrase of a selected entity in double curly braces(example: a single instance of {{Ron}} if you want to track Ron). Note that you can select one phrase for each entity and multiple entities can be selected. Check out the example below for clarity.
|
20 |
+
|
21 |
+
### The demo provides a json file with clusters and an HTML file with visualizations. The visualizations are color-coded based on the clusters.
|
22 |
+
|
23 |
+
### Static: Uses an instance of: MEIRa-S model
|
24 |
+
### Hybrid: Uses an instance of: MEIRa-H model
|
25 |
+
"""
|
26 |
+
|
27 |
|
28 |
def get_MEIRa_clusters(doc_name, text, model_type):
|
29 |
model_str = MODELS[model_type]
|
|
|
129 |
fn=coref_visualizer,
|
130 |
inputs=[
|
131 |
gr.Textbox(lines=1, placeholder="Enter document name:"),
|
132 |
+
gr.Textbox(lines=10, placeholder="Enter text for coreference resolution:"),
|
133 |
gr.Radio(choices=options, label="Select an Option"),
|
134 |
],
|
135 |
outputs=[
|
|
|
138 |
html_button,
|
139 |
json_button,
|
140 |
],
|
141 |
+
title="MEI Visualizer",
|
142 |
+
description=DESC_MD,
|
143 |
+
examples=[
|
144 |
+
[
|
145 |
+
"example",
|
146 |
+
"{{Harry}} went to Hogwarts to meet Hemoine and {{Ron}} . He also met Ron's mother at the railway station.",
|
147 |
+
"static",
|
148 |
+
]
|
149 |
+
],
|
150 |
)
|
151 |
|
152 |
demo.launch(debug=True)
|