bag-of-words
bag-of-words copied to clipboard
Code for "Bag-of-Words as Target for Neural Machine Translation"
Results
3
bag-of-words issues
Sort by
recently updated
recently updated
newest added
https://github.com/lancopku/bag-of-words/blob/44eda4d0db292493a52fe0172804711e617c48f4/utils/data_helper.py#L86 ``` def padding(data): src, tgt, original_src, original_tgt = zip(*data) src_len = [len(s) for s in src] src_pad = torch.zeros(len(src), max(src_len)).long() for i, s in enumerate(src): end = src_len[i] src_pad[i,...
from newDict.add(self.idxToLabel[i]) to newDict.add(self.idxToLabel[i.numpy().tolist()])