JP2023167720A - Dialogue device, dialogue system, and dialogue method - Google Patents

Dialogue device, dialogue system, and dialogue method Download PDF

Info

Publication number
JP2023167720A
JP2023167720A JP2022079113A JP2022079113A JP2023167720A JP 2023167720 A JP2023167720 A JP 2023167720A JP 2022079113 A JP2022079113 A JP 2022079113A JP 2022079113 A JP2022079113 A JP 2022079113A JP 2023167720 A JP2023167720 A JP 2023167720A
Authority
JP
Japan
Prior art keywords
response
dialogue
model
input data
input
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2022079113A
Other languages
Japanese (ja)
Inventor
尚和 内田
Hisakazu Uchida
健 本間
Takeshi Honma
真 岩山
Makoto Iwayama
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2022079113A priority Critical patent/JP2023167720A/en
Publication of JP2023167720A publication Critical patent/JP2023167720A/en
Pending legal-status Critical Current

Links

Images

Abstract

To provide a dialogue system capable of returning an appropriate response suitable for each category relative to a harmful input of various categories.SOLUTION: A dialogue system includes an information processing device 205 and a server 201 connected to the information processing device via a network 202. The server includes: an input unit 401 for receiving input data; a plurality of dialogue models 408 that is trained so as to output a safe response sentence to harmful input data for each attack target by the input data to each generate a response sentence to the input data; and a response selection unit 405 for selecting and outputting the response sentence from a plurality of response sentences based on a predetermined reference.SELECTED DRAWING: Figure 4A

Description

本発明は、対話装置、対話システム、及び、対話方法に関する。 The present invention relates to a dialogue device, a dialogue system, and a dialogue method.

Web上からSNSやチャットの対話ログを収集して作成した対話システムでは、誹謗中傷などの不適切な応答を防止するため、例えば、特開2006-11592(特許文献1)に記載の技術がある。この公報では、禁止用語を含む文を出力することを防止することを目的とする。そのため、分割部81は、入力された文を単語に分割する。単語リスト記憶部83は、文中での使用を許可する単語を記憶する。文削除部82は、分割部81から供給される文のすべての単語が、単語リスト記憶部83に記憶される文中での使用を許可する単語である場合、その文を出力する。特許文献1には、例えば、対話を行うロボット装置の対話の応答文の作成に利用される入出力ペア(の出力例)の取捨選択に適用する、技術が記載されている。 In a dialogue system created by collecting SNS and chat dialogue logs from the Web, there is a technique described in, for example, Japanese Patent Laid-Open No. 2006-11592 (Patent Document 1) to prevent inappropriate responses such as slander. . The purpose of this publication is to prevent sentences containing prohibited words from being output. Therefore, the dividing unit 81 divides the input sentence into words. The word list storage unit 83 stores words that are permitted to be used in a sentence. If all the words in the sentence supplied from the dividing unit 81 are words that are allowed to be used in the sentence stored in the word list storage unit 83, the sentence deletion unit 82 outputs the sentence. Patent Document 1 describes, for example, a technique applied to selecting (output examples of) input/output pairs used for creating a response sentence for a dialogue of a robot device that performs a dialogue.

また、非特許文献1には、事前学習済言語モデルを用いた対話システムにおいて、誹謗中傷を含む発話とそれに対して適切な応答を返している対話ログをSNSから収集し、この対話ログで言語モデルを追加学習することで誹謗中傷の発話に対して適切な応答を出力する技術が記載されている。 Furthermore, in Non-Patent Document 1, in a dialogue system using a pre-trained language model, dialogue logs of utterances containing slander and appropriate responses are collected from SNS, and this dialogue log is used to evaluate the language A technology is described that outputs an appropriate response to slanderous utterances by additionally learning a model.

特開2006-11592号公報Japanese Patent Application Publication No. 2006-11592

Ashutosh Baheti他2名“Just Say No: Analyzing the Stance of Neural Dialogue Generation in Offensive Contexts”、Georgia Institute of Technology, Atlanta, GA, USA [online]<URL:https://arxiv.org/abs/2108.11830>Ashutosh Baheti and 2 others “Just Say No: Analyzing the Stance of Neural Dialogue Generation in Offensive Contexts”, Georgia Institute of Technology, Atlanta, GA, USA [online]<URL: https://arxiv.org/abs/2108.11830>

特許文献1では応答に含まれる単語のみで出力可否、つまり、不適切か否かを判定しており、有害な単語は含まれていなくとも意味としては不適切となる応答を抑制することができない。例えば、誹謗中傷に対して「私もそう思う。」と応答した場合、不適切な応答となるが、応答文に有害な単語は含まれておらず、単語のみでは不適切と判定することができない。 In Patent Document 1, it is determined whether the response can be outputted, that is, whether it is inappropriate or not, based only on the words included in the response, and it is not possible to suppress responses that are inappropriate in meaning even if they do not include harmful words. . For example, if you respond to slander with "I think so too," it will be an inappropriate response, but the response does not contain any harmful words, and the words alone cannot be judged as inappropriate. Can not.

非特許文献1はこのような課題を解決するものだが、有害発言には、人種・民族差別やジェンダー差別などさまざまなカテゴリーがあるのに対し、これらを一つの有害性として扱っていることから、有害発言によってカテゴリーに応じた適切な応答を出力できない場合がある。 Non-Patent Document 1 solves this problem, but since there are various categories of harmful speech, such as racial/ethnic discrimination and gender discrimination, it treats these as one type of harmful speech. , it may not be possible to output an appropriate response according to the category due to harmful comments.

そこで、本発明は、さまざまなカテゴリーの有害入力に対して、それぞれのカテゴリーに合った適切な応答を返すことができる対話システムを提供する。 Accordingly, the present invention provides an interaction system that can respond to harmful inputs of various categories and return appropriate responses suitable for each category.

上記目的を達成するために、例えば特許請求の範囲に記載の構成を採用する。 In order to achieve the above object, for example, the configurations described in the claims are adopted.

本願は上記課題を解決する手段を複数含んでいるが、その一例を挙げるならば、情報処理装置と、情報処理装置にネットワークを介して接続されるサーバを有する対話システムである。サーバは、情報処理装置から、投稿コメントやその投稿コメントに対する返信コメント等の入力文を含む入力データを受け付ける入力部と、入力データによる攻撃対象ごとに、有害な入力データに対し安全な応答文を出力するよう学習され、入力データに対し、それぞれが応答文を生成する複数の対話モデルと、複数の対話モデルから生成される複数の応答文から、所定の基準に基づいて、一つの応答文を選択して出力する応答選択部と、を備える対話システムである。 The present application includes a plurality of means for solving the above problems, and one example thereof is an interaction system having an information processing device and a server connected to the information processing device via a network. The server has an input section that receives input data including input text such as posted comments and reply comments to the posted comments from the information processing device, and a safe response text for each attack target by the input data against harmful input data. A single response sentence is generated based on a predetermined standard from multiple dialogue models that are trained to output and each generates a response sentence in response to input data, and multiple response sentences generated from the multiple dialogue models. This is a dialogue system including a response selection unit that selects and outputs a response.

本発明によれば、さまざまな種類の有害発言に対して、カテゴリーに応じた適切な応答を返すことができる対話システムを提供することができる。 According to the present invention, it is possible to provide a dialogue system that can respond to various types of harmful comments with appropriate responses according to their categories.

上記した以外の課題、構成及び効果は、以下の実施形態の説明により明らかにされる。 Problems, configurations, and effects other than those described above will be made clear by the following description of the embodiments.

第1の実施形態に係る対話システムの対話処理の説明図である。FIG. 2 is an explanatory diagram of dialogue processing of the dialogue system according to the first embodiment. 対話システムのシステム構成例の一例を示す説明図である。FIG. 2 is an explanatory diagram showing an example of a system configuration of a dialogue system. 対話システムのハードウェア構成例の一例を示すブロック図である。1 is a block diagram illustrating an example of a hardware configuration of a dialogue system; FIG. 第1の実施形態に係る対話システムの機能的構成例の一例を示す図である。FIG. 1 is a diagram illustrating an example of a functional configuration of a dialogue system according to a first embodiment. 第1の実施形態に係る対話システムの記憶デバイスに格納されるデータの一利絵を説明する図である。FIG. 2 is a diagram illustrating a picture of data stored in a storage device of the dialogue system according to the first embodiment. 掲示板型SNSの対話ログの整形方法を示す説明図である。FIG. 2 is an explanatory diagram showing a method for formatting a dialogue log of a bulletin board type SNS. コメントに対するアノテーション例を示す図である。FIG. 3 is a diagram showing an example of annotation for a comment. 第1の実施形態に係る対話システムの有害性評価モデル作成処理のフローチャートを示す図である。FIG. 3 is a diagram illustrating a flowchart of a harmfulness evaluation model creation process of the dialogue system according to the first embodiment. 第1の実施形態に係る対話システムの有害性評価モデル作成処理におけるデータフローの説明図である。FIG. 3 is an explanatory diagram of a data flow in a hazard evaluation model creation process of the dialogue system according to the first embodiment. 第1の実施形態に係る対話システムの有害カテゴリー対応対話モデル作成処理のフローチャートを示す図である。FIG. 3 is a diagram illustrating a flowchart of harmful category compatible dialog model creation processing of the dialog system according to the first embodiment. 第1の実施形態に係る対話システムの有害カテゴリー対応対話モデル作成処理におけるデータフローの説明図である。FIG. 2 is an explanatory diagram of data flow in harmful category compatible dialogue model creation processing of the dialogue system according to the first embodiment. 第1の実施形態に係る対話システムの対話処理のフローチャートを示す図である。FIG. 3 is a diagram showing a flowchart of dialogue processing of the dialogue system according to the first embodiment. 第2の実施形態に係る対話システムの機能的構成例の一例を示すブロック図である。FIG. 2 is a block diagram illustrating an example of a functional configuration of a dialogue system according to a second embodiment. 第2の実施形態に係る対話システムの対話処理のフローチャートを示す図である。FIG. 7 is a diagram showing a flowchart of interaction processing of the interaction system according to the second embodiment. 第2の実施形態に係る対話システムの有害性スコアの例を示す図である。FIG. 7 is a diagram showing an example of a harmfulness score of the dialogue system according to the second embodiment. 第2の実施形態に係る対話システムのカテゴリー別有害性スコアの閾値と総合有害性スコアを算出するための重み係数の例を示す図である。FIG. 7 is a diagram illustrating an example of a weighting coefficient for calculating a threshold of a harmfulness score by category and a comprehensive harmfulness score of the dialogue system according to the second embodiment. 第3の実施形態にかかる対話システムの機能的構成例の一例を示すブロック図である。FIG. 7 is a block diagram illustrating an example of a functional configuration of a dialogue system according to a third embodiment. 第3の実施形態にかかる対話システムの有害性評価モデル作成処理のフローチャートを示す図である。FIG. 7 is a diagram showing a flowchart of a harmfulness evaluation model creation process of the dialogue system according to the third embodiment. 第3の実施形態にかかる共起カテゴリーの登録例を示す図である。FIG. 7 is a diagram showing an example of registration of co-occurrence categories according to the third embodiment.

