Giter Club home page Giter Club logo

Comments (4)

smallv0221 avatar smallv0221 commented on May 23, 2024

你可以在这里找到Dureader robust的数据集代码
https://github.com/PaddlePaddle/models/blob/release/2.0-beta/PaddleNLP/paddlenlp/datasets/squad.py
你应该需要继承Dureader robust数据集并且重写_read()方法,按照你的数据文件格式读入,最后也返回SquadExample就可以,没有qas_id的话可以在读入数据的时候加一个简单的递增的id。但是要训练的话只有问句和文本可能不够吧,还得有答案。

from paddlenlp.

Minjuner-97 avatar Minjuner-97 commented on May 23, 2024

你可以在这里找到Dureader robust的数据集代码
https://github.com/PaddlePaddle/models/blob/release/2.0-beta/PaddleNLP/paddlenlp/datasets/squad.py
你应该需要继承Dureader robust数据集并且重写_read()方法,按照你的数据文件格式读入,最后也返回SquadExample就可以,没有qas_id的话可以在读入数据的时候加一个简单的递增的id。但是要训练的话只有问句和文本可能不够吧,还得有答案。

您好,谢谢~ 目前我把自己的数据(问句,文本,答案)改成了源数据的格式并进行了替换,其中id是0到len(data)的一个数字递增,squad.py中更改了md5码。这样应该也可行吧~

from paddlenlp.

smallv0221 avatar smallv0221 commented on May 23, 2024

可以的,而且你如果是使用本地数据集用--data_path传入的话可以不用管md5.

from paddlenlp.

Minjuner-97 avatar Minjuner-97 commented on May 23, 2024

已解决,如使用自己的数据,可以将数据输入默认路径,但是需要在squad.py中改一下md5码(因为代码会核对md5,若不对应则会自动下载自带的原始数据。);指定--data_path路径也是如此。

from paddlenlp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.