Giter Club home page Giter Club logo

covid19_qa_baseline's Introduction

COVID19_QA_baseline

DataFountain疫情问答助手keras-bert实现,单模0.67,比赛链接:https://www.datafountain.cn/competitions/424/submits?view=submit-records
CyberZHG大佬的keras-bert:https://github.com/CyberZHG/keras-bert

数据预处理

  • 运行elastic.py,利用Elastic Search导入文档索引,选出测试集中每个问题最相关的五个文档,输出为test_top5.csv
  • 运行process.py,bert最大序列长度为512,因此要对文本进行划分。答案通常在一个句子内部或者一个或多个完整的句子,通常不超过两句话,因此以句子为单位进行划分,保证覆盖全文以及段落长度限制条件的约束下,使分段结果具有最小的重复并且最小化丢失答案信息的风险,通过构建有向无环图进行规划,详情请见split_text函数。对训练集测试集进行文本分割,输出为train_new.csv和test_new.csv。

训练、验证、测试

  • 运行base.py,利用roberta-wwm-ext预训练模型,模型下载地址:https://github.com/ymcui/Chinese-BERT-wwm
  • 多任务调和:分别预测出答案是否在该子文本中、答案开始的位置、答案结束的位置,五折交叉验证,计算每个子文本的得分,得分公式如下:
    image
    其中w1、w2分别设置为0.9、0.1(在验证集中分数最高)
  • 选择分数最高的子文本,预测其答案,选择概率最高的三个答案开始位置和结束位置进行排列组合,满足结束位置>开始位置、answer_score最大的为最终位置,输出为submit.csv提交文件,模型权重保存至model_save文件夹,log文件夹为训练数据记录

作者

[email protected]

covid19_qa_baseline's People

Contributors

lht-curry avatar

Watchers

 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.