QnA Maker の Active Learning について

(※QnA Maker は 2018 年 5 月に一般公開となりました。以下の内容はそれ以前の Preview 版の内容となります。)

今回は、以前「QnA Maker よくあるご質問」でご紹介したQnA Maker のActive Learning について、もう少し詳しく紹介します。

 

Knowledge Base にご自身で用意した精度の高い Q&A を直接入力する方法以外に、実際のユーザーの入力をもとに、精度を改善する Active Learning という方法があります。

以下のドキュメントの通り、類語や新しいQ&A ペアの追加を行って、マッチングの精度を改善することが可能と期待されます。

 

    • Active Learning

</en-us/azure/cognitive-services/qnamaker/guides/active-learning-qnamaker >

 

以下のTrain Knowledge Base API で、20 以上のユニークなユーザー(userId) から、合計で50 回、同じQ&A の呼び出しを行うことで、Knowledge Base にその Q&A が登録されます。

 

    • Train Knowledge Base

<https://westus.dev.cognitive.microsoft.com/docs/services/58994a073d9e04097c7ba6fe/operations/58edd31c3d9e041ffcef000f >

 

----- 抜粋:ここから -----

The developer of the knowledge base service can use this API to submit user feedback for tuning question-answer matching. QnA Maker uses active learning to learn from the user utterances that come on a published Knowledge base service. In this process, QnA Maker records user feedback from different users and trains the knowledge base to respond accordingly, when there are sufficient number of users sending the same feedback. Every user feedback is logged and model training is triggered when there are 50 new feedback
instances. Typically, the model updates are reflected when same question-answer pair from the knowledge base is sent as feedback for a given user query by at least 20 users. Most changes are immediately reflected in both the published and the saved knowledge bases. Some new question-answer pairs are only added to the saved knowledge base and they are moved to the published version in the next knowledge base publish operation by the developer. This gives the flexibility to the developer to keep or discard the newly added question-answer pairs.

----- 抜粋:ここまで -----

 

例えば、このAPI の Open API testing console を用いて、以下のように userId を 50 種類 (1 ~50) 使って同じ内容を送ります。

 

clip_image002

 

すると、以下の図で黄色のマーカーを引いた部分のように、新しいQ&A が追加されます。

 

clip_image004

 

このようにKnowledge Base に追加されても、実際にユーザーがそれを利用するには、Publish する必要があります。

つまり、Publish する前に、開発者が、その Q&A を削除するのか、Publish するのかを検討することができます。

 

ただ、追加されたQ&A は、Knowledge Base の画面上で色分けされるわけではないので、一見するとわかりにくいこともあるかと思います。

そのような場合のために、 [Publish] をクリックして Review your changes の画面にて [Download Diff File] をクリックして、差分のファイルをダウンロードしていただけます。

 

clip_image006

 

ダウンロードした tsv ファイルには、例えば、追加された Q & A がある場合、以下のように「Added」と表示されますし、変更がないものは「No Change」と表示されます。

 

----- 抜粋:ここから -----

Question         Answer Source Status

(略)

Hi        Hello    Editorial          No Change

Azure サポートの営業時間は?   北米の営業時間は、月曜日から金曜日の午前 6 時から午後 6 時 (太平洋標準時) となっています (北米の祝日を除きます)。営業時間は国によって異なります。また、地元の祝日によっても異なります。世界のほとんどの国で、営業時間は平日の午前 9 時から午後 5 時までです(土日祝は除きます)。   https://azure.microsoft.com/ja-jp/support/faq/          Added

----- 抜粋:ここまで -----

 

これにより、追加されたQ&A を確認し、Knowledge Base の画面で、そのQ&A を削除するのか、Publish するのかを検討することができます。

 

 

上記がお役に立てば幸いです。

 

Cognitive Services 開発サポートチーム 津田