自然语言相关(0)—— 任务介绍nlp tasks
自然语言相关(0)—— 任务介绍nlp tasks
基础
-
token
可能是字母、单词等等等 -
Downstream tasks:
Downstream tasks is what the field calls those supervised-learning tasks that utilize a pre-trained model or component.
任务
Part-of-Speech(POS) tagging 是否有必要 前处理
为句子中的每个词汇进行 词性标注
可以将这个结果输入到down stream model. 如果down stream的模型够强大并不需要pos tagging .
Word segmentation 是否有必要 前处理
分词,尤其是对中文而言,需要进行分词
这就可以是用模型来对each token进行分类,来学习词汇的边界
将结果输入到down stream model
Parsing 是否有必要 前处理
-
constituency parsing
-
dependency parsing
被当作一种额外的输入到down stream model
Coreference Resolution 指代消解 前处理
一段文字中,哪些词是指代同一个东西
被当作一种额外的输入到down stream model
Summarization 摘要
-
extractive summarization 直接从文章中提取句子来作为摘要
input: sequence output: class for each token
在这里一个句子是一个token,简单的说,就是将一篇文章中的语句进行二分类(是否提取出来)
-
abstractive summarization 不直接从文章提取
input:long sequence output: short sequence
notice: model (copy is encouraged)
machine translation 翻译
sequence to sequence
notice:Unsupervised machine translation is a critical research direction
grammar error correction 文法检查
sequence to sequence
notice: copy is encouraged
简单的做法看作是输入sequence,然后输出每一个token(word)的class(不变、替换、后方添加等)
sentiment classification 情感分类
输入一段文字输出是正面还是负面的
sequence to class
stance detection 立场侦测 [Used in Veracity Prediction 一般用于事实侦破]
two sequences -> class
labels: SDQC Support, Denying, Querying, and Commenting
Veracity Prediction
several sequences [post\replies\wikipedia] -> class
Natural Language Inference (NLI)
一个前提,一个假设 -> 矛盾contradiction\蕴含 entailment \中性 neutral
two sequence -> class
search engine 搜索引擎
two sequences -> class
输入的句子和库里的文章进行比对,输出是否相关 relevant
note: 谷歌说bert已经用到了现在的搜索引擎,和之前的算法模型相比,bert可以知道相同的一个词汇在不同的语境下面的区别,使搜索更加准确。
question answering 问答
在深度学习之前,QA的架构
现在的解决方案可以看作 seceral sequences -> sequence
距离上面的路还有很长的时间要走,现在主要用的QA是extractive QA,输入问题和包含答案的文章,然后输出是答案的文章中的index (强copy )
Dialogue 对话
several sequence to sequence 需要记得之前的话
-
chatting dialogue
-
task-oriented dialogue 比如订房等
为了得到更好的效果,将模型切分。
Natural Language Generation (NLG) 文本生成
文本生成,根据一些action等关键词汇,来生成相应便于理解的文本
Natural Language Understanding (NLU) 文本理解
对文本进行理解分析,从中获得想要的信息,可以给文件进行分类 sequence ->class 也可以进行slot filling 对每一个token进行分类
-
Intent Classification
-
Slot Filling
Knowledge Extraction 知识提取
比较火的研究方向,简单地说,从一些非结构化的文本数据提取出有用的信息,提取实体(entity),提取实体之间的关系(relation)。[warning: The description oversimplifies the task]
Name Entity Recognition (NER) 命名实体识别
Input: sequence
Output: class for each token (just like POS tagging,slot filling)
Relation Extraction 关系提取
可以简单的看成是分类问题,事先定义一些关系。然后将文本以及要提取关系的实体一同输入模型中,得到他们之间的关系(包括None)
评测
GLUE: General Language Understanding Evaluation
主页: https://gluebenchmark.com/
CLUE: Chinese Language Understanding Evaluation
中文版GLUE
主页: https://www.cluebenchmarks.com/
Super GLUE
增强版的GLUE
主页:https://super.gluebenchmark.com/
DecaNLP
使用一个模型来解决10个不同的nlp任务,这里面的想法感觉还是很有意思的,将不同的任务都看成是QA任务。
ref
此文是学习李宏毅老师Deep Learning for Human Language Processing (2020,Spring)的一个简单的笔记介绍。推荐大家去观看李宏毅老师的课程,老师很幽默也很适合小白入门。
老师相关课程lis: https://speech.ee.ntu.edu.tw/~tlkagk/courses.html
此文来自的ppt:NLP tasks