marcelcastrobr commited on
Commit
13a9362
1 Parent(s): b752604

update of application

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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
- labels = response['labels']
11
- scores = response['scores']
12
- clean_output = {labels[idx]: float(scores[idx]) for idx in range(len(labels))}
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))