NLP-Beginner 任务三:基于注意力机制的文本匹配
本次实战先初步介绍+贴代码,更多细节以后会补充。
传送门
参考论文:Enhanced LSTM for Natural Language Inference
一. 介绍
1.1 任务简介
本次的NLP(Natural Language Processing)任务是论文提出的中的ESIM模型文本进行匹配。
1.2 数据集
训练集共有55万余项,语言为英文,匹配关系共有四种:蕴含(Entailment),矛盾(Contradiction),中立/不冲突(Neutral),未知(-)(注:未知关系在数据里出现得很少)。
例子:
输入文本: A man inspects the uniform of a figure in some East Asian country.
输入假设: The man is sleeping.
输出: 矛盾(C)
输入文本: An older and younger man smiling.
输入假设: Two men are smiling and laughing at the cats playing on the floor.
输出: 中立(N)
输入文本: A black race car starts up in front of a crowd of people.
输入假设: A man is driving down a lonely road.
输出: 矛盾(C)
输入文本: A soccer game with multiple males playing.
输入假设: Some men are playing a sport.
输出: 蕴含(E)