Upload DemoQAPipeline
Browse files- 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']}
|