Update src/webui.py
Browse files- src/webui.py +12 -8
src/webui.py
CHANGED
@@ -147,7 +147,7 @@ def create_interface():
|
|
147 |
file_path_gr = gr.File(label="๐ Upload a File", visible=True)
|
148 |
text_gr = gr.Textbox(label="๐ Text", lines=5, placeholder="Enter your Text please.", visible=False)
|
149 |
instruction_gr = gr.Textbox(label="๐น๏ธ Instruction", lines=3, placeholder="You can enter any type of information you want to extract here, for example: Please help me extract all the person names.", visible=True)
|
150 |
-
constraint_gr = gr.Textbox(label="๐น๏ธ Constraint", lines=3, placeholder="
|
151 |
|
152 |
update_case_gr = gr.Checkbox(label="๐ฐ Update Case", value=False)
|
153 |
# update_schema_gr = gr.Checkbox(label="๐ Update Schema", value=False)
|
@@ -178,16 +178,20 @@ def create_interface():
|
|
178 |
|
179 |
def update_fields(task):
|
180 |
if task == "Base" or task == "":
|
181 |
-
return gr.update(visible=True, label="๐น๏ธ Instruction", lines=3,
|
|
|
182 |
elif task == "NER":
|
183 |
-
|
184 |
-
|
185 |
elif task == "RE":
|
186 |
-
return gr.update(visible=False), gr.update(visible=True, label="๐น๏ธ Constraint", lines=3,
|
|
|
187 |
elif task == "EE":
|
188 |
-
return gr.update(visible=False), gr.update(visible=True, label="๐น๏ธ Constraint", lines=3,
|
|
|
189 |
elif task == "Triple":
|
190 |
-
return gr.update(visible=False), gr.update(visible=True, label="๐น๏ธ Constraint", lines=3,
|
|
|
191 |
|
192 |
def update_input_fields(use_file):
|
193 |
if use_file:
|
@@ -401,4 +405,4 @@ def create_interface():
|
|
401 |
# Launch the front-end interface
|
402 |
if __name__ == "__main__":
|
403 |
interface = create_interface()
|
404 |
-
interface.launch()
|
|
|
147 |
file_path_gr = gr.File(label="๐ Upload a File", visible=True)
|
148 |
text_gr = gr.Textbox(label="๐ Text", lines=5, placeholder="Enter your Text please.", visible=False)
|
149 |
instruction_gr = gr.Textbox(label="๐น๏ธ Instruction", lines=3, placeholder="You can enter any type of information you want to extract here, for example: Please help me extract all the person names.", visible=True)
|
150 |
+
constraint_gr = gr.Textbox(label="๐น๏ธ Constraint", lines=3, placeholder="Please specify the types of entities, relations, events, or other relevant attributes in list format as per the task requirements.", visible=False)
|
151 |
|
152 |
update_case_gr = gr.Checkbox(label="๐ฐ Update Case", value=False)
|
153 |
# update_schema_gr = gr.Checkbox(label="๐ Update Schema", value=False)
|
|
|
178 |
|
179 |
def update_fields(task):
|
180 |
if task == "Base" or task == "":
|
181 |
+
return gr.update(visible=True, label="๐น๏ธ Instruction", lines=3,
|
182 |
+
placeholder="You can enter any type of information you want to extract here, for example: Please help me extract all the person names."), gr.update(visible=False)
|
183 |
elif task == "NER":
|
184 |
+
return gr.update(visible=False), gr.update(visible=True, label="๐น๏ธ Constraint", lines=3,
|
185 |
+
placeholder="Please specify the entity types to extract in list format, and all types will be extracted by default if not specified.")
|
186 |
elif task == "RE":
|
187 |
+
return gr.update(visible=False), gr.update(visible=True, label="๐น๏ธ Constraint", lines=3,
|
188 |
+
placeholder="Please specify the relation types to extract in list format, and all types will be extracted by default if not specified.")
|
189 |
elif task == "EE":
|
190 |
+
return gr.update(visible=False), gr.update(visible=True, label="๐น๏ธ Constraint", lines=3,
|
191 |
+
placeholder="Please specify the event types and their corresponding extraction attributes in dictionary format, and all types and attributes will be extracted by default if not specified.")
|
192 |
elif task == "Triple":
|
193 |
+
return gr.update(visible=False), gr.update(visible=True, label="๐น๏ธ Constraint", lines=3,
|
194 |
+
placeholder="Please read the documentation and specify the types of triples in list format.")
|
195 |
|
196 |
def update_input_fields(use_file):
|
197 |
if use_file:
|
|
|
405 |
# Launch the front-end interface
|
406 |
if __name__ == "__main__":
|
407 |
interface = create_interface()
|
408 |
+
interface.launch()
|