Code Monkey home page Code Monkey logo

klue-relation_extraction's Introduction

KLUE-Relation Extraction

문장의 단어(Entity)에 대한 속성과 관계를 예측하는 Task

Example)
sentence: 오라클(구 썬 마이크로시스템즈)에서 제공하는 자바 가상 머신 말고도 각 운영 체제 개발사가 제공하는 자바 가상 머신 및 오픈소스로 개발된 구형 버전의 온전한 자바 VM도 있으며, GNU의 GCJ나 아파치 소프트웨어 재단(ASF: Apache Software Foundation)의 하모니(Harmony)와 같은 아직은 완전하지 않지만 지속적인 오픈 소스 자바 가상 머신도 존재한다.
subject_entity: 썬 마이크로시스템즈
object_entity: 오라클

relation: 단체:별칭 (org:alternate_names)


가상환경

# 가상환경 생성
python -3.8 -m venv venv

# 가상환경 활성화
source venv/bin/activate

# 필요 라이브러리 설치
pip install -r requirements.txt

학습

python main.py -c custom_config # ./config/custom_config.yaml 을 이용할 시 
python main.py -m t -c custom_config
python main.py --mode train --config custom_config

추가 학습

추가 학습을 하려면 기존 모델의 체크포인트를 config.path.resume_path에 추가하시면 됩니다 (기타 위와 동일).

python main.py -m t -c custom_config

추론

# 실행 시 prediction 폴더에 submission.csv가 생성됨
python main.py -m i -s "saved_models/klue/bert-base.ckpt"
python main.py -m i -s "saved_models/klue/bert-base.ckpt" -c custom_config

(추가) 학습 + 추론

학습과 추론을 한 번에 실행할 수 있습니다. 추가 학습할 모델의 체크포인트를 config.path.resume_path에 입력하시고 다음을 실행하시면 추가로 학습 후 추론까지 진행합니다.

python main.py --mode all --config custom_config 
python main.py -m a -c custom_config

base_config.yaml

  • tokenizer - syllable: True 설정하면 음절 단위 토크나이저 적용 가능

TODO

  • auprc warning 확인
  • focal loss
  • confusion matrix

klue-relation_extraction's People

Contributors

wjlee-ling avatar jn-jeong avatar kimbyeolhee avatar lim4349 avatar jjeongah avatar

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.