Beispiel #1
0
 def test_run(self):
     exp: Experimenter = Experimenter(met_cls=KeywordBaseline,
                                      par_cls=KeywordBaselineParam,
                                      param_file=self.param_file,
                                      dataset=self.dataset,
                                      runname=self.runname,
                                      is_fake=False)
     exp.run()
     assert results_dir.joinpath('ir/clef/keyword.prel')
     assert results_dir.joinpath('clf/clef/keyword.json')
Beispiel #2
0
    def clean_results(self):
        # assertion to prevent from deleting from production results
        assert results_dir != project_root.joinpath('results')
        for task in ('ir', 'clf'):
            if results_dir.joinpath(task).exists():
                clefdir: Path = results_dir.joinpath(task).joinpath('clef')
                for fpath in clefdir.glob('*.prel'):
                    fpath.unlink()
                for fpath in clefdir.glob('*.json'):
                    fpath.unlink()

                clefdir.rmdir()
                results_dir.joinpath(task).rmdir()
Beispiel #3
0
 def setUp(self):
     results_dir.joinpath('ir/clef').mkdir(parents=True)
     results_dir.joinpath('clf/clef').mkdir(parents=True)
Beispiel #4
0
 def get_fpath_from(cls, dataset_name: str, method_name: str) -> Path:
     return results_dir.joinpath(f'clf/{dataset_name}/{method_name}.json')
Beispiel #5
0
 def setUp(self, *args, **kwargs):
     super(ExperimenterTest, self).setUp(*args, **kwargs)
     assert not results_dir.joinpath('ir/clef').exists()
     results_dir.joinpath('ir/clef').mkdir(parents=True)
     assert not results_dir.joinpath('clf/clef').exists()
     results_dir.joinpath('clf/clef').mkdir(parents=True)
Beispiel #6
0
 def get_result_dir(self) -> Path:
     return results_dir.joinpath(f'{self.name}')
Beispiel #7
0
 def get_fpath(self) -> Path:
     return results_dir.joinpath(
         f'ir/{self.dataset_name}/{self.method_name}.prel')