Update app.py
Browse files
app.py
CHANGED
@@ -7,8 +7,9 @@ import gradio as gr
|
|
7 |
#from pysentimiento import create_analyzer
|
8 |
import pandas as pd
|
9 |
|
10 |
-
|
11 |
-
|
|
|
12 |
|
13 |
# Inicializa Modelo de Clasificaci贸n de Sentimientos
|
14 |
model_name_sent = 'pysentimiento/robertuito-sentiment-analysis'
|
@@ -32,8 +33,7 @@ def classify_text(text):
|
|
32 |
else:
|
33 |
return "Neutro"
|
34 |
|
35 |
-
def clasificador(input1, input2):
|
36 |
-
# classifier = pipeline("zero-shot-classification", model="MoritzLaurer/mDeBERTa-v3-base-mnli-xnli",tokenizer=tokenizer)
|
37 |
# sequence_to_classify = input1
|
38 |
# input2_list = input2.split(",") # Parse the input string as a list
|
39 |
# candidate_labels= [item.strip() for item in input2_list]
|
@@ -43,7 +43,7 @@ def clasificador(input1, input2):
|
|
43 |
#analyzer = create_analyzer(task="sentiment", lang="es")
|
44 |
#output2 = analyzer.predict(input1)
|
45 |
output2=classify_text(input1)
|
46 |
-
return output2
|
47 |
|
48 |
|
49 |
iface = gr.Interface(
|
|
|
7 |
#from pysentimiento import create_analyzer
|
8 |
import pandas as pd
|
9 |
|
10 |
+
model_name_c = "MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7"
|
11 |
+
tokenizer_c = AutoTokenizer.from_pretrained(model_name)
|
12 |
+
classifier = pipeline("zero-shot-classification", model=model_name_c,tokenizer=tokenizer_c)
|
13 |
|
14 |
# Inicializa Modelo de Clasificaci贸n de Sentimientos
|
15 |
model_name_sent = 'pysentimiento/robertuito-sentiment-analysis'
|
|
|
33 |
else:
|
34 |
return "Neutro"
|
35 |
|
36 |
+
def clasificador(input1, input2):
|
|
|
37 |
# sequence_to_classify = input1
|
38 |
# input2_list = input2.split(",") # Parse the input string as a list
|
39 |
# candidate_labels= [item.strip() for item in input2_list]
|
|
|
43 |
#analyzer = create_analyzer(task="sentiment", lang="es")
|
44 |
#output2 = analyzer.predict(input1)
|
45 |
output2=classify_text(input1)
|
46 |
+
return output2 #, output2
|
47 |
|
48 |
|
49 |
iface = gr.Interface(
|