Navigation

    Gpushare.com

    • Register
    • Login
    • Search
    • Popular
    • Categories
    • Recent
    • Tags

    【4】transformers简介

    技术交流
    1
    1
    42
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 188****7632
      188****7632 last edited by

      这篇介绍datasets类,也是hugging face写的,集成了好多数据集

      ! pip install datasets
      

      本次介绍了GLUE任务中的一个数据集mrpc

      正如输出写的那样,是个dict,我们可以得到其元素

      然后预处理数据集


      正如文档写的那样,可以接收两个参数

      为了保持数据仍为数据集的格式,我们使用dataset.map函数

      增加了3列

      因为text长度不一样,我们采用动态填充

      参考:
      https://huggingface.co/course/chapter3/2?fw=pt

      1 Reply Last reply Reply Quote 2
      • First post
        Last post