File size: 565 Bytes
a7b3936
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class Sentence(object):
    def __init__(self, words, word_ids, char_seqs, char_id_seqs):
        self.words = words
        self.word_ids = word_ids
        self.char_seqs = char_seqs
        self.char_id_seqs = char_id_seqs

    def length(self):
        return len(self.words)

class NER_DependencyInstance(object):
    def __init__(self, sentence, tokens_dict, ids_dict, heads):
        self.sentence = sentence
        self.tokens = tokens_dict
        self.ids = ids_dict
        self.heads = heads

    def length(self):
        return self.sentence.length()