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

Uploaded CPython 3.7+Windows x86-64

concept_x_converter-0.2.0-cp37-abi3-win32.whl (206.6 kB view details)

Uploaded CPython 3.7+Windows x86

concept_x_converter-0.2.0-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.2.0-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.2.0-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.2.0-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.2.0-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.2.0-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.2.0-cp37-abi3-macosx_11_0_arm64.whl (342.7 kB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

concept_x_converter-0.2.0-cp37-abi3-macosx_10_7_x86_64.whl (352.9 kB view details)

Uploaded CPython 3.7+macOS 10.7+ x86-64

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.2.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 471e8f161ca084dbc8229e96ceec88b24f990ec48d9dff555e1526ad5fd1d325
MD5 d5597389a26033561b9abd1ac8f6bde0
BLAKE2b-256 a5eda8015de7f4b0d436b4f3cb193b99b070856338723a4e2c240385e8eefecb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.2.0-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 5730b809fb910dec936b71b2fe311ea625037092025159523ec9dc5bd3fc7561
MD5 633133f202ddecd22830fe52823944ac
BLAKE2b-256 e002447ccd98694a5e583cad704b6a5b1a973c440f96c464d98fa23cb5e83e23

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.2.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d7796e1755b1bbcfadc53c12163ca9a2cb438a6575fb9c745205e87d1e404345
MD5 712f9e20aaaa60a79965a8776332ead4
BLAKE2b-256 812289af3dcf52734e8809200d0be1a2e9d76c89f6d7375b98eef59561cd5142

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.2.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 3336c3f137f182bd39649fa775ab6e798a2382a97c86d787ce59e1d073e5b16c
MD5 e68264170828ff7b32ff12c2f045eb77
BLAKE2b-256 fec93d0dfb2b33186823ef2868c664d1414ced681408325be31c007cddacd8c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.2.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 2a574c96de05a236c5b016f74737a885f140f84097765a2d4c32011f7225159d
MD5 19d50b198dfed131bc3a44de5ab4605a
BLAKE2b-256 5f93471f5db5a1b8b71ae9039c835ff7c939be03d8a180553521a117ddeeb958

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.2.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 a893ae03ecf70f1393c27f8c1d114fdcb2a7e757b28837a761185496e3775067
MD5 9e715271edb4a9fba1b9c35874955bc7
BLAKE2b-256 0e4917433e08e5f6c6d2b0574543f8b3155a004e54464ab91325d4bb4a77ef6c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.2.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f51e94740f14ba0c40537f0d8caf8259ad7c662914f05b41d19eff813ed0712b
MD5 7cbf41ab8c5022797873958683c5d97e
BLAKE2b-256 4801765fb55a6b333cf9ff17563320597e92d803297b60023a5269b79ed1bcde

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.2.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 33dcc73bed76a0179635e299f3f0725e69d24a54494f95b71363c847fd72305d
MD5 b825e932a612d66b02a87b5ab11f2ed3
BLAKE2b-256 1871b7d138888421bf9612757788155e9aeb2ae8b33438a675cc1c045f1c4269

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.2.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 24e9b293a756906e4923e8cd3a55c22ade2a754b102f99d38b8209eede930b40
MD5 65c740ae9cf8cd7d9a259a3129b0b3bf
BLAKE2b-256 4e01170fb1ea73205c31192a87eec37042c1a0916632d5a937459d5a33b6e4e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.2.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 ceea8be09194b0eff7b786bbcc6c237202202d5ea8c032d8f4464eb88aba9072
MD5 b23579602e2c2d4f98d0721a65b7e606
BLAKE2b-256 f32843310a3384dbc1eacbecffa793390707b3c89856bb6aa2d32aa2912268f9

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