Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,11 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
def sentiment_analysis(sentence, template, model_name, positive, neutral, negative):
|
4 |
model_name = model_name
|
@@ -11,7 +18,7 @@ def sentiment_analysis(sentence, template, model_name, positive, neutral, negati
|
|
11 |
"neutral": neutral.split(" "),
|
12 |
"negative": negative.split(" "),
|
13 |
}
|
14 |
-
|
15 |
type_dic = {
|
16 |
"CCCC/ARCH_tuned_bert":"bert",
|
17 |
"bert-base-uncased":"bert",
|
|
|
1 |
import gradio as gr
|
2 |
+
import torch
|
3 |
+
from openprompt.plms import load_plm
|
4 |
+
from openprompt import PromptDataLoader
|
5 |
+
from openprompt.prompts import ManualVerbalizer
|
6 |
+
from openprompt.prompts import ManualTemplate
|
7 |
+
from openprompt.data_utils import InputExample
|
8 |
+
from openprompt import PromptForClassification
|
9 |
|
10 |
def sentiment_analysis(sentence, template, model_name, positive, neutral, negative):
|
11 |
model_name = model_name
|
|
|
18 |
"neutral": neutral.split(" "),
|
19 |
"negative": negative.split(" "),
|
20 |
}
|
21 |
+
|
22 |
type_dic = {
|
23 |
"CCCC/ARCH_tuned_bert":"bert",
|
24 |
"bert-base-uncased":"bert",
|