Esempio n. 1
0
 def __call__(self, obj, *args, **kwargs):      
     log.info("reading counts from " + self.counts_pkl_fname)
     self.counts_dict = cPickle.load(open(self.counts_pkl_fname))  
     Scorer.__call__(self, obj, *args, **kwargs)   
Esempio n. 2
0
 def __init__(self, counts_pkl_fname, score_attr="freq_score", oov_count=0):
     Scorer.__init__(self, score_attr)
     self.counts_pkl_fname = counts_pkl_fname
     self.oov_count = oov_count
Esempio n. 3
0
 def __init__(self, score_attr="rand_score"):
     Scorer.__init__(self, score_attr)
Esempio n. 4
0
 def __call__(self, obj, *args, **kwargs):
     # It is assumed that the order of documents (by docid) in the source
     # and reference is the same
     self.counts = iter(read_ref_trans_counts(self.ref_fname, flatten=True))        
     Scorer.__call__(self, obj, *args, **kwargs)
Esempio n. 5
0
 def __init__(self, ref_fname, score_attr):
     Scorer.__init__(self, score_attr)
     self.ref_fname = ref_fname
Esempio n. 6
0
 def __init__(self, base_score_attrs, score_attr="best_score"):
     Scorer.__init__(self, score_attr)
     self.base_score_attrs = base_score_attrs