Skip to main content

Wikipedia2Vec

tests pypi Version

Wikipedia2Vec is a tool used for obtaining embeddings (or vector representations) of words and entities (i.e., concepts that have corresponding pages in Wikipedia) from Wikipedia. It is developed and maintained by Studio Ousia.

This tool enables you to learn embeddings of words and entities simultaneously, and places similar words and entities close to one another in a continuous vector space. Embeddings can be easily trained by a single command with a publicly available Wikipedia dump as input.

This tool implements the conventional skip-gram model to learn the embeddings of words, and its extension proposed in Yamada et al. (2016) to learn the embeddings of entities.

An empirical comparison between Wikipedia2Vec and existing embedding tools (i.e., FastText, Gensim, RDF2Vec, and Wiki2vec) is available here.

Documentation are available online at http://wikipedia2vec.github.io/.

Basic Usage

Wikipedia2Vec can be installed via PyPI:

% pip install wikipedia2vec

With this tool, embeddings can be learned by running a train command with a Wikipedia dump as input. For example, the following commands download the latest English Wikipedia dump and learn embeddings from this dump:

% wget https://dumps.wikimedia.org/enwiki/latest/enwiki-latest-pages-articles.xml.bz2
% wikipedia2vec train enwiki-latest-pages-articles.xml.bz2 MODEL_FILE

Then, the learned embeddings are written to MODEL_FILE. Note that this command can take many optional parameters. Please refer to our documentation for further details.

Pretrained Embeddings

Pretrained embeddings for 12 languages (i.e., English, Arabic, Chinese, Dutch, French, German, Italian, Japanese, Polish, Portuguese, Russian, and Spanish) can be downloaded from this page.

Use Cases

Wikipedia2Vec has been applied to the following tasks:

References

If you use Wikipedia2Vec in a scientific publication, please cite the following paper:

Ikuya Yamada, Akari Asai, Jin Sakuma, Hiroyuki Shindo, Hideaki Takeda, Yoshiyasu Takefuji, Yuji Matsumoto, Wikipedia2Vec: An Efficient Toolkit for Learning and Visualizing the Embeddings of Words and Entities from Wikipedia.

@inproceedings{yamada2020wikipedia2vec,
  title = "{W}ikipedia2{V}ec: An Efficient Toolkit for Learning and Visualizing the Embeddings of Words and Entities from {W}ikipedia",
  author={Yamada, Ikuya and Asai, Akari and Sakuma, Jin and Shindo, Hiroyuki and Takeda, Hideaki and Takefuji, Yoshiyasu and Matsumoto, Yuji},
  booktitle = {Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations},
  year = {2020},
  publisher = {Association for Computational Linguistics},
  pages = {23--30}
}

The embedding model was originally proposed in the following paper:

Ikuya Yamada, Hiroyuki Shindo, Hideaki Takeda, Yoshiyasu Takefuji, Joint Learning of the Embedding of Words and Entities for Named Entity Disambiguation.

@inproceedings{yamada2016joint,
  title={Joint Learning of the Embedding of Words and Entities for Named Entity Disambiguation},
  author={Yamada, Ikuya and Shindo, Hiroyuki and Takeda, Hideaki and Takefuji, Yoshiyasu},
  booktitle={Proceedings of The 20th SIGNLL Conference on Computational Natural Language Learning},
  year={2016},
  publisher={Association for Computational Linguistics},
  pages={250--259}
}

The text classification model implemented in this example was proposed in the following paper:

Ikuya Yamada, Hiroyuki Shindo, Neural Attentive Bag-of-Entities Model for Text Classification.

@article{yamada2019neural,
  title={Neural Attentive Bag-of-Entities Model for Text Classification},
  author={Yamada, Ikuya and Shindo, Hiroyuki},
  booktitle={Proceedings of The 23th SIGNLL Conference on Computational Natural Language Learning},
  year={2019},
  publisher={Association for Computational Linguistics},
  pages = {563--573}
}

License

Apache License 2.0

Metadata

Release files for wikipedia2vec 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wikipedia2vec 2.0.0
File Size Uploaded
wikipedia2vec-2.0.0.tar.gz 970.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for wikipedia2vec 2.0.0
File
wikipedia2vec-2.0.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
wikipedia2vec-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
wikipedia2vec-2.0.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
wikipedia2vec-2.0.0-cp312-cp312-macosx_10_9_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.9+ x86-64 Details
wikipedia2vec-2.0.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
wikipedia2vec-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
wikipedia2vec-2.0.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
wikipedia2vec-2.0.0-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details
wikipedia2vec-2.0.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
wikipedia2vec-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
wikipedia2vec-2.0.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
wikipedia2vec-2.0.0-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details
wikipedia2vec-2.0.0-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
wikipedia2vec-2.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
wikipedia2vec-2.0.0-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details
wikipedia2vec-2.0.0-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
wikipedia2vec-2.0.0-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
wikipedia2vec-2.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
wikipedia2vec-2.0.0-cp38-cp38-macosx_11_0_arm64.whl CPython 3.8 CPython 3.8 macOS 11.0+ ARM64 Details
wikipedia2vec-2.0.0-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details

