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

Uploaded CPython 3.7+Windows x86-64

concept_x_converter-0.3.4-cp37-abi3-win32.whl (216.8 kB view details)

Uploaded CPython 3.7+Windows x86

concept_x_converter-0.3.4-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.4-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.4-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.4-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.4-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.4-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.4-cp37-abi3-macosx_11_0_arm64.whl (354.2 kB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

concept_x_converter-0.3.4-cp37-abi3-macosx_10_7_x86_64.whl (362.4 kB view details)

Uploaded CPython 3.7+macOS 10.7+ x86-64

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.4-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8b7261cfaf65646ae7b365fce44a0579e6d328d9751cb6749b86bf097d6fafdf
MD5 8f3fe946c2aa1c717e6aacd37180e134
BLAKE2b-256 bc393677b95b069cccc43260d50a3f4447a13d4588bf4f9eeef7fadc6dea25df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.4-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 2e418f7a702a3ed1b8e15f658d7ac6660c4b3cd9710da87194e66a8fa9cfb68f
MD5 8fe5107e193d8570a48d6ce630f2e4a7
BLAKE2b-256 de9ad80c8d31dc58e60949e83953e8049894c15b6b2e916af2d5da22daab69a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.4-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0b1829f3d255e333477703402c9fde16d481825d9d88a07245bb676b775f353d
MD5 42a3ec1c242433737288a0a6cc3535bb
BLAKE2b-256 64b84290421b16eb1ed3da5055b8dbe9be9a942247bc9222ccffe8a61847fdbc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.4-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 7b2ff9a1fa57bed8ab2c65cbadda43a2741947751677cf8a7f1da69bb4f93bb3
MD5 8984a941fb691d9827199a8041a969db
BLAKE2b-256 64bc00525df9f43c5de3702a0549e1e196b94f4b8a38e426a26ef1f59dc567c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.4-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 33e8e43aa98e9d291fe27feba539af3a831e9de9ec4f582dae92a3f8354a3b73
MD5 1a2039bc3c5d548f7e40f3ab07e48ab6
BLAKE2b-256 59b45d55dea9692e020be77438099ef79ec7f0f7d69ac051426c7c6e4dc3de1d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.4-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 4da84bd1c04898b28b82f079d44bcae5ccfc4a5012722bae5e5071259503b285
MD5 44c33fa6369dffda9043841887ba0635
BLAKE2b-256 db6bdb833e27c2e4b34514372593a7058ea48677961e4f8bce6274d5cce94914

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.4-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cc8e1d389f3c685cdc802cfad7c2e87975e19b2e2ab6bd6f08f652ba7eab12e6
MD5 0757b84a2fd9cd8c4c012adb92064c26
BLAKE2b-256 2285067fa9ddf60b9ea4cfea5e6606a3effbd6633388b5934999f0949206eeea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.4-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 399ab5b34f412939712797595811488b029b21110e52a347d46908afb0836a55
MD5 a3a50e40de5a78da9e126cc3940f9eb8
BLAKE2b-256 7cf37629ff869e34a0e0b1d540d018c3d50d96496ee50a9008acf2eff42ca445

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.4-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a3d4d90bc344c29b79048db189a7c3a394ff3bd62774a1f0a7dc6be84de3005a
MD5 bfba52f6811696d33efa2c0982302dcd
BLAKE2b-256 f3813bbeea37c3ba3756bb0e5454d35e1dfe2208a08929f162beb4023729e7e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.4-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 400519a45b5c267871971a43c989c834348762c9c8edd848f71644cf2c306530
MD5 a0cee817373fc247b000b7f93aa13816
BLAKE2b-256 8865ddca467a3ec4bab80047278288f1b4e4ed9a3fe15db93200238c9e56b429

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