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

Uploaded CPython 3.7+Windows x86-64

concept_x_converter-0.3.1-cp37-abi3-win32.whl (217.4 kB view details)

Uploaded CPython 3.7+Windows x86

concept_x_converter-0.3.1-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.1-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.1-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.1-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.1-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.1-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.1-cp37-abi3-macosx_11_0_arm64.whl (355.6 kB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

concept_x_converter-0.3.1-cp37-abi3-macosx_10_7_x86_64.whl (363.5 kB view details)

Uploaded CPython 3.7+macOS 10.7+ x86-64

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 667fcf48b9841e444847ecec5eb4ec3d6e05db2e0eb50d9c0fd2fed581f54910
MD5 29def926b7041a6883312ed29a02809e
BLAKE2b-256 df7105548307b80952378de99ca785741ef39b8b611924879591853dcf7da4ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.1-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 f16ad87469ef9c5c2f41bab3cfe5c8fc9bc2588ea219561ed2a2e9e91df87762
MD5 4ac3b42ccd1a94920b2c7093236b6da6
BLAKE2b-256 9f62956b4dda5760e551be49ee951f9f036ad7c5868d6da2b769a5181614d956

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dff52a6ab26a8e5246a516a81149191366ff16a572ff973ff23d8d46273f674c
MD5 f20d5a8d7f9cf0d6db78f54f46d93641
BLAKE2b-256 a95bb1504fa1486a67ec83875425cf6d961cb09c607397e44e89dc968af8819e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.1-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 eb3af1bbc461a50223c726dc7803c6234909033fdf7f605ad1ca64c2abab45db
MD5 c4e3f344fa596daceb04ec623ada88e5
BLAKE2b-256 59a6466a10a694188aed78e20b47ac27d0d97d7bda839d10d19b7b377b6544b6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.1-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 ddf15d27577ca3b386283ce6720caf1c7af2dabaabd80f941c09d58e4d4dd814
MD5 0129621ac9f8d3eb170e0fe7b8e060da
BLAKE2b-256 6a6d0fe9beaf7eb97be0485fcff375a0d321b836ab70604889f88f50f182e8bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.1-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 c993ee150e5e4131077d6767715ae719f97367aa4a51ff927dab05f202a3ed1f
MD5 d4d9a691bfd9744db7769e2c88106715
BLAKE2b-256 d45b3efa0d61ac5efa71850408d4ff94c73cfae76166478442d81d992b43e484

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 60a19054998e243a4667151b848f9cbd9dd71f5a976b8a0ed3549fc3e5764892
MD5 64ab603ec1023ae5412d04a3802e1704
BLAKE2b-256 13301c593b0e878ed9db1255b9408b16fe65896fa4f2256e87babf7668fe63d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.1-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 b43655c69d672a8205c28d9c0b57461d9f6d3c96709a57f5880f48f653ccc160
MD5 5c03368b85989a25bbef5df26f955293
BLAKE2b-256 d77b62c3e65b7ee71224743faa13a11f0c64b1d1976856263cb0cf60809a35bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.1-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ba4b51eaea6e318178ff8a801bb2b3325afd526ecad55168e049d262b9389c42
MD5 1a52703d90b005d404905761e2a06ec4
BLAKE2b-256 e9de48b86928749df6431d5e4ee363cf1c704fe2d741d0aebe28ea3b6116a14c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.1-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 9486d736483d053e103a41a7d03d16c4280b8b69492a5077866edc6d00a7af55
MD5 22a63607d11b5f0c981f4b8480937baa
BLAKE2b-256 e90efb03a82851e008b69e945b72d0cdf3475d84311e8a3d0d88f2d758fdf2bb

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