Spaces:
Sleeping
Sleeping
Commit
Β·
66e1140
1
Parent(s):
e57de1a
Update app.py
Browse files
app.py
CHANGED
@@ -18,9 +18,11 @@ Two main tasks are available:
|
|
18 |
|
19 |
- Sentiment Analysis (SA), with two English-only models (one for classification, one for generation) and a large multilingual model for classification.
|
20 |
|
|
|
|
|
21 |
- Name Entity Recognition (NER), with an English-only model that generates the identified characters.
|
22 |
|
23 |
-
All models have been tuned on the Hall and
|
24 |
|
25 |
Use the current interface to check if a language is included in the multilingual SA model, using language acronyms (e.g. it for Italian). the tabs above will direct you to each model to query.
|
26 |
|
@@ -32,7 +34,7 @@ This model is an XLM-R tuned model, pre-trained with 94 languages available, and
|
|
32 |
"""
|
33 |
|
34 |
description_S = """
|
35 |
-
A BERT-base-cased model pre-trained on Eglish-only text and tuned on annotated DreamBank English data
|
36 |
"""
|
37 |
|
38 |
description_G = """
|
@@ -56,6 +58,9 @@ examples_g = [
|
|
56 |
|
57 |
]
|
58 |
|
|
|
|
|
|
|
59 |
|
60 |
interface_words = gr.Interface(
|
61 |
fn=check_lang,
|
@@ -70,21 +75,28 @@ interface_model_L = gr.Interface.load(
|
|
70 |
name="huggingface/DReAMy-lib/xlm-roberta-large-DreamBank-emotion-presence",
|
71 |
description=description_L,
|
72 |
examples=examples,
|
73 |
-
title="
|
74 |
)
|
75 |
|
76 |
interface_model_S = gr.Interface.load(
|
77 |
name="huggingface/DReAMy-lib/bert-base-cased-DreamBank-emotion-presence",
|
78 |
description=description_S,
|
79 |
examples=examples[0],
|
80 |
-
title="
|
81 |
)
|
82 |
|
83 |
interface_model_G = gr.Interface.load(
|
84 |
name="huggingface/DReAMy-lib/t5-base-DreamBank-Generation-Emot-Char",
|
85 |
description=description_G,
|
86 |
examples=examples_g,
|
87 |
-
title="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
)
|
89 |
|
90 |
interface_model_NER = gr.Interface.load(
|
@@ -95,6 +107,6 @@ interface_model_NER = gr.Interface.load(
|
|
95 |
)
|
96 |
|
97 |
gr.TabbedInterface(
|
98 |
-
[interface_words, interface_model_L, interface_model_S, interface_model_G, interface_model_NER],
|
99 |
-
["Intro", "SA Large Multilingual", "SA Base En", "SA En Generation", "NER Generation"]
|
100 |
).launch()
|
|
|
18 |
|
19 |
- Sentiment Analysis (SA), with two English-only models (one for classification, one for generation) and a large multilingual model for classification.
|
20 |
|
21 |
+
- Relation Extraction (RE), with an English-only model that identifies relevant characters and existing relations between them following the Activity feature of the the Hall and Van de Castle framework.
|
22 |
+
|
23 |
- Name Entity Recognition (NER), with an English-only model that generates the identified characters.
|
24 |
|
25 |
+
All models have been tuned on the Hall and Van de Castle framework. More details are on the page for each model. For more on the training framework, see the [Bertolini et al., 2023](https://arxiv.org/pdf/2302.14828.pdf) preprint.
|
26 |
|
27 |
Use the current interface to check if a language is included in the multilingual SA model, using language acronyms (e.g. it for Italian). the tabs above will direct you to each model to query.
|
28 |
|
|
|
34 |
"""
|
35 |
|
36 |
description_S = """
|
37 |
+
A BERT-base-cased model pre-trained on Eglish-only text and tuned on annotated DreamBank English data.
|
38 |
"""
|
39 |
|
40 |
description_G = """
|
|
|
58 |
|
59 |
]
|
60 |
|
61 |
+
examples_re = [
|
62 |
+
["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."]
|
63 |
+
]
|
64 |
|
65 |
interface_words = gr.Interface(
|
66 |
fn=check_lang,
|
|
|
75 |
name="huggingface/DReAMy-lib/xlm-roberta-large-DreamBank-emotion-presence",
|
76 |
description=description_L,
|
77 |
examples=examples,
|
78 |
+
title="SA Large Multilingual",
|
79 |
)
|
80 |
|
81 |
interface_model_S = gr.Interface.load(
|
82 |
name="huggingface/DReAMy-lib/bert-base-cased-DreamBank-emotion-presence",
|
83 |
description=description_S,
|
84 |
examples=examples[0],
|
85 |
+
title="SA Base English-Only",
|
86 |
)
|
87 |
|
88 |
interface_model_G = gr.Interface.load(
|
89 |
name="huggingface/DReAMy-lib/t5-base-DreamBank-Generation-Emot-Char",
|
90 |
description=description_G,
|
91 |
examples=examples_g,
|
92 |
+
title="SA Generation",
|
93 |
+
)
|
94 |
+
|
95 |
+
interface_model_RE = gr.Interface.load(
|
96 |
+
name="huggingface/DReAMy-lib/t5-base-DreamBank-Generation-Act-Char",
|
97 |
+
description=description_G,
|
98 |
+
examples=examples_re,
|
99 |
+
title="RE Generation",
|
100 |
)
|
101 |
|
102 |
interface_model_NER = gr.Interface.load(
|
|
|
107 |
)
|
108 |
|
109 |
gr.TabbedInterface(
|
110 |
+
[interface_words, interface_model_L, interface_model_S, interface_model_G, interface_model_RE, interface_model_NER],
|
111 |
+
["Intro", "SA Large Multilingual", "SA Base En", "SA En Generation", "RE Generation", "NER Generation"]
|
112 |
).launch()
|