Exemplo n.º 1
0
    def __init__(self, search_context, qrel_file, host=None, port=None):
        self._search_context = search_context

        # Default values - set as attributes in the coniguration to change these values.
        self.dcg_discount = 0.5
        self.patch_type_threshold = 0.6
        self.viewport_size = 10
        self.novel_snippets_only = False

        self._qrel_data_handler = get_data_handler(
            filename=qrel_file,
            host=host,
            port=port,
            key_prefix='serpimpressions')
Exemplo n.º 2
0
 def __init__(self, search_context, topic, viewport_size=10, good_abandon_probability=0.5, bad_abandon_probability=0.5, patch_type_threshold=0.4, qrel_file=None, base_seed=0, host=None, port=0):
     super(StochasticSERPImpression, self).__init__(search_context, topic, patch_type_threshold=patch_type_threshold)
     self.__viewport_size = viewport_size
     self.__good_abandon_probability = good_abandon_probability
     self.__bad_abandon_probability = bad_abandon_probability
     
     self._host = host
     self._port = port
     self._filename = qrel_file
     
     self._data_handler = get_data_handler(filename=self._filename, host=self._host, port=self._port, key_prefix='serp')
     
     self.__random = Random()
     self.__random.seed(base_seed + 0)  # Just use base_seed for the seed value
 def __init__(self, topic, search_context, qrel_file, host=None, port=0):
     """
     Initialises an instance of the classifier.
     """
     super(BaseInformedTrecTextClassifier,
           self).__init__(topic,
                          search_context,
                          stopword_file=[],
                          background_file=[])
     self._filename = qrel_file
     self._host = host
     self._port = port
     self._data_handler = get_data_handler(filename=self._filename,
                                           host=self._host,
                                           port=self._port,
                                           key_prefix='informed')
Exemplo n.º 4
0
    def __init__(self,
                 search_context,
                 topic,
                 viewport_size=10,
                 patch_type_threshold=0.4,
                 qrel_file=None,
                 host=None,
                 port=0):
        super(SimpleSERPImpression,
              self).__init__(search_context,
                             topic,
                             patch_type_threshold=patch_type_threshold)
        self._host = host
        self._port = port
        self._filename = qrel_file
        self.__viewport_size = viewport_size

        self._data_handler = get_data_handler(filename=self._filename,
                                              host=self._host,
                                              port=self._port,
                                              key_prefix='serp')