Пример #1
0
    def new_session(self, agent, kb):
        if self.model_name == 'encdec':
            session = RNNNeuralSession(agent , kb, self.env)
        else:
            session = GraphNeuralSession(agent, kb, self.env)
        if self.timed_session:
            session = TimedSessionWrapper(agent, session)
	return session
Пример #2
0
 def new_session(self, agent, kb):
     if self.model_name in ('seq2seq', 'lf2lf'):
         session = PytorchNeuralSession(agent, kb, self.env)
     else:
         raise ValueError('Unknown model name {}'.format(self.model_name))
     if self.timed_session:
         session = TimedSessionWrapper(session)
     return session
Пример #3
0
 def new_session(self, agent, kb):
     if self.model_name == 'encdec':
         session = GeneratorNeuralSession(agent, kb, self.env)
     elif self.model_name == 'selector':
         session = SelectorNeuralSession(agent, kb, self.env)
     else:
         raise ValueError('Unknown model name')
     if self.timed_session:
         session = TimedSessionWrapper(session)
     return session
Пример #4
0
 def new_session(self, agent, kb, config=None):
     session = self._new_session(agent, kb, config)
     if self.timed_session:
         session = TimedSessionWrapper(session)
     return session
Пример #5
0
 def new_session(self, agent, kb):
     session = NeuralSession(agent, kb, self.encoder, self.decoder,
                             self.args)
     if self.timed_session:
         session = TimedSessionWrapper(session)
     return session
Пример #6
0
    def new_session(self, agent, kb):
        session = IRRankerSession(agent, kb, self.env)
        if self.timed_session:
            session = TimedSessionWrapper(agent, session)
	return session
Пример #7
0
 def new_session(self, agent, kb):
     session = FBNeuralSession(agent, kb, self.model, self.args)
     if self.timed_session:
         session = TimedSessionWrapper(session)
     return session