rouge/rouge.py
def get_scores(self, avg=False, ignore_empty=False):
        """Calculate ROUGE scores between each pair of
        lines (hyp_file[i], ref_file[i]).
        Args:
          * hyp_path: hypothesis file path
          * ref_path: references file path
          * avg (False): whether to get an average scores or a list
        """
        hyp_path, ref_path = self.hyp_path, self.ref_path

        with io.open(hyp_path, encoding="utf-8", mode="r") as hyp_file:
            hyps = [line[:-1] for line in hyp_file]
        with io.open(ref_path, encoding="utf-8", mode="r") as ref_file:
            refs = [line[:-1] for line in ref_file]

        return self.rouge.get_scores(hyps, refs, avg=avg,
                                     ignore_empty=ignore_empty)
def get_scores(self, avg=False, ignore_empty=False):
        """Calculate ROUGE scores between each pair of
        lines (hyp_file[i], ref_file[i]).
        Args:
          * hyp_path: hypothesis file path
          * ref_path: references file path
          * avg (False): whether to get an average scores or a list
        """
        hyp_path, ref_path = self.hyp_path, self.ref_path

        with io.open(hyp_path, encoding="utf-8", mode="r") as hyp_file:
            hyps = [line[:-1] for line in hyp_file]
        with io.open(ref_path, encoding="utf-8", mode="r") as ref_file:
            refs = [line[:-1] for line in ref_file]

        return self.rouge.get_scores(hyps, refs, avg=avg,
                                     ignore_empty=ignore_empty)
def get_scores ( self , avg = False , ignore_empty = False ) : hyp_path , ref_path = self . hyp_path , self . ref_path with io . open ( hyp_path , encoding = "utf-8" , mode = "r" ) as hyp_file : hyps = [ line [ : - 1 ] for line in hyp_file ] with io . open ( ref_path , encoding = "utf-8" , mode = "r" ) as ref_file : refs = [ line [ : - 1 ] for line in ref_file ] return self . rouge . get_scores ( hyps , refs , avg = avg , ignore_empty = ignore_empty )
Calculate ROUGE scores between each pair of
        lines (hyp_file[i], ref_file[i]).
        Args:
          * hyp_path: hypothesis file path
          * ref_path: references file path
          * avg (False): whether to get an average scores or a list
Calculate ROUGE scores between each pair of lines ( hyp_file [ i ] ref_file [ i ] ) . Args : * hyp_path : hypothesis file path * ref_path : references file path * avg ( False ) : whether to get an average scores or a list