GithubHelp home page GithubHelp logo

chriszhangmw / chinese_spelling_correction Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fushengwuyu/chinese_spelling_correction

0.0 1.0 0.0 10.16 MB

中文文本纠错数据生成工具

Python 100.00%

chinese_spelling_correction's Introduction

中文文本纠错模型

这里提供三种文本纠错模型的实现

  1. bert语言模型+字音字形相似度
    • correction_basic.py
    • 缺点:
      1. 不能解决多字,少字问题
  2. MLM
    correction_mlm.py 利用bert的MLM训练机制实现纠错功能
    输入: [CLS]错误句子[SEP][MASK][MASK]...[MASK][SEP]
    输出: 正确句子
  3. seq2seq
    correction_seq2seq.py 使用文本生成的方式生成正确句子
    输入: [CLS]错误句子[SEP][MASK][MASK]...[MASK][SEP
    输出: 正确句子
    缺点:推断速度比较慢

exampe:

wrong: 专家公步虎门大桥涡振原因
right: 专家公布虎门大桥涡振原因

数据

  1. 引用自https://github.com/iqiyi/FASPell里面的数据,所有数据打包在data/origin_data.zip
  2. 可以尝试自己构建纠错数据集,data/char_meta.txt提供了汉字的字音和字形数据.

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.