自然语言处理中的下游任务与机器翻译
1. 下游NLP任务
在自然语言处理(NLP)中,有许多下游任务可以通过预训练的Transformer模型来完成。以下是一些常见的下游任务及其示例。
1.1 CoLA数据集上的BERT微调
可以通过运行相关代码查看在CoLA数据集上微调的BERT模型。
#@title Loading the Dataset
#source of dataset : https://nyu-mll.github.io/CoLA/
import pandas as pd
df = pd.read_csv("in_domain_train.tsv", delimiter='\t', header=None,
names=['sentence_source', 'label', 'label_notes', 'sentence'])
df.shape
#@title Loading the Hugging Face Bert Uncased Base Model
from transformers import BertForSequenceClassification
model = BertForSequenceClassification.from_pretrained("bert-base-uncased",
num_labels=2)
这里使用的评估指标是MCC(Matthews Correlation Coefficient)。
超级会员免费看
订阅专栏 解锁全文
1846

被折叠的 条评论
为什么被折叠?



