Skip to content

Annie-Yeeun-Jang/text_style_transfer_Tobigs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

text_style_transfer_Tobigs

Description translated in English
Text Style Transfer project for 12th Tobig's Conference
투빅스 컨퍼런스 Text Style Transfer \

💬 Native/Formal Text Style Converter


MAIN

Native/Formal Text Style Converter 는 입력된 영어 문장을 Native하면서 Formal하게 만들어주는 모델입니다.
Native/Formal Text Style Converter is a style transfer model converting non-native and informal texts into native and formal style.

해당 프로젝트는 제 12회 투빅스 컨퍼런스에서 발표되었으며, 자세한 내용은 아래 링크를 통해 확인할 수 있습니다.
This project was presented in 12th Tobig's Conference. Please refer to the link for more information. (Slide and video are in Korean)

📂 Data


모델마다 다른 특징을 가진 데이터가 필요하여 총 4가지의 데이터를 사용하였습니다.
We used four different datasets for two different models.

Non-Native / Native Data

  • YELC(Yonsei English Learners' Corpus)

    • 연세대학교 신입생이 실시한 영어진단평가 데이터로, CEFR을 기준으로 A1-C2로 Proficiency를 표현
    • The essays are written by freshmen at Yonsei University for english proficiency. The level of proficiency is labeled ranging A1-C2 based on CEFR standard
    • A1-A2 : Non-native data / C1-C2: Native data로 사용
    • Labeled A1-A2 level as Non-native, C1-C2 level as Native
  • USECorpus (Uppsala Student English Corpus)

    • 440명의 스웨덴 대학생들이 쓴 에세이 데이터로, 수강한 학기 별로 A-C로 구분 (A가 첫 학기에 수강한 과목)
    • The essays are written by university students in Sweden, labeled by the semester the courses are taken. (A for the first semester, C for the last)
    • A : Non-native data / C: Native data로 사용
    • Used essay labeled 'A' as Non-native, and 'C' as Native, discarded data with label 'B'

Native Data

  • COCA Academic (Corpus of Contemporary American English)
    • 1990~2019년 사이 발간·유통된 10억 개 단어로 이루어진 소설, 잡지, 학술, 대본 등 현대 미국 영어 데이터
    • 그 중 Academic은 인문, 과학, 비즈니스 등의 다양한 학문에 대한 내용을 포함하여 이를 Native data로 사용

Informal / Formal Data

  • GYAFC (Grammarly’s Yahoo Answers Formality Corpus)
    • 질의응답 포럼인 야후 답변 데이터를 정제한 informal/formal pair 문장 데이터
    • Formal/Informal data로 사용

🔈 Usage


Requirements

pip install transformers==2.5.1 pytorch_pretrained_bert fasttext embeddings

Installation

git clone https://github.com/Tobigs-team/text_style_transfer_Tobigs.git
cd text_style_transfer_Tobigs

Native Text Style Converter

cd Style_Transformer
# train
python main.py
# infer
python test.py

Formal Text Style Converter

cd Formal_Transformer
# train
python train.py
# infer
python test.py

Native/Formal Text Style Converter

입력된 문장을 Native하면서 Formal하게 변환해주는 모델을 한번에 실행시키는 코드입니다.
To run the whole process, run the following command :

python infer.sh

📄 Results


Result5

✨ Contributors



Jaehee Kim

Jungeun Lee

Yeeun Jang

Hyowon Cho

💡 Reference


Style Transformer: Unpaired Text Style Transfer without Disentangled Latent Representation

Thank you BART! Rewarding Pre-Trained Models Improves Formality Style Transfer (ACL-IJCNLP 2021)

About

투빅스 컨퍼런스 Text Style Transfer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •