Skip to content

dialog_qa

allennlp_models.rc.predictors.dialog_qa

[SOURCE]


DialogQAPredictor#

@Predictor.register("dialog_qa")
class DialogQAPredictor(Predictor):
 | def __init__(
 |     self,
 |     model: Model,
 |     dataset_reader: DatasetReader,
 |     language: str = "en_core_web_sm"
 | ) -> None

predict#

class DialogQAPredictor(Predictor):
 | ...
 | def predict(self, jsonline: str) -> JsonDict

Make a dialog-style question answering prediction on the supplied input. The supplied input json must contain a list of question answer pairs, containing question, answer, yesno, followup, id as well as the context (passage).

Parametersjsonline : ``str``

A json line that has the same format as the quac data file.

ReturnsA dictionary that represents the prediction made by the system. The answer string will be under the

"best_span_str" key.