コード例 #1
0
    def __init__(self, input_nodes, output_nodes, sess, tokenizer, settings, minus):
        Base.__init__(
            self,
            input_nodes=input_nodes,
            output_nodes=output_nodes,
            sess=sess,
            tokenizer=tokenizer,
            label=None,
        )

        self._tag2idx = settings
        self._idx2tag = {int(v): k for k, v in self._tag2idx.items()}
        self._minus = minus
コード例 #2
0
ファイル: xlnet.py プロジェクト: huseinzol05/malaya
 def __init__(
     self,
     input_nodes,
     output_nodes,
     sess,
     tokenizer,
     label=['not similar', 'similar'],
 ):
     Base.__init__(
         self,
         input_nodes=input_nodes,
         output_nodes=output_nodes,
         sess=sess,
         tokenizer=tokenizer,
         label=label,
     )
コード例 #3
0
    def __init__(
        self, input_nodes, output_nodes, sess, tokenizer, settings, tok=None
    ):
        Base.__init__(
            self,
            input_nodes=input_nodes,
            output_nodes=output_nodes,
            sess=sess,
            tokenizer=tokenizer,
            label=None,
        )

        self._settings = settings
        self._tok = tok
        self._settings['idx2tag'] = {
            int(k): v for k, v in self._settings['idx2tag'].items()
        }
コード例 #4
0
    def __init__(
        self,
        input_nodes,
        output_nodes,
        sess,
        tokenizer,
        module,
        label=['negative', 'positive'],
    ):

        Base.__init__(
            self,
            input_nodes=input_nodes,
            output_nodes=output_nodes,
            sess=sess,
            tokenizer=tokenizer,
            label=label,
            module=module,
        )