论文阅读《An Effective Transition-based Model for Discontinuous NER》

0.总结

  • 使用transition-based model。这种model 使用传统数据结构(stack )作为基础,自定义栈的操作类型,从而达到一个 entity recognization 的效果
  • 如果需要本文对应的ppt,可以从我的GitHub中获取哇~
  • 文章来源:CSDN@LawsonAbs

本博客分成三部分:

  • part1是论文笔记,主要是概括论文的主要内容;
  • part2采用问答的方式来解答可能对论文产生疑问的地方;
  • part3部分是对如何实现论文的细节探讨。

PART1论文笔记

在这里插入图片描述在这里插入图片描述
在这里插入图片描述在这里插入图片描述这意思就是:可以通过添加细粒度的实体,从而将一个discontinuous NER 问题转换成一个 nested NER 问题。下面以文中的例子来说明这个问题:
重新添加:Body Location General Feeling 两个细粒度的实体,加上原本的Adverse drug event实体名,那么就可以将之前单纯的Discontinuous NER变成了一个Nested NER问题。这也就说明二者本质上是可以相互转换的(作者应该就是想表示这个意思)

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述这里先假设向量 c i c_i ci的维度是n。

在这里插入图片描述
在这里插入图片描述
下面详细说一下 s i a = s o f t m a x ( s i T W i a B ) B s_i^a = softmax(s_i^TW_i^aB)B sia=softmax(siTWiaB)B 公式中各个变量的含义:

  • s i s_i si is the vector representation of a span, so you can imagine s i ∈ R d s_i \in R^d siRd.
  • B B B is a sequence of vectors, each of which represents a token in the buffer. so the shape is B ∈ R d × l B \in R^{d \times l} BRd×l 【那么这里的 l l l就是buffer 中tokens 的个数】
  • the W a W_a Wa has the shape of R d × d R^{d \times d} Rd×d, the formula S i T W a B S_i^T W_aB SiTWaB part will get the annotation weights, whose shape is R 1 × l R^{1 \times l} R1×l.
  • And the final s a s_a sa has the shape of R 1 × d R^{1 \times d} R1×d.

作者站在attention的角度描述了一下上面这个公式,如下文:

An alternative explanation if you are familiar with attention:
you can imagine s i s_i si is the query vector, B plays the role of both key vectors and value vectors.
and the s a s_a sa is the weighted sum of B (value vectors), whose weights are calculated based on the correlation between key ( s i s_i si) and query vector (B).

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

PART2疑问

1. 该用什么数据集?什么部分?

下载得到的 CADEC,解压后得到的文件夹如下所示:
在这里插入图片描述
那么是用v1,还是v2?
在这里插入图片描述

  • 使用CADEC.v2文件夹中的数据即可。
  • 但是即使在上述的文件夹中的数据仍然数据量比较大,所以作者只取了ADE的部分
    在这里插入图片描述
    但是不清楚是否是因为typo,原作者写成了 ADR。

2.预处理数据的作用是什么?效果是什么?

待更新~

3.其它准备工作

主要是语料库的下载。

  • 需要下载elmo 模型和训练结果,下载地址为:https://allennlp.org/elmo。主要是下载weights 和options 两个文件
    在这里插入图片描述将下载得到的文件放到目录:/data/dai031/Corpora/ELMo/elmo_2x4096_512_2048cnn_2xhighway_5.5B 下。

  • 需要下载glove算法预训练得到的embedding信息,也就是文件glove.6B.100d.txt:可以在 https://www.kaggle.com/danielwillgeorge/glove6b100dtxt 中下载得到。

PART3代码实现

在加载文件 glove.6B.100d.txt 时不动代码卡住不动了:
在这里插入图片描述这个问题该怎么解决呢?

发现自己的确是个zz(原作者也不按常理出牌啊),把日志直接写到文件中了,而没有在窗口中输出。

文件地址如下:
在这里插入图片描述日志输出过程(训练有点儿慢)如下:
在这里插入图片描述

评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

说文科技

看书人不妨赏个酒钱?

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值