
class Instance(object):
    def __init__(self, tokenizer, sentence_pack, post_vocab, deprel_vocab, postag_vocab, synpost_vocab, args):
        self.id = sentence_pack['id']
        self.sentence = sentence_pack['sentence']
        self.tokens = self.sentence.strip().split()
        self.postag = sentence_pack['postag']
        self.head = sentence_pack['head']
        self.deprel = sentence_pack['deprel']
        self.sen_length = len(self.tokens)
        self.token_range = []
        self.bert_tokens = tokenizer.encode(self.sentence)

        self.length = len(self.bert_tokens)
        self.bert_tokens_padding = torch.zeros(args.max_sequence_len).long()
        self.aspect_tags = torch.zeros(args.max_sequence_len).long()
        self.opinion_tags = torch.zeros(args.max_sequence_len).long()
        self.tags = torch.zeros(args.max_sequence_len, args.max_sequence_len).long()
        self.tags_symmetry = torch.zeros(args.max_sequence_len, args.max_sequence_len).long()
        self.mask = torch.zeros(args.max_sequence_len)
