示例#1
0
    def __init__(self, params):
        """
        The constructor for Conversational Question Answering. This is a Conversational application class and is
        inherited from the CIS class.

        Args:
            params(dict): A dict of parameters. These are mandatory parameters for this class: 'logger' which is an
            instance of the util.logging.Logger class. ConvQA requires both a retrieval and machine reading
            comprehension engines. Each of them requires some additional parameters. Refer to the corresponding class
            for more information on the required parameters.
        """
        self.params = params
        self.logger = params['logger']
        self.logger.info(
            'Conversational Wirzard of Oz System... starting up...')
        self.params['live_request_handler'] = self.live_request_handler
        self.seeker = None

        self.interface = interface.get_interface(params)

        self.retrieval = retrieval.get_retrieval_model(params=self.params)
        self.request_dispatcher = RequestDispatcher(
            {'retrieval': self.retrieval})
        self.output_selection = naive_output_selection.NaiveOutputProcessing(
            {})
示例#2
0
 def __init__(self, params):
     super().__init__(params)
     self.retrieval = retrieval.get_retrieval_model(params=self.params)
     self.qa = mrc.get_mrc_model(params=self.params)
     self.request_dispatcher = RequestDispatcher({
         'retrieval': self.retrieval,
         'qa': self.qa
     })
     self.output_selection = naive_output_selection.NaiveOutputProcessing(
         {})