marcelcastrobr
commited on
Commit
·
9733f6c
1
Parent(s):
e8db8bd
update of application
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
from transformers import pipeline
|
3 |
classifier = pipeline("zero-shot-classification", model="NbAiLab/nb-bert-base-mnli")
|
4 |
|
@@ -10,7 +11,11 @@ def sequence_to_classify(sequence, labels):
|
|
10 |
predicted_labels = response['labels']
|
11 |
predicted_scores = response['scores']
|
12 |
clean_output = {idx: float(predicted_scores.pop(0)) for idx in predicted_labels}
|
13 |
-
|
|
|
|
|
|
|
|
|
14 |
return clean_output
|
15 |
|
16 |
example_text1="Folkehelseinstituttets mest optimistiske anslag er at alle voksne er ferdigvaksinert innen midten av september."
|
|
|
1 |
import gradio as gr
|
2 |
+
import datetime
|
3 |
from transformers import pipeline
|
4 |
classifier = pipeline("zero-shot-classification", model="NbAiLab/nb-bert-base-mnli")
|
5 |
|
|
|
11 |
predicted_labels = response['labels']
|
12 |
predicted_scores = response['scores']
|
13 |
clean_output = {idx: float(predicted_scores.pop(0)) for idx in predicted_labels}
|
14 |
+
print("Date:{} , Sequece:{}, Labels: {}".format(
|
15 |
+
str(datetime.datetime.now(),
|
16 |
+
sequence,
|
17 |
+
predicted_labels)
|
18 |
+
))
|
19 |
return clean_output
|
20 |
|
21 |
example_text1="Folkehelseinstituttets mest optimistiske anslag er at alle voksne er ferdigvaksinert innen midten av september."
|