-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathexample.sh
More file actions
executable file
·21 lines (15 loc) · 971 Bytes
/
example.sh
File metadata and controls
executable file
·21 lines (15 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
#train a word2vec model using gensim. This step is *optional*, you'll only need to do this if you want to initialise the model with pre-trained embeddings
#word2vec model settings are all in the python file itself (word2vec.py)
python word2vec_train.py
#train a model; configurations/hyper-parameters are all defined in tdlm_config.py
python tdlm_train.py
#all test inferences are invoked with tdlm_test.py
#compute language and topic model perplexity
python tdlm_test.py -m output/toy-model/ -d data/toy-valid.txt --print_perplexity
#print topics (to topics.txt)
python tdlm_test.py -m output/toy-model/ -d data/toy-valid.txt --output_topic topics.txt
#infer topic distribution in documents (saved as a npy file)
python tdlm_test.py -m output/toy-model/ -d data/toy-valid.txt --output_topic_dist topic-dist.npy
#generate sentences conditioned on topics
python tdlm_test.py -m output/toy-model/ -d data/toy-valid.txt --gen_sent_on_topic topic-sents.txt