论文笔记 | Cache Method in n-gram

2018-10-22  本文已影响42人  7okis

前言

本篇简略介绍一下 (Kuhn, 1988)[1] 和 (Kuhn, De Mori, 1990)[2] 中的主要思想,即在 n-gram 基础的马尔科夫模型中引入 cache 机制的方法。作为讨论后续使用神经网络方法引入连续 cache 的序列模型的铺垫。

思想

为序列模型引入 cache 是基于这样的假设:近期使用的单词,出现频率比全局更高。这是一个受语言学启发的假设。

原语言模型基于 n-gram ,论文中提出的模型为其增加了 cache 部分。以 Part-of-Speech (POS) 作为线索,改进语言模型。这是基于另一个假设:一个内容词(a content word),比如特定的名词或动词,倾向于集中出现;而功能词(function words),倾向于平均分布。

模型的核心可以用以下公式概括:

P(W_i = W | g_i = g_j) \approx k_{M, j} \times f(W_i = W | g_i = g_j) + k_{C, j} \times C_j(W, i)

各项含义如下:

进行序列预测时,每个 POS 维护一个 LRU 的 cache 储存一定量的单词。对于第 i 个位置,预测其为单词 W 的概率由前两个位置的 POS 产生各种 POS 的概率,乘以由上面公式计算出不同 POS 生成该单词的概率得到。

以上部分,略去了 trigram 预测 POS 的模型以及对 out-of-vocabulary 单词的处理。具体可见论文。

结果

实验证明了 cache 的有效性,并为内容词与功能词的语言学假设提供了实验支持。实验发现[2],功能词全局部分比重较大,而内容词 cache 部分与全局部分比重相当。

评论

对语境信息建模的方式很多,直接用 cache 储存起来算是很直接的想法。这篇论文[3]将 Kuhn 两篇中的思想改成了连续版本,依然保留了无需训练的优点。也许有的时候模型偏置(model bias)不需要对处理的过程太过干预,能为其提供获得想要信息的方法就好。


  1. Kuhn, R. (1988). Speech recognition and the frequency of recently used words: A modified markov model for natural language. Proceedings of the 12th conference on Computational linguistics-Volume 1, Association for Computational Linguistics.

  2. Kuhn, R. and R. De Mori (1990). "A cache-based natural language model for speech recognition." IEEE transactions on pattern analysis and machine intelligence 12(6): 570-583.

  3. Grave, E., et al. (2016). "Improving neural language models with a continuous cache." arXiv preprint arXiv:1612.04426.

上一篇 下一篇

猜你喜欢

热点阅读