All Projects → toriving → KoEDA

toriving / KoEDA

Licence: MIT license
Korean Easy Data Augmentation

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to KoEDA

PyKOMORAN
(Beta) PyKOMORAN is wrapped KOMORAN in Python using Py4J.
Stars: ✭ 38 (-38.71%)
Mutual labels:  korean, korean-nlp
detox
Korean Hate Speech Detection Model
Stars: ✭ 38 (-38.71%)
Mutual labels:  korean, korean-nlp
g2pK
g2pK: g2p module for Korean
Stars: ✭ 137 (+120.97%)
Mutual labels:  korean, korean-nlp
Zeroth
Kaldi-based Korean ASR (한국어 음성인식) open-source project
Stars: ✭ 248 (+300%)
Mutual labels:  korean, data-augmentation
kss
Kss: A Toolkit for Korean sentence segmentation
Stars: ✭ 198 (+219.35%)
Mutual labels:  korean, korean-nlp
KoSpacing
Automatic Korean word spacing with R
Stars: ✭ 76 (+22.58%)
Mutual labels:  korean, korean-nlp
KLUE
📖 Korean NLU Benchmark
Stars: ✭ 420 (+577.42%)
Mutual labels:  korean, korean-nlp
hangul-search-js
🇰🇷 Simple Korean text search module
Stars: ✭ 22 (-64.52%)
Mutual labels:  korean, korean-nlp
BERT-embedding
A simple wrapper class for extracting features(embedding) and comparing them using BERT in TensorFlow
Stars: ✭ 24 (-61.29%)
Mutual labels:  korean, korean-nlp
keras-transform
Library for data augmentation
Stars: ✭ 31 (-50%)
Mutual labels:  data-augmentation
fastai sparse
3D augmentation and transforms of 2D/3D sparse data, such as 3D triangle meshes or point clouds in Euclidean space. Extension of the Fast.ai library to train Sub-manifold Sparse Convolution Networks
Stars: ✭ 46 (-25.81%)
Mutual labels:  data-augmentation
KoreanTextMatcher
한글 음절 근사 매칭/초성 검색 라이브러리
Stars: ✭ 39 (-37.1%)
Mutual labels:  korean
NavilIME
Windows Hangul (Korean) Input Method Editor based on TSF
Stars: ✭ 79 (+27.42%)
Mutual labels:  korean
hama-py
🦛 파이썬 한글 처리 라이브러리. Python Korean Morphological Analyzer
Stars: ✭ 16 (-74.19%)
Mutual labels:  korean
korean-dev-books
📚 한국어 개발/CS 서적 큐레이션 리스트
Stars: ✭ 51 (-17.74%)
Mutual labels:  korean
Awesome-Few-Shot-Image-Generation
A curated list of papers, code and resources pertaining to few-shot image generation.
Stars: ✭ 209 (+237.1%)
Mutual labels:  data-augmentation
National-Petition
청와대 국민청원 분석으로 국민의 생각 알아보기 📈🔬
Stars: ✭ 45 (-27.42%)
Mutual labels:  korean
amazfit-bip-kr
Amazfit Bip Korean Firmware and tools for making it
Stars: ✭ 34 (-45.16%)
Mutual labels:  korean
korean-romanizer
한국어를 입력하면 로마자로 변환해주는 Java 라이브러리
Stars: ✭ 38 (-38.71%)
Mutual labels:  korean
Hikari
simple discord.js music bot using distube 🎵 | Stage channel support!
Stars: ✭ 19 (-69.35%)
Mutual labels:  korean

KoEDA

Deploy Test Release Black

Easy Data Augmentation for Korean

This is a project that re-implemented Easy data augmentation and A Easier Data Augmentation, which were implemented for English, to fit Korean.

Prerequisites

  • python >= 3.7

Installation

This repository is tested on Python 3.7 - 3.9.

KoEDA can be installed using pip as follows:

$ pip install koeda

Quick Start

  • EDA
from koeda import EDA


eda = EDA(
    morpheme_analyzer="Okt", alpha_sr=0.3, alpha_ri=0.3, alpha_rs=0.3, prob_rd=0.3
)

text = "아버지가 방에 들어가신다"

result = eda(text)
print(result)
# 아버지가 정실에 들어가신다

result = eda(text, p=(0.9, 0.9, 0.9, 0.9), repetition=2)
print(result)
# ['아버지가 객실 아빠 안방 방에 정실 들어가신다', '아버지가 탈의실 방 휴게실 에 안방 탈의실 들어가신다']
  • AEDA
from koeda import AEDA


aeda = AEDA(
    morpheme_analyzer="Okt", punc_ratio=0.3, punctuations=[".", ",", "!", "?", ";", ":"]
)

text = "어머니가 집을 나가신다"

result = aeda(text)
print(result)
# 어머니가 ! 집을 , 나가신다

result = aeda(text, p=0.9, repetition=2)
print(result)
# ['! 어머니가 ! 집 ; 을 ? 나가신다', '. 어머니 ? 가 . 집 , 을 , 나가신다']

Augmenters

  • EasyDataAugmentation (EDA)
  • AEasierDataAugmentation (AEDA)
  • RandomDeletion (RD)
  • RandomInsertion (RI)
  • SynonymReplacement (SR)
  • RandomSwap (RS)

There are two ways to load Augmenter.

The first is to use the full name.

from koeda import EasyDataAugmentation

The second is to use abbreviations.

from koeda import EDA

Usage

  • EDA
augmenter = EDA(
              morpheme_analyzer: str = None,  # Default = "Okt"
              alpha_sr: float = 0.1,
              alpha_ri: float = 0.1,
              alpha_rs: float = 0.1,
              prob_rd: float = 0.1
            )

result = augmenter(
            data: Union[List[str], str], 
            p: List[float] = None,  # Default = (0.1, 0.1, 0.1, 0.1)
            repetition: int = 1
          )
  • AEDA
augmenter = AEDA(
              morpheme_analyzer: str = None,  # Default = "Okt"
              punc_ratio: float = 0.3,
              punctuations: List[str] = None  # default = ('.', ',', '!', '?', ';', ':')
            )

result = augmenter(
            data: Union[List[str], str], 
            p: float = None,  # Default = 0.3 
            repetition: int = 1
          )
  • The others (RD, RI, SR, RS)
augmenter = RD(
              morpheme_analyzer: str = None, 
            )

augmenter = RI(
              morpheme_analyzer: str = None, 
              stopword: bool = False
            )

augmenter = SR(
              morpheme_analyzer: str = None, 
              stopword: bool = False
            )

augmenter = RS(
              morpheme_analyzer: str = None, 
            )

result = augmenter(
            data: Union[List[str], str], 
            p: float = 0.1,
            repetition: int = 1
          )

Reference

Easy Data Augmentation Paper
Easy Data Augmentation Repository
A Easier Data Augmentation Paper
A Easier Data Augmentation Repository
Korean WordNet

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].