以下、図面を参照して本発明の実施形態を説明する。以下の記載および図面は、本発明を説明するための例示であって、説明の明確化のため、適宜、省略および簡略化がなされている。本発明は、他の種々の形態でも実施する事が可能である。特に限定しない限り、各構成要素は単数でも複数でも構わない。 Embodiments of the present invention will be described below with reference to the drawings. The following description and drawings are examples for explaining the present invention, and are omitted and simplified as appropriate for clarity of explanation. The present invention can also be implemented in various other forms. Unless specifically limited, each component may be singular or plural.

図面において示す各構成要素の位置、大きさ、形状、範囲などは、発明の理解を容易にするため、実際の位置、大きさ、形状、範囲などを表していない場合がある。このため、本発明は、必ずしも、図面に開示された位置、大きさ、形状、範囲などに限定されない。 The position, size, shape, range, etc. of each component shown in the drawings may not represent the actual position, size, shape, range, etc. in order to facilitate understanding of the invention. Therefore, the present invention is not necessarily limited to the position, size, shape, range, etc. disclosed in the drawings.

また、以下の説明では、プログラムを実行して行う処理を説明する場合があるが、プログラムは、プロセッサ(例えばCPU(Central Processing Unit)、GPU(Graphics Processing Unit))によって実行されることで、定められた処理を、適宜に記憶資源(例えばメモリ)および/またはインターフェースデバイス(例えば通信ポート)等を用いながら行うため、処理の主体がプロセッサとされてもよい。同様に、プログラムを実行して行う処理の主体が、プロセッサを有するコントローラ、装置、システム、計算機、ノードであってもよい。プログラムを実行して行う処理の主体は、演算部であれば良く、特定の処理を行う専用回路(例えばFPGA(Field-Programmable Gate Array)やASIC(Application Specific Integrated Circuit))を含んでいてもよい。 In addition, in the following explanation, processing performed by executing a program may be explained, but the program is executed by a processor (for example, a CPU (Central Processing Unit) or a GPU (Graphics Processing Unit)). The processor may be the main body of the processing in order to perform the processing using appropriate storage resources (for example, memory) and/or interface devices (for example, communication ports). Similarly, the subject of processing performed by executing a program may be a controller, device, system, computer, or node having a processor. The main body of the processing performed by executing the program may be an arithmetic unit, and may include a dedicated circuit (for example, FPGA (Field-Programmable Gate Array) or ASIC (Application Specific Integrated Circuit)) that performs specific processing. .

本実施の形態による対話装置、対話システム、対話方法は、例えば、パーソナルコンピューターの操作に対するQA、保険加入に関するQAの他、受付ロボット、コールセンタや高齢者向けロボットに適応される。特に、受付ロボット、コールセンタや高齢者向けロボットでは、多岐にわたる入力文を含む入力データに対して安全な応答文を出力することができ、受付時やコールセンタへの問い合わせに対する適切なおもてなし、高齢者の孤独を和らげるといった価値を提供することできる。 The dialogue device, dialogue system, and dialogue method according to the present embodiment are applied to, for example, QA for personal computer operations, QA for insurance enrollment, reception robots, call centers, and robots for the elderly. In particular, reception robots, call centers, and robots for the elderly can output safe response sentences to input data that includes a wide variety of input sentences. It can provide value such as alleviating loneliness.

本発明の第1の実施形態に係る対話処理の説明図を図1に示す。対話システム100は、ユーザから入力文を含む入力データ110を受け取り、応答文111を出力する。入力データ110は入力文含み、入力文は有害な発言の一例であり、投稿コメント、投稿コメントと投稿コメントに対する返信コメント等を含む。以下、入力データ110を入力文110として説明を続ける。対話システム100は、有害カテゴリー1に分類される有害な入力文に適切な応答ができるよう調整した有害カテゴリー1対応対話モデル101、有害カテゴリー2に分類される有害な入力文に適切な応答ができるよう調整した有害カテゴリー2対応対話モデル102、有害カテゴリーNに分類される有害な入力文に適切な応答ができるよう調整した有害カテゴリーN対応対話モデル103を備えており、入力文をそれぞれの対話モデルに入力して応答文を生成する。 FIG. 1 shows an explanatory diagram of interaction processing according to the first embodiment of the present invention. The dialogue system 100 receives input data 110 including an input sentence from a user, and outputs a response sentence 111. The input data 110 includes an input sentence, and the input sentence is an example of a harmful remark, and includes a posted comment, a posted comment, and a reply comment to the posted comment. Hereinafter, the explanation will be continued assuming that the input data 110 is the input sentence 110. The dialogue system 100 includes a dialogue model 101 compatible with harmful category 1, which is adjusted to be able to appropriately respond to harmful input sentences classified as harmful category 1, and a dialogue model 101 that is adjusted to be able to appropriately respond to harmful input sentences classified as harmful category 2. It is equipped with a dialogue model 102 compatible with harmful category 2, which has been adjusted as shown in FIG. to generate a response sentence.

ここで「有害カテゴリー」とは、投稿コメントを含む入力データ、投稿コメントと投稿コメントに対する返信コメントを含む入力データに含まれる入力文よって攻撃される対象「攻撃対象」であって、例えば、人種・民族差別や犯罪記事等である。そのため、有害カテゴリー1対応対話モデル101、有害カテゴリー2対応対話モデル102、有害カテゴリーN対応対話モデル103を、攻撃対象対応対話モデルと称することもできる。 Here, the term "harmful category" refers to an "attack target" that is attacked by input data including posted comments, and input sentences included in input data including posted comments and reply comments to posted comments, and includes, for example, racial - Articles about ethnic discrimination or crimes. Therefore, the dialogue model 101 compatible with harmful category 1, the dialogue model 102 compatible with harmful category 2, and the dialogue model 103 compatible with harmful category N can also be referred to as the dialogue model compatible with attack targets.

そして、対話システム100は、対話モデルが生成した各応答文に対して、有害か否かを評価して有害性スコアを算出し、有害性スコアがもっとも低い応答文を選択して出力する。図1では、入力文110に対して、有害カテゴリー1対応対話モデル101が出力した応答文104の有害性が最も低いと判定され、応答文111として出力されている様子を表している。 Then, the dialogue system 100 evaluates each response sentence generated by the dialogue model to determine whether it is harmful or not, calculates a harm score, and selects and outputs the response sentence with the lowest harm score. In FIG. 1, a response sentence 104 output by the harmful category 1 compatible dialogue model 101 is determined to be the least harmful to an input sentence 110, and is output as a response sentence 111.

<対話システム>
図2は、実施例1にかかる対話システムのシステム構成例を示す説明図である。対話システム100は、たとえば、クライアントサーバシステムであり、サーバ201と、PC203、スマートフォン204などの情報処理装置205と、を有する。サーバ201と情報処理装置205とは、インターネット、LAN(Local Area Network)、WAN(Wide Area Network)などのネットワーク202を介して通信可能である。
<Dialogue system>
FIG. 2 is an explanatory diagram showing an example of the system configuration of the dialogue system according to the first embodiment. The dialogue system 100 is, for example, a client server system, and includes a server 201 and an information processing device 205 such as a PC 203 or a smartphone 204. The server 201 and the information processing device 205 can communicate via a network 202 such as the Internet, a LAN (Local Area Network), or a WAN (Wide Area Network).

クライアントサーバシステムの場合、対話プログラムは、サーバ201にインストールされる。したがって、サーバ201は、対話システムとして、応答生成、モデル管理、応答選択、対話履歴管理処理を実行する。この場合、情報処理装置205は、処理対象のテキストのサーバ201への送信、サーバ201からの処理結果の受信、処理対象のテキストを入力するインタフェースとなる。 In the case of a client-server system, the interaction program is installed on the server 201. Therefore, the server 201 executes response generation, model management, response selection, and dialog history management processing as a dialog system. In this case, the information processing device 205 serves as an interface for transmitting text to be processed to the server 201, receiving processing results from the server 201, and inputting text to be processed.

一方、スタンドアロン型の場合、対話プログラムは、情報処理装置205にインストールされ、サーバ201は不要である。したがって、情報処理装置205は、対話装置として、テキストの入力、入力したテキストの応答生成、結果の出力を実行する。 On the other hand, in the case of a stand-alone type, the dialog program is installed on the information processing device 205, and the server 201 is not required. Therefore, the information processing device 205 functions as an interaction device, inputting text, generating a response to the input text, and outputting the results.

<対話システムのハードウェア構成例>
図3は、対話装置300のハードウェア構成例を示すブロック図である。
<Example of hardware configuration of dialogue system>
FIG. 3 is a block diagram showing an example of the hardware configuration of the dialog device 300.

対話装置300は、対話システムの場合にはサーバ201に相当し、スタンドアロン型の場合には情報処理装置205に相当する。対話装置300は、プロセッサ301と、記憶デバイス302と、入力デバイス303と、出力デバイス304と、通信インタフェース(通信IF)305と、を有する。プロセッサ301、記憶デバイス302、入力デバイス303、出力デバイス304、および通信IF305は、バス306により接続される。プロセッサ301は、対話装置300を制御する。記憶デバイス302は、プロセッサ301の作業エリアとなる。また、記憶デバイス302は、各種プログラムやデータを記憶する非一時的なまたは一時的な記録媒体である。記憶デバイス302としては、たとえば、ROM(Read Only Memory)、RAM(Random Access Memory)、HDD(Hard Disk Drive)、フラッシュメモリがある。入力デバイス303は、データを入力する。入力デバイス303としては、たとえば、キーボード、マウス、タッチパネル、テンキー、スキャナ、マイク、生体センサがある。出力デバイス304は、データを出力する。出力デバイス304としては、たとえば、ディスプレイ、プリンタ、スピーカがある。通信IF305は、ネットワーク202と接続し、データを送受信する。 The dialogue device 300 corresponds to the server 201 in the case of a dialogue system, and corresponds to the information processing device 205 in the case of a stand-alone type. The dialog device 300 includes a processor 301 , a storage device 302 , an input device 303 , an output device 304 , and a communication interface (communication IF) 305 . The processor 301, storage device 302, input device 303, output device 304, and communication IF 305 are connected by a bus 306. Processor 301 controls interaction device 300 . The storage device 302 becomes a work area for the processor 301. Furthermore, the storage device 302 is a non-temporary or temporary recording medium that stores various programs and data. Examples of the storage device 302 include ROM (Read Only Memory), RAM (Random Access Memory), HDD (Hard Disk Drive), and flash memory. Input device 303 inputs data. Examples of the input device 303 include a keyboard, a mouse, a touch panel, a numeric keypad, a scanner, a microphone, and a biosensor. Output device 304 outputs data. Examples of the output device 304 include a display, a printer, and a speaker. Communication IF 305 connects to network 202 and transmits and receives data.

<対話システム100の機能的構成例>
図4Aは、実施例1にかかる対話システム100の機能的構成例を示すブロック図である。対話システム100は、対話処理プログラムがインストールされたコンピュータであり、情報処置装置205、あるいはサーバ201である。対話システム100は、対話処理プログラムにより、入力部401、応答生成部404、モデル管理部402、対話モデル群408、有害性評価モデル403、応答選択部405、対話履歴管理部407、出力部406を実現する。
<Functional configuration example of dialogue system 100>
FIG. 4A is a block diagram showing an example of the functional configuration of the dialogue system 100 according to the first embodiment. The dialogue system 100 is a computer in which a dialogue processing program is installed, and is an information processing device 205 or a server 201. The dialog system 100 uses an input section 401, a response generation section 404, a model management section 402, a dialog model group 408, a toxicity evaluation model 403, a response selection section 405, a dialog history management section 407, and an output section 406 using a dialog processing program. Realize.

