예제 #1
0
 def __init__(self, argument_string):
     """
     Initialises metric-specific parameters.
     """
     Scorer.__init__(self, argument_string)
     if not 'negative_value' in self._arguments.keys():
         self._arguments['negative_value'] = 0.0
예제 #2
0
 def __init__(self, argument_string):
     """
     Initialises metric-specific parameters.
     """
     Scorer.__init__(self, argument_string='')
     self._reference = None
     # use n-gram order of 4 by default
     self.additional_flags = argument_string
예제 #3
0
파일: sentence_bleu.py 프로젝트: yxsu/RRGen
 def __init__(self, argument_string):
     """
     Initialises metric-specific parameters.
     """
     Scorer.__init__(self, argument_string)
     # use n-gram order of 4 by default
     if not 'n' in list(self._arguments.keys()):
         self._arguments['n'] = 4
예제 #4
0
 def __init__(self, argument_string):
     """
     Initialises metric-specific parameters.
     """
     Scorer.__init__(self, argument_string)
     # use n-gram order of 4 by default
     if not 'n' in list(self._arguments.keys()):
         self._arguments['n'] = 4
예제 #5
0
파일: chrf.py 프로젝트: zombie366/nematus
 def __init__(self, argument_string):
     """
     Initialises metric-specific parameters.
     """
     Scorer.__init__(self, argument_string)
     # use character n-gram order of 4 by default
     if not 'n' in list(self._arguments.keys()):
         self._arguments['n'] = 6
     # use beta = 1 by default (recommendation by Maja Popovic for generative modelling)
     if not 'beta' in list(self._arguments.keys()):
         self._arguments['beta'] = 1
예제 #6
0
파일: meteor.py 프로젝트: zombie366/nematus
 def __init__(self, argument_string):
     Scorer.__init__(self, argument_string)
     
     #Lock for the METEOR process, which can only handle one request at a time:
     self.lock = threading.Lock()
     
     #Get necessary arguments for starting METEOR from argument string parsed in Scorer.__init__()
     self._meteor_language = self._arguments["meteor_language"]
     self._meteor_path = self._arguments["meteor_path"] + "/"
     
     #Start a METEOR process:
     command = "java -Xmx2G -jar "+self._meteor_path+"meteor-*.jar - - -l "+self._meteor_language+" -stdio"
     self.meteor_process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
예제 #7
0
파일: beer.py 프로젝트: rsennrich/nematus
 def __init__(self, argument_string):
     Scorer.__init__(self, argument_string)
     
     #Lock for the BEER process, which can only handle one request at a time:
     self.lock = threading.Lock()
     
     #Get necessary arguments for starting BEER from argument string parsed in Scorer.__init__()
     self._beer_language = self._arguments["beer_language"]
     self._beer_path = self._arguments["beer_path"] + "/"
     
     #Start a BEER process:
     command = self._beer_path+"beer -l "+self._beer_language+" --workingMode interactive "
     self.beer_process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
예제 #8
0
    def __init__(self,
                 input_file: pl.Path = None,
                 logger: logging.Logger = None,
                 logging_level: int = logging.WARNING) -> None:
        """
        Creates the FileScorer object.

        :param pl.Path input_file: the file to parse
        :param logging.Logger logger: a logging.Logger object for outputting information
        :param int logging_level: the severity level for logging
        """
        Scorer.__init__(self, logger=logger, logging_level=logging_level)
        self.input_file = None
        self.set_input_file(input_file)
예제 #9
0
    def __init__(self,
                 input_directory: pl.Path = None,
                 logger: logging.Logger = None,
                 logging_level: int = logging.WARNING) -> None:
        """
        Creates the DirectoryScorer object.

        :param pl.Path input_directory: the directory from which to parse files
        :param logging.Logger logger: a logging.Logger object for outputting information
        :param int logging_level: the severity level for logging
        """
        Scorer.__init__(self, logger=logger, logging_level=logging_level)
        self.input_directory = None
        self.set_input_directory(input_directory)
        self.files = []
예제 #10
0
파일: beer.py 프로젝트: zombie366/nematus
    def __init__(self, argument_string):
        Scorer.__init__(self, argument_string)

        #Lock for the BEER process, which can only handle one request at a time:
        self.lock = threading.Lock()

        #Get necessary arguments for starting BEER from argument string parsed in Scorer.__init__()
        self._beer_language = self._arguments["beer_language"]
        self._beer_path = self._arguments["beer_path"] + "/"

        #Start a BEER process:
        command = self._beer_path + "beer -l " + self._beer_language + " --workingMode interactive "
        self.beer_process = subprocess.Popen(command,
                                             stdin=subprocess.PIPE,
                                             stdout=subprocess.PIPE,
                                             stderr=subprocess.PIPE,
                                             shell=True)
예제 #11
0
 def __init__(self):
     Scorer.__init__(self)
예제 #12
0
 def __init__(self):
     Scorer.__init__(self)