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

Uploaded CPython 3.7+Windows x86-64

concept_x_converter-0.3.5-cp37-abi3-win32.whl (217.9 kB view details)

Uploaded CPython 3.7+Windows x86

concept_x_converter-0.3.5-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.5-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.5-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.5-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.5-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.5-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.5-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.5-cp37-abi3-macosx_10_7_x86_64.whl (364.0 kB view details)

Uploaded CPython 3.7+macOS 10.7+ x86-64

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.5-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e0198ef9984662a059666da534fa4c5111f64a199cf4ab94998059ee6f58533d
MD5 b442baeff8fca052ba545ebaab3ee352
BLAKE2b-256 6318614ae82c72dc769eb5414e7339b20ff3d1cf4197bf7341a59deb4fc508f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.5-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 f7cd8e742782422f950d8b6a34bc6854cf6a00fb535de2580286885f36cfa5b5
MD5 a51d7a7ebc83789492360c3af290b42e
BLAKE2b-256 c378b8fafdc3e424158fe87b44b62a9fea8cd7e3a31b62f326bb501a84150263

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4e9c050667b49a4fba5d4966e13203d6fed6d7f4f4188d393761266622a51b94
MD5 81e8cffea15a86cda168513fe6ccb269
BLAKE2b-256 9fab520bc159e7f81a6615f04494768f8d13f15f7a8f7e6d8f764667f8c1e77d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.5-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 f2f084a9ec7c4f3c3c6444aebf09a8a587c13df534630cccee961e25c3924ada
MD5 b1c7b17d7c03a4968516ab2d151d50cc
BLAKE2b-256 0d3f2df974d8dd59978903c27f239dfd2df6bc513e1338af5bcfda7072d24589

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.5-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 4dc984268dce354c480c2c0e4002809d5a60881bb72d58445ee82ea26c2dc606
MD5 a1a9614b6f8b011eef0af5424beb38eb
BLAKE2b-256 2e9d42b86e1c26c9f2919bbbeea61ee041947d7776f210330d5718e7d7232431

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.5-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 8bb40f97155f88412a8249357c58c654cd8f0cd5bf77429422c36f3befd44f41
MD5 46a8bf2143713f85330f5a875ec3b529
BLAKE2b-256 6874dc27a5ae5fecaf08ace43ad839328f5a7051dcf893119b968bc5557893da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.5-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 13a009a16e2490852707586ea5931b48932fa08775f07b7e5baca7afc50b66bb
MD5 ca1fecf3ec94c74beb21e731e5c0e72e
BLAKE2b-256 3b8bd42b56e97fc70c58292f96247097d44f28001654d648a7d413079a95e8b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.5-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 4b600ff358c393c7469814f36741483728384769e8d57ac322752b27f8010ecc
MD5 d47fa8e4cd901cf157339d044464abeb
BLAKE2b-256 bacca5054f7ded6c9ca7f05da26463eb82a79c868f1fe80e691c74d1e6de3c15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.5-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8aaf9911dcaad983af811d6aa2afc63fd77454274c15cb1ad72e83783a6d5602
MD5 610f189429092a36c9baf8fcf21c5134
BLAKE2b-256 d1756468c445f0899e5f39203c34d7e1a197ab7b8dac4211cb3bd317b9235b90

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.5-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 cdfa7f628b14db45afe6a39801f2c24ba6a3dd2a7bcc127f431cd806ca493bd1
MD5 d058041384a9b2aea3d782ad4b13aa28
BLAKE2b-256 c6d1b61d1f77ec0159d1acea95d110cd83ff4c6812829a874abc5b267c6434e0

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