embedding 和segmentation representation

传统的neural Model for Chinese Word  Segmentation

中文分词一般是基于字符的序列标签。每个字符可以被标记为集合{B, M, E, S}中的一个元素。 B - Begin, M - Middle, E-End of a multi-character segmentation(多字符分割),S 代表 Single character segmentation。

neural Model总共有三个专门(specialized)的层:

  • 字符嵌入层 (a character embedding layer)
  • 一系列传统的神经网络层(a series of classical neural network layers)
  • 标签推断层 ( tag inference layer)

embedding 和segmentation representation

embedding 和segmentation representation

embedding 和segmentation representation

 embedding 和segmentation representation

embedding 和segmentation representation

c(t)∈Rd,x(t) =[c(t-2),c(t-1),c(t),c(t+1),c(t+2)]∈RH1,H1=k*d, |T|为tags size(这边假设k=5)

 

RNN Model

输入序列:

embedding 和segmentation representation

隐藏层update:

embedding 和segmentation representation

我们看到,h(t)与h(t-1)是有关系的。

PS:RNN实际上是无法学习长时间动力学行为的,梯度反向传播时,存在梯度爆炸(explode)消失(vanish)现象。

 

LSTM Model

LSTM提供一个记忆单元 C。 C的变化被三个门给控制:

  • 输入门input gate: i
  • 遗忘门forget gate: f
  • 输出门output gate: o

下面是gate, cell update, hidden output update的定义

embedding 和segmentation representation 

PS: Wic, Wfc and Woc 是对角阵(diagonal matrices)   但是,在其他地Wic, Wfc and Woc 不是对角的的,而是额外再加个偏置bi,o,f

 

LSTM Architectures for Chinese Word Segmentation

 

LSTM-1: The LSTM-1 simply replace the hidden neurons with LSTM units

embedding 和segmentation representation

 

 

LSTM-2:在LSTM-1的基础上再堆积一层,并且下一层的h(t)直接作为上一层的输入, 不做任何变化

embedding 和segmentation representation

 

LSTM-3:在LSTM-1的基础上,将将局部的LSTM输出进行合并 ,将h'(t)=[h(t-m1),..,h(t),...,h(t+m2]代替原来的h(t)

embedding 和segmentation representation

 

LSTM-4:在LSTM-3的基础上,再堆积一层

embedding 和segmentation representation

 

Inference at Sentence Level

由于标签之间存在一定关系,已有的工作是定义一个概率转移矩阵A=(Aij)4*4,

  Aij:代表Tag i 转移到 Tag j的转移概率,i,j ∈ T, |T|=4

定义a sentence level score

 embedding 和segmentation representation

其中,embedding 和segmentation representation是Tag embedding 和segmentation representation对应的score,embedding 和segmentation representation就是网络输出的4维向量。涉及到的参数为

θ={M, A, Wic, Wfc, Woc, Wix, Wfx, Wox, Wih, Wfh, Woh, Wcx, Wch}

 

 

 Training

Max-Margin criterion

定义Y (xi)为所有句子xi可能出现的标签集合,并且yixi对应的正确标签。

定义embedding 和segmentation representation

embedding 和segmentation representation

其中,embedding 和segmentation representationembedding 和segmentation representation

 

现在假设我们有一批训练数据,并且建立以下的L2范数下的正则化损失函数:

embedding 和segmentation representation

 embedding 和segmentation representation

 

用到的优化方法

  • subgradient method (Ratliff et al., 2007)
  • diagonal variant of AdaGrad (Duchi et al., 2011) 

     embedding 和segmentation representation

 

 Dropout

对于神经网络中的各个层的节点,都已p的概率选择睡眠,也就是1-p的概率被**。(或者每层采取不同的p,反正得自己去试,看看怎么样的参数最好,文中是在input lay中取p=0.2)

 

模型超参(hyper-parameters)设置:

embedding 和segmentation representation