Slide 1

Slide 1 text

Unsupervised Latent Tree Induction with Deep Inside-Outside Recursive Autoencoders NAACL 2019

Slide 2

Slide 2 text

Introduction • 句法分析被广泛用于NLP的下游任务 • Tree data少且集中于news领域,跨域困难。 • DIORA:无监督地从任何domain中提取浅层parsing和完整语法树

Slide 3

Slide 3 text

Introduction • 模型建立在latent tree chart parser的现有工作上。 • - Semi-supervised recursive autoencoders for predicting sentiment distributions • - The forest convolutional network: Compositional distributional semantics with a neural chart and without binarization • - Learning to compose task-specific tree structures, AAAI 2018 • - Jointly Learning Sentence Embeddings and Syntax with Unsupervised Tree-LSTMs • CKY算法也是一种chart parser。

Slide 4

Slide 4 text

What is chart? • 一个长度为T的sequence,可以制作一个T*T大小的chart • Chart里的每个cell可以看作是内部节点, • 是所有可能的subtree的软加权 I jump over the river

Slide 5

Slide 5 text

DIORA的贡献 • 将Inside-Outside算法合并到latent tree chart parser中 • 不需要annotation,以language model为训练目标。 • 无监督方法中,DIORA是state-of-the-art,且树最深

Slide 6

Slide 6 text

DIORA • Inside过程递归地压缩输入序列,通过合成函数得到每一个结点 的inside向量表示。Inside过程只考虑子树不考虑context; • Outside过程,通过计算context得到outside向量表示(后面展 开),从根节点展开到叶子节点; • 最后通过优化叶子节点的表示来优化树。

Slide 7

Slide 7 text

符号约定 • 对于chart里的每一个cell k,都有对应的 • 约定每一个单词x,其embedding vector为v • 相容分数越高,merge的概率越高,节点越可能不存在

Slide 8

Slide 8 text

Inside Pass • 对于叶子节点, • 使用一个线性变换计算inside vector和score:

Slide 9

Slide 9 text

Inside Pass • 对于任意的一个高层节点k,儿子节点对的组合为{k}。 • 这里k对应了一个span。K范围里的相邻节点对(i, j) ∈ {k} • 对每个节点对做两个运算: • (i, j)的相容分数e(i, j) • (i, j)的向量a(i, j)

Slide 10

Slide 10 text

Inside Pass • 首先看相容分数e,e计算两个相邻的cell有多大可能被合并。 • 其中, • 是一个双线性函数,S是一个需要学习的参数

Slide 11

Slide 11 text

Inside Pass • 再看组合向量composition vector。 • 这个分数和这个vector表示了cell k的子树软加权。 • 有两种方法实现这个函数:Tree-LSTM和MLP。 Tree-LSTM中,inside时w=1,outside时w=0 MLP做的是concat

Slide 12

Slide 12 text

Inside Pass • Chart的高层节点vector以累加的方式进行计算。

Slide 13

Slide 13 text

Outside Pass • Outside pass类似于inside pass。 • 根节点被作为bias学习。 • 计算不是通过两个儿子计算,而是通过父亲节点和兄弟节点。 • 根节点的vector随机初始化。

Slide 14

Slide 14 text

Outside Pass • 对于下层节点k, • 计算父节点j和兄弟节点i的composition score, • 约定为f • Compose函数inside和outside共享参数。

Slide 15

Slide 15 text

Training Objective • 用语言模型来训练。 • Margin Loss: • N是采样的负样本数量,根据词频随机采样。

Slide 16

Slide 16 text

Generate a Tree • 有多种办法,这里使用传统的CKY 算法。 • CKY算法可以为CFG和PCFG以动态 规划的方式parse出一个树 • 所以这里只用inside分数e(i, j)

Slide 17

Slide 17 text

Experiment • 模型在三个task上应用: • Unsupervised Parsing • Phrase Segmentation • 看模型识别出了句子中有多少个短语 • Phrase Similarity • 首先用DIORA算出每个短语的表示,然后两两短语之间算cos相似 度,对于一个短语,如果与它最相似的K个短语的label和它一样, 那么这个短语就预测对了。

Slide 18

Slide 18 text

相关论文 • Semi-supervised recursive autoencoders for predicting sentiment distributions • The forest convolutional network: Compositional distributional semantics with a neural chart and without binarization • Learning to compose task-specific tree structures, AAAI 2018 • Jointly Learning Sentence Embeddings and Syntax with Unsupervised Tree-LSTMs • Do latent tree learning models identify meaningful structure in sentences? • Grammar induction with neural language models: An unusual replication • Structured alignment networks for matching sentences • graph-based dependency parser + beam search: The insideoutside recursive neural network model for dependency parsing • Neural crf parsing