図4Bに示すように、入力部401、モデル管理部402、応答生成部404、応答選択部405、出力部406、対話履歴管理部407は、プロセッサ301が記憶デバイス302に格納された対話処理プログラム410を実行することで各種機能を実現する。 As shown in FIG. 4B, an input unit 401, a model management unit 402, a response generation unit 404, a response selection unit 405, an output unit 406, and a dialog history management unit 407 are configured by a dialog processing program stored in a storage device 302 by a processor 301. By executing 410, various functions are realized.

また、対話モデル群408、有害性評価モデル403、ベース対話モデル1002も、記憶デバイス302に格納される。 Furthermore, the interaction model group 408, the toxicity evaluation model 403, and the base interaction model 1002 are also stored in the storage device 302.

また、後述する有害単語リスト802、アノテーションデータ600等の各種データは、記憶デバイス302の各種データ411内に格納される。 Further, various data such as a harmful word list 802 and annotation data 600, which will be described later, are stored in various data 411 of the storage device 302.

入力部401は、図3の入力デバイス303に対応し、入力文であるテキストデータを読み込むモジュールで、テキストデータの加工と応答生成部404への入力を行う。また、有害性評価モデル403と対話モデル群408作成時のテキストデータの登録は、すべて入力部401を介して行われる。 The input unit 401 corresponds to the input device 303 in FIG. 3, and is a module that reads text data, which is an input sentence, and processes the text data and inputs it to the response generation unit 404. In addition, all text data are registered through the input unit 401 when creating the toxicity evaluation model 403 and the interaction model group 408.

モデル管理部402は、応答生成部404が使用する対話モデル群408と、応答選択部405が使用する有害性評価モデル403を管理する。モデル管理部402は、応答生成部404の指示に従って所定のモデルにテキスト(入力文)を入力し、モデルの出力結果(応答文)を返す。また、モデル管理部402は、応答選択部405の指示に従って所定のモデルに応答文を入力し、所定のモデルにより応答文の有害性スコアを算出し、応答文の有害性を把握する。さらに、モデル管理部402は、各種モデルの作成と登録も行う。 The model management unit 402 manages the interaction model group 408 used by the response generation unit 404 and the toxicity evaluation model 403 used by the response selection unit 405. The model management unit 402 inputs text (input sentence) to a predetermined model according to instructions from the response generation unit 404, and returns the output result (response sentence) of the model. Furthermore, the model management unit 402 inputs the response sentence into a predetermined model according to instructions from the response selection unit 405, calculates a harmfulness score of the response sentence using the predetermined model, and grasps the harmfulness of the response sentence. Furthermore, the model management unit 402 also creates and registers various models.

応答生成部404は、入力部401から受け取ったテキスト(入力文)を、モデル管理部402を介して対話モデル群408に入力し、それぞれの有害カテゴリー対応対話モデル(以下、単に対話モデルと称する)から応答文を取得する。対話モデルは、テキストを入力するとそのテキストに対する応答文を生成する。対話モデルは、SNSなどから取得した複数往復の対話文で学習したニューラル言語モデルである。 The response generation unit 404 inputs the text (input sentence) received from the input unit 401 to the dialog model group 408 via the model management unit 402, and generates a dialog model corresponding to each harmful category (hereinafter simply referred to as a dialog model). Get the response text from. When text is input, a dialogue model generates a response sentence for that text. The dialogue model is a neural language model learned from multiple round-trip dialogues obtained from SNS and the like.

図5は、入力部401から入力される掲示板型SNSから取得した投稿コメントと返信コメントのテキストで、ニューラル言語モデルの学習を行って対話モデルを作成するまでの説明図である。 FIG. 5 is an explanatory diagram of the process of training a neural language model and creating a dialogue model using the texts of posted comments and reply comments acquired from the bulletin board type SNS input from the input unit 401.

500は、入力部401から入力される掲示板型SNSのスレッド(投稿と一連の返信のツリー構造)を示す一例である。投稿コメント501に対する返信コメントが502と505である。また、返信コメント502に対する返信として返信コメント503が、さらにその返信として返信コメント504がある。 500 is an example of a bulletin board type SNS thread (tree structure of posts and a series of replies) input from the input unit 401. Comments 502 and 505 are replies to the posted comment 501. Further, there is a reply comment 503 as a reply to the reply comment 502, and a reply comment 504 as a reply to the reply comment 503.

510は、入力部401において、500の投稿コメントと返信コメントをニューラル言語モデルの学習用に整形したデータである。500は502~504と505~506の2つの枝を持ち、510では、それぞれの枝が511と512として整形されている。511は、501~504のコメントを連結したテキストで、「|」はコメントとコメントの境界を示す特殊なトークン(単語)であり、ニューラル言語モデルはこのトークンをもとに複数のコメントで構成されるテキストからそれぞれのコメントの範囲を認識する。 510 is data in which the input unit 401 formats 500 posted comments and reply comments for neural language model learning. 500 has two branches, 502 to 504 and 505 to 506, and in 510, the branches are formatted as 511 and 512, respectively. 511 is a text that connects comments 501 to 504, and "|" is a special token (word) that indicates the boundary between comments, and the neural language model is composed of multiple comments based on this token. Recognize the range of each comment from the text.

入力文として、投稿コメントと返信コメントを含む510の形式で大量の対話データを用意してニューラル言語モデルを学習することで、対話モデル522が作成され、例えば、対話モデル522に入力文521「午後から雪が降るそうです。」を与えると、この入力に対して尤もらしい応答として出力523「初雪ですね。」が得られる。対話モデル群408の対話モデルは、後述の方法で有害発言に対して適切な応答を出力できるよう学習された対話モデルである。 A dialogue model 522 is created by preparing a large amount of dialogue data in the format 510 including posted comments and reply comments as input sentences and learning the neural language model. It looks like it's going to snow.'', the output 523 ``It's the first snow.'' is obtained as a plausible response to this input. The dialogue models in the dialogue model group 408 are dialogue models that have been trained to output appropriate responses to harmful comments using the method described below.

ニューラル言語モデルを用いた対話モデルには、例えば、GPT-2(Generative Pre-trained Transformer 2)を用いて作成できる。例えば、SNSから取得したデータをGPT-2アーキテクチャで学習した対話モデルに、DialoGPTがある。なお、複数往復の対話履歴を含むテキストを入力としてその応答のテキストを出力することができればよく、これ以外の技術を用いて実現してもよい。例えば、別のアーキテクチャとして、BART(Bidirectional Auto-Regressive Transformer)が挙げられる。 A dialogue model using a neural language model can be created using, for example, GPT-2 (Generative Pre-trained Transformer 2). For example, DialoGPT is an interaction model that is trained using the GPT-2 architecture using data obtained from SNS. It should be noted that it is only necessary to input a text including a history of multiple round-trip conversations and output a response text, and it may be realized using other techniques. For example, another architecture is BART (Bidirectional Auto-Regressive Transformer).

有害性評価モデル403は、入力部401から入力されたテキストが有害発言等の有害な内容か否かを判別する文分類モデルで、入力されたテキスト(入力文)に対して有害か否かの二値の分類を行う。また、分類モデルの出力をソフトマックス関数に通して算出した分類結果の確率を、有害性スコアとして出力する。 The toxicity evaluation model 403 is a sentence classification model that determines whether the text input from the input unit 401 is harmful content such as harmful remarks, and is a sentence classification model that determines whether the input text (input sentence) is harmful or not. Perform binary classification. Furthermore, the probability of the classification result calculated by passing the output of the classification model through a softmax function is output as a harmfulness score.

有害性評価モデル403も、GPT-2(Generative Pre-trained Transformer 2)によって実現される。有害性評価モデル403は、後述の方法で有害な内容か安全な内容かの二値のラベルをコメント単位で付与したデータを用意し、文を入力した際にその文のラベルを予測するよう追加学習を行う。 The hazard evaluation model 403 is also realized by GPT-2 (Generative Pre-trained Transformer 2). The hazard evaluation model 403 prepares data in which a binary label of harmful content or safe content is assigned to each comment using the method described later, and adds a function that predicts the label of a sentence when the sentence is input. Learn.

応答選択部405は、応答生成部404が対話モデルによって出力した各応答文に対してモデル管理部402を介して有害性評価モデル403による評価を行う。応答選択部405は、有害性スコアが所定の閾値未満でかつ、もっとも低い応答文を出力部406と対話履歴管理部407に出力する。出力部406は、応答選択部405が選択した応答文を出力デバイス304に出力する。 The response selection unit 405 uses the toxicity evaluation model 403 to evaluate each response sentence output by the response generation unit 404 using the dialogue model via the model management unit 402. The response selection unit 405 outputs the response sentence with the lowest harmfulness score below a predetermined threshold to the output unit 406 and the dialogue history management unit 407. The output unit 406 outputs the response sentence selected by the response selection unit 405 to the output device 304.

対話履歴管理部407は、応答選択部405が選択した応答文を対話履歴として保持し、入力部401が入力を受け取ったときに、保持していた対話履歴を応答生成部404に出力する。例えば、対話履歴管理部407は、図5の入力される投稿コメント521に対し、応答選択部405により選択された応答文523との対応を管理する。 The dialogue history management unit 407 holds the response sentence selected by the response selection unit 405 as a dialogue history, and outputs the held dialogue history to the response generation unit 404 when the input unit 401 receives an input. For example, the dialogue history management unit 407 manages the correspondence between the input posted comment 521 in FIG. 5 and the response sentence 523 selected by the response selection unit 405.

<有害性評価モデル作成処理>
有害性評価モデル作成処理は、実施例1にかかる対話システム100において、モデル管理部402が、対話処理に必要な有害性評価モデルの作成、および、有害カテゴリー対応対話モデルの作成処理に使用するカテゴリー別有害性評価モデルの作成を行う処理である。モデル管理部402は、掲示板型SNSから取得した投稿コメントとそれに対する返信コメントに対し、ユーザを介して有害性有無のアノテーションを行い、これを使用して有害性評価モデルの学習を行う。有害性評価モデルを作成する処理のフローチャートを図7に、また、この処理におけるデータフローを図8に示す。アノテーションを行うデータの例を図6に示す。
<Hazard assessment model creation process>
In the hazard evaluation model creation process, in the dialogue system 100 according to the first embodiment, the model management unit 402 creates a hazard evaluation model necessary for dialogue processing, and creates a hazard category corresponding dialogue model. This is the process of creating another hazard assessment model. The model management unit 402 annotates posted comments acquired from the bulletin board type SNS and reply comments thereto as to whether or not they are harmful via the user, and uses this annotation to learn a harmfulness evaluation model. FIG. 7 shows a flowchart of the process of creating a hazard evaluation model, and FIG. 8 shows the data flow in this process. FIG. 6 shows an example of data to be annotated.

