Skip to main content

中文錯誤類型文字增量

Project description

中文錯誤類型文字增量

安裝

pip install zh-mistake-text-aug

使用 (Pipeline)

from zh_mistake_text_aug import Pipeline
import random

random.seed(7)
pipeline = Pipeline()
augs = pipeline("中文語料生成")
for aug in augs:
    print(aug)
type='MissingWordMaker' correct='中文語料生成' incorrect='中文料生成' incorrect_start_at=2 incorrect_end_at=2 span='語'
type='MissingVocabMaker' correct='中文語料生成' incorrect='語料生成' incorrect_start_at=0 incorrect_end_at=2 span='中文'
type='PronounceSimilarWordMaker' correct='中文語料生成' incorrect='中文語尥生成' incorrect_start_at=3 incorrect_end_at=3 span='尥'
type='PronounceSameWordMaker' correct='中文語料生成' incorrect='諥文語料生成' incorrect_start_at=0 incorrect_end_at=0 span='諥'
type='PronounceSimilarVocabMaker' correct='中文語料生成' incorrect='鍾文語料生成' incorrect_start_at=0 incorrect_end_at=2 span='鍾文'
type='PronounceSameVocabMaker' correct='中文語料生成' incorrect='中文预料生成' incorrect_start_at=2 incorrect_end_at=4 span='预料'
type='RedundantWordMaker' correct='中文語料生成' incorrect='成中文語料生成' incorrect_start_at=0 incorrect_end_at=0 span='成'
type='MistakWordMaker' correct='中文語料生成' incorrect='谁文語料生成' incorrect_start_at=0 incorrect_end_at=0 span='谁'

可用方法

from zh_mistake_text_aug.data_maker import ...
Data Maker Description
MissingWordMaker 隨機缺字
MissingVocabMaker 隨機缺詞
PronounceSimilarWordMaker 隨機相似字替換
PronounceSimilarWordPlusMaker 編輯距離找發音相似並且用高頻字替換
PronounceSimilarVocabMaker 發音相似詞替換
PronounceSameWordMaker 發音相同字替換
PronounceSameVocabMaker 發音相同詞替換
RedundantWordMaker 隨機複製旁邊一個字作為沆於字
MistakWordMaker 隨機替換字
MistakeWordHighFreqMaker 隨機替換高頻字
MissingWordHighFreqMaker 隨機刪除高頻字

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zh-mistake-text-aug-0.2.1.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zh_mistake_text_aug-0.2.1-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file zh-mistake-text-aug-0.2.1.tar.gz.

File metadata

  • Download URL: zh-mistake-text-aug-0.2.1.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.13 Linux/5.4.0-125-generic

File hashes

Hashes for zh-mistake-text-aug-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c837d77770796483883adeef38342b447838c583f5853e28c77830a3b4da64e1
MD5 1b9ec85d365903328592e16500ecc863
BLAKE2b-256 904fb79afd8c8be9a599d7d193f6a0dc9caf44eb17ba6e107ddf4ef9695cce83

See more details on using hashes here.

File details

Details for the file zh_mistake_text_aug-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: zh_mistake_text_aug-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.13 Linux/5.4.0-125-generic

File hashes

Hashes for zh_mistake_text_aug-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 db085a11f73cb0c540c0aa99a30106bee9e175c9f9e8bf8c15b6655999b4a75f
MD5 1d6fbd5556f895156ada2eb031549674
BLAKE2b-256 75dfd65678a0121c96b4bfad13e6b5271ccda2e1ae0d23eccf9a4a30fba0f283

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page