My solution to cs224n assignment3
来源:互联网 发布:高达网络限定 编辑:程序博客网 时间:2024/06/05 02:01
My solution
a primer on NER
NER(Named entity recognition)命名实体识别是一种序列标注问题,
输入一个句子,输出一个标注的序列。
标注的种类有:
- Person (PER) (He or she are not considered named entities.)
- Organization (ORG)
- Location (LOC)
- Miscellaneous (MISC) (杂项)
- O(不是命名实体)
标注的评价指标:
对于非空的标注,计算Recall, Precision, F1-score(如果直接计算全体标注正确率,会因为O比较多造成较大干扰)。
另外有entity-level评价指标:
也就是说计算entitiy的Recall, Precision和F1-score的值,那么只有在一个词组全部标注对的时候,才算标注正确了这个entity。
更全面的刻画是confusion matrix,例如:
window into NER
最简单的思路是根据window里的x直接通过一个神经网络来预测。
以下为一些问题和解答:
(a)混淆
Q: Provide 2 examples of sentences containing a named entity with an ambiguous type
A: 这个问题只是举例子,比较简单,这个问题说明命名实体识别存在歧义,答案给的句子是:
“Spokesperson for Levis, Bill Murray, said … “, where it is ambiguous whether Levis is a person or an organization.
“Heartbreak is a new virus,” where Heartbreak could either be a MISC named entity (it’s actually the name of a virus), or simply a noun.
Q: Why might it be important to use features apart from the word itself to predict named entity labels?
A: 因为很多时候有些普通名词可能是一个组织,很多时候人名也可能是组织,所以说,单凭单个单词没有办法获得全部信息,需要结合周围语境综合判断,这就是window的出发点。
Q: Describe at least two features (apart from the word) that would help in predicting whether a word is part of a named entity or not.
A: 例如单词的大小写情况,以及词性,前后缀之类的。
(b)维度和时间复杂度分析
比较简单,略。
(c)(d)代码和分析
代码实现略,另外如果在IDE中,注意设置命令行参数。
分析的结果是给出混淆矩阵,ORG容易被误识成PER。
2.3.RNN/GRU for NER
RNN, GRU模型应用于序列标注问题比较常见了,下面是几个注意点。
没法把F1-score直接作为损失函数
因为F1-score涉及整语料,而且是离散的不可导,所以F1-score没法直接作为损失函数而采用交叉熵损失函数。
检查梯度和预训练RNNs的方法
课件里有涉及到。
GRU模拟自动机的习题
assignment里涉及了GRU模拟自动机的习题,主要是不等式操作,比较简单。这给了一个预训练的思路,先给出大致的自动机模型,预训练参数按照不等式随即设置。
- My solution to cs224n assignment3
- My solution to cs224n assignment2
- My solution to cs224n assignment1(1-2)
- My solution to cs224n assignment1(3-4)
- My Solution to Project Euler in Ruby
- My Solution to Project Euler in Perl
- My Solution to Project Euler in JavaScript
- assignment3
- leetcode Sum Root to Leaf Numbers my Solution
- TopCoder SRM280 -- My Solution
- TopCoder SRM285 -- My Solution
- My Solution: Word Ladder
- LeetCode : atoi My solution
- Triangle LeetCode |My solution
- LeetCode Anagrams My solution
- solution of my error
- My solution to:MySQL triggers cannot update the same row that the trigger is assigned to.
- leetcode Intersection of Two Linked Lists My Submissions Question Solution Total Accepted: 43555 To
- 怎么样分析表或索引
- Excel文档导出和导入
- jQuery Mobile中图标icon样式大全ui-icon-*
- hdu 1671 STL
- mysql insert锁机制
- My solution to cs224n assignment3
- 软件设计师经验分享
- jQuery Mobile中主题theme样式a-z
- python 列输出转为行输出
- 类的魔法方法
- CBO (基于代价的优化方式)
- jQuery Mobile中网格grid样式ui-grid-*
- MySQL innodb的锁机制解读
- Hql连接查询的两个错误(Path expected for join!和unexpected token on)