図8に示すように、モデル管理部402は、まず、SNSのダンプデータ801から有害発言を含むスレッドを抽出し、有害性評価モデルの学習用にデータの整形を行う(ステップS701)。ダンプデータ801は、一定期間のSNSのログをまとめたデータである。ダンプデータが取得できない場合は、SNSのクローリングによってデータを、入力部401から取得する。 As shown in FIG. 8, the model management unit 402 first extracts threads containing harmful comments from the SNS dump data 801, and formats the data for learning the harmfulness evaluation model (step S701). Dump data 801 is data that summarizes SNS logs for a certain period of time. If the dump data cannot be acquired, the data is acquired from the input unit 401 by crawling the SNS.

有害発言を含むスレッドの抽出は、有害発言関連用語リスト802の単語を含むスレッドをスクリーニングする。有害単語リスト802は誹謗中傷等の有害発言で頻出する単語のリストであり、記憶デバイス302の各種データ411として格納されている。単語リストは、Web上で公開されている禁止用語のリストなどを利用すればよく、また、ユーザが独自に作成してもよい。ステップS701のデータ整形は、図5で例示した形式500のデータを形式510のデータに整形する入力部401の処理である。 To extract threads containing harmful remarks, threads containing words in the harmful speech-related term list 802 are screened. The harmful word list 802 is a list of words that frequently appear in harmful comments such as slander, and is stored as various data 411 in the storage device 302. The word list may be created using a list of prohibited words published on the Web, or may be created independently by the user. The data formatting in step S701 is a process performed by the input unit 401 to format data in format 500 illustrated in FIG. 5 into data in format 510.

次にモデル管理部402は、ステップS701で整形されたデータ803に対して有害性有無に関するデータを付与するアノテーションを行う。アノテーションは人手で行うため、モデル管理部402がアノテーション対象のデータを出力デバイス304に出力し、入力デバイス303を通してユーザの入力を受け付ける。 Next, the model management unit 402 performs annotation on the data 803 formatted in step S701 to add data regarding the presence or absence of harmfulness. Since the annotation is performed manually, the model management unit 402 outputs the data to be annotated to the output device 304 and receives user input through the input device 303.

モデル管理部402は、整形済データ803から一つのデータを取り出す(ステップS702)。ここで、データとは、図5の511、512で例示した投稿コメントとその返信コメントを結合したデータである。このように投稿コメントとその返信コメントのアノテーションを同時に実施することで、コメント単体ではなく前のコメントも踏まえた有害性をアノテーションする。例えば、有害なコメントに同意するコメントも有害とする。 The model management unit 402 extracts one piece of data from the formatted data 803 (step S702). Here, the data is data that is a combination of posted comments and their reply comments exemplified by 511 and 512 in FIG. In this way, by simultaneously annotating posted comments and their reply comments, the harmfulness is annotated not only based on the comment alone but also on previous comments. For example, comments that agree with harmful comments are also considered harmful.

有害性は、予め定義されたカテゴリーから選択する。「有害性のカテゴリー」は、投稿コメントを含む入力データ、投稿コメントと投稿コメントに対する返信コメント等の入力文を含む入力データによって攻撃される対象「攻撃対象」であって、たとえば、人種・民族、ジェンダー、宗教、容姿、健康(障がい)、政治・社会経済などである。また、たとえば、特定の人種の特定の性別のように複数のカテゴリーにまたがった有害発言もあるため、有害性のラベルは複数カテゴリーを指定できるようにしておく。このようにして、一つのデータに含まれるすべてのコメントに対してアノテーションを行う(ステップS703)。 Hazards are selected from predefined categories. "Harmful categories" are "attack targets" that are attacked by input data including posted comments, posted comments and input data such as reply comments to posted comments, and include, for example, race/ethnicity. , gender, religion, appearance, health (disability), politics/socioeconomics, etc. Furthermore, since there are some harmful comments that fall into multiple categories, such as those related to a specific race or gender, the harmfulness label should be able to specify multiple categories. In this way, all comments included in one data are annotated (step S703).

アノテーションデータの例を図6に示す。図6は、アノテーションデータ600を示し、投稿コメント601とその返信コメント602~604に対し、有害性のカテゴリーとしてラベルが付与されている。前述の通り、モデル管理部402は一連の返信コメントをまとめて出力デバイス304に出力し、ユーザに対してアノテーションを実行させることで、文脈を考慮したラベルを付与できるようにする。605~608はアノテーションによって付与されたラベルである。アノテーションデータ600は、コメントに対する攻撃対象を特定するカテゴリーをラベルとして付与されたデータである。 An example of annotation data is shown in FIG. FIG. 6 shows annotation data 600, in which a posted comment 601 and its reply comments 602 to 604 are labeled as harmful categories. As described above, the model management unit 402 collectively outputs a series of reply comments to the output device 304 and allows the user to perform annotation, thereby making it possible to assign a label in consideration of the context. 605 to 608 are labels given by annotation. The annotation data 600 is data that is labeled with a category that specifies an attack target for a comment.

コメント601「あの国は犯罪者が多いですね。」は、人種・民族差別的なコメントであるため、「人種・民族」のラベルを付与する。コメント602「そんなことはない。」は、コメント601に反対するコメントであり有害性はないため、「有害性なし」のラベルが付与する。コメント603「いや、その通りだと思う。」は、コメント単体では有害性はないが、コメント601に同意する人種・民族差別的なコメントと判断できるため「人種・民族」のラベルを付与する。コメント604「あの国の男は怠け者の犯罪者だ。」は、人種・民族差別とジェンダー差別の二つの有害性を含むため、608の通り、「人種・民族」と「ジェンダー」の二つのラベルを付与する。 Comment 601 "There are a lot of criminals in that country." is a racially/ethnically discriminatory comment, so it is assigned a "racial/ethnic" label. Comment 602 "That's not true." is a comment that opposes comment 601 and is not harmful, so it is given a label of "not harmful." Comment 603 "No, I think that's right." is not harmful on its own, but it can be judged as a racial/ethnic discriminatory comment that agrees with comment 601, so it is given the label "racial/ethnic". do. Comment 604, ``Men from that country are lazy criminals.'' contains the two harmful effects of racial/ethnic discrimination and gender discrimination. Assign one label.

ユーザが一つのデータのアノテーションを完了し、ユーザから入力デバイス303を通して登録指示を受け付けると、モデル管理部402は、当該データを登録するとともに、このデータを含めて、これまでアノテーションされたデータについてカテゴリーごとのデータ数を集計する。 When a user completes the annotation of one piece of data and receives a registration instruction from the user through the input device 303, the model management unit 402 registers the data and assigns a category to the data that has been annotated so far, including this data. Aggregate the number of data for each.

モデル管理部402は、アノテーションされたデータ数が、あらかじめ設定されたデータ数に満たないカテゴリーがある場合、ステップS702に戻り、次のデータを取り出してアノテーションを続ける。このように、カテゴリーごとに十分な数のデータが登録できるまでアノテーションを行うことで、有害性評価モデルにカテゴリー間の精度差が出ることを防ぐ。 If there is a category in which the number of annotated data is less than the preset number of data, the model management unit 402 returns to step S702, extracts the next data, and continues annotation. In this way, annotation is performed until a sufficient number of data have been registered for each category, thereby preventing accuracy differences between categories in the hazard assessment model.

すべてのカテゴリーについて所定の数のデータが登録されると(ステップS704:YES)、モデル管理部402は、アノテーション済データ804を使用して有害性評価モデル403の学習を行う(ステップS705)。各データは、カテゴリーを含めた有害性がアノテーションされているが、このステップでは、モデル管理部402は、カテゴリーを分けずに有害か否かの二値分類を行う有害性評価モデルを作成する。したがって、モデル管理部402は、アノテーションされたデータに対して、正解ラベルを有害か否かの二値に変換して有害性評価モデル403の学習を行う。 When a predetermined number of data are registered for all categories (step S704: YES), the model management unit 402 uses the annotated data 804 to train the hazard evaluation model 403 (step S705). Each piece of data is annotated with hazards including categories, but in this step, the model management unit 402 creates a hazard evaluation model that performs binary classification of whether or not it is harmful without dividing the data into categories. Therefore, the model management unit 402 trains the toxicity evaluation model 403 by converting the correct label into a binary value indicating whether or not it is harmful for the annotated data.

次に、モデル管理部402は、カテゴリーごとの有害性評価モデル403を作成するため、アノテーション済データ804をカテゴリーごとに分類する(ステップS706)。データの分類後、モデル管理部402は、そのうちの一つのカテゴリーに着目し(ステップS707)、当該カテゴリーのデータ805を使用して有害性評価モデルの学習を行う(ステップS708)。そして、モデル管理部402は、未処理のカテゴリーがあれば(ステップS709:YES)、ステップS707に戻り、当該カテゴリーの有害性評価モデルの学習を行う。このようにしてすべてのカテゴリーの有害性評価モデルの学習が終わると(ステップS709)、有害性評価モデル作成処理が完了する。 Next, the model management unit 402 classifies the annotated data 804 for each category in order to create a hazard evaluation model 403 for each category (step S706). After classifying the data, the model management unit 402 focuses on one of the categories (step S707), and uses the data 805 of the category to train a hazard evaluation model (step S708). If there is an unprocessed category (step S709: YES), the model management unit 402 returns to step S707 and learns the toxicity evaluation model for the category. When learning of the hazard evaluation models for all categories is completed in this manner (step S709), the hazard evaluation model creation process is completed.

<有害カテゴリー対応対話モデル作成処理>
有害カテゴリー対応対話モデル(対話モデル)作成処理は、有害発言に対して適切な応答ができる対話モデルを、攻撃対象、即ち有害カテゴリーごとに作成する処理である。モデル管理部402が、有害性評価モデルを用いて、入力部401から入力されたSNSのダンプデータから有害発言に対して適切な応答を行っているスレッドを抽出し、このようなスレッドを使用してベース対話モデルの追加学習を行う。
<Harmful category compatible dialogue model creation process>
The harmful category compatible dialogue model (dialogue model) creation process is a process of creating a dialogue model that can appropriately respond to harmful comments for each target of attack, that is, for each harmful category. The model management unit 402 uses the toxicity evaluation model to extract threads that are responding appropriately to harmful comments from the SNS dump data input from the input unit 401, and uses such threads. Additional learning of the base interaction model is performed.

実施例1にかかる対話システム100において各種有害発言に対応した対話モデルの作成処理のフローチャートを図9に、また、この処理におけるデータフローを図10に示す。 FIG. 9 shows a flowchart of a process for creating a dialogue model corresponding to various harmful comments in the dialogue system 100 according to the first embodiment, and FIG. 10 shows a data flow in this process.

モデル管理部402は、まず、有害カテゴリー対応対話モデルのもとになるベース対話モデル1002を、ネットワーク202を介して外部装置から読み込み、記憶デバイス302に格納する(ステップS901)。ベース対話モデル1002は、SNS等から取得した大量の対話ログを用いて学習されたニューラル言語モデルで、第三者が公開しているニューラル対話モデルを流用する。 The model management unit 402 first reads the base interaction model 1002, which is the basis of the harmful category corresponding interaction model, from an external device via the network 202 and stores it in the storage device 302 (step S901). The base dialogue model 1002 is a neural language model learned using a large amount of dialogue logs obtained from SNS etc., and utilizes a neural dialogue model published by a third party.

