ChancesYuan
commited on
Commit
•
0f1ad79
1
Parent(s):
1fb62f8
update
Browse files
app.py
CHANGED
@@ -16,14 +16,21 @@ with gr.Blocks() as demo:
|
|
16 |
with gr.Tabs():
|
17 |
|
18 |
with gr.TabItem("E-FB15k237"):
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
22 |
|
23 |
-
|
24 |
-
|
25 |
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
gr.Examples(
|
28 |
examples=[["[MASK] r1 t1", "h1"], ["[MASK] r2 t2", "h2"]],
|
29 |
inputs=[input, alter_label],
|
@@ -40,9 +47,8 @@ with gr.Blocks() as demo:
|
|
40 |
|
41 |
add_output = gr.Textbox(label="Add Results", lines=2, placeholder="")
|
42 |
|
43 |
-
|
44 |
edit_button.click(fn=edit_process, inputs=[input, alter_label], outputs=edit_output)
|
45 |
-
origin_button.click(fn=origin_preditcion, inputs=[input, alter_label], outputs=edit_output)
|
46 |
add_button.click(fn=add_process, inputs=[input, alter_label], outputs=add_output)
|
47 |
|
48 |
demo.launch()
|
|
|
16 |
with gr.Tabs():
|
17 |
|
18 |
with gr.TabItem("E-FB15k237"):
|
19 |
+
with gr.Row():
|
20 |
+
with gr.Column():
|
21 |
+
input = gr.Textbox(label="Input", lines=1, placeholder="Mask triple input")
|
22 |
+
origin_button = gr.Button("Origin")
|
23 |
|
24 |
+
with gr.Column():
|
25 |
+
origin_output = gr.Textbox(label="Before Edit", lines=2, placeholder="")
|
26 |
|
27 |
+
with gr.Row():
|
28 |
+
with gr.Column():
|
29 |
+
alter_label = gr.Textbox(label="Alter Entity", lines=1, placeholder="Entity Name")
|
30 |
+
edit_button = gr.Button("Edit", elem_id="warning")
|
31 |
+
|
32 |
+
with gr.Column():
|
33 |
+
edit_output = gr.Textbox(label="After Edit", lines=2, placeholder="")
|
34 |
gr.Examples(
|
35 |
examples=[["[MASK] r1 t1", "h1"], ["[MASK] r2 t2", "h2"]],
|
36 |
inputs=[input, alter_label],
|
|
|
47 |
|
48 |
add_output = gr.Textbox(label="Add Results", lines=2, placeholder="")
|
49 |
|
50 |
+
origin_button.click(fn=origin_preditcion, inputs=[input, alter_label], outputs=origin_output)
|
51 |
edit_button.click(fn=edit_process, inputs=[input, alter_label], outputs=edit_output)
|
|
|
52 |
add_button.click(fn=add_process, inputs=[input, alter_label], outputs=add_output)
|
53 |
|
54 |
demo.launch()
|