Total release size: 49.7 MB

Release files / wikipedia2vec-2.0.0.tar.gz

Download URL wikipedia2vec-2.0.0.tar.gz
Size 970.0 kB
Tags Source
SHA-256 checksum
How to use checksums
191b9a80fb16653315385fc5ff4b26c92bf02dca5ffcd038d184ed6e61b6c350
BLAKE2b-256 checksum
How to use checksums
cb1c07887bf23c3fa3dfc01bf0b6e3c02048a02f5d1c29e75b5569f1bd92e78a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp312-cp312-win_amd64.whl

Download URL wikipedia2vec-2.0.0-cp312-cp312-win_amd64.whl
Size 1.5 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
ddcc94fe9fa1132106f5c08da417e724400f38ace5f8d657352e6fd2831ab580
BLAKE2b-256 checksum
How to use checksums
205eda15e9166f44c452fb1f3142b87cd20a9dc3c51d1c38482c44a1eb3454a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL wikipedia2vec-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 5.1 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
4cd6b33d84fc7faaec117e1312869b07906ab0fd03de82bf51e93aa81f5efa5b
BLAKE2b-256 checksum
How to use checksums
4e7f71ceffdfb1e26a1302d56ee9e4568022df70aed93b7cabdd87157b7971eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL wikipedia2vec-2.0.0-cp312-cp312-macosx_11_0_arm64.whl
Size 1.6 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
907a7912c0a982fe96c97918b46f3a22562443b236b666c03f88be2a1e7c6900
BLAKE2b-256 checksum
How to use checksums
01c2d3621f0ca49d89e79b67855431ac722678389df55c6e0b4b03bf129a6a21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp312-cp312-macosx_10_9_x86_64.whl

Download URL wikipedia2vec-2.0.0-cp312-cp312-macosx_10_9_x86_64.whl
Size 1.7 MB
Tags CPython 3.12 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
ff717fff738c4aab92c640f443515505816fcf4767ecb343a8e61fc1aaca66c2
BLAKE2b-256 checksum
How to use checksums
e6ad7b9d54c2ed5647b7b15e0781100a582ee6a6f3c8a04223d27550bd0c35bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp311-cp311-win_amd64.whl

Download URL wikipedia2vec-2.0.0-cp311-cp311-win_amd64.whl
Size 1.5 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
e17b1db1b858455753febb05334b65c2676dbcea1f4e66e7b1adaef5c4d52e6e
BLAKE2b-256 checksum
How to use checksums
9f7719d09f5b543ed3cacf0d7ded0cafdee61baf0f610ff5b3c296043cba86c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL wikipedia2vec-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 5.1 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
f554cefde337725866de9888bc567e8a1bc2b024f0b1f025ce9d8273bd229cff
BLAKE2b-256 checksum
How to use checksums
8f4341c122f4b2a67d94fa154da796c8f9d41dc189e398637210e56802587d01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL wikipedia2vec-2.0.0-cp311-cp311-macosx_11_0_arm64.whl
Size 1.6 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
dc327989c3ac31b864468cb3882e2ddc6abb850efb2ae5605a316111182b144d
BLAKE2b-256 checksum
How to use checksums
5a7ac40eebd9dad0230a16539cb7fd84779c19d39d207473c412b408074e3fcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp311-cp311-macosx_10_9_x86_64.whl

Download URL wikipedia2vec-2.0.0-cp311-cp311-macosx_10_9_x86_64.whl
Size 1.7 MB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
3ec0da92623093e0ccb59249cb70fdbed9d679462135a618bff7e39f235d2fdb
BLAKE2b-256 checksum
How to use checksums
f967b011227824a7210760eaab8e4dc16bd8aeb5797db29ab5cb27052b8a7204
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp310-cp310-win_amd64.whl

Download URL wikipedia2vec-2.0.0-cp310-cp310-win_amd64.whl
Size 1.5 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
eda8c27a31538bf471a6ef44e9e351f5b4eba3852fb1dff49b524f0fdbd678c2
BLAKE2b-256 checksum
How to use checksums
386ffc4cb6472d569b0349644d0776d5b638b2a9fa39e24ae6281932d51338bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL wikipedia2vec-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.7 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1cb267258ec8ea59e68c0625a613700eea4a4a99ea77948f654005eca72d9441
BLAKE2b-256 checksum
How to use checksums
4f95583ff157469e665b892126d6168a6df7442c987a22049036910415211d67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp310-cp310-macosx_11_0_arm64.whl

