Implementation of the deep latent positions and topics model (Deep-LPTM)
Project description
The Deep Latent Topic Model package
This code is provided with the Deep-LPTM paper. The package can be used directly in command line or in a python script as described below.
Command line
This section provides an example of usage of the package in the command line.
Note that the folder at the data_path location is assumed to hold the binary adjacency matrix in
adjacency.csv, and the texts in texts.csv as a matrix T, such that $$T[i,j]$$ = doc sent from node $i$ to node $j$
python main.py -K 3 -Q 4 --data_path data_path --save_results True
--save_path results_path --init_type dissimilarity --max_iter 10 --tol 0.001 --initialise_etm True
Other arguments can be provided.
Function
To use the package in a script, the following arguments are required:
adj: (array) binary adjacency matrix of the directed graphW: (list of str) texts corresponding to the edges of the graphQ: (int) number of clustersK: (int) number of topics
The following function fits Deep-LPTM and provides the results in a dictionary:
from deeplptm_package import deeplptm
results = deeplptm(adj, W, Q, K)
Remark: all the arguments that can be provided to deeplptm() are provided in
the documentation. To access to this information, use the command help(deeplptm) in a Python terminal,
after loading the package.
If you are interested in handling the text preprocessing yourselves, as well as getting your hands on the model,
you can follow the tutorial notebook at doc/Tutorial_deep-LPTM.ipynb.
Project details
Release history Release notifications | RSS feed
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 deeplptm-0.0.1.tar.gz.
File metadata
- Download URL: deeplptm-0.0.1.tar.gz
- Upload date:
- Size: 40.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e151de40d743a8ad973deef00600c00199115a491d275cacba5b2c015191d201
|
|
| MD5 |
3ca1e32eaaab62a50b4b0677b9e50d99
|
|
| BLAKE2b-256 |
8b54fa24ee0ac5baf21e0793532daf14ffa57d553d8485dac95e42bbd9c91940
|
File details
Details for the file deeplptm-0.0.1-py3-none-any.whl.
File metadata
- Download URL: deeplptm-0.0.1-py3-none-any.whl
- Upload date:
- Size: 246.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab1a0cec341eb4182c9cee5fcb56db62eb64f499674d6437d0a703eef9facde6
|
|
| MD5 |
5535815fde9a44d87d24c26ab2d5595d
|
|
| BLAKE2b-256 |
7636dd01532a601ab89924a5cca4f4ff5ad5b9286716c94f99a2c3b8b3255f77
|