Topic-Aware Latent Models for Representation Learning on Networks
- Clone the repository by typing the following command:
git clone https://github.com/abdcelikkanat/TNE.git
- To initialize a new environment for Python 3.6 and to activate it, run the commands
conda create -n tne python=3.6
source activate tne
- Install all the required modules.
pip install -r requirements.txt
Note: It may be required to compile the C extension of gensim package for a faster training process so you can run the following command inside the "ext/gensim_wrapper/models/" folder:
python setup.py install
and you should copy the output .so file into the same directory.
An example to learn node representations with Louvain community detection method might be
python run.py --corpus ./examples/corpus/karate.corpus --graph_path ./examples/datasets/karate.gml --emb ./karate.embedding --comm_method louvain
Similarly, we can adopt LDA algorithm in learning node representations.
python run.py --corpus ./examples/corpus/karate.corpus --emb ./karate.embedding --comm_method lda --K 2
You can view all the detailed list of commands by typing
python run.py -h
i) You might need to compile the source codes of BigClam and GibbsLDA algorithms for your operating system and place the executable files into suitable directories. You can also configure some parameters defined in the consts.py file.