我想进行情感分析并在python中创建SVM模型,该模型使用点(坐标)绘制矢量,但仅适用于数值。我想将一个句子映射到一个向量。示例:“食物非常美味”转换为(a,b)坐标,表示句子是+ ve还是-ve。有没有一种方法可以将句子转换为向量。
看看gensim
from gensim.models import Word2Vec
sentences_list=[
'the quick brown fox jumps over the lazy dog',
'This is a sample sentence'
'... more ...'
]
tokens = Word2Vec(sentences_list)