- ์ฑ๋ด ๋น๋๋ ์ฑ์ ์์ฐจ๊ณ , ์์ ๋ง์ ๋ฅ๋ฌ๋ ์ฑ๋ด ์ ํ๋ฆฌ์ผ์ด์ ์ ๋ง๋์๊ณ ์ถ์ผ์ ๊ฐ์?
- 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')
ํ์ฌ ๋ฒ์ ์ GPU์์ KNN์ ์๋๊ฐ ๋๋ฌด ๋๋ฆฌ๋ค๋ ์ด์๊ฐ ๋ฐ๊ฒฌ ๋์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ผ๋, ์์ง ์์ฑ๋์ง ์์์ pip๋ก๋ ๋ฐฐํฌํ์ง ์์์ผ๋, ๋ค์ ํ์ต์๋๊ฐ ๋๋ฆฌ๋๋ผ๋ pip์ ๋ฐฐํฌ๋ ๋ฒ์ (1.0.3)๊ณผ ์๋์ ๊ณต์ ๋ํ๋จผํ ์ด์ ์ ๋์จ ์ฝ๋๋ฅผ ์ด์ฉํด์ฃผ์ธ์.
- ํ๊ตญ์ด๋ฅผ ์ง์ํ๋ ์ต์ด์ ์คํ์์ค ๋ฅ๋ฌ๋ ์ฑ๋ด ํ๋ ์์ํฌ์ ๋๋ค. (๋น๋์๋ ๋ค๋ฆ ๋๋ค.)
- ๋ค์ํ Pre built-in ๋ชจ๋ธ๊ณผ Lossํจ์๋ฅผ ์ง์ํฉ๋๋ค. NLP๋ฅผ ์ ๋ชฐ๋ผ๋ ์ฑ๋ด์ ๋ง๋ค ์ ์์ต๋๋ค.
- ์์ ๋ง์ ์ปค์คํ ๋ชจ๋ธ, Lossํจ์๋ฅผ ์ ์ฉํ ์ ์์ต๋๋ค. NLP ์ ๋ฌธ๊ฐ์๊ฒ ๋์ฑ ์ ์ฉํฉ๋๋ค.
- ์ฑ๋ด์ ํ์ํ ๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ, ๋ชจ๋ธ, ํ์ต ํ์ดํ๋ผ์ธ, RESTful API๊น์ง ๋ชจ๋ ๋ถ๋ถ์ ์ ๊ณตํฉ๋๋ค.
- ๊ฐ๊ฒฉ ๋ฑ์ ์ ๊ฒฝ์ธ ํ์ ์์ผ๋ฉฐ, ์์ผ๋ก๋ ์ญ ์คํ์์ค ํ๋ก์ ํธ๋ก ์ ๊ณตํ ์์ ์ ๋๋ค.
- ์๋์ ๊ฐ์ ๋ค์ํ ์ฑ๋ฅ ํ๊ฐ ๋ฉํธ๋ฆญ๊ณผ ๊ฐ๋ ฅํ ์๊ฐํ ๊ธฐ๋ฅ์ ์ ๊ณตํฉ๋๋ค.
- 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 ๊ด๋ฆฌ ๊ธฐ๋ฅ ๊ตฌํํด์ ์ถ๊ฐํ๊ธฐ
- ์ฑ๋ด ๋ถ๋ฅ ๊ทธ๋ฆผ
- seq2seq ๊ทธ๋ฆผ
- Fallback Detection ๊ทธ๋ฆผ
- ๋ฐ๋ชจ ์ ํ๋ฆฌ์ผ์ด์ ํ ํ๋ฆฟ
- ๊ทธ ์ธ์ ๊ทธ๋ฆผ ๋ฐ ์์ค์ฝ๋ : ๋ณธ์ธ ์ ์
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.