なお、使用する対話モデルは、モデル管理部402が扱うアーキテクチャで、対話システム100の対話処理で扱う言語と同じ言語の学習データ、または当該言語を一定量含む多言語データで学習されたモデルとする。学習済みの対話モデルがない場合、対話システム100によって、SNSのダンプデータの取得からデータ整形、言語モデルの学習を行って作成する。 Note that the dialogue model to be used is a model that is trained using training data of the same language as the language handled by the dialogue processing of the dialogue system 100, or multilingual data containing a certain amount of the language, in an architecture handled by the model management unit 402. . If there is no trained dialogue model, the dialogue system 100 creates one by acquiring SNS dump data, shaping the data, and learning a language model.

次に、モデル管理部402は、有害性評価モデル作成処理の過程で入力部401が作成した整形済データ803を読み込む(ステップS902)。そして、モデル管理部402は、有害性評価モデル作成処理で作成した有害性評価モデル403を使用して、整形したデータに対して有害性の自動アノテーションを行う(ステップS903)。有害性評価モデル403による自動アノテーションは、有害性評価モデル作成処理のアノテーションと同様にコメント単位で行われる。なお、ここでの自動アノテーションは、有害か否かの二値である。 Next, the model management unit 402 reads the formatted data 803 created by the input unit 401 in the process of creating a hazard evaluation model (step S902). Then, the model management unit 402 performs automatic annotation of toxicity on the formatted data using the toxicity evaluation model 403 created in the toxicity evaluation model creation process (step S903). Automatic annotation by the hazard evaluation model 403 is performed on a comment-by-comment basis, similar to the annotation in the hazard evaluation model creation process. Note that the automatic annotation here has a binary value of whether it is harmful or not.

次にモデル管理部402は、有害なコメントを含み最後の返信コメントが有害ではないデータ1001を、有害性評価モデル403を用いて抽出する(ステップS904)。このスクリーニングによって、有害発言に対して適切な応答を行っている対話データを収集する。 Next, the model management unit 402 extracts data 1001 that includes a harmful comment and whose last reply comment is not harmful, using the harmfulness evaluation model 403 (step S904). Through this screening, dialogue data showing appropriate responses to harmful comments is collected.

次にモデル管理部402は、有害性評価モデル作成処理で作成したカテゴリー別の有害性評価モデルを使用して、ステップS904で抽出したデータ1001を有害性のカテゴリー別に分類する(ステップS905)。そして、次のステップにて、モデル管理部402は、有害カテゴリー対応対話モデルの追加学習を行っていく。 Next, the model management unit 402 classifies the data 1001 extracted in step S904 into categories of toxicity using the category-specific toxicity evaluation model created in the hazard evaluation model creation process (step S905). Then, in the next step, the model management unit 402 performs additional learning of the interaction model corresponding to the harmful category.

まず、モデル管理部402は、有害カテゴリーの一つに着目する(ステップS906)。そして、モデル管理部402は、ステップS901で読み込んだベース対話モデル1002に対して、ステップS904で抽出したデータを使用した追加学習を行い、汎用有害性対応対話モデル1003を作成する(ステップS907)。作成された汎用有害性対応対話モデル1003は記憶デバイス302に格納される。 First, the model management unit 402 focuses on one of the harmful categories (step S906). Then, the model management unit 402 performs additional learning on the base dialogue model 1002 read in step S901 using the data extracted in step S904, and creates a general-purpose hazard response dialogue model 1003 (step S907). The created general-purpose toxicity response interaction model 1003 is stored in the storage device 302.

そして、モデル管理部402は、ステップS905で分類したカテゴリー別のデータから着目しているカテゴリーのデータを選択する。モデル管理部402は、さらに、ステップS907で追加学習を行った汎用有害性対応対話モデル1003に対して選択したデータを使用した追加学習を行い、当該カテゴリーのカテゴリー対応対話モデルを作成する。 Then, the model management unit 402 selects data of the category of interest from the data classified by category in step S905. The model management unit 402 further performs additional learning using the selected data on the general-purpose toxicity response interaction model 1003 that underwent additional learning in step S907, and creates a category response interaction model for the category.

未処理のカテゴリーがある場合(ステップS909:YES)、ステップS906に戻り、未処理のカテゴリーの対話モデルを作成する。このようにしてすべてのカテゴリーの対話モデルを作成し(ステップS909:NO)、処理を終了する。このように、カテゴリー別データによる追加学習の前に、全カテゴリーのデータで追加学習を行うことで、有害発話全般に対する汎用性と特定の有害カテゴリーに対する専用性の両方の性質を獲得する効果がある。 If there is an unprocessed category (step S909: YES), the process returns to step S906 and an interaction model for the unprocessed category is created. In this way, interaction models for all categories are created (step S909: NO), and the process ends. In this way, performing additional learning using data from all categories before performing additional learning using categorical data has the effect of acquiring both generality for harmful utterances in general and specialization for specific harmful categories. .

<対話処理>
実施例1にかかる対話システム100における対話処理のフローチャートを図11に示す。対話処理では、有害性評価モデル作成処理で作成した有害性評価モデル403と、有害カテゴリー対応対話モデル作成処理で作成した、有害カテゴリー別の複数の対話モデルを使用して、有害入力に対して適切な応答を出力する処理である。
<Interaction processing>
FIG. 11 shows a flowchart of dialogue processing in the dialogue system 100 according to the first embodiment. Dialogue processing uses the hazard evaluation model 403 created in the hazard evaluation model creation process and the multiple dialogue models for each harmful category created in the harm category compatible dialogue model creation process to determine the appropriate response to the harmful input. This is a process that outputs a response.

対話処理は、入力デバイス303を通してユーザからテキストが入力されることで開始される。まず、入力部401が入力データを読み込み、入力データに含まれる入力文を、応答生成部404に出力する(ステップS1101)。ここで応答生成部404は、対話履歴管理部407が対話履歴を保持していた場合、対話履歴と入力文を結合する。次に、応答生成部404が、モデル管理部402を介して、入力文を各対話モデルに入力する(ステップS1102)。尚、対話履歴管理部407に対話履歴を保持していない場合には、入力文のみを各対話モデルに入力する。モデル管理部402は、すべての対話モデルから入力文に対する応答文を取得し、応答生成部404へ出力する。 The interaction process is started when a user inputs text through the input device 303. First, the input unit 401 reads input data and outputs an input sentence included in the input data to the response generation unit 404 (step S1101). Here, the response generation unit 404 combines the dialogue history and the input sentence if the dialogue history management unit 407 holds the dialogue history. Next, the response generation unit 404 inputs the input sentence to each interaction model via the model management unit 402 (step S1102). Note that if the dialogue history management unit 407 does not hold the dialogue history, only the input sentence is input to each dialogue model. The model management unit 402 acquires response sentences for input sentences from all interaction models and outputs them to the response generation unit 404.

応答生成部404は、モデル管理部402から受け取った応答文を応答選択部405に入力し、応答選択部405がこれらの応答文の有害性を評価する(ステップS1103)。応答選択部405は、モデル管理部402を介して、有害性評価モデル403に各応答文を入力し、応答文ごとに有害性スコアを得る。有害性スコアは、有害性評価モデル403が出力をソフトマックス関数に通して算出した分類結果の確率で0~1の値を取る。有害性スコアが1に近いほど、有害である確率が高いことを示す。 The response generation unit 404 inputs the response sentences received from the model management unit 402 to the response selection unit 405, and the response selection unit 405 evaluates the harmfulness of these response sentences (step S1103). The response selection unit 405 inputs each response sentence into the toxicity evaluation model 403 via the model management unit 402, and obtains a toxicity score for each response sentence. The harm score is the probability of the classification result calculated by the harm evaluation model 403 by passing the output through a softmax function, and takes a value between 0 and 1. The closer the harm score is to 1, the higher the probability that it is harmful.

次に応答選択部405は、算出した有害性スコアをもとに応答選択部405が出力した複数の応答文から最も適切な一つの応答文を選択する。応答選択部405は、まず、有害性スコアが閾値未満、つまり、安全な応答文があるかを判定する(ステップS1104)。有害性スコアが閾値未満の応答文があった場合(ステップS1104:YES)、応答選択部405は、その中から有害性スコアがもっとも低い応答文を選択する(ステップS1105)。なお、閾値未満の応答文が一つであった場合、この処理は省略される。 Next, the response selection unit 405 selects the most appropriate one response sentence from the plurality of response sentences output by the response selection unit 405 based on the calculated harmfulness score. The response selection unit 405 first determines whether there is a response sentence whose toxicity score is less than a threshold value, that is, whether there is a safe response sentence (step S1104). If there is a response sentence with a toxicity score below the threshold (step S1104: YES), the response selection unit 405 selects the response sentence with the lowest toxicity score from among them (step S1105). Note that if there is only one response sentence that is less than the threshold, this process is omitted.

有害性スコアが閾値未満の応答文がなかった場合(ステップS1104:NO)、つまり、すべての応答文を有害であると判定された場合、応答選択部405は、例外処理として、予め設定しておいた定型の応答文を出力する(ステップS1106)。定型の応答文とは、たとえば、「その発言には同意できません。」、あるいは「わかりません。」など、その有害入力文に対して同意しないことを示す応答である。このように処理することで、いずれの対話モデルからも適切な応答が得られなかった場合でも、有害な応答を出力することを防ぐ。 If there is no response sentence with a harmfulness score below the threshold (step S1104: NO), that is, if all the response sentences are determined to be harmful, the response selection unit 405 performs a preset response as an exception process. The fixed format response sentence is output (step S1106). The standard response sentence is, for example, a response indicating that the user does not agree with the harmful input sentence, such as "I don't agree with that statement." or "I don't understand." By processing in this manner, even if no appropriate response is obtained from any interaction model, harmful responses are prevented from being output.

そして、応答選択部405は、選択した応答文を出力部406に出力するとともに、入力文と選択した応答文を対話履歴として対話履歴管理部407に出力する(ステップS1107)。対話履歴管理部407は、応答選択部405が出力した入力文と応答文を対話履歴に追加する。対話履歴管理部407は、次の対話処理が開始された際に、対話履歴を応答生成部404に出力する。 Then, the response selection unit 405 outputs the selected response sentence to the output unit 406, and also outputs the input sentence and the selected response sentence to the conversation history management unit 407 as a conversation history (step S1107). The dialogue history management unit 407 adds the input sentence and response sentence output by the response selection unit 405 to the dialogue history. The dialogue history management unit 407 outputs the dialogue history to the response generation unit 404 when the next dialogue process is started.

以上説明した実施例1によれば、さまざまな種類の有害発言に対して適切な応答を返すことができる対話システムを提供することができる。 According to the first embodiment described above, it is possible to provide a dialogue system that can return appropriate responses to various types of harmful comments.

実施例1によれば、さまざまなカテゴリーに分類される有害発言に対して、カテゴリーごとに生成された対話モデルが適切な応答を生成し、応答選択部が各対話モデルにより生成した応答から最も適切な応答を選択することができる。換言すると、さまざまなカテゴリーの有害入力文に対して、適切な応答を返すことができる。 According to the first embodiment, the dialogue models generated for each category generate appropriate responses to harmful comments classified into various categories, and the response selection unit selects the most appropriate response from among the responses generated by each dialogue model. You can choose the appropriate response. In other words, it is possible to return appropriate responses to various categories of harmful input sentences.

