Пример #1
0
    def __init__(self, args):
        super(DialogueClassifierNetwork, self).__init__()
        self.args = args
        self.dialogue_embedder = DialogueEmbedder(args)

        ## Define class networkict_
        dict_ = {
            "input_size": args.output_input_size,
            "hidden_size": args.output_hidden_size,
            "output_size": 1,
            "num_layers": args.output_num_layers[0],
        }
        self.current_dl_trasnformer1 = model_factory.get_model_by_name(
            args.output_layer[0], args, kwargs=dict_)
        self.current_dl_trasnformer2 = model_factory.get_model_by_name(
            args.output_layer[0], args, kwargs=dict_)
        dict_ = {
            "input_size": args.output_input_size,
            "hidden_size": args.output_hidden_size,
            "output_size": 1,
            "num_layers": args.output_num_layers[0],
        }
        self.next_dl_trasnformer = model_factory.get_model_by_name(
            args.output_layer[0], args, kwargs=dict_)
        self.prev_dl_trasnformer = model_factory.get_model_by_name(
            args.output_layer[0], args, kwargs=dict_)
Пример #2
0
	def __init__(self, args):
		super(DialogueBowNetwork, self).__init__()
		self.dialogue_embedder = DialogueEmbedder(args)
		self.args = args

		## Define class network
		dict_ = {"input_size": args.output_input_size, "hidden_size": args.output_hidden_size[0], "num_layers" : args.output_num_layers[0],
				 "output_size": args.output_size}
		self.next_bow_scorer = model_factory.get_model_by_name(args.output_layer[0], args, kwargs = dict_)
		self.prev_bow_scorer = model_factory.get_model_by_name(args.output_layer[0], args, kwargs = dict_)
 def __init__(self, args, **kwargs):
     super(DialogueEmbedder, self).__init__()
     self.args = args
     if not args.fixed_token_encoder:
         self.token_encoder = model_factory.get_model_by_name(
             args.token_encoder, args)
     if not args.fixed_utterance_encoder:
         self.utterance_encoder = model_factory.get_model_by_name(
             args.utterance_encoder, args)
     conversation_dict = {
         "input_size": args.embed_size,
         "hidden_size": args.hidden_size,
         "num_layers": args.num_layers
     }
     self.conversation_encoder = model_factory.get_model_by_name(
         args.conversation_encoder, args, kwargs=conversation_dict)
Пример #4
0
	def __init__(self, args):

		## Initialize environment
		self.args = args
		self.updates = 0

		## If token encodings are not computed on the fly using character CNN based models but are obtained from a pretrained model
		if args.fixed_token_encoder:
			self.token_encoder = model_factory.get_embeddings(args.token_encoder, args)

		self.network = model_factory.get_model_by_name(args.network, args)
Пример #5
0
    def __init__(self, args):
        super(DialogueActClassifierNetwork, self).__init__()
        self.dialogue_embedder = DialogueEmbedder(args)

        ## Define class network
        ## output labels size
        dict_ = {
            "input_size": args.output_input_size,
            "hidden_size": args.output_hidden_size[0],
            "num_layers": args.output_num_layers[0],
            "output_size": args.output_size
        }
        self.classifier = model_factory.get_model_by_name(args.output_layer[0],
                                                          args,
                                                          kwargs=dict_)