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

Uploaded CPython 3.7+Windows x86-64

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

Uploaded CPython 3.7+Windows x86

concept_x_converter-0.3.6-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.6-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.6-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.6-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.6-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.6-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.6-cp37-abi3-macosx_11_0_arm64.whl (355.5 kB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

concept_x_converter-0.3.6-cp37-abi3-macosx_10_7_x86_64.whl (363.8 kB view details)

Uploaded CPython 3.7+macOS 10.7+ x86-64

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.6-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6081036e52e447d7ee41f81a5f12b969302a6343f397330f78cd1ea3e4dae96d
MD5 7377fd3c32c54585cfa27af397f0289f
BLAKE2b-256 72e70a0b0214fb504eb11b2f179d777b4e10abc16c11986b7fb0783fe5149233

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.6-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 0046b8ee13a35c522ceb3131e7b8b09956df66ddbb11ce9c83e4b9443e7f2267
MD5 33a62095d5b72ff82206eb9f22962b31
BLAKE2b-256 715e1e4d6387445adcd577f48dda78ef5b85ce25afd8abd2059f3dc9ba28c7f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.6-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4773c6e61d1ada5e56f0707fdf958e73f5300b92271523f54fc2a09f2d75ddb6
MD5 c8ce2da0aa51120ee55fdf354c7e0291
BLAKE2b-256 3adfd7b4b4d8bfad2cf8e9f662642e6bbd653bbebd5970a6f23ccc122bb6b77e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.6-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 782c19e8d6fd3013f7c9511b0f114c63b1d883779c6d37939b3091f04743fe61
MD5 ee2b3ba7b890abafe6e62881be71ecdf
BLAKE2b-256 3082f1e1bdb85021a308e38b7edae09c03b82a929ba65db1e79a87e1be43cd80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.6-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 95fc2874e231de0b6b6e9ad21d03a5ac6babfc0d5822ba214310618b8e0c5f2e
MD5 954121db701145161b5478a06eba5689
BLAKE2b-256 f553c3bd1f1f2adcb52ad32d47c924042b2d9b14d7aa068cb0cc07a7537da73f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.6-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 9bc1d6d5e6824050acfe277a33782a30326c0061e66b55e9c8949f7acf72b880
MD5 4bfccc6b2bfeeb37a4a2bd26540d7848
BLAKE2b-256 9c9f186375178f2ced6d758dc63dd58ae33f85ba36b5c61af3d955d1f1df743e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.6-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8ad8b5e523a883520520cfed95500e690b666af472311ce0b5ac203783c1cb41
MD5 9cf5f20f8b48d803006e3ca6249af88a
BLAKE2b-256 8ad1ba71de89f7809b3e29ea0888c347549e15b26f2c12d98fadc75ce480da12

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.6-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 b934b93d2ab7d24200cd6c3a300b003e6228db97444dd99a5268361953a3c527
MD5 5520b3f3db67885413174a62dbd82ea9
BLAKE2b-256 0f0e7161151cea8706ae55a1f4f1fde811a0b8e57a7821e5313ad2d610f771dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.6-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 276ebf9e91c1ef9e0a81699797c5c72e3012a4e93394dd8c2c8794e5e5ba39f3
MD5 5d31a0d7df990ce2230bc72bbc236028
BLAKE2b-256 2ce4faaef9ea9f49ce8f5eb9f7256c19eee5dbd87b21ef0033fdcc73abb86324

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concept_x_converter-0.3.6-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 883245eed2b3bd24d9716c1e676601869a5b52d68d5cde8776ccca774bacd5ff
MD5 03d9f54494ded2e51640d5eee70cab9e
BLAKE2b-256 d8cf185e8cfb2faf95887b57604be373c602d8eedd87a63cf750ef3b030fddab

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