Commit
·
a28c1a4
1
Parent(s):
7539d0f
update of application
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ def sequence_to_classify(sequence, labels):
|
|
9 |
|
10 |
hypothesis_template = 'Dette eksempelet er {}.'
|
11 |
response1 = classifier(sequence, labels, hypothesis_template=hypothesis_template, multi_class=True)
|
12 |
-
|
13 |
|
14 |
print("response is:{}".format(response))
|
15 |
print(type(response))
|
@@ -18,8 +18,8 @@ def sequence_to_classify(sequence, labels):
|
|
18 |
print("\n")
|
19 |
print("response1 is:{}".format(response1))
|
20 |
print(type(response1))
|
21 |
-
|
22 |
-
return
|
23 |
|
24 |
example_text="Folkehelseinstituttets mest optimistiske anslag er at alle voksne er ferdigvaksinert innen midten av september."
|
25 |
example_labels=[["politikk", "helse", "sport", "religion"]]
|
|
|
9 |
|
10 |
hypothesis_template = 'Dette eksempelet er {}.'
|
11 |
response1 = classifier(sequence, labels, hypothesis_template=hypothesis_template, multi_class=True)
|
12 |
+
clean_output1 = {idx: float(response1['scores'].pop()) for idx in response1['labels']}
|
13 |
|
14 |
print("response is:{}".format(response))
|
15 |
print(type(response))
|
|
|
18 |
print("\n")
|
19 |
print("response1 is:{}".format(response1))
|
20 |
print(type(response1))
|
21 |
+
print("clean_output1: {}".format(clean_output1))
|
22 |
+
return clean_output1
|
23 |
|
24 |
example_text="Folkehelseinstituttets mest optimistiske anslag er at alle voksne er ferdigvaksinert innen midten av september."
|
25 |
example_labels=[["politikk", "helse", "sport", "religion"]]
|