Skip to main content

No project description provided

Project description

ConecptX_Converter

This tool is designed for converting ConceptX activation files into Word2Vec format. The resulting Word2Vec file can be used with gensim library in Python to find semantically similar words.

This tool could be built as a binary file, or it could be run as a cargo project. The following sections describe how to build and run the tool.

Usage

Generate a word2vec file from a ConceptX activation file.

cargo run <input_file_name> <output_file_name>

Replace <input_file_name> with the name of your ConceptX activation file, and <output_file_name> with the name you would like to give to your Word2Vec file.

For example, if your input file is named my_conceptx_file.txt and you want to name your output file my_word2vec_file.txt, you would run the following command:

cargo run text.in.tok.sent_len.activations-layer11.json output.txt

The output file will have the following format:

<num_words> <dim>
word1:<line_num>:<position_num> val11 val12 val13 ... val1dim
word2:<line_num>:<position_num> val21 val22 val23 ... val2dim
...

Where num_words is the number of words in the input file, dim is the dimension of the word vectors, and valij is the jth value of the ith word vector. line_num and position_num are the line number and position number of the word in the original context (This is designed for the purpose of retrieving the original context of the word from the input file).

Then, in your Python code, you can load the word2vec file using the following code:

import gensim

model = gensim.models.KeyedVectors.load_word2vec_format('output.txt', binary=False)

# find the most similar word of the word "He", which is in the 0th line and 0th position of the original context

print(model.most_similar(positive=['He:0:0'], topn=5))

Build Binary

cargo build --release

Run Binary

./target/release/conceptx_converter <input_file_name> <output_file_name>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

concept_x_converter-0.3.3-cp37-abi3-win_amd64.whl (222.5 kB view details)

Uploaded CPython 3.7+Windows x86-64

concept_x_converter-0.3.3-cp37-abi3-win32.whl (215.0 kB view details)

Uploaded CPython 3.7+Windows x86

concept_x_converter-0.3.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ x86-64

concept_x_converter-0.3.3-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.4 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ s390x

concept_x_converter-0.3.3-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (1.3 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ppc64le

concept_x_converter-0.3.3-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.2 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARMv7l

concept_x_converter-0.3.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARM64

concept_x_converter-0.3.3-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl (1.2 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.5+ i686

concept_x_converter-0.3.3-cp37-abi3-macosx_11_0_arm64.whl (353.8 kB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

concept_x_converter-0.3.3-cp37-abi3-macosx_10_7_x86_64.whl (362.0 kB view details)

Uploaded CPython 3.7+macOS 10.7+ x86-64

File details

Details for the file concept_x_converter-0.3.3-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for concept_x_converter-0.3.3-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 94a872d652df12edab3a09f3c1e980a953c7c71333d02e422f07c3dcfe5678d0
MD5 98877e3593b19d82ecb91106f4aaab6e
BLAKE2b-256 e849bacf6f0b0c2691018c2cd30f5cdf914ee7118e779a857cddd21679a51eba

See more details on using hashes here.

File details

Details for the file concept_x_converter-0.3.3-cp37-abi3-win32.whl.

File metadata

File hashes

Hashes for concept_x_converter-0.3.3-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 3d03d0562fa8d8208129d487ad8b21c7c9ad3fe2409f3d3873ce335369c95e4e
MD5 1f8cc245c1117d886c498cab9bbbf6ad
BLAKE2b-256 c0c29fcb11b3ffa04ec0d68e8d788f079e656a8b9dcd0d1110edd980c2eb636b

See more details on using hashes here.

File details

Details for the file concept_x_converter-0.3.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for concept_x_converter-0.3.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1eca9a7768b0fcb8c2a0de1c22f81bb25bc482498890eefae66df0f30e13f0a6
MD5 ac2e0e5c38b5fba3e5eaa03ab0e826cc
BLAKE2b-256 c89e1ed0cb7ae8ac3f2c58b5d9a70e8281075c3cfe1cd03f1782a1e2ca78ee75

See more details on using hashes here.

File details

Details for the file concept_x_converter-0.3.3-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for concept_x_converter-0.3.3-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 a2d877a1eb559409445d21a083671662b6d472bbef219b6cd839eae421f7cadd
MD5 f5c4afe6a006e51b5e4859b477c97674
BLAKE2b-256 81bad5e5c830742a28a9490170f2e1df66158e47554238be5421e87873f1b441

See more details on using hashes here.

File details

Details for the file concept_x_converter-0.3.3-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for concept_x_converter-0.3.3-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 9077bdde4c52e26998e1518bfe77a398796f2621ac11a34615f61eb5f3a00877
MD5 11dc23e9251c39a5535e89750730dbba
BLAKE2b-256 c458ce0bf43cf18772967bd501a9373c0db72622da4f02f7953528b550645397

See more details on using hashes here.

File details

Details for the file concept_x_converter-0.3.3-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for concept_x_converter-0.3.3-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 8f336f49e16aece6021adee71f3c422687849c7449e68974f097610af664cfd0
MD5 c0d3099de7966944388a66a257f3f4dc
BLAKE2b-256 745f79aab16453a9782f548da6ad3c0fe70f077f57a56e536b5d8164f6955757

See more details on using hashes here.

File details

Details for the file concept_x_converter-0.3.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for concept_x_converter-0.3.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 133eb2593804322f07309596d52600111e9276b40c43788362221b44dfdd086f
MD5 bd4a3fb82476f8fed5cfbc31aaa84160
BLAKE2b-256 a003461d3342c867e72372110e740afb8bdc8b1b93abb09d8b21daffa2f08e10

See more details on using hashes here.

File details

Details for the file concept_x_converter-0.3.3-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for concept_x_converter-0.3.3-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 ca0b8bdacd90a756cbf913eea31cb6651964ade463992f554f6ff4c004338e53
MD5 9be82570af093dcc360628bfc4d9158d
BLAKE2b-256 3d01000d91af9d8664ff2872f4e6d559772a09910ea264b12156271eeaa24fab

See more details on using hashes here.

File details

Details for the file concept_x_converter-0.3.3-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for concept_x_converter-0.3.3-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f67eda873c19074d05e7b815fc2911058e0e6ec6f88c674a2b4d0796acc18a34
MD5 aefe5f01742eb5f7e0be169fe22a7db2
BLAKE2b-256 a28a637d0f431bec1d12900a9b74d71b35c853ba1bfbc5bfb00d0d36f74ddd36

See more details on using hashes here.

File details

Details for the file concept_x_converter-0.3.3-cp37-abi3-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for concept_x_converter-0.3.3-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 c7cecfe9633d087f9fed8b02a59b34486f3188e8ec9edff6bd2f704da8a31571
MD5 304a3f8c97a7acbb0f70340140f46e5e
BLAKE2b-256 da3d076456a8f4cbb0d573c1c91eae3f1229b8d7ed7d7d95e2c29fa136c6173f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page