nlp_xiaojiang/conf/feature_config.py

27 lines
722 B
Python
Raw Permalink Normal View History

2019-05-10 10:09:41 +08:00
# -*- coding: UTF-8 -*-
# !/usr/bin/python
# @time :2019/5/10 9:13
# @author :Mo
# @function :path of FeatureProject
2019-05-25 12:44:33 +08:00
import pathlib
import sys
2019-05-10 10:09:41 +08:00
import os
2019-05-25 12:44:33 +08:00
# base dir
projectdir = str(pathlib.Path(os.path.abspath(__file__)).parent.parent)
sys.path.append(projectdir)
2019-05-10 10:09:41 +08:00
# path of BERT model
2019-06-11 15:44:36 +08:00
model_dir = projectdir + '/Data/chinese_L-12_H-768_A-12'
2019-05-25 12:44:33 +08:00
config_name = model_dir + '/bert_config.json'
ckpt_name = model_dir + '/bert_model.ckpt'
vocab_file = model_dir + '/vocab.txt'
2019-05-10 10:09:41 +08:00
# gpu使用率
2019-05-25 12:44:33 +08:00
gpu_memory_fraction = 0.32
2019-05-10 10:09:41 +08:00
# 默认取倒数第二层的输出值作为句向量
2019-08-24 23:40:02 +08:00
layer_indexes = [-2] # 可填 1, 2, 3, 4, 5, 6, 7..., 13,其中1为embedding层
2019-05-25 12:44:33 +08:00
# 序列的最大程度
max_seq_len = 32