Download URL wikipedia2vec-2.0.0-cp310-cp310-macosx_11_0_arm64.whl
Size 1.6 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a2b70318e8e9ed7bf44fb321b272692de5e875314234d19e51d348133c74a97e
BLAKE2b-256 checksum
How to use checksums
fd0a04cdd6eb5c088fb4ceb5a2c0251f7ee659ed5bb2a8cb2ab38408f13c6e89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp310-cp310-macosx_10_9_x86_64.whl

Download URL wikipedia2vec-2.0.0-cp310-cp310-macosx_10_9_x86_64.whl
Size 1.7 MB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
df3c47db08266fbc73112f7600ebd8ac4be6d2e474d632967591a666a5d3102a
BLAKE2b-256 checksum
How to use checksums
1d4ff1b94048afd56d643e2b684162d8f9e6ebeedbad964bea720578f656cbdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp39-cp39-win_amd64.whl

Download URL wikipedia2vec-2.0.0-cp39-cp39-win_amd64.whl
Size 1.5 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
0ea17fd852158765c6328156f86d87507f9fac52b6a9121a99834d5c7aac13e1
BLAKE2b-256 checksum
How to use checksums
7d45e34d41f420d78c15d8d0c7ca8520664fc42aa229451c86a1ea1806fe1edb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL wikipedia2vec-2.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.8 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
0e874978e0333788b0a92cb2039eabd629d01f1a912fd9e2e8872adc7ee8d22c
BLAKE2b-256 checksum
How to use checksums
f6a38124139e51b441682a4182173af7e77e739b60a30de709cffa34e9fdb5ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp39-cp39-macosx_11_0_arm64.whl

Download URL wikipedia2vec-2.0.0-cp39-cp39-macosx_11_0_arm64.whl
Size 1.6 MB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8f0658b2704c4c0b3c107d00b9e65b136e16bc27a835d10e5a90c69efe594a32
BLAKE2b-256 checksum
How to use checksums
a16349fb110fc83ae8f5127ae5dbd2f19268a34aaa1f9458a77d20b964fedaac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp39-cp39-macosx_10_9_x86_64.whl

Download URL wikipedia2vec-2.0.0-cp39-cp39-macosx_10_9_x86_64.whl
Size 1.7 MB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
3f75bbfa99692215545f952dc71c8ede42c23def895d10d4b0cd3b686e74d6a7
BLAKE2b-256 checksum
How to use checksums
055205757adfa27cbe1d9b44009be6cff58bf0877de1a0b700e7eb35594cd26d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp38-cp38-win_amd64.whl

Download URL wikipedia2vec-2.0.0-cp38-cp38-win_amd64.whl
Size 1.6 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
1cfbfb90478ec515b8635bb286ea01b9c64a0c1a50ef7e251ed15aa2e7fa56ee
BLAKE2b-256 checksum
How to use checksums
6f229258a3b5cca042e461c07c2d94fc7c5f97a54557b1a2c0d367651d9824f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL wikipedia2vec-2.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.9 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
747dcaeaba220f1b246881d2d6edbb4da5e344cba8733208ee37e72fe2dad2cb
BLAKE2b-256 checksum
How to use checksums
f13c6972eb074133c6f2ef0810d7b56fafbd45c4ce0511b03048fb612c4d7e1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp38-cp38-macosx_11_0_arm64.whl

Download URL wikipedia2vec-2.0.0-cp38-cp38-macosx_11_0_arm64.whl
Size 1.6 MB
Tags CPython 3.8 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
23a3f8b080693683024ccbcf3534518fd8ba5e7d1a63241a9eecee2132afb8e3
BLAKE2b-256 checksum
How to use checksums
bf7e057d7e0ef6a34cc1cb1242a4d146071ffa5808c118b8636cce8538e08c12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / wikipedia2vec-2.0.0-cp38-cp38-macosx_10_9_x86_64.whl

Download URL wikipedia2vec-2.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Size 1.7 MB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
7bbbb8c69cd98a2fbc15d44bffc2c9b16228b060b4ed550fa960973e0b8c01fd
BLAKE2b-256 checksum
How to use checksums
2661ed685e7c23ca454da813d380489e0bdb519606b0eb709f6c7116bec1616f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

This release

2.0.0 This release

21 release files

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.2.8

1 release file

0.2.7

1 release file

0.2.6

1 release file

0.2.5

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2

1 release file

0.1.15

1 release file

0.1.14

1 release file

0.1.13

1 release file

0.1.12

1 release file

0.1.11

1 release file

0.1.10

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page