INNER CODE UNIT · Python
__init__
taishi-i/nagisa · nagisa/model.py:13
def __init__(self, hp, params=None, embs=None):
# Set hyperparameters.
dim_uni = hp['DIM_UNI']
dim_bi = hp['DIM_BI']
dim_ctype = hp['DIM_CTYPE']
dim_word = hp['DIM_WORD']
dim_tag_emb = hp['DIM_TAGEMB']
size_uni = hp['VOCAB_SIZE_UNI']
size_bi = hp['VOCAB_SIZE_BI']
size_word = hp['VOCAB_SIZE_WORD']
size_postags = hp['VOCAB_SIZE_POSTAG']
lr = hp['LEARNING_RATE']
ws = hp['WINDOW_SIZE']
layers = hp['LAYERS']
dim_hidden = hp['DIM_HIDDEN']
self.dropout_rate = hp['DROPOUT_RATE']
# Build a word segmentation model and a POS-tagging model simultaneously.