GithubHelp home page GithubHelp logo

nlp-demo's Introduction

项目概述

本项目旨在提供一些NLP常用任务的基础代码,如抽取式问答、阅读理解等,项目将使用Bert-base作为预训练模型。

项目中使用到的库

  1. PyTorch: https://pytorch.org/
  2. Transformers: https://huggingface.co/docs/transformers/quicktour
  3. Accelerate: https://huggingface.co/docs/accelerate/

项目简介

  1. question-answering-demo: 抽取式问答 Demo,预测答案的开始Token和结束Token所在位置。

参数讲解

  1. epochs:训练轮数
  2. learning_rate:学习率
  3. base_model_name:预训练模型
  4. load_model_path:训练好的模型,一般在测试时加载
  5. train_batch_size:训练batch_size
  6. test_batch_size:测试batch_size
  7. train_file:训练数据集
  8. test_file:测试数据集
  9. max_test_data_num:调试时使用,加载test数据条数
  10. max_train_data_num:训练时使用,加载train数据条数
  11. max_seq_length:最大序列长度,bert参数
  12. save_model_path:保存模型路径
  13. test_num:多少step测试
  14. seed:随机种子
  15. weight_decay:权重削减
  16. do_train:是否训练,测试时不用指定

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.