Coder Social home page Coder Social logo

korbertsum's Introduction

문서 요약 텍스트를 활용한 KorBertSum input data 생성하기

문서 요약 텍스트를 활용해서 KorBertSum input data를 생성하는 레포지토리입니다.

이 문서의 원저작권은 BertSum 에 있습니다.

KorBertSum을 전반적으로 참고했습니다.

BertSum 에서 embedding 방식에 관해 도움을 받을 수 있습니다.

전제 조건

pip3 install logger
pip3 install kiwipiepy

ETRI 홈페이지(https://aiopen.etri.re.kr/bertModel) 에서 access key를 발급받은 뒤 BERT model을 다운로드 받아야 합니다. (사용협약서상 모델을 공개하지 않는 점 양해 부탁드립니다.)

학습은 Colab Pro 환경에서 진행했습니다.

사용 방법

문서 요약 텍스트에서 기사 전체 문단과 extractive sentence를 json 파일로 생성한다.

python article2json.py

임베딩을 진행한다.

python embedding.py

list를 tensor 파일로 변환한다.

python list2tensor.py

주의사항

get_src 함수에 Kiwi tokenizer와 ETRI tokenizer로 형태소 분석하는 기능을 구현했습니다.

현재 ETRI 형태소 분석기 변경으로 인해 형태소 분석이 되지 않아 Kiwi tokenizer로 재배포했습니다.

Kiwi와 ETRI 형태소 분석기의 태그셋이 서로 다른 부분이 있는데, 이 점이 성능에 영향을 미칠 수도 있는 점 유의 바랍니다.

list2tensor.py에서 마무리로 .pt 확장자로 변환해주는 로직을 추가해줘야 합니다.

출처

BertSum 논문: https://arxiv.org/pdf/1903.10318.pdf

참고한 블로그: https://velog.io/@raqoon886/KorBertSum-SummaryBot

ETRI 형태소분석기: https://aiopen.etri.re.kr/guide/WiseNLU

Kiwi 형태소분석기: https://github.com/bab2min/kiwipiepy

korbertsum's People

Contributors

junseoklee42 avatar

Watchers

 avatar

Forkers

ldw3097

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.