[英]How can I get the embeddings from a list of words in Python?
有沒有辦法從單詞列表中獲取單詞嵌入以找到單詞之間的語義關系?
例如,我有以下列表:
words = ['one','two','three','football','game','player']
我試圖通過來自CountVectorizer
的sklearn
將我的列表轉換為numpy
數組向量,結果是一個由 1 和 0 組成的 numpy 數組,但這顯然是錯誤的。
你應該看看 word2vec 算法:
或者您可以在 Python 中使用 Gensim lib for word2vec:
https://stackabuse.com/implementing-word2vec-with-gensim-library-in-python/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.