Language Model estimates the probs that the sequences of words can be a sentence said by a human. Training it, we can get the embeddings of the whole vocabulary.

UnConditional Language Model just assigns probs to sequences of words. That’s to say, given the first n-1 words and to predict the probs of the next word.(learn the prob distribution of next word).

Beacuse of the probs chain rule, we only train this:

Conditional LMs

A conditional language model assigns probabilities to sequences of words, W =(w1,w2,…,wt) , given some conditioning context x.

For example, in the translation task, we must given the orininal sentence and its translation. The orininal sentence is the conditioning context, and by using it, we predict the objection sentence.

Data for training conditional LMs:

  To train conditional language models, we need paired
 samples.E.X.

Such task like:Translation, summarisation, caption generation,
 speech recognition

How to evaluate the conditional LMs?

  • Traditional methods: use the cross-entropy or perplexity.(hard to interpret,easy to implement)
  • Task-specific evaluation:  Compare the model’s most likely output to human-generated expected output . Such as 【BLEU】、METEOR、ROUGE…(okay to interpret,easy to implement)
  • Human evaluation: Hard to implement.

Algorithmic challenges:

Given the condition context x, to find the max-probs of the the predict sequence of words, we cannot use the gready search, which might cann’t generate a real sentence.

We use the 【Beam Search】.

We draw attention to the “encoder-decoder” models  that learn a function that maps  x  into a fixed-size
 vector and then uses a language model to “decode”
 that vector into a sequence of words,

Model: K&B2013

A simpal of Encoder – just cumsum(very easy)

A simpal of Encoder – CSM Encoder:use CNN to encode

The Decoder – RNN Decoder

The cal graph is.

Sutskever et al. Model (2014):

- Important.Classic Model

Cal Graph:

Some Tricks to Sutskever et al. Model :

  • Read the Input Sequence ‘backwards’: +4BLEU

  

  • Use an ensemble of m 【independently trained】 models (at the decode period) :
  1. Ensemble of 2 models: +3 BLEU
  2. Ensemble of 5 models: +4.5 BLEU

    For example:

      

  • we want to find the most probable (MAP) output
 given the input,i,e.

      

  We use the beam search : +1BLEU

    For example,the beam size is 2:

      

Example of A Application: Image caption generation

Encoder:CNN

Decoder:RNN or

conditional n-gram LM(different to the RNN but it is useful)

We must have some datasets already.

Kiros et al. Model has done this.

.

【NLP】Conditional Language Models的更多相关文章

  1. 【NLP】Conditional Language Modeling with Attention

    Review: Conditional LMs Note that, in the Encoder part, we reverse the input to the ‘RNN’ and it per ...

  2. [转]【NLP】干货!Python NLTK结合stanford NLP工具包进行文本处理 阅读目录

    [NLP]干货!Python NLTK结合stanford NLP工具包进行文本处理  原贴:   https://www.cnblogs.com/baiboy/p/nltk1.html 阅读目录 目 ...

  3. 【NLP】Tika 文本预处理:抽取各种格式文件内容

    Tika常见格式文件抽取内容并做预处理 作者 白宁超 2016年3月30日18:57:08 摘要:本文主要针对自然语言处理(NLP)过程中,重要基础部分抽取文本内容的预处理.首先我们要意识到预处理的重 ...

  4. 【NLP】前戏:一起走进条件随机场(一)

    前戏:一起走进条件随机场 作者:白宁超 2016年8月2日13:59:46 [摘要]:条件随机场用于序列标注,数据分割等自然语言处理中,表现出很好的效果.在中文分词.中文人名识别和歧义消解等任务中都有 ...

  5. 【NLP】基于自然语言处理角度谈谈CRF(二)

    基于自然语言处理角度谈谈CRF 作者:白宁超 2016年8月2日21:25:35 [摘要]:条件随机场用于序列标注,数据分割等自然语言处理中,表现出很好的效果.在中文分词.中文人名识别和歧义消解等任务 ...

  6. 【NLP】基于机器学习角度谈谈CRF(三)

    基于机器学习角度谈谈CRF 作者:白宁超 2016年8月3日08:39:14 [摘要]:条件随机场用于序列标注,数据分割等自然语言处理中,表现出很好的效果.在中文分词.中文人名识别和歧义消解等任务中都 ...

  7. 【NLP】基于统计学习方法角度谈谈CRF(四)

    基于统计学习方法角度谈谈CRF 作者:白宁超 2016年8月2日13:59:46 [摘要]:条件随机场用于序列标注,数据分割等自然语言处理中,表现出很好的效果.在中文分词.中文人名识别和歧义消解等任务 ...

  8. 【NLP】条件随机场知识扩展延伸(五)

    条件随机场知识扩展延伸 作者:白宁超 2016年8月3日19:47:55 [摘要]:条件随机场用于序列标注,数据分割等自然语言处理中,表现出很好的效果.在中文分词.中文人名识别和歧义消解等任务中都有应 ...

  9. 【NLP】Recurrent Neural Network and Language Models

    0. Overview What is language models? A time series prediction problem. It assigns a probility to a s ...

随机推荐

  1. react中的路由配置踩坑记

    react 路由配置中,如果根路由(/)匹配一个组件,另一个路由(/list)在进行匹配的时候也会匹配到根路由(/),即在 /list 页面展示的时候 / 页面总是展示在上方. 此时如果想进行严格匹配 ...

  2. js 递归修改json无限级key值

    var tree = [ { name: 'node1' }, { name: 'node2', children: [{ name: 'node-2-1' }, { name: 'node2-2' ...

  3. 怎么使用Fiddler进行抓包

    启动Fiddler,打开菜单栏中的 Tools > Fiddler Options,打开“Fiddler Options”对话框.      在Fiddler Options”对话框切换到“Co ...

  4. java基础知识总结一:

      四种内部类 直接抛出异常 单例模式: 懒汉式单例.饿汉式单例.登记式单例     []关于内部类:  []关于异常: 直接捕捉并抛出异常:不需要给异常添加名字: if(i>10)throw ...

  5. 测者的性能测试手册:Web压力测试工具webbench

    webbench最多可以模拟3万个并发连接去测试网站的负载能力,个人感觉要比Apache自带的ab压力测试工具好,安装使用也特别方便. 1.适用系统:Linux 2.编译安装: wget http:/ ...

  6. TomCat的安装及测试

    1.每个版本的安装都是一样,解压之后是一个文件夹 2.配置环境变量,右击我的电脑,属性--高级属性设置--环境变量--新建--配path即可(path后加;%CATALINA_HOME%\bin;) ...

  7. Linux 环境下 Git 安装与基本配置

    索引: 目录索引 参看代码 GitHub: git.txt 一.Linux (DeepinOS) 环境 1.安装 sudo apt-get update sudo apt-get install gi ...

  8. SC命令

    描述:         SC 是用来与服务控制管理器和服务进行通信         的命令行程序. 用法:         sc <server> [command] [service n ...

  9. Linux 中磁盘阵列RAID10损坏以及修复

    在Linux 中磁盘阵列RAID10配置中我们已经正确配置了RAID10 ,一般来说在RAID10中最多允许50%的磁盘损毁,当然除了,同一磁盘RAID1中的硬盘设备全部损毁. 这次我们讨论一下:假设 ...

  10. Redis操作list

    来自:http://www.cnblogs.com/alex3714/articles/6217453.html List操作,redis中的List在在内存中按照一个name对应一个List来存储. ...