Esempio n. 1
0
 def _get_results(self):
     self.write_predictions()
     if self._name == "squad":
         squad_official_eval.set_opts(self._config, self._split)
         squad_official_eval.main()
         return sorted(
             utils.load_json(self._config.qa_eval_file(self._name)).items())
     elif self._name == "squadv1":
         return sorted(
             squad_official_eval_v1.main(self._config, self._split).items())
     else:
         return sorted(
             mrqa_official_eval.main(self._config, self._split,
                                     self._name).items())
Esempio n. 2
0
 def _get_results(self):
     self.write_predictions()
     if self._name in ["squad", "ccks42ee", "ccks42single", "ccks42multi"]:
         squad_official_eval.set_opts(self._config, self._split, self._name)
         squad_official_eval.main()
         return sorted(
             utils.load_json(self._config.qa_eval_file(self._name)).items())
     elif self._name in ["squadv1", "cmrc2018", "drcd"]:
         return sorted(
             squad_official_eval_v1.main(self._config, self._split,
                                         self._name).items())
     else:
         return sorted(
             mrqa_official_eval.main(self._config, self._split,
                                     self._name).items())