Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 3
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
Ejemplo n.º 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
Ejemplo n.º 5
0
 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
Ejemplo n.º 6
0
 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)
Ejemplo n.º 7
0
 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)
Ejemplo n.º 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)
Ejemplo n.º 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 = []
Ejemplo n.º 10
0
    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)
Ejemplo n.º 11
0
 def __init__(self):
     Scorer.__init__(self)
Ejemplo n.º 12
0
 def __init__(self):
     Scorer.__init__(self)