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.7-cp37-abi3-win_amd64.whl (223.4 kB view details)

Uploaded CPython 3.7+Windows x86-64

concept_x_converter-0.3.7-cp37-abi3-win32.whl (216.3 kB view details)

Uploaded CPython 3.7+Windows x86

concept_x_converter-0.3.7-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.7-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.7-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.7-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.7-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.7-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.7-cp37-abi3-macosx_11_0_arm64.whl (355.4 kB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

concept_x_converter-0.3.7-cp37-abi3-macosx_10_7_x86_64.whl (363.7 kB view details)

Uploaded CPython 3.7+macOS 10.7+ x86-64

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.7-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3793186b04addba061f8fff99ce31b2072a1e4eed13bffcf48c5306f6637d745
MD5 1eb6c1c205cbcf40f66ab8335a88b60f
BLAKE2b-256 54917756de9142df4fdef8e1931ee0d1727236e25b39e69ed1ecc2a981927501

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.7-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 e29551ac575cf5b3305536c240e04c063f06a1e8dff8b6430a9ba3b260da4839
MD5 7a3cecb4b322dcb17c5e854baf56a8da
BLAKE2b-256 ab7bd0162482464c2ae660ce2d9682ac56b0a4fa2f709468c0d89ed84c4ebc9f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.7-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d00f576339743ef763a47c4e630adb1c631c4e41e90c452f906589d14f90449c
MD5 15632a921a939cef5a9445e4f2dc8183
BLAKE2b-256 7a35e090a54e416970c6a20bc14304c8016990100d8054bb3191c61c61525489

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.7-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 fdb9407817c871914e6001bba5f149c3ed47cd8782dd1f94ea0a8cdf68775b39
MD5 aec72f058146d0f41033b65800431661
BLAKE2b-256 4abf294c6f31a73186b9a6a70095a047895ad3bcb4903278e03e9efd9728ad28

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.7-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 44d39930b9cf8c62d28505605a4073ec6f21b92a2cecc4604d481d5d789943cc
MD5 458b75aca4375221480cbf5d6a46c00b
BLAKE2b-256 92210fc296182dcb9ac70ae853b2b6d1d7337451806d2092817878c11a93c549

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.7-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 4d9810f3661ac5c3c0b16927d3ad80a4cd64e5ac8f9f6dedf442e62c6fad68ac
MD5 32fe59e49a65ca17ba67abdfefe5e64e
BLAKE2b-256 cf717ef6166572f3a36df890ac6fd303a02dd19143678a616c09175435f52e17

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.7-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e50bc01c0b7c96e9085d9f8c3d9bc7add467d9f2ce8792f89fe2b43a20912875
MD5 2089a0e8269fcda820d42e1f7a87057d
BLAKE2b-256 7e31b8e14ad7f0c0d6bdf0244374daa5e6952299c74fc0fd148f72f99bfeb852

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.7-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 3226e3a439b3308674337f363b3a911f629969d7079c138b1887e31215d2552f
MD5 1e5fa9bb9c5456dec6e1d46a72027417
BLAKE2b-256 ec1876d4d7052c346953cd197d0584febecab555470fe306f7a548b910d78092

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.7-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b8266cd40105e860e19163add414701c488125498fd52c5347495b699519ce5b
MD5 42b651a513547b5a661a5ad1be07d2d3
BLAKE2b-256 2f0f3e28d6d20ce4d2bc1f7f69281cffeacbf990329ea7cb739c5708ee3389ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.7-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 fe82c4e97ec0a88ad1eb552f27f57a2d391348ae5814881cbb70b7da65f88302
MD5 9160072c7e07aa74cdceacaa8f74d469
BLAKE2b-256 1e648bd2ef2bebb682d56827ae892c00b953af9dcd0b540c6933c88ad55e1172

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