Skip to Main Content
弱监督学习实用指南
book

弱监督学习实用指南

by Wee Hyong Tok, Amit Bahree, Senja Filipi
January 2023
Beginner to intermediate content levelBeginner to intermediate
209 pages
3h 55m
Chinese
Southeast University Press
Content preview from 弱监督学习实用指南
使用
Snorkel
标记的数据集进行文本分类
131
#
转化为张量
train_input_ids_tensor =
torch.tensor(tokenized_train["input_ids"])
train_attention_mask_tensor =
torch.tensor(tokenized_train["attention_mask"])
train_labels_tensor = torch.tensor(y_train.to_list())
val_input_ids_tensor =
torch.tensor(tokenized_validation ["input_ids"])
val_attention_mask_tensor =
torch.tensor(tokenized_validation ["attention_mask"])
val_labels_tensor = torch.tensor(y_val.to_list())
模型训练
在开始微调
RoBERTa
模型之前,我们将为训练和验证数据创建
DataLoader
DataLoader
将在模型的微调过程中使用。要做到这一点,我们首先将
inputs_
ids
attention_mask
labels
转换为
TensorDataset
。接下来,我们将使
TensorDataset
作为输入创建
DataLoader
,并指定
batch_size
的大小。
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar
解密金融数据

解密金融数据

Justin Pauley
C++语言导学(原书第2版)

C++语言导学(原书第2版)

本贾尼 斯特劳斯特鲁普

Publisher Resources

ISBN: 9787576602630