Giter Site home page Giter Site logo

chinese_extraction_mrc_b9c6's Introduction

项目说明

项目是基于Pytorch + BERT做的一个抽取式中文机器阅读理解系统

数据集

dureader2.0

训练

cd script 
sh train.sh train

预测

cd script 
sh train.sh predict

预测的结果在./output_dir/predictions.json中

其他

说明下本项目关键的几个地方:

  • start position
    我们输入的是段落中的字的索引,需要转化为tokenizer之后的索引,并且,还需要加上query token 的长度。
  • end position 和start position同理
  • 长度超过max_seq_length 对于太长的句子,采用了划窗策略,即按照一定的长度对文本进行拆分,然后再检查答案是否在对应的窗口文本中,如果在则改变相应的起末位置索引;如果不在,则起末位置索引置0
  • 计算loss的时候,忽略了>=max_seq_length的label和小于0的label。
  • 防止处理出错,对label进行了clamp操作,小于0的置0,大于max_seq_length置max_seq_length。

chinese_extraction_mrc_b9c6's People

Contributors

trellixvulnteam avatar

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.