其实我对token不是很了解.. 当我阅读 googleresearch/bert model 时,我看到了这些词。
# 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.
谁能举个关于token级和segment级分类的例子?
最佳答案
段级分类意味着每个段都有一个标签,例如,一个分类器将电影评论分类为好或坏。整个输入序列只有一个输出标签。
标记级分类意味着每个标记都将被赋予一个标签,例如,词性标注器会将每个词分类为一个特定的词性。每个标记(序列中的元素)将在输出中具有相应的标签。
如果您不确定 token 是什么,可以先将其视为句子中的每个单词,但为了更正确,请查看 https://nlp.stanford.edu/IR-book/html/htmledition/tokenization-1.html .根据您对文本进行标记化和预处理的方式,标记可以是单词、标点符号、特殊标记、子词级符号等。
关于python - NLP 任务中的 token-level 和 segment-level 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53444377/