本実施例では、有害性評価に有害カテゴリー別の有害性評価モデルを使用し、有害カテゴリーごとに有害性スコアの閾値を設定することで、有害カテゴリーごとの重要度を指定できるよう構成した対話システムについて説明する。 In this example, a hazard evaluation model for each hazard category is used for hazard evaluation, and a hazard score threshold is set for each hazard category, thereby making it possible to specify the importance of each hazard category. I will explain about it.

図12は、本実施例にかかる対話システムの機能的構成例を示すブロック図である。有害性評価モデルが有害性評価モデル群1201として複数モデル構成となっている以外は、実施例1にかかる対話システムと同じ構成である。また、有害性評価モデル群を構成するカテゴリー別の有害性評価モデルは、図7で説明した有害性評価モデル作成処理のフローチャートにおけるステップS708で作成されたカテゴリー別の有害性評価モデルである。 FIG. 12 is a block diagram showing an example of the functional configuration of the dialogue system according to this embodiment. The configuration is the same as that of the dialog system according to the first embodiment, except that the hazard evaluation model is a multiple model configuration as the hazard evaluation model group 1201. Moreover, the hazard evaluation model by category that constitutes the group of hazard evaluation models is the hazard evaluation model by category created in step S708 in the flowchart of the hazard evaluation model creation process described in FIG.

<対話処理>
実施例2にかかる対話処理のフローチャートを図13に示す。ステップS1301~ステップS1302までは、図11のステップS1101~ステップS1102までの処理と同様である。ステップS1303にて、応答生成部404は、モデル管理部402から受け取った応答文を応答選択部405に入力し、応答選択部405がこれらの応答文の有害性を評価する。応答選択部405は、モデル管理部402を介して、有害性評価モデル群1201に各応答文を入力し、応答文ごとにカテゴリー別有害性評価モデルから有害性スコアを得る。
<Interaction processing>
FIG. 13 shows a flowchart of the interaction process according to the second embodiment. Steps S1301 to S1302 are the same as steps S1101 to S1102 in FIG. 11. In step S1303, the response generation unit 404 inputs the response sentences received from the model management unit 402 to the response selection unit 405, and the response selection unit 405 evaluates the harmfulness of these response sentences. The response selection unit 405 inputs each response sentence to the toxicity evaluation model group 1201 via the model management unit 402, and obtains a toxicity score from the category-based toxicity evaluation model for each response sentence.

図14は、対話システムにおいて、応答選択部405が参照する有害性スコアテーブル1400であり、記憶デバイス302の各種データ411内に格納されている。有害性スコアテーブル1400は、複数の応答文の有害性スコアを管理する。図14では、3つの応答文のカテゴリーごとの有害性スコアの例を示す。応答文1401~1403について、カテゴリーセット1405それぞれのスコアが記載されている。1406は、後述の方法で算出された総合有害性スコアである。 FIG. 14 shows a harmfulness score table 1400 that is referred to by the response selection unit 405 in the dialog system, and is stored in various data 411 of the storage device 302. The harmfulness score table 1400 manages harmfulness scores of a plurality of response sentences. FIG. 14 shows examples of harmfulness scores for each category of three response sentences. For response sentences 1401 to 1403, scores for each category set 1405 are listed. 1406 is a total toxicity score calculated by the method described below.

応答選択部405は、次に、有害性スコアが閾値未満の応答文があるかを判定する(ステップS1304)。応答選択部405は、カテゴリー別有害性評価モデルごとに得られたすべての有害性スコアが閾値未満かを判定する。つまり、応答選択部405は、攻撃対象ごとに有害性スコアテーブル1400の有害性スコアと閾値、重み係数管理テーブル1500の閾値1501を比較することで、応答文の有害性を判断する。 The response selection unit 405 next determines whether there is a response sentence whose toxicity score is less than the threshold (step S1304). The response selection unit 405 determines whether all the toxicity scores obtained for each categorical hazard evaluation model are less than the threshold. That is, the response selection unit 405 determines the harmfulness of the response sentence by comparing the harmfulness score and threshold value of the harmfulness score table 1400 and the threshold value 1501 of the weighting coefficient management table 1500 for each attack target.

図15は、閾値、重み係数管理テーブル1500であり、記憶デバイス302の各種データ411内に格納される。閾値、重み係数管理テーブル1500は、カテゴリーごとの閾値1501と後述の総合有害性スコアの算出に用いる重み係数1502の例を示す。図15では、ジェンダーのみ閾値が0.5でありそのほかのカテゴリーの0.6に対して低く設定されているが、これはジェンダーの有害性を重視し、確率が低くても有害と判定する設定としていることを意味する。 FIG. 15 shows a threshold value and weighting coefficient management table 1500, which is stored in various data 411 of the storage device 302. A threshold and weighting coefficient management table 1500 shows examples of thresholds 1501 for each category and weighting coefficients 1502 used for calculating a comprehensive toxicity score, which will be described later. In Figure 15, the threshold value for gender is 0.5, which is set lower than 0.6 for other categories, but this is a setting that emphasizes the harmfulness of gender and judges it as harmful even if the probability is low. It means that.

図14に示す応答文の例では、応答文1401が、人種・民族とジェンダーの有害性スコアがともに0.55である。図15において、人種・民族の閾値は0.6であるため閾値未満となるが、ジェンダーの閾値は0.5となっているため閾値以上となる。したがって、応答選択部405は応答文1401を有害と判定する。一方、応答文1402と応答文1403はいずれの有害性スコアも閾値未満であり、応答選択部405はこの二つの応答文を安全と判定する。 In the example of the response sentence shown in FIG. 14, the response sentence 1401 has a harmfulness score of 0.55 for both race/ethnicity and gender. In FIG. 15, the threshold value for race/ethnicity is 0.6, which is less than the threshold value, but the threshold value for gender is 0.5, so it is greater than the threshold value. Therefore, response selection unit 405 determines response sentence 1401 to be harmful. On the other hand, both response sentences 1402 and 1403 have toxicity scores below the threshold, and the response selection unit 405 determines these two response sentences as safe.

有害性スコアが閾値未満の応答文1402と1403があるため(ステップS1304:YES)、応答選択部405は、それぞれの応答文に対して、重み係数1502を用いて総合有害性スコア1406を算出する(ステップS1305)。総合有害性スコアは、カテゴリー別有害性スコアにそれぞれ指定された重み係数を乗算したときの最大値である。応答文1402のカテゴリーごとの有害性スコアそれぞれに重み係数を乗算すると、ジェンダーは有害性スコア0.4に重み係数1.2を乗算した0.48が最大となり、この値が応答文1402の総合有害性スコアとなる。同様の方法で計算すると、応答文1403の総合有害性スコアは0.4となる。 Since there are response sentences 1402 and 1403 whose toxicity score is less than the threshold (step S1304: YES), the response selection unit 405 calculates the overall toxicity score 1406 using the weighting coefficient 1502 for each response sentence. (Step S1305). The overall toxicity score is the maximum value obtained by multiplying the categorical toxicity scores by the respective specified weighting coefficients. When each harmfulness score for each category of the response sentence 1402 is multiplied by a weighting coefficient, the maximum gender for gender is 0.48, which is the product of the harmfulness score of 0.4 and the weighting coefficient of 1.2, and this value is the overall value of the response sentence 1402. This is the toxicity score. When calculated in a similar manner, the overall toxicity score of response sentence 1403 is 0.4.

そして、応答選択部405は、総合有害性スコアが最も低い応答を選択する(ステップS1306)。図14の例では、応答文1403の総合有害性スコア0.4が最低となるため、応答文1403が最終的な出力として選択される。そして、応答選択部405は、選択した応答文を出力部406と対話履歴管理部407に出力する(ステップS1308)。 Then, the response selection unit 405 selects the response with the lowest overall toxicity score (step S1306). In the example of FIG. 14, the response sentence 1403 has the lowest overall toxicity score of 0.4, so the response sentence 1403 is selected as the final output. Then, the response selection unit 405 outputs the selected response sentence to the output unit 406 and the dialogue history management unit 407 (step S1308).

以上説明した実施例2によれば、すべての有害カテゴリーを同等に扱うか、または、特定のカテゴリーについて有害性の判断における重要度を変えるかを任意に設定できる対話システムを提供することができる。 According to the second embodiment described above, it is possible to provide an interaction system in which it is possible to arbitrarily set whether to treat all harmful categories equally or to change the importance of a specific category in determining the harmfulness.

本実施例では、対話モデル群の構成を任意に変更することで、対応する有害カテゴリーの変更や、使用する対話モデルの数を削減することで限られたリソースでの動作を可能にする対話システムについて説明する。 In this example, by arbitrarily changing the configuration of a group of dialogue models, the corresponding harmful category can be changed, and the number of dialogue models to be used can be reduced, thereby making it possible to operate with limited resources. I will explain about it.

図16は、本実施例にかかる対話システムの機能的構成例を示すブロック図である。実施例3では、対話モデル群1600が、標準モデル群1601、混合モデル群1602、詳細モデル群1603で構成される。 FIG. 16 is a block diagram showing an example of the functional configuration of the dialogue system according to this embodiment. In the third embodiment, the interaction model group 1600 is composed of a standard model group 1601, a mixed model group 1602, and a detailed model group 1603.

標準モデル群1601は、実施例1にかかる対話システムの対話モデル群408と同様の構成で、実施例1と実施例2で説明した有害カテゴリー別対応対話モデルで構成される。 The standard model group 1601 has the same configuration as the dialog model group 408 of the dialog system according to the first embodiment, and is composed of the corresponding dialog models for each harmful category described in the first and second embodiments.

混合モデル群1602は、複数の有害カテゴリーを混合した対話モデルで、例えば、一つの対話モデルで人種・民族とジェンダーに対応するよう構成した対話モデルである。 The mixed model group 1602 is a dialogue model that is a mixture of a plurality of harmful categories, and is, for example, a dialogue model configured to correspond to race/ethnicity and gender in one dialogue model.

詳細モデル群1603は、標準モデル群1601の有害カテゴリーを細分化したカテゴリー分類で作成した対話モデルである。例えば、人種・民族は、黒人、白人、アメリカ先住民、ジェンダーは、男性、女性、LGPTなどに細分化できる。対話モデル群1600以外は、実施例1にかかる対話システムと同じ構成である。 The detailed model group 1603 is an interaction model created by subdividing the harmful categories of the standard model group 1601 into categories. For example, race/ethnicity can be subdivided into black, white, Native American, and gender can be subdivided into male, female, LGPT, etc. The configuration other than the dialog model group 1600 is the same as that of the dialog system according to the first embodiment.

本実施例では、標準モデル群1601、混合モデル群1602、詳細モデル群1603を使い分けることにより、特に重視したい有害カテゴリーへの対応やそのためのハードウェアリソースの節約を行う。 In this embodiment, by properly using the standard model group 1601, mixed model group 1602, and detailed model group 1603, it is possible to deal with harmful categories that are particularly important and to save hardware resources for this purpose.

<有害性評価モデル作成処理>
図17に実施例3にかかる対話システムのモデル管理部402による有害性評価モデル作成処理のフローチャートを示す。なお、図17では図7で説明した有害性評価モデル作成処理に対する変更部分のみ図示している。図17のフローチャートは図7におけるステップS702~704にあたり、これ以降の動作は図7と同様である。
<Hazard assessment model creation process>
FIG. 17 shows a flowchart of the hazard evaluation model creation process by the model management unit 402 of the dialog system according to the third embodiment. Note that FIG. 17 shows only the changes to the hazard evaluation model creation process described in FIG. 7. The flowchart in FIG. 17 corresponds to steps S702 to S704 in FIG. 7, and the operations thereafter are the same as those in FIG.

