Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
这篇介绍datasets类,也是hugging face写的,集成了好多数据集
! pip install datasets
本次介绍了GLUE任务中的一个数据集mrpc
正如输出写的那样,是个dict,我们可以得到其元素
然后预处理数据集
正如文档写的那样,可以接收两个参数
为了保持数据仍为数据集的格式,我们使用dataset.map函数 增加了3列
因为text长度不一样,我们采用动态填充
参考: https://huggingface.co/course/chapter3/2?fw=pt