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

Uploaded CPython 3.7+Windows x86-64

concept_x_converter-0.3.2-cp37-abi3-win32.whl (216.2 kB view details)

Uploaded CPython 3.7+Windows x86

concept_x_converter-0.3.2-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.2-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.2-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.2-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.2-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.2-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.2-cp37-abi3-macosx_11_0_arm64.whl (354.1 kB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

concept_x_converter-0.3.2-cp37-abi3-macosx_10_7_x86_64.whl (362.3 kB view details)

Uploaded CPython 3.7+macOS 10.7+ x86-64

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.2-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 96d33c9eeea6b5132a99be93681b4c77a075df4935a329e81fca0a273faac847
MD5 a055d472af08cef139515ada6038a473
BLAKE2b-256 e5172ad93dc250d5b43a7df12f4949aa22e7bb2d4d9a0b95dd4d0ad0be0993fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.2-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 5047fb7827235f54a091239f22dd9a0908b5f0a60483b6d857e0e3c029ed0c08
MD5 664e832b5f515e643cbe2ea82d757e08
BLAKE2b-256 113e853bc141e5b0f032b43a0050d17137b0a75593acc61fe83eb676096dc5ea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 18fc08c9f475abb2caea4a7a5cf3746b033acfa115509ef32ff3bf86d8661e0b
MD5 7271c75489c2b79acfa5e915b903f7aa
BLAKE2b-256 38ec6589c09153880376e90a93cd831b3a398ba0b89b553909a2082e231a6e87

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.2-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 a42947cc415ee916820bc337faa7e6a3fcaba7d4df7fae3e0de036e3f39542fe
MD5 8c74a15b317b6dd4e58a97457c3987c2
BLAKE2b-256 b32dff56c79f83d2156ae37d1032cd11183389984d75e9d45241824ba796ccd4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.2-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 72fedaabaec75501e92617f8066ad39207cc061bd10025f43445a21375fadab9
MD5 5c277b08e9a06edb45eaeb1bb469c133
BLAKE2b-256 79bd18519957650898eb99ab6336c7d609b58067d38c907c699773a35fd07576

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.2-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 0d5cb4e81f300f13c0cda4cfa57fadfe134998b7e8bbc5fd3bcc8ea961e77d81
MD5 5cd483de85890cad83630c9bee95bdd9
BLAKE2b-256 61f23a6ac35dfc48df23738a2274391328fdd37de88949fdfb55390784f6978e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 41bc8bfe85a5a89e66f806a9c14c8149867fa52027a42daf84c534ab559bae6b
MD5 cce7149d070fc81db392c74c25bc3bd5
BLAKE2b-256 71f8ca0913dd97b6eb3953a1d93a75f100cb48808301446609d8e8b380a42051

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.2-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 fa3310bd8e19c0aea472326d225431397467fea44a4647819bb79a622b5ca109
MD5 2d11fdcb00ee4954103ba867d19046f2
BLAKE2b-256 e187f5fecbe039b259b3779fa02e7e77d637e7a77f58d97d3487bcb475a89eee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.2-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3abebc80b3eca31febbda275d392b8d15c8b9cbe3335ce27b75410f019d4ce35
MD5 3fea11da2bf03b4d6a2f853553fb1f5d
BLAKE2b-256 3a5048cd41723e990813407f6156efc968e4fa813aeb912e4fd8bfbcfcdeb487

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.2-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 5bc02480a5919ab152ae377bec19a700c6a47c823f801748e3781517dcd3268c
MD5 0d1c9271e35033fe936a4c0dadb42aae
BLAKE2b-256 06effe45b5c0c034d298a9321b8a984baa4a2abc6ad36a90baf3574812593a60

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