モデル管理部402は、有害性評価モデルの学習用に整形したデータから一つのデータに着目する(ステップS1701)。 The model management unit 402 focuses on one piece of data from the data formatted for learning the hazard evaluation model (step S1701).

そして、モデル管理部402がアノテーション対象のデータを出力デバイス304に出力し、入力デバイス303を通してユーザの入力を受け付ける(ステップS1702)。このとき、メインカテゴリーとサブカテゴリーの両方を登録する。メインカテゴリーは実施例1で用いたカテゴリーで、サブカテゴリーは前述した人種・民族に対する黒人、白人、アメリカ先住民などのカテゴリーである。メインカテゴリーとサブカテゴリーはあらかじめ定義しておき、アノテーション時にユーザが選択できるようにしておく。 Then, the model management unit 402 outputs the data to be annotated to the output device 304, and receives user input through the input device 303 (step S1702). At this time, both the main category and subcategory are registered. The main category is the category used in Example 1, and the subcategories are the aforementioned racial/ethnic categories such as black, white, and Native American. The main category and subcategories are defined in advance so that the user can select them during annotation.

登録されたデータに複数のメインカテゴリーが含まれていた場合(ステップS1703:YES)、モデル管理部402は、カテゴリーの組み合わせを共起カテゴリーとして登録する(ステップS1704)。図6に示したデータ608の例では、人種・民族とジェンダーの二つのカテゴリーが含まれており、この条件に該当する。なお、図6の例では、一つのコメント(コメント604)に対して二つのカテゴリーが付与されている例だが、ステップS1703では、一連のコメント列であるデータ単位で複数のカテゴリーが含まれるか否かを条件とする。 If the registered data includes a plurality of main categories (step S1703: YES), the model management unit 402 registers the combination of categories as a co-occurring category (step S1704). The example of data 608 shown in FIG. 6 includes two categories, race/ethnicity and gender, and falls under this condition. Note that in the example of FIG. 6, two categories are assigned to one comment (comment 604), but in step S1703, it is determined whether or not a data unit, which is a series of comment strings, includes multiple categories. The condition is that

図18に共起カテゴリーテーブル1800の登録例を示す。共起カテゴリーテーブル1800は、記憶デバイス302の各種データ411内に格納される。共起カテゴリーテーブル1800は、共起カテゴリーのパターン1801とその頻度1802との対応関係を管理する。図6の例である人種・民族とジェンダーは1803のパターンに一致するため、モデル管理部402により、このパターンの頻度が加算される。なお、当該パターンが登録されていなかった場合は、パターンの登録を行う。ステップS1705の処理に移り、全カテゴリーのデータ数が充足されている場合(ステップS1705:YES)、ステップS1706の処理に移り、充足されていない場合(ステップS1705:NO)はステップS1701に戻り、次のデータのアノテーションを行う。 FIG. 18 shows a registration example of the co-occurrence category table 1800. The co-occurrence category table 1800 is stored in the various data 411 of the storage device 302. The co-occurrence category table 1800 manages the correspondence between co-occurrence category patterns 1801 and their frequencies 1802. Since race/ethnicity and gender in the example of FIG. 6 match the pattern 1803, the model management unit 402 adds the frequency of this pattern. Note that if the pattern has not been registered, the pattern is registered. The process moves to step S1705, and if the number of data for all categories is satisfied (step S1705: YES), the process moves to step S1706, and if it is not satisfied (step S1705: NO), the process returns to step S1701 and the next Annotate the data.

ステップS1706にて、モデル管理部402は、任意の閾値を超える高頻度の共起カテゴリーを混合カテゴリーとして登録する。図18の例では、モデル管理部402は、例えば、共起カテゴリー1803、1804、1805を混合カテゴリーセットとして登録する。次にモデル管理部402は、ステップS1706で登録した混合カテゴリーセットに含まれないカテゴリーがあるかを確認する(ステップS1707)。 In step S1706, the model management unit 402 registers co-occurrence categories with a high frequency exceeding an arbitrary threshold as mixed categories. In the example of FIG. 18, the model management unit 402 registers co-occurrence categories 1803, 1804, and 1805 as a mixed category set, for example. Next, the model management unit 402 checks whether there are any categories that are not included in the mixed category set registered in step S1706 (step S1707).

全カテゴリーを、人種・民族、ジェンダー、宗教、容姿、健康(障がい)、政治・社会経済として、登録した混合カテゴリーを「人種・民族、ジェンダー」、「容姿、ジェンダー」、「人種・民族、政治・社会経済」とすると、「健康(障がい)」が混合カテゴリーセットに含まれていない。混合カテゴリーセットに含まれないカテゴリーがある場合(ステップS1707:YES)、モデル管理部402は、作成した混合カテゴリーセットに当該カテゴリーを追加する(ステップS1708)。これにより、「人種・民族、ジェンダー」、「容姿、ジェンダー」、「人種・民族、政治・社会経済」、「健康(障がい)」が混合カテゴリーセットとなる。 All categories are classified as race/ethnicity, gender, religion, appearance, health (disability), politics/socioeconomics, and registered mixed categories are classified as "race/ethnicity, gender," "appearance, gender," and "race/ethnicity." ``Ethnicity, Politics/Socioeconomics'', ``Health (Disability)'' is not included in the mixed category set. If there is a category that is not included in the mixed category set (step S1707: YES), the model management unit 402 adds the category to the created mixed category set (step S1708). As a result, "race/ethnicity, gender," "appearance, gender," "race/ethnicity, politics/socioeconomics," and "health (disability)" become a mixed category set.

これ以降の処理は、図7のステップS705以降と同様で、モデル管理部402は、有害性評価モデルの作成とカテゴリー別有害性評価モデルの作成を行って処理を終了する。なお、各有害性評価モデルは、メインカテゴリー、サブカテゴリー、混合カテゴリーそれぞれで作成する。 The subsequent processing is similar to step S705 and subsequent steps in FIG. 7, and the model management unit 402 creates a hazard evaluation model and a category-specific hazard evaluation model, and then ends the process. Each hazard assessment model is created for each main category, subcategory, and mixed category.

<有害カテゴリー対応対話モデル作成処理>
実施例3にかかる対話システムの有害カテゴリー対応対話モデル作成処理は、作成する対話モデルがメインカテゴリー、サブカテゴリー、混合カテゴリーとなるのみで作成処理自体は同一である。メインカテゴリーの対話モデルが標準モデル群1601、サブカテゴリーの対話モデルが詳細モデル群1603、混合カテゴリーの対話モデルが、混合モデル群1602である。
<Harmful category compatible dialogue model creation process>
The dialogue model creation process corresponding to harmful categories in the dialogue system according to the third embodiment is the same as the creation process itself except that the dialogue models to be created are main category, subcategory, and mixed category. Main category interaction models are standard model group 1601, subcategory interaction models are detailed model group 1603, and mixed category interaction models are mixed model group 1602.

<対話処理>
実施例3にかかる対話システムの対話処理では、起動時に使用する対話モデルを、入力部401から指定ユーザによって行われる。対話モデルが指定されるとモデル管理部402は、当該指定された対話モデルが標準モデル群1601の場合、実施例1にかかる対話システムの対話処理と同等を実行する。例えばユーザが対話モデルとして、混合モデル群1602を指定した場合、標準モデル群1601を使用した場合と比較して応答の質は低下するが、使用する対話モデルの数が削減されることで動作に必要なハードウェアリソースを低減することができる。
<Interaction processing>
In the dialog processing of the dialog system according to the third embodiment, a dialog model to be used at startup is input by a designated user from the input unit 401. When a dialogue model is designated, the model management unit 402 executes the same dialogue processing as the dialogue system according to the first embodiment, if the designated dialogue model is the standard model group 1601. For example, if the user specifies the mixed model group 1602 as the interaction model, the quality of the response will be lower than when the standard model group 1601 is used, but the reduction in the number of interaction models used will improve the operation. Necessary hardware resources can be reduced.

具体的には、ユーザから入力を受け付けてから応答が出力されるまでの時間が削減される、また、クライアントサーバ方式で運用する場合、一度に対応できるクライアント数を増やすことができる、などの効果が期待できる。一方、詳細モデル群1603を使用する場合は、処理に必要なハードウェアリソースは増えるものの、サブカテゴリーに応じたより適切な応答を生成することができる。 Specifically, the time from receiving input from the user to outputting the response is reduced, and when operating in a client-server format, the number of clients that can be handled at once can be increased. can be expected. On the other hand, when using the detailed model group 1603, although the hardware resources required for processing increase, it is possible to generate a more appropriate response according to the subcategory.

また、必ずしも、標準モデル群1601、混合モデル群1602、詳細モデル群1603の括りに限定せず、異なるモデル群の対話モデルを組み合わせた運用も可能である。例えば、ハードウェアリソースの問題で混合モデル群1602による少数モデル構成とする必要がある一方、「女性差別」についてはより適切な応答を出力したいというニーズがあった場合、混合モデル群1602と詳細モデル群1603に含まれる「女性」カテゴリー対応モデルを併用すればよい。 Furthermore, the present invention is not necessarily limited to the standard model group 1601, the mixed model group 1602, and the detailed model group 1603, and it is also possible to combine interaction models from different model groups. For example, if it is necessary to configure a small number of models using the mixed model group 1602 due to hardware resource issues, but there is a need to output a more appropriate response for "discrimination against women," then the mixed model group 1602 and detailed model A model corresponding to the "female" category included in group 1603 may be used together.

以上説明した実施例3によれば、対話システムを動作させるハードウェアリソースの都合や特に重視したい有害カテゴリーがある場合に対応して、対話モデルの構成を任意に変更できる対話システムを提供することができる。 According to the third embodiment described above, it is possible to provide a dialogue system in which the configuration of the dialogue model can be arbitrarily changed depending on the availability of hardware resources for operating the dialogue system or when there is a harmful category that should be particularly emphasized. can.

なお、本発明は上記した実施例に限定されるものではなく、様々な変形例が含まれる。例えば、上記した実施例は本発明を分かりやすく説明するために詳細に説明したものであり、必ずしも説明した全ての構成を備えるものに限定されるものではない。また、ある実施例の構成の一部を他の実施例の構成に置き換えることが可能であり、また、ある実施例の構成に他の実施例の構成を加えることも可能である。また、各実施例の構成の一部について、他の構成の追加・削除・置換をすることが可能である。 Note that the present invention is not limited to the embodiments described above, and includes various modifications. For example, the embodiments described above are described in detail to explain the present invention in an easy-to-understand manner, and the present invention is not necessarily limited to having all the configurations described. Furthermore, it is possible to replace a part of the configuration of one embodiment with the configuration of another embodiment, and it is also possible to add the configuration of another embodiment to the configuration of one embodiment. Furthermore, it is possible to add, delete, or replace some of the configurations of each embodiment with other configurations.

また、上記の各構成、機能、処理部、処理ステップ等は、それらの一部又は全部を、例えば集積回路で設計する等によりハードウェアで実現してもよい。 Moreover, each of the above-mentioned configurations, functions, processing units, processing steps, etc. may be realized in part or in whole by hardware, for example, by designing an integrated circuit.

