def __init__(self, model, vocab=None): if vocab == None: self._shadow = Linear(len(model.weight)) else: self._shadow = Linear(len(model.weight), vocab) self.model = model self._counter = 1.0
def __init__(self, vocab_words, vocab_tags, encoded=True): self.vocab_words = vocab_words self.vocab_tags = vocab_tags self.most_frequent = {} self.pre_sufix = {} self.fallback = None if encoded: self.model = Linear(len(vocab_tags)) else: self.model = Linear(len(vocab_tags), vocab_tags)
def __init__(self, vocab_words, vocab_tags): self.vocab_words = vocab_words self.vocab_tags = vocab_tags self.model = Linear(len(vocab_tags))