Spaces:
Running
Running
domain dropdown
Browse files- interfaces/sentiment.py +6 -1
interfaces/sentiment.py
CHANGED
@@ -14,6 +14,10 @@ HF_TOKEN = os.environ["hf_read"]
|
|
14 |
languages = [
|
15 |
"Czech", "English", "French", "German", "Hungarian", "Italian"
|
16 |
]
|
|
|
|
|
|
|
|
|
17 |
|
18 |
def build_huggingface_path(language: str):
|
19 |
return "poltextlab/xlm-roberta-large-pooled-sentiment"
|
@@ -47,5 +51,6 @@ def predict_cap(text, language):
|
|
47 |
demo = gr.Interface(
|
48 |
fn=predict_cap,
|
49 |
inputs=[gr.Textbox(lines=6, label="Input"),
|
50 |
-
gr.Dropdown(languages, label="Language")
|
|
|
51 |
outputs=[gr.Label(num_top_classes=3, label="Output"), gr.Markdown()])
|
|
|
14 |
languages = [
|
15 |
"Czech", "English", "French", "German", "Hungarian", "Italian"
|
16 |
]
|
17 |
+
domains = {
|
18 |
+
"parliamentary speech": "parlspeech",
|
19 |
+
}
|
20 |
+
|
21 |
|
22 |
def build_huggingface_path(language: str):
|
23 |
return "poltextlab/xlm-roberta-large-pooled-sentiment"
|
|
|
51 |
demo = gr.Interface(
|
52 |
fn=predict_cap,
|
53 |
inputs=[gr.Textbox(lines=6, label="Input"),
|
54 |
+
gr.Dropdown(languages, label="Language"),
|
55 |
+
gr.Dropdown(domains.keys(), label="Domain", value=domains.keys()[0])],
|
56 |
outputs=[gr.Label(num_top_classes=3, label="Output"), gr.Markdown()])
|