NLP任务中token-level和segment-level有什么区别?

Mon*_*ana 2 python nlp tensorflow

其实我对token不太了解。当我阅读googleresearch/bert模型时,我看到了这些词。

# In the demo, we are doing a simple classification task on the entire   
# segment.  
#   
# If you want to use the token-level output, use model.get_sequence_output()   # instead.
Run Code Online (Sandbox Code Playgroud)

谁能举一个关于令牌级和段级分类的例子吗?

Pro*_*yag 6

片段级分类意味着每个片段都有一个标签,例如将电影评论分类为好或坏的分类器。整个输入序列只有一个输出标签。

标记级分类意味着每个标记都会被赋予一个标签,例如词性标注器会将每个单词分类为一个特定的词性。每个标记(序列中的元素)将在输出中具有相应的标签。

如果您不确定标记是什么,您可以首先将其视为句子中的每个单词,但为了更正确,请查看https://nlp.stanford.edu/IR-book/html/htmledition /tokenization-1.html。根据您对文本进行标记和预处理的方式,标记可以是单词、标点符号、特殊标记、子词级符号等。