I am using the below code to generate the answers using BERT model.
But how do I generate the respective confidence scores/metrics for each answer ? Is there any method that can show the metrics/probability or confidence score for each answer?
from deeppavlov import build_model, configs
bert_model = build_model(configs.squad.squad_bert_infer, download=False)
q1 = “For what time period did Pradhan Mantri Vaya Vandana Yojana got opened?”
answers = bert_model([sample_text], [q1])
[[‘one year i.e. from 4th May 2017 to 3rd May 2018’], , [103742.2265625]]