def test_write_report(self):
     d = mkdtemp(prefix='test_eval_')
     eval_dir(sample_dir, sample_gold_dir, 'reranker')
     write_reports(d)
     files = os.listdir(d)
     self.assertTrue("details.tsv" in files)
     self.assertTrue("summary.tsv" in files)
     print "Reports written to %s" %d
示例#2
0
from logging.config import fileConfig

#fileConfig('logging.cfg')

#aida_path = 'evaluation/CATNAFCROMER_airbus'
#assert os.path.exists(aida_path)
#kore50_path = '../../..//kore50.naf'
#assert os.path.exists(kore50_path)
# ref = (None, 
#        aida_path, 
#        kore50_path)
ref = ('AIDA', 'kore50-naf.gold')

# put your targets here
# each target should be a *TUPLE* of a resource label and directories storing
# NAF files, for example:
# targets = (('spotlight_v1', 
#             'aida-conll-naf.evaluation.spotlight', 
#             'kore50-naf.evaluation.spotlight'),
#            (...))
# targets = (('AIDA', 
#             'evaluation/aida-conll-naf.gold', 
#             'evaluation/kore50-naf.gold'),)
targets = (('babelfy', 'kore50-out'),)
assert targets

for tar in targets:
    for tar_dir, ref_dir in zip(tar[1:], ref[1:]):
        eval_dir(tar_dir, ref_dir, tar[0], ref[0])
write_reports('evaluation')