论文笔记:Neural Architectures for Named Entity Recognition

本文详细探讨了使用双向LSTM生成的分数矩阵在CRF(条件随机场)模型中的作用,介绍了如何计算词级别的得分和序列预测概率,以及如何通过最大似然估计来优化正确标签序列。重点讲解了从状态转移概率矩阵中进行的序列预测和概率计算过程。

Neural Architectures for Named Entity Recognition

2.3 CRF Tagging Models

  • Input sentence: X=(X1,X2,...,XN)\mathbf{X}=\mathbf{(X_1,X_2,...,X_N)}X=(X1,X2,...,XN)

  • Matrix of scores (output by BiLSTM) : P∈Rn×k\mathbf{P}\in \mathbb{R}^{n\times k}PRn×k

    -Score of the jthj^{th}jth of ithi^{th}ithword in a sentence : Pi,jP_{i,j}Pi,j

  • The numbers of distinct tags: kkk

  • Sequence of predictions: y=(y1,y2,...,yn)\mathbf{y}=(y_1,y_2,...,y_n)y=(y1,y2,...,yn)

y\mathbf{y}y's score: s(X,y)=∑i=0nAyi,yi+1+∑i=0nPi,yis(\mathbf{X}, \mathbf{y})=\sum\limits_{i=0}^nA_{y_i,y_{i+1}}+\sum\limits_{i=0}^nP_{i,y_i}s(X,y)=i=0nAyi,yi+1+i=0nPi,yi

  • Matrix of transition scores: A∈R(k+2)×(k+2)A \in \mathbb{R}^{(k+2) \times(k+2)}AR(k+2)×(k+2)

    • score of a transition from the tag iii to tag jjj: Ai,jA_{i,j}Ai,j
    • start and end tag: y0,yny_0, y_ny0,yn

Probability for the sequence y\mathbf{y}y:

p(y∣X)=es(X,y)∑y~∈Yxes(X,y~)p(\mathbf{y}|\mathbf{X})=\frac{e^{s(\mathbf{X}, \mathbf{y})}}{\sum_{\tilde{y}}\in\mathbf{Y_x}e^{s(\mathbf{X}, \mathbf{\tilde{y}})}}p(yX)=y~Yxes(X,y~)es(X,y)

Maximize the log_probability of the correct tag sequence:

log(p(y∣X))=s(X,y)−log(∑y~∈Yxes(X,y~)=s(X,y)−logaddy~∈Yxs(X,y~)log(p(\mathbf{y}|\mathbf{X}))={s(\mathbf{X}, \mathbf{y})}-log(\sum\limits_{{\tilde{y}}\in\mathbf{Y_x}}e^{s(\mathbf{X}, \mathbf{\tilde{y}}})=s(\mathbf{X}, \mathbf{y})-{logadd}_{\tilde{y}\in\mathbf{Y_x}} s(\mathbf{X}, \mathbf{\tilde{y}})log(p(yX))=s(X,y)log(y~Yxes(X,y~)=s(X,y)logaddy~Yxs(X,y~)

  • All possible tag sequences for a sentence X\mathbf{X}X: YX\mathbf{Y_X}YX

Predict the output sequence by:

y∗=argmaxy~∈YXs(X,y~)\mathbf{y}^*=argmax_{\tilde{y}\in \mathbf{Y_X}} s(\mathbf{X}, \mathbf{\tilde{y}})y=argmaxy~YXs(X,y~)

### 关于命名实体识别 (NER) 的最新研究论文推荐 以下是几篇在命名实体识别领域具有代表性和影响力的最新研究论文: #### 1. **BERT-based Models for Named Entity Recognition** BERT及其变体模型已经在多个自然语言处理任务中表现出色,尤其是在命名实体识别方面。最新的研究表明,结合上下文表示的预训练语言模型能够显著提升NER的效果[^1]。 论文推荐: - *Fine-Tuning Pretrained Language Models for Named Entity Recognition*:该文章探讨了如何微调预训练的语言模型(如BERT)以适应不同的NER任务,并提出了针对不同场景的有效策略。 #### 2. **Bi-LSTM-CRF Model Enhancements** Bi-LSTM-CRF 是一种经典的序列标注模型,在许多实际应用中仍然占据重要地位。然而,研究人员不断对其进行改进,例如引入注意力机制或优化CRF层的设计[^4]。 论文推荐: - *Attention-Based Bidirectional LSTM with Conditional Random Fields for Chinese Named Entity Recognition*:这篇文章介绍了如何利用注意力机制增强传统的Bi-LSTM-CRF架构,从而提高中文NER的表现。 #### 3. **IDCNN + CRF Architectures** IDCNN是一种基于卷积神经网络的结构,相较于RNN系列模型,它可以实现更快的并行计算。尽管如此,由于池化和上采样的操作可能导致信息丢失,因此需要进一步优化[^5]。 论文推荐: - *A Novel Neural Network Architecture Combining IDCNN and CRF for Efficient Sequence Labeling Tasks Including NER*:此研究提出了一种新的组合方式,试图减少信息损失的同时保持高效性能。 #### 4. **Cross-Domain Adaptation in NER** 跨域适配是当前NER研究的一个热点方向,特别是在面对少量标记数据的情况下。迁移学习技术和自监督方法被广泛应用于此情境下。 论文推荐: - *Adapting to New Domains with Minimal Supervision via Transfer Learning Techniques Applied on NER Systems*: 探索了当目标领域缺乏充足标签资源时,如何有效运用源领域的知识完成跨域NER任务。 #### 5. **Multilingual NER Research** 随着全球化进程加快,多语言支持成为必要条件之一。一些前沿工作致力于构建统一框架来处理多种语言环境下的实体识别问题。 论文推荐: - *XLM-R: Multilingual Pretraining of a Robust Cross-Language Transformer for Global NER Applications*: XLM-R作为一款强大的多语言预训练模型,在国际范围内的NER项目中有广泛的应用潜力。 --- ```python import torch from transformers import BertTokenizer, BertForTokenClassification tokenizer = BertTokenizer.from_pretrained('bert-base-cased') model = BertForTokenClassification.from_pretrained('dbmdz/bert-large-cased-finetuned-conll03-english') def predict_entities(text): inputs = tokenizer.encode_plus( text, return_tensors="pt", padding=True, truncation=True ) outputs = model(**inputs)[0] predictions = torch.argmax(outputs, dim=2) tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0]) entities = [(token, prediction.item()) for token, prediction in zip(tokens, predictions)] return entities text = "Apple is looking at buying U.K. startup for $1 billion" entities = predict_entities(text) print(entities) ``` --- ###
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值