Giter Site home page Giter Site logo

kochat's Introduction

Kochat

PyPI version GitHub CodeFactor

introduction_kochat



  • ์ฑ—๋ด‡ ๋นŒ๋”๋Š” ์„ฑ์— ์•ˆ์ฐจ๊ณ , ์ž์‹ ๋งŒ์˜ ๋”ฅ๋Ÿฌ๋‹ ์ฑ—๋ด‡ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋งŒ๋“œ์‹œ๊ณ  ์‹ถ์œผ์‹ ๊ฐ€์š”?
  • Kochat์„ ์ด์šฉํ•˜๋ฉด ์†์‰ฝ๊ฒŒ ์ž์‹ ๋งŒ์˜ ๋”ฅ๋Ÿฌ๋‹ ์ฑ—๋ด‡ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋นŒ๋“œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
# 1. ๋ฐ์ดํ„ฐ์…‹ ๊ฐ์ฒด ์ƒ์„ฑ
dataset = Dataset(ood=True)

# 2. ์ž„๋ฒ ๋”ฉ ํ”„๋กœ์„ธ์„œ ์ƒ์„ฑ
emb = GensimEmbedder(model=embed.FastText())

# 3. ์˜๋„(Intent) ๋ถ„๋ฅ˜๊ธฐ ์ƒ์„ฑ
clf = DistanceClassifier(
    model=intent.CNN(dataset.intent_dict),                  
    loss=CenterLoss(dataset.intent_dict)                    
)

# 4. ๊ฐœ์ฒด๋ช…(Named Entity) ์ธ์‹๊ธฐ ์ƒ์„ฑ                                                     
rcn = EntityRecognizer(
    model=entity.LSTM(dataset.entity_dict),
    loss=CRFLoss(dataset.entity_dict)
)

# 5. ๋”ฅ๋Ÿฌ๋‹ ์ฑ—๋ด‡ RESTful API ํ•™์Šต & ๋นŒ๋“œ
kochat = KochatApi(
    dataset=dataset, 
    embed_processor=(emb, True), 
    intent_classifier=(clf, True),
    entity_recognizer=(rcn, True), 
    scenarios=[
        weather, dust, travel, restaurant
    ]
)

# 6. View ์†Œ์ŠคํŒŒ์ผ๊ณผ ์—ฐ๊ฒฐ                                                                                                        
@kochat.app.route('/')
def index():
    return render_template("index.html")

# 7. ์ฑ—๋ด‡ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์„œ๋ฒ„ ๊ฐ€๋™                                                          
if __name__ == '__main__':
    kochat.app.template_folder = kochat.root_dir + 'templates'
    kochat.app.static_folder = kochat.root_dir + 'static'
    kochat.app.run(port=8080, host='0.0.0.0')

Warning

ํ˜„์žฌ ๋ฒ„์ „์€ GPU์—์„œ KNN์˜ ์†๋„๊ฐ€ ๋„ˆ๋ฌด ๋Š๋ฆฌ๋‹ค๋Š” ์ด์Šˆ๊ฐ€ ๋ฐœ๊ฒฌ ๋˜์–ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ–ˆ์œผ๋‚˜, ์•„์ง ์™„์„ฑ๋˜์ง€ ์•Š์•„์„œ pip๋กœ๋Š” ๋ฐฐํฌํ•˜์ง€ ์•Š์•˜์œผ๋‹ˆ, ๋‹ค์†Œ ํ•™์Šต์†๋„๊ฐ€ ๋Š๋ฆฌ๋”๋ผ๋„ pip์— ๋ฐฐํฌ๋œ ๋ฒ„์ „(1.0.3)๊ณผ ์•„๋ž˜์˜ ๊ณต์‹ ๋„ํ๋จผํ…Œ์ด์…˜์— ๋‚˜์˜จ ์ฝ”๋“œ๋ฅผ ์ด์šฉํ•ด์ฃผ์„ธ์š”.



Why Kochat?

  • ํ•œ๊ตญ์–ด๋ฅผ ์ง€์›ํ•˜๋Š” ์ตœ์ดˆ์˜ ์˜คํ”ˆ์†Œ์Šค ๋”ฅ๋Ÿฌ๋‹ ์ฑ—๋ด‡ ํ”„๋ ˆ์ž„์›Œํฌ์ž…๋‹ˆ๋‹ค. (๋นŒ๋”์™€๋Š” ๋‹ค๋ฆ…๋‹ˆ๋‹ค.)
  • ๋‹ค์–‘ํ•œ Pre built-in ๋ชจ๋ธ๊ณผ Lossํ•จ์ˆ˜๋ฅผ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. NLP๋ฅผ ์ž˜ ๋ชฐ๋ผ๋„ ์ฑ—๋ด‡์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ์ž์‹ ๋งŒ์˜ ์ปค์Šคํ…€ ๋ชจ๋ธ, Lossํ•จ์ˆ˜๋ฅผ ์ ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. NLP ์ „๋ฌธ๊ฐ€์—๊ฒ ๋”์šฑ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค.
  • ์ฑ—๋ด‡์— ํ•„์š”ํ•œ ๋ฐ์ดํ„ฐ ์ „์ฒ˜๋ฆฌ, ๋ชจ๋ธ, ํ•™์Šต ํŒŒ์ดํ”„๋ผ์ธ, RESTful API๊นŒ์ง€ ๋ชจ๋“  ๋ถ€๋ถ„์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
  • ๊ฐ€๊ฒฉ ๋“ฑ์„ ์‹ ๊ฒฝ์“ธ ํ•„์š” ์—†์œผ๋ฉฐ, ์•ž์œผ๋กœ๋„ ์ญ‰ ์˜คํ”ˆ์†Œ์Šค ํ”„๋กœ์ ํŠธ๋กœ ์ œ๊ณตํ•  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.
  • ์•„๋ž˜์™€ ๊ฐ™์€ ๋‹ค์–‘ํ•œ ์„ฑ๋Šฅ ํ‰๊ฐ€ ๋ฉ”ํŠธ๋ฆญ๊ณผ ๊ฐ•๋ ฅํ•œ ์‹œ๊ฐํ™” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.




