1 / 23

Hà Nội 2013

B ài 2 Natural Language Understanding ( NLU) - Artificial Intelligence Markup Language ( AIML). Hà Nội 2013. Yêu cầu :. Eclipse đã cài đặt ADT, Android SDK Cài đặt Robot SDK Ref erence : http ://ftri.fpt.edu.vn/robot/docs/NAO/SDK.html. Mục đích :.

bing
Download Presentation

Hà Nội 2013

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Bài 2 Natural Language Understanding (NLU) - Artificial Intelligence Markup Language (AIML) HàNội 2013

  2. Yêucầu: • Eclipse đãcàiđặt ADT, Android SDK • Càiđặt Robot SDK Reference: http://ftri.fpt.edu.vn/robot/docs/NAO/SDK.html

  3. Mụcđích: • Giớithiệucác API của NLU và AIML

  4. Task 1: NLU • NLU liênquanchủyếuđếnbàitoánphânlớp: • C = {c1, c2, …, ck} tập k lớp • X = {xi} (i=1,2,…) làtậpcácđốitượngcầnphânlớp • Xâydựngánhxạf: • flàmôhìnhphânlớp(classification model, classifier). • fcóthểđượcxâydựngbằnghọcgiámsátdựatheotậpdữliệuhuấnluyệnD = {(x1, c1), (x2, c2), …, (xn, cn)}: • Huấnluyệnmôhìnhfdựatrêntậphuấnluyện Dsaocho f phânlớpchínhxácnhất. X f C

  5. Mộtsốmôhìnhphânloại: • Môhình Naïve Bayes • Môhình TF IDF • Môhình Bernoulli • Thamkhảotàiliệulink.

  6. NLU API NLU API Train Learn Classify Training Data

  7. Dữliệu training đượcchứatrong 1 file text có format nhưsau: Mỗidòngchứa 1 label (action) và text. Lưuý: File nàyphảilưuởsdcardkhisửdụng.

  8. API đượcđịnhnghĩatrongTextClassifierclass. • Hầuhếtcáchàmlàasynchronizemethods: set callback thông qua method: • Train API:

  9. Classify API:

  10. Learn API:

  11. Tạo 1 robot project mớicó 2 layout: • activity_main.xml • activity_other.xml

  12. Tạo 1 object TextClassifier: • Cóthểlấy 1 list các action (label) đượcsắpxếptheothứtựgiảmdầncủaxácsuất: • Hoặclấy action vớixácsuấtlớnnhất:

  13. Đểhọcdữliệumới: • Cóthể download source code theolink

  14. Task 2: AIML • AIML API đượcđịnhnghĩatrongChatBotclass. • Nóbaogồm: Train API:

  15. Get response API:

  16. Ngoàiracòncó 1 số API khác:

  17. Sphinx + AIML project: • Tạocác layout:

  18. Copy aiml, sphinx data vào assets folder: Lưuý: • Aiml data phảiđượcchứatrongthưmục bots của assets. Thưmụctiếptheolàcótêngiốngnhưtêncủa chat bot. • Cáccâuhỏiđượcchứatrong file question_data.txt.

  19. Copy aiml, sphinx data vào assets folder: Lưuý: • Aiml data phảiđượcchứatrongthưmục bots của assets. Thưmụctiếptheolàcótêngiốngnhưtêncủa chat bot. • Cáccâuhỏiđượcchứatrong file question_data.txt. • Cácdữliệutrong assets sẽđược copy vàosdcardtronglầnđầuchạy app.

  20. Để train aimlphải copy dữliệuvàosdcardtrước. Sauđó set chat bot name choChatbot class.

  21. Để train sphinx data, phảiđọc list câuhỏivào 1 mảng.

  22. Lấy response từ input text: • Download source code từlink.

  23. Thanks for Listening!!!

More Related