Skip to main content

kogpt2 based kiosk chatbot

Project description

kiosk_bot

KoGPT2를 이용한 간단한 kiosk chatbot 입니다.

데이터는 AiHub의 한국어대화 데이터를 사용했습니다.

데이터는 학습만 진행하였고 공개는 하지 않습니다.

Architecture

Hugging face의 예제들을 보며 구현하였습니다.

gpt

inputUser + <BOS> + System + <EOS>로 구현하였다.

outputP(system|user)를 최대화 시키기위해 모델을 학습하였다.

Install

git clone https://github.com/momozzing/kiosk_bot.git
git lfs pull     ## lfs 가 없으면 설치하셔야 합니다. 
pip install requirements.txt

How to train?

기존 학습된 데이터로 대화를 하고 싶으시면 installHow to chat 으로 넘어가셔도 됩니다.

cd kiosk_bot/data  ## 안에 원하시는 데이터를 넣으시면 됩니다. 

kiosk_bot/GPT-2_fine_tune.py  ## 안에 데이터 loader들의 파일이름을 변경해주시면 됩니다. 

deepspeed --num_gpus=1 GPT-2_fine_tune.py ## 변경후 이것으로 실행하시면 됩니다. 

그후 생성된 skt-kogpt2-base-v2.pt 를 사용하시면 됩니다. 

How to chat?

python interactive.py   ##기존 데이터로 채팅하기

python new_data_interactive.py  ##새로운 데이터로 파인튜닝한것 pt파일 불러와서 채팅하기.

--기존 데이터 채팅--

User: 아메리카노 주세요
System: 따뜻한 거 드릴까요?

User: 아이스로 주세요
System: 사이즈는 톨 괜찮으세요?

User: 그란데 사이즈로 주세요
System: 죄송한데 저희 가게에는 레귤러랑 라지 사이즈 밖에 없어요

User:  그럼 라지사이즈로 주세요
System: 네 고객님 테이크아웃 하시나요?

User: 먹고갈게요
System: 네 그럼 머그잔으로 준비해드리겠습니다

User: 감사합니다
System: 좋은 하루 보내세요

Reference

HuggingFace

KoGPT2

AIHUB

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kiosk_bot-1.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kiosk_bot-1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file kiosk_bot-1.0.tar.gz.

File metadata

  • Download URL: kiosk_bot-1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.11

File hashes

Hashes for kiosk_bot-1.0.tar.gz
Algorithm Hash digest
SHA256 946bfb7a7bcec3c71c984482d693eb6a201856768664f590bf55dcdae648acf6
MD5 5b5ce7b2d1a4956a3e8ca807176e597f
BLAKE2b-256 3f4d2770519e2fd8aa438f04fea5b31627a44c672128237d99e458641f2b6bb0

See more details on using hashes here.

File details

Details for the file kiosk_bot-1.0-py3-none-any.whl.

File metadata

  • Download URL: kiosk_bot-1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.11

File hashes

Hashes for kiosk_bot-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a53eca7373cc2df9b773666a205d0a7be6f4681e1d631dd4e9d002da5eb2c986
MD5 d5a519346c162e716bc53b9db35ffa80
BLAKE2b-256 cbc8c73a5bf0af969c9edb7942d840ea9afeb189ce6a3ca84e52459ba782f9af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page