[英]How do I use the word2vec model that I trained?
I am trying to make a basic sentiment analysis program.我正在尝试制作一个基本的情绪分析程序。 Right now, I have a trained and saved word2vec model from a database of tweets, similarly to the example provided in https://www.kaggle.com/code/stoicstatic/twitter-sentiment-analysis-using-word2vec-bilstm/notebook .
现在,我有一个从推文数据库中训练并保存的 word2vec 模型,类似于https://www.kaggle.com/code/stoicstatic/twitter-sentiment-analysis-using-word2vec-bilstm/notebook中提供的示例.
What I was wondering was how I could use the model that I have trained and apply it to other data outside of the training data.我想知道的是如何使用我训练过的模型并将其应用于训练数据之外的其他数据。 My end goal was to be able to assign values such as -1 = negative, 0 = neutral, and 1 = positive to different texts.
我的最终目标是能够为不同的文本分配值,例如 -1 = 否定、0 = 中性和 1 = 肯定。
Any help would be greatly appreciated.任何帮助将不胜感激。 Thank you!
谢谢!
There's no practical way to tutor you through that broad goal as a answer here.这里没有实用的方法来指导您完成这个广泛的目标作为答案。
If you follow the notebook you've linked exactly, with either its data or your very-similar data/goals, does it work?如果您遵循您已准确链接的笔记本,无论是其数据还是您非常相似的数据/目标,它是否有效? If not, you could potentially ask more specific question based on the exact places where things break, or fail to meet expectations.
如果没有,您可能会根据事情中断或未能达到预期的确切位置提出更具体的问题。 But until you've done that, it's impossible to know what programming details to say to you to help.
但在您完成此操作之前,不可能知道要对您说哪些编程细节来提供帮助。
Also, starting out, you may want to begin with searching for, and working through, some more-basic test-classification/sentiment-analysis tutorials in Python that don't use word2vec or deeper neural-networks like BiLSTM .此外,开始时,您可能希望开始搜索和完成一些更基本的 Python 测试分类/情感分析教程,这些教程不使用 word2vec 或更深层的神经网络(如 BiLSTM) 。
Only after you have a general sense of inputs/outputs/choices/evaluations, and the form of a working system as a baseline, would you then mix-in techniques like word2vec or deep-NNs.只有在您大致了解输入/输出/选择/评估,以及作为基线的工作系统的形式之后,您才会混合使用 word2vec 或深度神经网络等技术。 And then, also, your questions here would be focused enough to answer.
然后,您在这里的问题也将足够集中以回答。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.