forked from shibing624/python-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
38 lines (28 loc) · 1.18 KB
/
config.py
File metadata and controls
38 lines (28 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# -*- coding: utf-8 -*-
# Author: XuMing <[email protected]>
# Data: 17/12/29
# Brief:
import os
################## for language model ##################
bimodel_path = './data/model/zhwiki_bigram.klm'
trimodel_path = './data/model/zhwiki_trigram.klm'
################## for training #########################
# path of training data
train_data_path = "data/rank/train.txt"
# path of testing data, if testing file does not exist,
# testing will not be performed at the end of each training pass
test_data_path = "data/rank/test.txt"
# path of word dictionary, if this file does not exist,
# word dictionary will be built from training data.
dic_path = "data/rank/vocab.txt"
share_semantic_generator = True # whether to share network parameters between source and target
share_embed = True # whether to share word embedding between source and target
num_workers = 1 # threads
use_gpu = False # to use gpu or not
num_batches_to_log = 50
num_batches_to_save_model = 400 # number of batches to output model
# directory to save the trained model
# create a new directory if the directoy does not exist
model_save_dir = "output"
if not os.path.exists(model_save_dir):
os.mkdir(model_save_dir)