3
1

More than 5 years have passed since last update.

IBM Watson Assistant (Conversation) 書き方 Tips

Last updated at Posted at 2018-08-24

IBM Watson Assistant は簡単に説明するとチャットボット用のフレームワークですが、原理的にはこれまた簡単に説明すると「IF (条件・コンディション) THEN (レスポンス)」をひたすら書いていくのが基本です。

ただ、入力される自然言語テキストは当然ですが入力パターンが非常に多く、全部の入力パターンに対して(条件・コンディション)を設定していたのではキリがありませんし、AIっぽくもなんともないのです。そこで(条件・コンディション)部に機械学習の機能を入れ込んでいるのが、IBM Watson Assistantのよいところです。(※個人の意見です!w)

ところがコンディション部にはけっこういろいろな記述方法が用意されているので、そこの部分までまとめたのが以下の記事になります。

コンディション部

入力が「A」に等しい

input.text == 'A'

入力が正規表現「[0-9]」にマッチする

input.text.matches('[0-9]')

Intent がヒットする

#intentname
#(日本語インテント名)

Intent の確信度が0.5以上

intents[0].confidence > 0.5

ユーザーエンティティにヒットする

@userentityname

Context 変数に値がセットされている

例として「username」というContext変数とする

context.username != null
context['username'] != null

Context 変数の配列が値を含む

$配列変数名.contains('ham')

。。。続きはまた今度。

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1