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])
Answer:
[[‘one year i.e. from 4th May 2017 to 3rd May 2018’], [685], [103742.2265625]]
Thanks much! It worked. Another quick thing, if I have to get top 3 answers and their probability scores using Infer model, how do I get them ? Please help!