예제 #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)   
예제 #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
예제 #3
0
 def __init__(self, score_attr="rand_score"):
     Scorer.__init__(self, score_attr)
예제 #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)
예제 #5
0
 def __init__(self, ref_fname, score_attr):
     Scorer.__init__(self, score_attr)
     self.ref_fname = ref_fname
예제 #6
0
 def __init__(self, base_score_attrs, score_attr="best_score"):
     Scorer.__init__(self, score_attr)
     self.base_score_attrs = base_score_attrs