Fahad Ebrahim commited on
Commit
a2af74c
·
1 Parent(s): 1a4bdfa

Dict output

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -22,6 +22,7 @@ def text_classification(text):
22
  classifier = TextClassificationPipeline(model=model, tokenizer=tokenizer, max_length=256, padding="max_length", truncation=True,top_k=None)
23
  preprocessed_issue = preprocess (text)
24
  out = classifier(preprocessed_issue)[0]
 
25
  return out
26
 
27
  examples=["This is a question", "This is a bug", "This is an enhancement" ]
 
22
  classifier = TextClassificationPipeline(model=model, tokenizer=tokenizer, max_length=256, padding="max_length", truncation=True,top_k=None)
23
  preprocessed_issue = preprocess (text)
24
  out = classifier(preprocessed_issue)[0]
25
+ label_scores = {result['label']: result['score'] for result in out}
26
  return out
27
 
28
  examples=["This is a question", "This is a bug", "This is an enhancement" ]