यह सामान्य एनएलपी प्रश्न की तरह अधिक है। Word2Vec नाम के शब्द एम्बेड करने के लिए उपयुक्त इनपुट क्या है? क्या लेख से संबंधित सभी वाक्य एक कॉर्पस में एक अलग दस्तावेज़ होना चाहिए? या कहा कि प्रत्येक लेख में एक दस्तावेज होना चाहिए? यह अजगर और जेनसिम का उपयोग करने के लिए सिर्फ एक उदाहरण है।
कॉर्पस वाक्य से विभाजित:
SentenceCorpus = [["first", "sentence", "of", "the", "first", "article."],
["second", "sentence", "of", "the", "first", "article."],
["first", "sentence", "of", "the", "second", "article."],
["second", "sentence", "of", "the", "second", "article."]]
कॉर्पस लेख द्वारा विभाजित:
ArticleCorpus = [["first", "sentence", "of", "the", "first", "article.",
"second", "sentence", "of", "the", "first", "article."],
["first", "sentence", "of", "the", "second", "article.",
"second", "sentence", "of", "the", "second", "article."]]
प्रशिक्षण वर्ड 2 वी पायथन में:
from gensim.models import Word2Vec
wikiWord2Vec = Word2Vec(ArticleCorpus)