Documentation

  1. Kochat์ด๋ž€?
  2. About Chatbot
  3. Getting Started
  4. Usage
  5. Visualization Support
  6. Performance Issue
  7. Demo

TODO List

  • ver 1.0 : ์—”ํ‹ฐํ‹ฐ ํ•™์Šต์— CRF ๋ฐ ๋กœ์Šค ๋งˆ์Šคํ‚น ์ถ”๊ฐ€ํ•˜๊ธฐ
  • ver 1.0 : ์ƒ์„ธํ•œ README ๋ฌธ์„œ ์ž‘์„ฑ ๋ฐ PyPI ๋ฐฐํฌํ•˜๊ธฐ
  • ver 1.0 : ๊ฐ„๋‹จํ•œ ์›น ์ธํ„ฐํŽ˜์ด์Šค ๊ธฐ๋ฐ˜ ๋ฐ๋ชจ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ œ์ž‘ํ•˜๊ธฐ
  • ver 1.0 : Jupyter Note Example ์ž‘์„ฑํ•˜๊ธฐ + Colab ์‹คํ–‰ ํ™˜๊ฒฝ
  • ver 1.0 : ๋ฐ๋ชจ ๋ฐ์ดํ„ฐ์…‹ 10๋ฐฐ๋กœ ํ™•์žฅ (intent ๋‹น 600 โ†’ 5000 ๋ผ์ธ)
  • ver 1.1 : OOD ๋ฐ์ดํ„ฐ์…‹ ์—†์ด OOD ๋ถ„๋ฅ˜๊ธฐ๋Šฅ ํ•™์Šต (๊ตฌํ˜„์™„๋ฃŒ, ๋งˆ๋ฌด๋ฆฌํ•„์š”)
  • ver 1.2 : ๋ฐ์ดํ„ฐ์…‹ ํฌ๋งท RASA์ฒ˜๋Ÿผ markdown์— ๋Œ€๊ด„ํ˜ธ ํ˜•ํƒœ๋กœ ๋ณ€๊ฒฝ
  • ver 1.2 : System Entity & Intent ๋ฐ์ดํ„ฐ์…‹ ์ง€์› (์ผ๋‹จ NER ๋ฐ์ดํ„ฐ ๊ธ์–ด๋ชจ์œผ๊ณ  ์ธํ…ํŠธ๋Š” ์Œ..)
  • ver 1.3 : Pretrain Embedding ์ ์šฉ ๊ฐ€๋Šฅํ•˜๊ฒŒ ๋ณ€๊ฒฝ (Gensim)
  • ver 1.4 : Transformer ๊ธฐ๋ฐ˜ ๋ชจ๋ธ ์ถ”๊ฐ€ (Etri BERT, SK BERT) with Hugging face
  • ver 1.5 : Pytorch Embedding ๋ชจ๋ธ ์ถ”๊ฐ€ + Pretrain ์ ์šฉ ๊ฐ€๋Šฅํ•˜๊ฒŒ
  • ver 1.4 : Intent & Entity ๋ฉ€ํ‹ฐ๋ชจ๋‹ฌ ์ง€์› (ํ•™์Šต์†๋„ ๋ฐ ์ถ”๋ก  ๊ฐœ์„ ์„ ์œ„ํ•จ)
  • ver 1.7 : Seq2Seq ์ถ”๊ฐ€ํ•ด์„œ Fallback์‹œ ๋Œ€์ฒ˜ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋งŒ๋“ค๊ธฐ (LSTM, SK GPT2)
  • ver 1.8 : ๋„ค์ด๋ฒ„ ๋งž์ถค๋ฒ• ๊ฒ€์‚ฌ๊ธฐ ์ œ๊ฑฐํ•˜๊ณ , ์ž์ฒด์ ์ธ ๋„์–ด์“ฐ๊ธฐ ๊ฒ€์‚ฌ๋ชจ๋“ˆ ์ถ”๊ฐ€
  • ver 1.9 : ๋Œ€ํ™” ํ๋ฆ„๊ด€๋ฆฌ๋ฅผ ์œ„ํ•œ Story ๊ด€๋ฆฌ ๊ธฐ๋Šฅ ๊ตฌํ˜„ํ•ด์„œ ์ถ”๊ฐ€ํ•˜๊ธฐ


Reference

License

Copyright 2020 Kochat.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

kochat's People

Contributors

hyunwoongko 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.