また、制御線や情報線は説明上必要と考えられるものを示しており、製品上必ずしも全ての制御線や情報線を示しているとは限らない。実際には殆ど全ての構成が相互に接続されていると考えてもよい。 Further, the control lines and information lines are shown to be necessary for explanation purposes, and not all control lines and information lines are necessarily shown in the product. In reality, almost all components may be considered to be interconnected.

100 対話システム
101 有害カテゴリー1対応対話モデル
110 入力文
111 応答文
401 入力部
402 モデル管理部
403 有害性評価モデル
404 応答生成部
405 応答選択部
406 出力部
407 対話履歴管理部
408 対話モデル群
100 Dialogue system 101 Harmful category 1 compatible dialogue model 110 Input sentence 111 Response sentence 401 Input section 402 Model management section 403 Hazard evaluation model 404 Response generation section 405 Response selection section 406 Output section 407 Dialogue history management section 408 Dialogue model group

Claims (10)

情報処理装置と、情報処理装置にネットワークを介して接続されるサーバを有する対話システムであって、
前記サーバは、
前記情報処理装置から、入力データを受け付ける入力部と、
入力データによる攻撃対象ごとに、有害な入力データに対し安全な応答文を出力するよう学習され、入力データに対し、それぞれが応答文を生成する複数の対話モデルと、
前記複数の対話モデルによって生成された複数の応答文から、所定の基準に基づいて最も適切な応答文を選択して出力する応答選択部と、を備える
対話システム。
An interaction system comprising an information processing device and a server connected to the information processing device via a network,
The server is
an input unit that receives input data from the information processing device;
For each attack target using input data, multiple interaction models are trained to output safe response sentences to harmful input data, and each generates a response sentence in response to input data,
A dialogue system comprising: a response selection unit that selects and outputs the most appropriate response sentence from a plurality of response sentences generated by the plurality of dialogue models based on a predetermined criterion.
請求項1に記載の対話システムであって、
前記応答選択部は、
応答文が有害か否かを判定する有害性評価モデルを使用して前記複数の対話モデルが出力した複数の応答文のそれぞれの有害性スコアを算出し、
有害性スコアが所定の閾値未満、かつ、最も低い応答文を選択する
対話システム。
The dialogue system according to claim 1,
The response selection section includes:
Calculating the toxicity score of each of the plurality of response sentences output by the plurality of dialogue models using a toxicity evaluation model that determines whether the response sentence is harmful;
A dialogue system that selects a response sentence whose toxicity score is less than a predetermined threshold and the lowest.
請求項1に記載の対話システムであって、
前記複数の対話モデルのそれぞれは、
入力データによる攻撃対象ごとに、有害な入力データと入力データに対する安全な応答文で学習される
対話システム。
The dialogue system according to claim 1,
Each of the plurality of interaction models is
A dialogue system that learns from harmful input data and safe response sentences for each input data attack target.
請求項3に記載の対話システムであって、
前記サーバは、前記複数の対話モデルを作成するモデル管理部を有し、
前記モデル管理部は、
前記入力部から入力した入力データに対し有害性評価モデルを利用してアノテーションを実行し、
前記入力部から入力した入力データから、有害な入力データに対し安全な応答文が含まれる入力データを抽出し、
抽出した入力データを、前記攻撃対象ごと分類し、
分類された各入力データを利用して、汎用有害性対応対話モデルとしてベース対話モデルを追加学習し、
前記汎用有害性対応対話モデルを、当該攻撃対象に分類された入力データを利用して追加学習することで、攻撃対象ごとに攻撃対象対応対話モデルを生成する
対話システム。
The dialogue system according to claim 3,
The server includes a model management unit that creates the plurality of interaction models,
The model management department includes:
Executing annotation on the input data input from the input unit using a hazard evaluation model,
Extracting input data that includes a safe response sentence to harmful input data from the input data input from the input section,
The extracted input data is classified according to the attack target, and
Using each classified input data, the base interaction model is additionally trained as a general-purpose hazard response interaction model,
A dialogue system that generates an attack target compatible dialogue model for each attack target by additionally learning the general-purpose harmfulness compatible dialogue model using input data classified into the attack target.
請求項1に記載の対話システムであって、
前記応答選択部は、
入力データによる攻撃対象ごとに有害か否かを判定する複数の有害性評価モデルを使用して前記複数の対話モデルが出力した応答文の有害性スコアを算出し、
算出された有害性スコアが所定の閾値未満、かつ、最も低い応答文を選択する
対話システム。
The dialogue system according to claim 1,
The response selection section includes:
Calculating the harm score of the response sentences output by the plurality of dialogue models using a plurality of harm evaluation models that determine whether each attack target based on input data is harmful;
A dialogue system that selects a response sentence whose calculated harm score is less than a predetermined threshold and the lowest.
請求項5に記載の対話システムであって、
前記サーバは、
前記複数の応答文の攻撃対象ごとの有害性スコアを管理する有害性スコアテーブルと、
攻撃対象ごとの有害性スコアの閾値と重み係数を管理する閾値、重み係数管理テーブルとを、記憶する記憶デバイスを有し、
前記応答選択部は、
攻撃対象ごとに前記有害性スコアテーブルの有害性スコアと前記閾値、重み係数管理テーブルの閾値を比較することで、応答文の有害性を判断し、
有害性の判断で安全な応答文の内、攻撃対象ごとの重み係数に基づいて、最適な応答文を選択する
対話システム。
The dialogue system according to claim 5,
The server is
a toxicity score table for managing toxicity scores for each attack target of the plurality of response sentences;
It has a storage device that stores thresholds and weighting coefficient management tables for managing harmfulness score thresholds and weighting coefficients for each attack target,
The response selection section includes:
Determine the harmfulness of the response sentence by comparing the harmfulness score of the harmfulness score table with the threshold value and the threshold value of the weighting coefficient management table for each attack target,
A dialogue system that selects the optimal response sentence from among safe response sentences based on the weighting coefficient for each attack target.
請求項4に記載の対話システムであって、
前記複数の対話モデルは、
入力データによる攻撃対象をカテゴリーとして分類し、前記カテゴリーを複数混合した混合カテゴリーで分類された有害な入力データと該入力データに対する安全な応答文で学習されたものである
対話システム。
The dialogue system according to claim 4,
The plurality of interaction models are:
A dialogue system that classifies attack targets based on input data into categories, and learns from harmful input data classified into a mixed category that is a mixture of a plurality of the categories and safe responses to the input data.
請求項7に記載の対話システムであって、
前記入力部は、
前記複数の対話モデルに含まれる対話モデルのうち、使用する攻撃対象対応対話モデルを指定し、
前記モデル管理部は、指定された攻撃対象対応対話モデルを使用して入力データに対する応答文を生成する
対話システム。
The dialogue system according to claim 7,
The input section is
Specifying an attack target response interaction model to be used from among the interaction models included in the plurality of interaction models,
The model management unit is a dialogue system that generates a response sentence to input data using a designated attack target correspondence dialogue model.
入力データを受け付ける入力デバイスと、応答文を出力する出力デバイスとを有する対話装置であって、
前記入力デバイスにより入力された入力データによる攻撃対象ごとに、有害な入力データに対し安全な応答文を出力するよう学習され、前記入力データに対し、それぞれが応答文を生成する複数の対話モデルと
複数の応答文から所定の基準に基づいて応答文を選択して、前記出力デバイスに出力する応答選択部と、を備える
対話装置。
An interaction device having an input device that receives input data and an output device that outputs a response sentence,
A plurality of interaction models each of which is trained to output a safe response sentence to harmful input data for each attack target using the input data input by the input device, and each generates a response sentence in response to the input data. An interaction device comprising: a response selection unit that selects a response sentence from a plurality of response sentences based on a predetermined criterion and outputs the selected response sentence to the output device.
入力部と出力部とを備えた対話システムを用いた対話方法であって、
前記対話システムの複数の対話モデルは、
有害な入力データに対し安全な応答文を出力するよう学習されたものであり、
前記複数の対話モデルは、入力された入力データによる攻撃対象ごとに、前記入力データに対し、それぞれが応答文を生成し、
前記複数の対話モデルのそれぞれの応答文から、所定の基準に基づいて応答文を選択して出力する
対話方法。
A dialogue method using a dialogue system comprising an input part and an output part,
The plurality of dialogue models of the dialogue system are:
It has been trained to output safe responses to harmful input data,
Each of the plurality of interaction models generates a response sentence to the input data for each attack target based on the input data, and
A dialogue method that selects and outputs a response sentence based on a predetermined criterion from response sentences of each of the plurality of dialogue models.
JP2022079113A 2022-05-12 2022-05-12 Dialogue device, dialogue system, and dialogue method Pending JP2023167720A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2022079113A JP2023167720A (en) 2022-05-12 2022-05-12 Dialogue device, dialogue system, and dialogue method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2022079113A JP2023167720A (en) 2022-05-12 2022-05-12 Dialogue device, dialogue system, and dialogue method

Publications (1)

Publication Number Publication Date
JP2023167720A true JP2023167720A (en) 2023-11-24

Family

ID=88838285

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2022079113A Pending JP2023167720A (en) 2022-05-12 2022-05-12 Dialogue device, dialogue system, and dialogue method

Country Status (1)

Country Link
JP (1) JP2023167720A (en)

Similar Documents

Publication Publication Date Title
Rudkowsky et al. More than bags of words: Sentiment analysis with word embeddings
US10460748B2 (en) Conversational interface determining lexical personality score for response generation with synonym replacement
US10936664B2 (en) Dialogue system and computer program therefor
US10878816B2 (en) Persona-based conversational interface personalization using social network preferences
Shah et al. Early depression detection from social network using deep learning techniques
CN111386520A (en) Constructing incoherent nodes by overlaying on a basic knowledge graph
JP2021197133A (en) Meaning matching method, device, electronic apparatus, storage medium, and computer program
US20170169355A1 (en) Ground Truth Improvement Via Machine Learned Similar Passage Detection
WO2019159986A1 (en) Information provision device, information provision method, and program
WO2021014249A1 (en) Natural language response in machine assisted agents
CN112287085B (en) Semantic matching method, system, equipment and storage medium
US20220147713A1 (en) Social bias mitigation in textual models
JP2020135135A (en) Dialog content creation assisting method and system
JP2021047817A (en) Output device and output program
CN112579733A (en) Rule matching method, rule matching device, storage medium and electronic equipment
JP2021022211A (en) Inquiry response support device, inquiry response support method, program and recording medium
CN113360001A (en) Input text processing method and device, electronic equipment and storage medium
Saha et al. Emoji prediction using emerging machine learning classifiers for text-based communication
KR102507809B1 (en) Artificial intelligence dialogue system for psychotherapy through consensus formation
JP2023167720A (en) Dialogue device, dialogue system, and dialogue method
US11045340B2 (en) Adding accessibility properties to a software application
JP2021512384A (en) Quantum superposition and entanglement of social emotions and natural language generation
Herbert et al. Comparative analysis of intelligent personal agent performance
JP7403023B1 (en) Writing support system, writing support method and program
Dissanayake et al. Enhancing conversational ai model performance and explainability for sinhala-english bilingual speakers