vec2vec project
Project description
vec2vec
This repository provides a reference implementation of vec2vec, which can reduce the dimension to matrix.
Requirements
Before starting this project, you must install requirements below.
faiss==1.7.0
gensim==4.0.1
networkx==2.6.2
scikit-learn==0.24.2
Note:It's recommended that using conda to install faiss, and conda version need to update.
conda install faiss-cpu -c conda-forge
Basic Usage
-
To run vec2vec by terminal, execute the following command from the project home directory:
python ./vec2vec/main.py --input ./vec2vec/data/train.bowYou can check out the other options available by using:
python ./vec2vec/main.py --help -
To run the vec2vec in your project, execute the following command:
pip install vec2vec
Input
Refer to the ./vec2vec/data/train.bow in the project.
Output
The output are like below:
************* The number of num_walks is : 5 *******************
Matrix2vec p and q and topk: 1 1 10
The shape of the input matrix: (2000, 13155)
BuildNNGraphFromFAISS Finished in 0:00:03.305026 s.
The shape of the adjmatrix is: (2000, 2000)
Preprocess_transition_probs Finished in 0:00:00.902988 s.
Random Walk Finished in 0:00:00.590795 s.
Begin to train word2vec...
Model Matrix2vec Finished in 0:00:09.073013 s.
Accuracy: [0.662 0.652 0.64 0.668]
Accuracy: 0.6555 (+/- 0.0212)
Miscellaneous
Please send any questions you might have about the code and/or the algorithm to xiangwangcn@163.com.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vec2vec-0.0.5.tar.gz.
File metadata
- Download URL: vec2vec-0.0.5.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed0f5ff165d189f27c1d8a5fa36c6f2c5136dcfcc0e49eaff150c5d900559876
|
|
| MD5 |
b0d545a22700d06b9c8642651f87d6e0
|
|
| BLAKE2b-256 |
5e81927240708dbc6b0e77bfaa97c41d689eecb753d0cfd33d78ab5eed3756cf
|
File details
Details for the file vec2vec-0.0.5-py3-none-any.whl.
File metadata
- Download URL: vec2vec-0.0.5-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4e3b668accb1977f740b575e782011601928acae0438957e507cf4c1cc8a180
|
|
| MD5 |
da596bcbf2dc246e26aa202f2fb2af4b
|
|
| BLAKE2b-256 |
8cad551ce316373b84d92970b346339f52901db27f1bece5473b1624bee991fd
|