【NLP】How to Generate Embeddings?
How to represent words.
0 .
Native represtation: one-hot vectors
Demision: |all words|
(too large and hard to express senmatic similarity)
Idea:produce dense vector representations based on the context/use of words
So, there are Three main approaches:
1.
Count-based methods
(1) Define a basis vocabulary C(lower than all words dimision) of context words(expect:the、a、of…)
(2) Define a word window size W
(3) Count the basis vocabulary words occurring W words to the left or right of each instance of a target word in the corpus
(4) From a vector represtation of the target word based on these counts
Example-express:
We can calculate the similarity of two words using inner product or cosine.
For instance.
2.
Neural Embedding Models(Main Idea)
To generate an embedding matrix in R(|all words| * |context words|) which looks like:
(count based vectors)
Rows are word vectores.
We can retrieve a certain word vector with one-hot vector.
(One)generic idea behind embedding learning:
(1) Collect instances ti∈inst(t) of a word t of vocab V
(2) For each instance, collect its context word c(ti) (e.g.k-word window)
(3) Define some score function score(ti,c(ti),θ,E) with upper bound on output
(4) Define a loss
(5) Estimate:
(6) Use the estimated E as the embedding matrix
Attention:
Scoring function estimates whether a sentence(or the object word and its context) is said or used normally by a people,so the higher the score,the more likely it is.
3.
C&W
Firstly,we embed all words in a sentence with E.
Then,sentence(w1,w2,w3,w4,w5) goes through a convolution layer(maybe just simpal connection layer).
Then,it goes through a simpal MLP.
Then,it goes through the ‘scorer’layer and output the final Score.
Minimize the loss function(!),and use the parameter matrix of input layer and ..
4. Word2Vec
1) CBoW(contextual bag of words)
2) Skip-gram:
【NLP】How to Generate Embeddings?的更多相关文章
- 【NLP】前戏:一起走进条件随机场(一)
前戏:一起走进条件随机场 作者:白宁超 2016年8月2日13:59:46 [摘要]:条件随机场用于序列标注,数据分割等自然语言处理中,表现出很好的效果.在中文分词.中文人名识别和歧义消解等任务中都有 ...
- 【NLP】基于自然语言处理角度谈谈CRF(二)
基于自然语言处理角度谈谈CRF 作者:白宁超 2016年8月2日21:25:35 [摘要]:条件随机场用于序列标注,数据分割等自然语言处理中,表现出很好的效果.在中文分词.中文人名识别和歧义消解等任务 ...
- 【NLP】基于机器学习角度谈谈CRF(三)
基于机器学习角度谈谈CRF 作者:白宁超 2016年8月3日08:39:14 [摘要]:条件随机场用于序列标注,数据分割等自然语言处理中,表现出很好的效果.在中文分词.中文人名识别和歧义消解等任务中都 ...
- 【NLP】基于统计学习方法角度谈谈CRF(四)
基于统计学习方法角度谈谈CRF 作者:白宁超 2016年8月2日13:59:46 [摘要]:条件随机场用于序列标注,数据分割等自然语言处理中,表现出很好的效果.在中文分词.中文人名识别和歧义消解等任务 ...
- 【NLP】条件随机场知识扩展延伸(五)
条件随机场知识扩展延伸 作者:白宁超 2016年8月3日19:47:55 [摘要]:条件随机场用于序列标注,数据分割等自然语言处理中,表现出很好的效果.在中文分词.中文人名识别和歧义消解等任务中都有应 ...
- 【NLP】Tika 文本预处理:抽取各种格式文件内容
Tika常见格式文件抽取内容并做预处理 作者 白宁超 2016年3月30日18:57:08 摘要:本文主要针对自然语言处理(NLP)过程中,重要基础部分抽取文本内容的预处理.首先我们要意识到预处理的重 ...
- [转]【NLP】干货!Python NLTK结合stanford NLP工具包进行文本处理 阅读目录
[NLP]干货!Python NLTK结合stanford NLP工具包进行文本处理 原贴: https://www.cnblogs.com/baiboy/p/nltk1.html 阅读目录 目 ...
- 【NLP】Conditional Language Models
Language Model estimates the probs that the sequences of words can be a sentence said by a human. Tr ...
- 【NLP】干货!Python NLTK结合stanford NLP工具包进行文本处理
干货!详述Python NLTK下如何使用stanford NLP工具包 作者:白宁超 2016年11月6日19:28:43 摘要:NLTK是由宾夕法尼亚大学计算机和信息科学使用python语言实现的 ...
随机推荐
- Spring Cloud 入门教程(八): 断路器指标数据监控Hystrix Dashboard 和 Turbine
1. Hystrix Dashboard (断路器:hystrix 仪表盘) Hystrix一个很重要的功能是,可以通过HystrixCommand收集相关数据指标. Hystrix Dashboa ...
- [CF1137E]Train Car Selection[维护凸壳]
题意 题目链接 分析 首先,如果加到了车头所有之前的车厢都不可能成为答案. 如果加到了车尾,容易发现对于 \(x_2<x_3\) 而言在某个时刻会出现 2 又比 3 优的情况. 具体来讲,如果存 ...
- Js获取当前页面URL各种参数
JS获取当前页面URL各种参数 一:Location Location 对象包含有关当前 URL 的信息. Location 对象是 Window 对象的一个部分,可通过 window.locatio ...
- Signalr实现消息推送
一.前言 大多数系统里面好像都有获取消息的功能,但这些消息来源都不是实时的,比如你开两个浏览器,用两个不同的账号登录,用一个账号给另外一个账号发送消息,然而并不会实时收到消息,必须要自己手动F5刷新一 ...
- Java类的加载及实例的创建
java中class.forName()和classLoader都可用来对类进行加载.class.forName()前者除了将类的.class文件加载到jvm中之外,还会对类进行解释,执行类中的sta ...
- ASP.NET MVC5+EF6+EasyUI 后台管理系统-WebApi的用法与调试
1:ASP.NET MVC5+EF6+EasyUI 后台管理系统(1)-WebApi与Unity注入 使用Unity是为了使用我们后台的BLL和DAL层 2:ASP.NET MVC5+EF6+Easy ...
- navicat 和 pymysql
---------------------------------------------------相信时间的力量,单每月经过努力的时间,一切的安排都是懊脑的安排. # # ------------ ...
- UnderWater+SDN论文之二
---- Software-defined underwater acoustic networking platform and its applications source: Ad Hoc Ne ...
- 实现h5中radio单击取消与选中
<input type = "radio" id = "raid" name = "raname" checked = 'checke ...
- html总结:表格中的文字居中
<style> table { text-align:center; } </style>