简体   繁体   English

如何使用我训练的 word2vec 模型?

[英]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.

相关问题 如何在不手动下载模型的情况下访问/使用Google预先训练的Word2Vec模型? - How to access/use Google's pre-trained Word2Vec model without manually downloading the model? 如何加载预训练的 Word2vec 模型文件? - How to load a pre-trained Word2vec MODEL File? 如何检查经过 model 训练的 word2vec 中是否存在键 - How to check if a key exists in a word2vec trained model or not 如何在自训word2vec model中删除单词 - How to delete words in self-trained word2vec model 如何将word2vec返回的单词向量用作特征? - How do I use the word vector returned by word2vec as features? 如何使用 word2vec 来训练分类器? - How can I use word2vec to train a classifier? Gensim 的 Doc2Vec - 如何使用预训练的 word2vec(词相似性) - Gensim's Doc2Vec - How to use pre-trained word2vec (word similarities) 我什么时候应该考虑使用预训练模型 word2vec model 权重? - When should I consider to use pretrain-model word2vec model weights? 如何从word2vec的Google预训练模型中提取单词向量? - How to extract a word vector from the Google pre-trained model for word2vec? 如何使用预训练的模型权重初始化新的 word2vec 模型? - How to initialize a new word2vec model with pre-trained model weights?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM