예제 #1
0
    def __init__(self, vocabfile, ignore_target, context_math, word_path,
                 context_path, conll_filename, window_size,
                 top_inferences_to_analyze):

        CsInferrer.__init__(self)
        self.ignore_target = ignore_target
        self.context_math = context_math
        self.word_vecs = Embedding(word_path)
        self.context_vecs = Embedding(context_path)
        self.use_stopwords = False

        assert (not (window_size >= 0 and conll_filename is not None))
        self.window_size = window_size
        if (window_size < 0):
            self.conll_file = open(conll_filename, 'r')
            self.sents = read_conll(self.conll_file, True)
        self.top_inferences_to_analyze = top_inferences_to_analyze

        self.w2counts, ignore, self.stopwords = load_vocabulary_counts(
            vocabfile)
예제 #2
0
    def __init__(self, path, vocabfile, top_inferences_to_analyze):
        CsInferrer.__init__(self)
        self.embeddings = Embedding(path)
        self.top_inferences_to_analyze = top_inferences_to_analyze

        self.w2counts, ignore1, ignore2 = load_vocabulary_counts(vocabfile)
예제 #3
0
 def __init__(self, path, vocabfile, top_inferences_to_analyze):
     CsInferrer.__init__(self)
     self.embeddings = Embedding(path)
     self.top_inferences_to_analyze = top_inferences_to_analyze
     
     self.w2counts, ignore1, ignore2 = load_vocabulary_counts(vocabfile)