GithubHelp home page GithubHelp logo

halokim / kogpt2-chatbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from haven-jeon/kogpt2-chatbot

0.0 1.0 0.0 212 KB

Simple Chit-Chat based on KoGPT2 + ONXX + CoreML

License: MIT License

Python 10.11% Jupyter Notebook 89.89%

kogpt2-chatbot's Introduction

추가사항

기존 공개된 KoGPT2 챗봇 모델에 ONNX 모델변환과 CoreML 변환코드를 작성했습니다.

CoreML 모델은 아직 테스트중입니다.

  • ONNX Export
  • CoreML Export

Simple Chit-Chat based on KoGPT2

Purpose

Architecture

학습 데이터에 적합하게 Hello! GPT-2를 응용, 아래와 같은 아키텍처를 설계함

drawing

  • 데이터의 Q 필드를 <usr>발화, A 필드를 <sys>발화 그리고 감정 레이블을 <sent>로 매핑해 P(<sys>|<usr>, <sent>)를 최대화 할 수 있는 모델을 학습한다. 감정 레이블은 이곳의 정의를 따른다(일상다반사 0, 이별(부정) 1, 사랑(긍정) 2).

Install

# MXNet은 [링크](https://mxnet.apache.org/get_started?)를 참고하여 시스템에 맞는 버전으로 설치한다.
pip3 install mxnet-cuXX
pip3 install gluonnlp sentencepiece pandas torch transformers pytorch_lightning 
pip3 install git+https://github.com/SKT-AI/KoGPT2#egg=kogpt2
git clone --recurse-submodules https://github.com/haven-jeon/KoGPT2-chatbot.git

How to Train

  • PyTorch
CUDA_VISIBLE_DEVICES=0 python train_torch.py --gpus 1 --train --max_epochs 2
  • MXNet
CUDA_VISIBLE_DEVICES=0 python train.py --num-epoch 2 --train

How to Chat!

# CUDA_VISIBLE_DEVICES=0 python train.py --chat
CUDA_VISIBLE_DEVICES=0 python train_torch.py --gpus 1 --chat
user > 방가워용.
Simsimi > 저도요.

user > 어버이날엔 뭘 하죠?
Simsimi > 부모님께 효도하는 것도 좋을 것 같아요.

user > 용돈이 너무 적어요.
Simsimi > 아껴 쓰세요.

user > 미친듯이 고민해도 방법이 없네요.
Simsimi > 좋은 방법이 있을 거예요.

user > 큼지막한 방에서
Simsimi > 혼자만의 시간을 가지세요.

user > 큰돈을 만드는 방법은?
Simsimi > 돈을 많이 버는 것뿐이에요.

user > 집은 너무 비싼거 같아요.
Simsimi > 비싸다고 해서 다 좋은 건 아니에요.

Colab tutorials

  • PyTorch
    • Open In Colab
  • MXNet
    • Open In Colab
  • ONNX
    • Open In Colab

TODO

  • 감정 정보를 조건으로 준 응답 생성
  • PyTorch 버전 작업
  • 다양한 generation 방식 테스트

kogpt2-chatbot's People

Contributors

halokim avatar haven-jeon avatar

Watchers

 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.