marcelcastrobr
commited on
Commit
•
13a9362
1
Parent(s):
b752604
update of application
Browse files
app.py
CHANGED
@@ -7,9 +7,9 @@ def sequence_to_classify(sequence, labels):
|
|
7 |
hypothesis_template = 'Dette eksempelet er {}.'
|
8 |
label_clean = str(labels).split(",")
|
9 |
response = classifier(sequence, label_clean, hypothesis_template=hypothesis_template, multi_class=True)
|
10 |
-
|
11 |
-
|
12 |
-
clean_output = {labels[idx]: float(
|
13 |
|
14 |
print("response is:{}".format(response))
|
15 |
print("clean_output: {}".format(clean_output))
|
|
|
7 |
hypothesis_template = 'Dette eksempelet er {}.'
|
8 |
label_clean = str(labels).split(",")
|
9 |
response = classifier(sequence, label_clean, hypothesis_template=hypothesis_template, multi_class=True)
|
10 |
+
predicted_labels = response['labels']
|
11 |
+
predicted_scores = response['scores']
|
12 |
+
clean_output = {labels[idx]: float(predicted_scores[idx]) for idx in range(len(predicted_labels))}
|
13 |
|
14 |
print("response is:{}".format(response))
|
15 |
print("clean_output: {}".format(clean_output))
|