tutorial on word2vector

Posted The Blog of Xiao Wang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了tutorial on word2vector相关的知识,希望对你有一定的参考价值。

Tutorial on word2vector

 

Project pagehttps://radimrehurek.com/gensim/models/word2vec.html  

 

1. install gensim: https://radimrehurek.com/gensim/install.html 

  sudo pip install --upgrade gensim 

技术分享图片
 1 [email protected]:~$ sudo pip install --upgrade gensim
 2 [sudo] password for wangxiao: 
 3 The directory /home/wangxiao/.cache/pip/http or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudos -H flag.
 4 The directory /home/wangxiao/.cache/pip or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudos -H flag.
 5 Collecting gensim
 6 /usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/util/ssl_.py:339: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
 7   SNIMissingWarning
 8 /usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/util/ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
 9   InsecurePlatformWarning
10 /usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/util/ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
11   InsecurePlatformWarning
12   Downloading https://files.pythonhosted.org/packages/c3/57/dc00a059b1b739c71dd25355541ebe141ce1ba31917671c826c5fcdfd145/gensim-3.4.0-cp27-cp27mu-manylinux1_x86_64.whl (22.6MB)
13     100% |████████████████████████████████| 22.6MB 1.1MB/s 
14 Requirement not upgraded as not directly required: six>=1.5.0 in /usr/local/lib/python2.7/dist-packages (from gensim) (1.10.0)
15 Collecting smart-open>=1.2.1 (from gensim)
16   Downloading https://files.pythonhosted.org/packages/4b/69/c92661a333f733510628f28b8282698b62cdead37291c8491f3271677c02/smart_open-1.5.7.tar.gz
17 Requirement not upgraded as not directly required: numpy>=1.11.3 in /usr/local/lib/python2.7/dist-packages (from gensim) (1.13.3)
18 Collecting scipy>=0.18.1 (from gensim)
19   Downloading https://files.pythonhosted.org/packages/9c/0b/5deb712a9ea5bb0a1de837d04ef7625c5f3ee44efe7ed0765ceda681d7f1/scipy-1.0.1-cp27-cp27mu-manylinux1_x86_64.whl (46.7MB)
20     100% |████████████████████████████████| 46.7MB 167kB/s 
21 Collecting boto>=2.32 (from smart-open>=1.2.1->gensim)
22   Downloading https://files.pythonhosted.org/packages/bd/b7/a88a67002b1185ed9a8e8a6ef15266728c2361fcb4f1d02ea331e4c7741d/boto-2.48.0-py2.py3-none-any.whl (1.4MB)
23     100% |████████████████████████████████| 1.4MB 195kB/s 
24 Collecting bz2file (from smart-open>=1.2.1->gensim)
25   Downloading https://files.pythonhosted.org/packages/61/39/122222b5e85cd41c391b68a99ee296584b2a2d1d233e7ee32b4532384f2d/bz2file-0.98.tar.gz
26 Requirement not upgraded as not directly required: requests in /usr/local/lib/python2.7/dist-packages (from smart-open>=1.2.1->gensim) (2.11.1)
27 Collecting boto3 (from smart-open>=1.2.1->gensim)
28   Downloading https://files.pythonhosted.org/packages/6f/ca/d9523c1ebc5fbb1787ec0b52c1e3725d47766fe91015bb04e782b9818a38/boto3-1.7.10-py2.py3-none-any.whl (128kB)
29     100% |████████████████████████████████| 133kB 208kB/s 
30 Collecting s3transfer<0.2.0,>=0.1.10 (from boto3->smart-open>=1.2.1->gensim)
31   Downloading https://files.pythonhosted.org/packages/d7/14/2a0004d487464d120c9fb85313a75cd3d71a7506955be458eebfe19a6b1d/s3transfer-0.1.13-py2.py3-none-any.whl (59kB)
32     100% |████████████████████████████████| 61kB 226kB/s 
33 Collecting jmespath<1.0.0,>=0.7.1 (from boto3->smart-open>=1.2.1->gensim)
34   Downloading https://files.pythonhosted.org/packages/b7/31/05c8d001f7f87f0f07289a5fc0fc3832e9a57f2dbd4d3b0fee70e0d51365/jmespath-0.9.3-py2.py3-none-any.whl
35 Collecting botocore<1.11.0,>=1.10.10 (from boto3->smart-open>=1.2.1->gensim)
36   Downloading https://files.pythonhosted.org/packages/77/c9/a40ebce24bbab4c7986fccdac9dade097385ad2feae73dcc47d31a1b4dc8/botocore-1.10.10-py2.py3-none-any.whl (4.2MB)
37     100% |████████████████████████████████| 4.2MB 362kB/s 
38 Requirement not upgraded as not directly required: futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from s3transfer<0.2.0,>=0.1.10->boto3->smart-open>=1.2.1->gensim) (3.1.1)
39 Collecting docutils>=0.10 (from botocore<1.11.0,>=1.10.10->boto3->smart-open>=1.2.1->gensim)
40   Downloading https://files.pythonhosted.org/packages/50/09/c53398e0005b11f7ffb27b7aa720c617aba53be4fb4f4f3f06b9b5c60f28/docutils-0.14-py2-none-any.whl (543kB)
41     100% |████████████████████████████████| 552kB 475kB/s 
42 Requirement not upgraded as not directly required: python-dateutil<3.0.0,>=2.1; python_version >= "2.7" in /usr/local/lib/python2.7/dist-packages (from botocore<1.11.0,>=1.10.10->boto3->smart-open>=1.2.1->gensim) (2.5.3)
43 Installing collected packages: boto, bz2file, docutils, jmespath, botocore, s3transfer, boto3, smart-open, scipy, gensim
44   Running setup.py install for bz2file ... done
45   Running setup.py install for smart-open ... done
46   Found existing installation: scipy 0.18.0
47     Uninstalling scipy-0.18.0:
48       Successfully uninstalled scipy-0.18.0
49 Successfully installed boto-2.48.0 boto3-1.7.10 botocore-1.10.10 bz2file-0.98 docutils-0.14 gensim-3.4.0 jmespath-0.9.3 s3transfer-0.1.13 scipy-1.0.1 smart-open-1.5.7
View Code

 

2. 

以上是关于tutorial on word2vector的主要内容,如果未能解决你的问题,请参考以下文章

windows 10使用vscode进行远程代码开发 | tutorial to use vscode for remote development using ssh on windows(示例代码

pymongo和mongoengine安装和使用教程 包含常用命令行和代码示例 | pymongo and mongoengine tutorial on ubuntu 16.04

使用 word2vector 数据训练 SVM

word2vector

Word2vector---------学习笔记

第二篇: 词向量之Spark word2vector实战