text_raw_indices = tokenizer.text_to_sequence(text_left + " " + aspect + " " + text_right)
text_raw_without_aspect_indices = tokenizer.text_to_sequence(text_left + " " + text_right)
text_left_indices = tokenizer.text_to_sequence(text_left)
text_left_with_aspect_indices = tokenizer.text_to_sequence(text_left + " " + aspect)
text_right_indices = tokenizer.text_to_sequence(text_right, reverse=True)
text_right_with_aspect_indices = tokenizer.text_to_sequence(" " + aspect + " " + text_right, reverse=True)
aspect_indices = tokenizer.text_to_sequence(aspect)
left_context_len = np.sum(text_left_indices != 0)
aspect_len = np.sum(aspect_indices != 0)
aspect_in_text = torch.tensor([left_context_len.item(), (left_context_len + aspect_len - 1).item()])
polarity = int(polarity) + 1
问问题
140 次
1 回答
0
只需使用激光,你会没事的。它也涵盖了乌尔都语。
你可以在这里阅读更多:
- https://engineering.fb.com/ai-research/laser-multilingual-sentence-embeddings/
- https://github.com/facebookresearch/LASER
这里也有非官方的pypi
包。它替代了一些内部依赖项,但仍按预期工作。
还有最重要的问题,所以我们可以更好地帮助您:您想要实现什么,您的最终目标是什么?
于 2019-11-15T10:11:24.097 回答