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

Uploaded CPython 3.7+Windows x86-64

concept_x_converter-0.3.0-cp37-abi3-win32.whl (218.9 kB view details)

Uploaded CPython 3.7+Windows x86

concept_x_converter-0.3.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.3.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.3.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.3.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.3.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.3.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.3.0-cp37-abi3-macosx_11_0_arm64.whl (358.4 kB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

concept_x_converter-0.3.0-cp37-abi3-macosx_10_7_x86_64.whl (369.1 kB view details)

Uploaded CPython 3.7+macOS 10.7+ x86-64

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 22d0ebed18acc6831f6f6829dba81e8294eea1fb1d59e1ad8a35395345e59406
MD5 c6ae1ca2433a656333707a8b110088a4
BLAKE2b-256 5dfc756b699a3676bd74d83141271bec62e2da11c04edbed145c87b0fe9679a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.0-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 5c4ee437e37e1d508c1c000da2c7e8c9c03785431b810ede1cb02771d2340929
MD5 863ad7f20774989c7f2c05376b5882fe
BLAKE2b-256 befa2ea70661ae7a47df6faef48a8bb25a31fec811890323bc950e4f45aca251

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8b4a82de81758c1d3d021f6007305c910776b8b683d50c7b646c81fbba2b7fad
MD5 bcc8baaef35269585bf7b7fd48e205da
BLAKE2b-256 4278d623f9604e7911fc45c2a0e33b2b5847a50f29534d62d3f7ddf16f365779

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 31cd4564c4a343c5816ff5a925c7719d2f3f0df076cb849026a9aa0fd62eba60
MD5 7acec1e11675dadf5863bdb5a9b31165
BLAKE2b-256 5912f4d03ac895c7d35e544ec4b32e8b0aa44ea7a310371bb6d80f3fb4f887cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 60a0d2a65f7685139f85dda521aa416143a9397e06ad67e1839699f9990c6dc2
MD5 fd833ca632d355b3f19ec3457b68ac2c
BLAKE2b-256 f5e54d72f84992c1d54d3e880ee83ce442dee5747e57ecabf3ef66cd3480a9e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 e883563a3d321cfc8a02ec062a77fb28cc967783b647530db8d281ad2008e4ab
MD5 9e95fe1767436ddd1af40b1b4b31998c
BLAKE2b-256 961ee658d2c340fd48ee523ebbe23b7fd8ba1369becd83b6796ef2d38a586304

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6abd06f8b6ecd10c3c7ff09597c12e0e0ff2ed38f6b57635e2d294fa2497edd6
MD5 7a2ffda81654552140c9414119db4a7f
BLAKE2b-256 ee15534c51d2eb69afe83d5e6ecf365bdabe91bb64d346c1eedc889d388dd64c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 287138170980dcf178f01a49e98ceca940bba51c845d2f686b443e26dbd4fa8b
MD5 4284c6e4338ee63d8448ebcd2d175d9a
BLAKE2b-256 b461389699ca64abd3e8f0900d38769a2864461b9f56eecfb3cd5432eda5766f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 32cc1f7a4d98460985bec5f294f7377b438f3dbaab9b652d4c2f88df02d66f97
MD5 ecbaf85f45204a1b563c006d2ec5e322
BLAKE2b-256 bcc613e0beefc301cd8f81beb802f4a0739382001b209d93fc656cf71e41cd00

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.0-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 e5ad4edbd11b0f790577856724fc7d6e320f15b15bac1609e6d2145b42077390
MD5 1c3d35f6069ac320326cb9b3636b91c2
BLAKE2b-256 0db47fae7efd850f35197c7c978d1eebafe35f5060174fbdea1103b4b99cdffc

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