Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import pandas as pd
|
|
|
|
| 3 |
|
| 4 |
languages = pd.read_csv("model_lang.csv", names=["Lang_acr"])
|
| 5 |
|
|
@@ -98,11 +99,25 @@ interface_model_G = gr.Interface.load(
|
|
| 98 |
title="SA Generation",
|
| 99 |
)
|
| 100 |
|
| 101 |
-
interface_model_RE = gr.Interface.load(
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
)
|
| 107 |
|
| 108 |
interface_model_NER = gr.Interface.load(
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import pandas as pd
|
| 3 |
+
from graph_utils import *
|
| 4 |
|
| 5 |
languages = pd.read_csv("model_lang.csv", names=["Lang_acr"])
|
| 6 |
|
|
|
|
| 99 |
title="SA Generation",
|
| 100 |
)
|
| 101 |
|
| 102 |
+
# interface_model_RE = gr.Interface.load(
|
| 103 |
+
# name="models/DReAMy-lib/t5-base-DreamBank-Generation-Act-Char",
|
| 104 |
+
# description=description_R,
|
| 105 |
+
# examples=examples_re,
|
| 106 |
+
# title="RE Generation",
|
| 107 |
+
# )
|
| 108 |
+
|
| 109 |
+
interface_model_RE = gr.Interface(
|
| 110 |
+
text_to_graph,
|
| 111 |
+
inputs=gr.Textbox(label="Text", placeholder="Enter a text here."),
|
| 112 |
+
outputs=[gr.HTML(label="Extracted graph"),gr.Textbox(label="Extracted text")]
|
| 113 |
+
examples= [
|
| 114 |
+
["I was skating on the outdoor ice pond that used to be across the street from my house. I was not alone, but I did not recognize any of the other people who were skating around. I went through my whole repertoire of jumps, spires, and steps-some of which I can do and some of which I'm not yet sure of. They were all executed flawlessly-some I repeated, some I did only once. I seemed to know that if I went into competition, I would be sure of coming in third because there were only three contestants. Up to that time I hadn't considered it because I hadn't thought I was good enough, but now since everything was going so well, I decided to enter."],
|
| 115 |
+
["I was talking on the telephone to the father of an old friend of mine (boy, 21 years old). We were discussing the party the Saturday night before to which I had invited his son as a guest. I asked him if his son had a good time at the party. He told me not to tell his son that he had told me, but that he had had a good time, except he was a little surprised that I had acted the way I did."],
|
| 116 |
+
["I was walking alone with my dog in a forest."]
|
| 117 |
+
],
|
| 118 |
+
title=title,
|
| 119 |
+
description=description_R,
|
| 120 |
+
cache_examples=True,
|
| 121 |
)
|
| 122 |
|
| 123 |
interface_model_NER = gr.Interface.load(
|