houyu0930 commited on
Commit
e9f2c57
verified
1 Parent(s): 536f457

Upload DemoQAPipeline

Browse files
Files changed (1) hide show
  1. demo_qa_pipe.py +1 -1
demo_qa_pipe.py CHANGED
@@ -4,5 +4,5 @@ from transformers import QuestionAnsweringPipeline
4
  class DemoQAPipeline(QuestionAnsweringPipeline):
5
  def postprocess(self, model_outputs):
6
  # Format: {'score': 1.3321573119791374e-13, 'start': 70, 'end': 90, 'answer': 'Hopkins was featured'}
7
- answers = super.postprocess(model_outputs)
8
  return {'guess': answers['answer'], 'confidence': answers['score']}
 
4
  class DemoQAPipeline(QuestionAnsweringPipeline):
5
  def postprocess(self, model_outputs):
6
  # Format: {'score': 1.3321573119791374e-13, 'start': 70, 'end': 90, 'answer': 'Hopkins was featured'}
7
+ answers = super().postprocess(model_outputs)
8
  return {'guess': answers['answer'], 'confidence': answers['score']}