JP2004070876A - Conversation system and conversation processing program - Google Patents
Conversation system and conversation processing program Download PDFInfo
- Publication number
- JP2004070876A JP2004070876A JP2002233090A JP2002233090A JP2004070876A JP 2004070876 A JP2004070876 A JP 2004070876A JP 2002233090 A JP2002233090 A JP 2002233090A JP 2002233090 A JP2002233090 A JP 2002233090A JP 2004070876 A JP2004070876 A JP 2004070876A
- Authority
- JP
- Japan
- Prior art keywords
- sentence
- conversation
- time
- related information
- user
- 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
Links
Images
Landscapes
- Toys (AREA)
- Machine Translation (AREA)
Abstract
【課題】データベースの作成作業の負担を軽減し、自然な流れで、かつ、ユーザが楽しめるユニークな会話を実現する。
【解決手段】小説などの会話文を含んだ既存の文章情報から会話として利用可能な文章を抽出し、これらの文章に各文章間の時間的、話題的な距離を示す時間関連情報を付加して会話文データベース18を作成する。また、ニュース記事などの会話文を含まない既存の文章情報を利用して前記同様にして記事文データベース19を作成する。ユーザの発言に対し、会話文データベース18または記事文データベース19から会話として適切な文章を時間関連情報に基づいて選出して発言する。このように、既存の文章情報を利用することでデータベースを簡易に作成でき、そのデータベースを用いて自然な流れで、しかも、ユニークな会話を行うことができる。
【選択図】 図1To reduce the burden of creating a database, and to realize a unique conversation that can be enjoyed by a user in a natural manner.
SOLUTION: Extracting sentences that can be used as conversations from existing sentence information including conversation sentences such as novels, and adding time-related information indicating temporal and topical distances between the sentences to these sentences. To create the conversation database 18. Further, the article database 19 is created in the same manner as described above using existing sentence information that does not include a conversation sentence such as a news article. In response to the user's utterance, an appropriate sentence as a conversation is selected from the conversation sentence database 18 or the article sentence database 19 based on the time-related information and uttered. In this way, a database can be easily created by using existing text information, and a unique conversation can be performed using the database in a natural manner.
[Selection] Figure 1
Description
【0001】
【発明の属する技術分野】
本発明は、会話型ロボット等の玩具類やテレビゲーム機などに用いられる会話システムであって、ユーザがコンピュータを相手に会話することで楽しみや安らぎなどを得ることのできる会話システムに関する。
【0002】
【従来の技術】
従来、テレビゲーム機や玩具等に用いられる会話システムの多くは、通常、予め決められたシナリオに沿って会話を行う方式(以下、「シナリオ方式」と呼ぶ)を採用している。この「シナリオ方式」で用いられるシナリオは、実現性を考慮して、会話システムがまず話題を限定するような発言を行い、その後の会話の進展も、分岐が極力少なくなるように作られている。このため、人間(ユーザ)が会話の主導権をとれず、会話の流れが平凡だったり、不自然だったりするなどの欠点がある。
【0003】
そこで、「シナリオ方式」以外の会話システムとして、「人工知能」的な会話システムと、「人工無能」的な会話システムが考えられている。「人工知能」的な会話システムは、ユーザの発言を構文解析することにより意味を抽出して、発言の意図を理解し、それに基づいて返事を作り出そうとするシステムである。このシステムは、人間の知能に近い処理を行って会話を実現するものであるため、高度な技術が必要であると共に、あるゆる分野に対応させることは困難である。つまり、例えば「切符販売」や「情報検索」などのように、会話が限定された分野にしか適用することができない。
【0004】
これに対し、「人工無能」的な会話システムは、「人工無能」と俗称されているアプローチを主に用いる会話システムである。これは、ユーザの発言を構文解析して意味抽出するといったような手法を用いないで、表面的に会話らしきものを実現するものである。つまり、ユーザの発言の意味は理解していないが、会話としては成立するようなシステムを実現するものである。このシステムでは、ユーザの発言から特定のパターン(キーワード)を見つけ、そのパターンと予め用意されたデータベースに登録された各パターンとを比較し、該当するパターンに対応した返事のデータ群を出力する。例えば、データベースの中に「野球」といったパターンと、それに対応する返事データとして「私はABCチームのファンです。」と登録されている場合に、ユーザが「僕は野球が好きだ」と言ったとしたら、会話システムはその発言に含まれる「野球」をキーワードにしてデータベースを検索して、「私はABCチームのファンです」と答える。
【0005】
このように、「人工無能」的な会話システムは、構文解析等の複雑な処理を必要とせず、データベースによるパターンマッチングを採用しているため、実際の会話のような省略的な文や、文法的にあいまいな文であっても対応できる。また、ユーザの普通の発言(「シナリオ方式」のような決められた形式ではない発言)に対して返事を生み出す根本的な仕組みが提供されているので、ユーザが会話を自然に主導することができる。
【0006】
【発明が解決しようとする課題】
上述した「人工無能」的な会話システムでは、データベースの内容や量が会話の質に大きな影響を与える。データベースにつまらいない内容しか登録されていないと、つまらない会話しかできないし、登録量が少ないと、同じ会話の繰り返しとなる。しかし、質、量共に充実したデータベースを作成するには膨大な作業が必要となる。また、データベースの作成に関わる技術者が限られた人となるので、会話システムが返事できる話題もそれらの人が精通している話題の範囲に限られてしまう可能性がある。また、様々な会話の流れを事前に想定してデータベースを作成しておくことは非常に難しいので、会話として自然な流れにならない場合が多い。
【0007】
本発明は前記のような点に鑑みなされたもので、データベースの作成作業の負担を軽減し、自然な流れで、かつ、ユーザが楽しめるユニークな会話を実現することのできる会話システム及び会話処理プログラムを提供することを目的とする。
【0008】
【課題を解決するための手段】
本発明の会話システムは、ユーザとの間で会話を行う会話システムであって、既存の文章情報から会話として利用可能な文章を抽出する文章抽出手段と、この文章抽出手段によって抽出された各文章間の時間的、話題的な距離を示す時間関連情報を算出する時間関連情報算出手段と、前記文章抽出手段によって抽出された各文章に前記時間関連情報算出手段によって算出された時間関連情報を付加して記憶するデータベースと、ユーザの発言に対し、前記データベースから会話として適切な文章を前記時間関連情報に基づいて選択して発言する会話処理手段とを具備して構成される。
【0009】
このような構成の会話システムによれば、例えば小説、戯曲、映画やドラマのシナリオ、落語や漫才などの記録、実際の会話記録といったような会話文を含んだ既存の文章情報、あるいは、ニュース記事などのように会話文を含まない既存の文章情報を対象として、このような文章情報から会話として利用可能な文章が抽出され、これらの文章に各文章間の時間的、話題的な距離を示す時間関連情報が付加されてデータベースに登録される。そして、ユーザの発言に対し、このデータベースから会話として適切な文章が前記時間関連情報に基づいて選択されて発言される。このように、既存の文章情報を利用することでデータベースを簡易に作成でき、そのデータベースを用いて自然な流れで、しかも、ユニークな会話を行うことができる。
【0010】
また、本発明の会話システムは、ユーザとの間で会話を行う会話システムであって、既存の文章情報から会話として利用可能な文章を抽出する文章抽出手段と、この文章抽出手段によって抽出された各文章間の時間的、話題的な距離を示す時間関連情報を算出する時間関連情報算出手段と、前記文章抽出手段によって抽出された各文章に前記時間関連情報算出手段によって算出された時間関連情報を付加して記憶するデータベースと、ユーザの発言からキーワードを抽出するキーワード抽出手段と、このキーワード抽出手段によって抽出されたキーワードを含む文章を前記データベースから検索し、その文章の時間関連情報との差分が所定値以下の文章を発言候補として選択する選択手段と、この選択手段によって選択された文章を利用して発言する発言処理手段とを具備して構成される。
【0011】
このような構成の会話システムによれば、例えば小説、戯曲、映画やドラマのシナリオ、落語や漫才などの記録、実際の会話記録といったような会話文を含んだ既存の文章情報、あるいは、ニュース記事などのように会話文を含まない既存の文章情報を対象として、このような文章情報から会話として利用可能な文章が抽出され、これらの文章に各文章間の時間的、話題的な距離を示す時間関連情報が付加されてデータベースに登録される。そして、ユーザの発言に対し、その発言から会話の切っ掛けとなるキーワードが抽出され、前記データベースから当該キーワードを含む文章が検索されると共に、前記時間関連情報に基づいてその文章に時間的、話題的に近い文章が選出されて発言に利用される。このように、既存の文章情報を利用することでデータベースを簡易に作成でき、ユーザの発言に対し、そのデータベースから時間関連情報を用いて会話として適切な文章を選出して発言することで、自然な流れで、しかも、ユニークな会話を行うことができる。
【0012】
また、前記構成の会話システムにおいて、前記データベースの各文章に時間関連情報と共に前回発言日時を示す情報を付加しておき、前記選択手段は前記前回発言日時情報に基づいて所定日数以内に発言されていない文章を対象として発言候補の選択を行う構成とする。これにより、例えば3日以内に発言された文章を対象外として発言するなど、頻繁に同じセリフを発言することを回避することができる。
【0013】
また、前記構成の会話システムにおいて、前記発言処理手段は前記選択手段によって選択された文章から会話として不適切な部分を削除して発言する構成とする。これにより、既存の文章情報として、例えばニュース記事を利用した場合において、ニュース記事特有の表現で会話には不自然なものを除外してから発言するこができるので、ニュース記事を流用して発言しているにもか拘わらず不自然さの少ない発言を行うことができる。
【0014】
また、前記構成の会話システムにおいて、前記発言処理手段は前記選択手段によって選択された文章から会話として不適切な部分を削除し、その削除後の文章に含まれるキーワードの数に応じて当該文章を複数に分割することにより、これらの分割文章のいずれかを発言する構成とする。これにより、既存の文章情報として、例えばニュース記事を利用した場合において、会話の持つ情報量に近くなるように、その記事文の部分的に切り出して用いることで、本来は会話に用いるためのものではない書き言葉の文章から会話らしい発言を作り出すことができる。
【0015】
また、本発明の会話システムは、ユーザとの間で会話を行う会話システムであって、会話文と非会話文とが混在する特定の文章情報を記憶する記憶手段と、この記憶手段に記憶された文章情報の中からユーザの発言に含まれるキーワードを含んだ文章を検索する検索手段と、この検索手段によって検索された文章が会話文であるか非会話文であるか判断する判断手段と、この判断手段によって会話文であると判断された場合にそれ以後の会話文を対象として時間的、話題的な距離を示す時間関連情報を算出し、その時間関連情報に基づいて会話として適切な文章を選択して発言する第1の発言処理手段と、前記判断手段によって非会話文であると判断された場合にそれ以後の非会話文を対象として時間的、話題的な距離を示す時間関連情報を算出し、その時間関連情報に基づいて会話として適切な文章を選択し、その文章から会話として不適切な部分を削除して発言する第2の発言処理手段とを具備して構成される。
【0016】
このような構成の会話システムによれば、会話文と非会話文とが混在する特定の文章情報を利用して、会話における発言を作り出すことができる。この特定の文章情報とは、例えば電子ブックであり、会話文と会話文でない地の文章が混在している。ユーザの発言に含まれるキーワードが会話文にあれば、会話文を対象として時間関連情報が算出され、その時間関連情報に基づいて会話として適切な文章が選出されて発言される。一方、ユーザの発言に含まれるキーワードが非会話文にあれば、非会話文を対象として時間関連情報が算出され、その時間関連情報に基づいて会話として適切な文章が選出され、さらに、その文章から会話として不適切な部分が削除されて発言される。
【0017】
また、本発明の会話システムは、ユーザとの間で会話を行う会話システムであって、見出し語とそれに対応する説明文とからなる特定の辞書情報を記憶する記憶手段と、この記憶手段に記憶された辞書情報の中からユーザの発言に含まれるキーワードを含んだ見出し語を検索する検索手段と、この検索手段によって検索された見出し語に対応した説明文を前記辞書情報から抽出し、その説明文から会話として不適切な部分を削除して発言する第1の発言処理手段とを具備して構成される。
【0018】
このような構成の会話システムによれば、例えば「国語辞典」や「百科事典」などの特定の辞書情報を利用して、会話における発言を作り出すことができる。この辞書情報は見出し語とそれに対応する説明文とからなる。ユーザの発言に対し、その発言に含まれるキーワードを含んだ見出し語が検索され、その見出し語に対応した説明文が前記辞書情報から抽出され、さらに、その説明文から会話として不適切な部分が削除されて発言される。
【0019】
また、前記構成の会話システムにおいて、前記辞書情報の中にユーザの発言に含まれるキーワードを含んだ見出し語が存在しなかった場合に、前記辞書情報の中からランダムに見出し語を選出し、その見出し語に対応した説明文を利用して発言することで会話を継続させる第2の発言処理手段を備えた構成とする。これにより、ユーザの発言に含まれるキーワードが辞書情報の見出し語にない場合でも、この辞書情報からランダムに選出される見出し語に対応した説明文を利用して発言することで、会話を継続することができる。
【0020】
【発明の実施の形態】
以下、図面を参照して本発明の実施形態を説明する。
【0021】
(第1の実施形態)
図1は本発明の第1の実施形態に係る会話システムのハードウェア構成を示すブロック図である。この会話システムは、ユーザの発言に対し、あたかも人間が返事をしているかの如く発言して会話を進めるためのものであり、例えば会話型ロボット等の玩具類やテレビゲーム機などに搭載される。
【0022】
図1では、本システムを汎用のコンピュータによって実現した場合の基本的な構成が示されており、CPU11、音声入力部12、A/D変換部13、音声出力部14、D/A変換部15、ワークメモリ16、不揮発性メモリ17によって構成されている。
【0023】
CPU11は、不揮発性メモリ17などに記憶されたプログラムを読み込むことにより、そのプログラムに記述された手順に従って所定の処理を実行する。音声入力部12は、会話時にユーザの音声を入力するためのマイクである。この音声入力部12から入力されたユーザの音声(アナログデータ)はA/D変換部13でデジタルデータに変換されてCPU11に取り込まれる。CPU11はワークメモリ16を用いて処理を行い、ユーザの発言に対する返事をD/A変換部15を介して出力する。D/A変換部15は、CPU11によって生成された音声データをアナログデータに変換して音声出力部14に与える。音声出力部14は、これを外部に出力するためのスピーカである。
【0024】
不揮発性メモリ17は、例えばフラッシュメモリからなり、電源が切れても記憶内容が消えない書き換え可能なメモリである。この不揮発性メモリ17には、本発明の会話システムを実現するためのプログラム17aの他、会話処理に必要な情報として、会話文データベース18、記事文データベース19、キーワード履歴テーブル20、前回発言記事文バッファ21、累積発言文字数カウンタ22が設けられている。前記プログラム17aは、後述するデータベース作成処理を実行するためのプログラムを含む。
【0025】
会話文データベース18は、例えば小説、戯曲、映画やドラマのシナリオ、落語や漫才の記録、実際の会話記録など、会話文を含んだ既存の文章情報を対象として、その文章情報から会話部分の文章だけを抜き出して作成されたデータベースである。記事文データベース19は、例えばニュース記事など、会話文を含まない既存の文章情報(書き言葉による文章情報)を対象として、その文章情報から会話として利用可能な部分の文章を抜き出して作成されたデータベースである。
【0026】
キーワード履歴テーブル20は、ユーザの発言の中に見つけたキーワードと、それを見つけた日時のデータを履歴として保持としておくためのテーブルである。会話時にキーワードを見つける度にそれらをキーワード履歴テーブル20に書き込んでいく。この場合、キーワード履歴テーブル20の記憶容量が一杯になった時点で古い日時のデータから上書きしていくものとする。前回発言記事文バッファ21は、会話時に記事文データベース19に登録された記事の文章を利用してユーザに対する発言(返事)が行われた場合にその文章を保持しておくためのものである。累積発言文字数カウンタ22は、発言に利用された記事の文章の文字数をカウントしておくものである。
【0027】
このような構成の会話システムにおいて、音声入力部12から入力されたユーザの音声はA/D変換部13にてデジタルデータに変換された後、CPU11に与えられる。CPU11では、「音声認識処理」→「会話処理」→「読み上げ処理」といった順で各処理を行ってユーザの発言に対する返事を返す。すなわち、まず、「音声認識処理」により音声から文字への変換を行ってテキスト形式の文章を作成する。なお、「音声認識処理」では仮名漢字変換処理も同時に行われているものとする。次に、このテキスト形式の文章に対して「会話処理」を施してユーザの発言に対する返事を作成し、これを「読み上げ処理」によって読み上げる。このときCPU11にてユーザに対する返事として生成された音声データはD/A変換部15によってアナログデータに変換された後、音声出力部14を通じて出力される。
【0028】
ここで、「音声認識処理」と「読み上げ処理」については一般的に知られている手法を用いるものとしてその詳しい説明は省略する。以下では「会話処理」を中心に説明する。
【0029】
まず、「会話処理」で用いられる会話文データベース18と記事文データベース19を作成するための処理について説明する。なお、これらの会話文データベース作成処理は、本システムに備えられたCPU11の一機能として実行されるものであっても、あるいは、例えば本システムに接続されるパソコン等にて実行されるものであっても良い。パソコン等で行う構成の場合には、そこで作成された会話文データベース18や記事文データベース19が本システムの不揮発性メモリ17に書き込まれて、会話処理時に参照されることになる。本実施形態では、本システムに備えられたCPU11がプログラム17aを読み込むことで、以下に説明するような会話文データベース18と記事文データベース19の作成処理を行うものとする。
【0030】
(a)会話文データベース作成処理
会話文データベース作成処理では、例えば小説、戯曲、映画やドラマのシナリオ、落語や漫才などの記録、実際の会話記録など、直面している会話とはもともとは全く無関係に作られた作品の文章中に含まれる会話文を利用してデータベース(会話文データベース18)を作成する。この場合、この種の既存の文章情報から会話部分の文章を抜き出すと共に、これらの会話文間の時間的、話題的な距離を示す情報(以下、時間関連情報と称す)を算出して会話文データベース18に登録しておくことで、会話処理時に前記時間関連情報に基づいて適切な会話文を選択する。
【0031】
図2は第1の実施形態における会話システムの会話文データベース作成処理の流れを示すフローチャートである。ここでは、説明を簡単にするために、小説のテキストファイルが例えば不揮発性メモリ17などにあり、そのテキストファイルを読み込んで処理するものとする。なお、対象ファイルが戯曲やシナリオや会話記録などの場合には細部が多少異なる処理となる。
【0032】
小説のテキストファイルが複数あり、それらを1つずつ処理していく。会話部分の抽出は、対象が小説の場合に、「」や『』の会話記号用のかぎ括弧を利用して行えば良い。文単位への分割は、句点(。)などを利用すれば良い。時間関連情報は、各会話文の時間的な近さ、話題としての近さを知るための情報である。この時間関連情報の値が近い時には、その会話文が発言された時間が近く、同じ話題である可能性が高いことを示す。小説の場合には、各会話文が発言された時間そのものは分からないので、改行コードなどに基づいてその情報を作成する。改行コードが入ると、そこで文章間の時間的、意味的な繋がりは少し薄れると考える。小説において、空白行は、文章間に区切りをつけるために設けられている場合が多いので、空白行が入ると、その前後の文章の時間関連情報値を大きく(例えば“10”)隔てる。ファイルが変わると、全く違う話題になるので、さらに大きな値(例えば“100”)を加算する。
【0033】
この会話文データベース作成処理について詳しく説明する。
【0034】
図2に示すように、CPU11は、まず、時間関連情報を初期値“0”にして最初のテキストファイルを開き(ステップA11)、その先頭から次の改行コードまでのテキストを読み込む(ステップA12)。そして、CPU11は、その読み込んだテキストが空白行か否かをチェックする(ステップA13)。空白行でなければ(ステップA13のYES)、CPU11は「」や『』の会話記号を利用して当該テキストから会話部分の文章の抽出処理を行う(ステップA14)。その結果、会話部分があれば(ステップA15のYES)、CPU11は句点などを利用して会話部分の文章を文単位で分割し、これらの文データに時間関連情報と前回発言日時を付加して会話文データベース18に登録する(ステップA16)。なお、前回発言日時は会話処理で用いられるデータであり、この時点では空データを登録しておく。
【0035】
続いて、CPU11は現在の時間関連情報に“1”を加算し(ステップA17)、次の改行コードまでのテキストを読み込んで前記同様の処理を行う(ステップA18→A12)。また、読み込んだテキストが空白行の場合には(ステップA13のYES)、時間関連情報に“10”を加算して(ステップA19)、次のテキストに移る。
【0036】
全てのテキストに対する処理が終了すると(ステップA18のYes)、未処理のテキストファイルがあれば(ステップA20のYes)、そのテキストファイルに対して前記同様の処理を繰り返す。その際、全く違う話題になるので、CPU11は次のテキストファイルを開いたときに時間関連情報に“100”を加算しておく(ステップA21)。
【0037】
このようにして、会話文を含んだテキストファイルから会話文としての文章を抽出して文単位で時間関連情報および前回発言日時と共に会話文データベース18に登録していく。
【0038】
図3に前記会話文データベース作成処理の対象となる小説のテキストファイルの一例を示す(太宰治「グッド・バイ」より抜粋)。各行が改行コードまでの文章である。「…」はここで示した文章の前後にもデータがあることを表現している。なお、印刷や表示された時の一行と改行コードまでの一行とは異なる。改行コードがなくても一行に表示しきれない長さの文は改行されて表示、印刷される。また、時間関連情報は参考のために付したもので、実際のテキストファイルにはない。ここでは、「ケンカするほど深い仲、ってね。」の文章の時間関連情報が“5000”だったとして、そこから算出した値が示されている。「怪力(四)」は、章の題名である。このような章の変わり目を認識してやや大き目の値(例えば“30”など)を時間関連情報に加算しても良い。ここでは、空白行が必ず前後にあるので、それを利用した例を示した。
【0039】
図4にこのテキストファイルから作成された会話文データベース18の一例を示す。この会話文データベース18には、前記図3に示した小説の会話部分の文データが文単位で登録されている。これらの文データには時間関連情報と前回発言日時が付加されている。前回発言日時は会話処理で用いるデータであって、ここでは空白データである。
【0040】
(b)記事文データベース作成処理
記事文データベース作成処理では、ニュース記事などを対象として会話にふさわしい文を抽出してデータベース(記事文データベース19)を作成する。前記会話文データベース作成処理と同様に、文章情報から会話文を抜き出すと共に、これらの会話文間の時間的、話題的な距離を示す時間関連情報を算出して記事文データベース19に登録しておくことで、会話処理時に前記時間関連情報に基づいて適切な会話文を選べるようにする。ただし、ニュース記事などでは、そのニュース記事特有の表現が使われており、しかも、小説のように会話文を含まないため、会話文にふさわしい形に編集する必要がある。
【0041】
図2は第1の実施形態における会話システムの記事文データベース作成処理の流れを示すフローチャートである。ここでは、インターネット上のニュースサイトなどからニュース記事がダウンロードされて、HTML(HyperText Markup Language)形式の複数のファイルとして、例えば不揮発性メモリ17などに既にあるものとして説明する。
【0042】
ホームページ情報の中には、表示される文字以外にHTMLタグが含まれるのでこれを削除する。また、記事の内容を表現する文章以外に、リンクを伴った他の記事の見出しや他のホームページの名称などがある。これらには句点(。)が含まれないので、ここではそれで識別して削除する。ホームページの記事では、内容的に大きな区切りではないところでも空白行を用いることが多いので、空白行を見つけた時の時間関連情報の加算値は“1”とする。内容的に大きな区切りとなる箇所では、複数の空白行と共に見出しなども用いられ、その度に時間関連情報が加算されるので問題はない。また、ここでは、会話文データベース18の作成処理とは異なる処理を示すために、改行コードまでの文章が複数の文から構成されていても同じレコードに記録するものとする。
【0043】
この記事文データベース作成処理について具体的に説明する。
【0044】
図5に示すように、CPU11は、まず、時間関連情報を初期値“0”にして最初のHTMLファイルを開き(ステップB11)、そのHTMLファイルからタグを除去することで、画面に表示されているニュース記事のテキストのみを残す(ステップB12)。
【0045】
ここで、CPU11は次の改行コードまでのテキストを読み込み(ステップB13)、その読み込んだテキストが空白行か否かをチェックする(ステップB14)。空白行でなければ(ステップB14のYES)、CPU11は当該テキストに句点があるか否かをチェックする(ステップB15)。その結果、句点があれば(ステップB15のYes)、当該テキストは文章であるものとして、CPU11はその文データを抽出して時間関連情報と前回発言日時を付加して記事文データベース19に登録する(ステップB16)。なお、前回発言日時は会話処理で用いられるデータであり、この時点では空データを登録しておく。一方、句点がなければ(ステップB15のNO)、当該テキストは見出しやリンクであると判断して破棄して、ステップB17の進む。
【0046】
続いて、CPU11は現在の時間関連情報に“1”を加算し(ステップB17)、次の改行コードまでのテキストを読み込んで前記同様の処理を行う(ステップB18→B13)。
【0047】
また、全てのテキストに対する処理が終了すると(ステップB18のYes)、未処理のHTMLファイルがあれば(ステップB19のYes)、そのHTMLファイルに対して前記同様の処理を繰り返す。その際、全く違う記事になるので、CPU11は次のテキストファイルを開いたときに時間関連情報に“100”を加算しておく(ステップB20)。
【0048】
このようにして、ニュース記事などを対象として会話として利用可能な文章を抽出して時間関連情報および前回発言日時と共に記事文データベース19に登録していく。図6に前記記事文データベース作成処理によって作成される記事文データベース19の一例を示す。時間関連情報が“10000”と“10001”のレコードと、時間関連情報が“10102”から“10106”のレコードとは違うファイルの記事(ホームページ上では違うアドレスの記事)である。時間関連情報が“10102”から“10106”で2つずつ増えているのは、これらの文章は一連の文章ではあるが、間に空白行が入っていたことを意味している。
【0049】
(c)会話処理
次に、会話文データベース18と記事文データベース19を用いた会話処理について説明する。
【0050】
図7および図8は第1の実施形態における会話システムの会話処理の流れを示すフローチャートである。また、図9乃至図11はこの会話処理の中に含まれるレコード選択処理、記事文切断発言処理、記事文不適切部分削除処理の流れを示すフローチャートである。
【0051】
まず、これらのフローチャートで示される処理を説明する前に、理解を容易とするため、具体例を挙げて本システムの会話処理について説明する。ここで、「キーワード」とは、他の言葉よりも強く示唆する言葉を示すものであるが、本実施形態では説明を簡便にするために、2文字以上の漢字、カタカナ、数字、またはこれらの組み合わせからなる単語を会話の切っ掛けとなるキーワードとして認識するものとする。
【0052】
例えば、ユーザが「僕は音楽が好きだ」と言ったとすると、この中のキーワードは「音楽」である。そこで、会話文データベース18の中から「音楽」といったキーワードを有する文データが検索される。この場合、図4に示す会話文データベース18の例であれば(前回発言日時も図のようにデータがないものとし、ここで表示されている以外に「音楽」を含む文データがないとする)、レコード選択処理(図9)において、まず、「あなたにも音楽がわかるの?」と「ばか、僕の音楽通を示らんな、君は。」といった文データが抽出されると共に、これらの文データとの時間関連情報の差が2以下である「音痴みたいな顔をしているけど。」,「名曲ならば、一日一ぱいでも聞いていたい。」,「あの曲は、何?」,「ショパン。」も抽出される。
【0053】
これらの中の1つがランダムに選ばれて発言される。どれも音楽に関する発言なので、課題として適切である。これにより、ユーザに対して会話システムは自分の発言を理解したと錯覚させることができ、発言自体の表現も小説から抜粋されたものでユニークであり、会話の流れとしても自然である。
【0054】
この場合、会話文データベース18の中でキーワードを含む会話文を発言した人物の文章だけを利用してユーザに返事する方法も考えられるが、本実施形態では、キーワードを含む会話文を発言した人物と、その人と会話している人物の両方の文章から返事を見つけ出すようにしているため、返事のバリエーションが多く抽出でき、同時に、キーワード(前記例では「音楽」)そのものを含む会話文も返事として返されるされることがあるので、ユーザは自分の言ったことを理解していると強く感じて満足を得ることができる。また、キーワードがいつも返事に入っていると逆に不自然さを感じてしまうこともあるが、本実施形態ではキーワード(「音楽」)を含む文に後続するキーワードを含まない文も発言されることがあるので、その不自然さを感じることもない。しかも、その返事はキーワード(「音楽」)を含む会話の流れから選ばれたものであり、自然な内容であることが多い。
【0055】
ここで、会話文データベース18に登録された各会話文のデータに付加された時間関連情報が各会話文の時間的・内容的な差を適切に表現している。例えば、ユーザの発言の中に「ケンカ」というキーワードがあって、「ケンカするほど深い中、ってね。」が候補となったとしても、そのレコードの直後のレコードである「ピアノが聞こえるね。」が候補となることはない。
【0056】
また、本実施形態では、「あなたにも音楽がわかるの?音痴みたいな顔をしているけど。」のように、小説では1回の発言とされるところを、2つの文に分けて1つだけを発言させる。1つの文に比べると2つの文に含まれる情報は当然多く、情報量が増えると、ユーザの発言と食い違う情報が含まれてしまう可能性が高まる。それを避けて、ユーザの発言との食い違いが生じる可能性を下げるために、文単位にわけて発言させることで、会話システムが行っている会話とは本来は全く無関係に作られた小説の中の会話をいろいろな場面で利用できるようになる。
【0057】
また、発言された文の前回発言日時を会話文データベース18に記録しておき、これをレコード選択時に利用することで、同じ文が頻繁に発言されて飽きられることを防いでいる。
【0058】
ここで、会話文データベース18に返事を見つけられなかった場合、本システムは、より広い話題を含んでいる記事文データベース19を利用する。文を選択する処理は会話文データベース18の場合と同じである。しかし、選択された文をそのまま発言すると、会話としては非常に不自然になるので、記事文切断発言処理(図10)により、これを会話として自然なもの変形する。
【0059】
まず、ニュース特有の表現で、それをそのまま会話に用いると不自然な文を記事不適切部分削除処理(図11)で削除する。
【0060】
例えば、ユーザが「僕は****が好きなんだ」と言ったとして、それに対して選択されたレコードが、「米大リーグ、ア・リーグの最優秀選手(MVP)に選出された*****の****外野手(28)が9日、関西空港着の航空機で**夫人とともに帰国した。首位打者と盗塁王を獲得し、シーズン242安打の新人最多安打記録を90年ぶりに更新。」だったとする。なお、“****”の部分は、実際には人物の名前や場所の名前などが入るものであるが、ここでは固有名詞の記載を避けるために*記号でマスクして表現するものとする。
【0061】
前記の文章の例では、「(MVP)」,「(28)」,「9日」が不適切部分として削除される。これは、括弧を「カッコ」などと読み上げるのは会話として明らかに不自然なことによる。また、括弧自体は自動的に読まずに済ませるようにしたとしても、括弧の中の内容を読むことも不自然である。ユーザの日常の会話では、名詞の後に同格の名詞をつけることはないし、人物の年齢をその人を指す名詞の直後にいきなり言うこともない。「9日」のような日程に関する文言についても、このニュースが出た月内であれば意味があるが、他の月でも無意味なものであるため、削除対象となる。
【0062】
これらを削除することにより、前記文章は次のようになる。
【0063】
「米大リーグ、ア・リーグの最優秀選手に選出された*****の****外野手が、関西空港着の航空機で**夫人とともに帰国した。首位打者と盗塁王を獲得し、シーズン242安打の新人最多安打記録を90年ぶりに更新。」
しかし、これでも会話における発言としては全く不自然である。その最大の原因は、1回の発言としては情報量が多すぎることにある。日常会話では、1回の発言に含まれる情報量は非常に少ない。本実施形態では、キーワードの数で会話の情報量を量るものとする。
【0064】
例えば、「あなたにも音楽がわかるの?音痴みたいな顔をしているけど。」はキーワードを2つ(「音楽」,「音痴」)しか含んでいない。これに対し、「米大リーグ、ア・リーグの最優秀選手に選出された*****の****外野手が、関西空港着の航空機で**夫人とともに帰国した。首位打者と盗塁王を獲得し、シーズン242安打の新人最多安打記録を90年ぶりに更新。」は、明らかに2個以上のキーワードが含まれている。そこで、ランダムに任意の文字位置を選び、句読点を利用して、それを含む文節(選ばれた文字位置を含む文に読点がない場合は文)を切り出す。ここでは「文節」を、句読点で区切られ、その中にはそれ以上の句読点がない部分を言うことにする。
【0065】
これにより、例えば「米大リーグ」が切り出されたり、「ア・リーグの最優秀選手に選出された*****の****外野手が」などが切り出される。「米大リーグ」が切り出された場合は、ここに含まれるキーワードは1個だけなので、これをそのまま利用して返事とする。「ア・リーグの最優秀選手に選出された****の****外野手が」の文節が切り出された場合は、ここに含まれるキーワードが5個でまだ多すぎるので、さらに、この文節の中からランダムに任意の文字位置を選び、今度はキーワードを区切りとしてその文字を含む部分を切り出す。それでもまだ切り出した部分の情報量が多すぎる場合にはこれを繰り返して、最終的には、例えば「ア・リーグの最優秀選手に」や「*****の****外野手が」などを切り出す。
【0066】
文節は句読点ではもはや切り出せないが、キーワードを区切りにして切断しているので、切り出した部分は比較的自然な日本語となる。これらを返事とすると、結果として、ややぶっきらぼうで中途半端な印象も与えはするが、ユーザの発言との食い違いが目立たない曖昧な返事になる。なお、切り出した部分を編集して、例えば「米大リーグだな」や「****の****外野手がね」などのように語尾をつけたりしても良い。
【0067】
この手法では、関連している情報の一部分だけを発言しているので、ユーザは残りの部分を聞きたくもなる。例えば、ユーザの発言「野球」に対して「*****の****外野手が」と返事されるとその後が聞きたくなるし、「90年ぶりに更新」と返事されると、何が90年ぶりだろう、と興味を引かれる。このように意図的に情報量を制限することで、会話にミステリアスな味わいを付加し、ユーザに好奇心を持たせる効果も出せる。
【0068】
ユーザの発言のキーワードを用いて、会話文データベース18でも記事文データベース19でも返事が作れなかった場合、あるいは、ユーザの発言にキーワードが含まれていなかった場合に、そのまま応答しないでいると、非常に無口な会話システムとなってしまう可能性がある。そのような場合に備えた処理が図8に会話処理(2)として示した処理である。
【0069】
すなわち、記事文データベース19を用いて発言したときに、そのときに発言用として選択された文章を前回発言記事文バッファ21に記録しておくことで、これを利用して発言する。記事文データベース19を用いた発言の場合には、会話らしい情報量とするために、全体の文章のごく一部分しか発言していないので、残りの部分も発言する。
【0070】
これにより、主に以下の3つの効果が出せる。
(1)記事文データベース19を用いた発言が持つミステリアスな味わいにより引き起こされた興味や好奇心にある程度の充足感を与える。
(2)1つの話題について継続して会話しているという感覚をユーザに与える。
(3)選択された記事文の中にユーザの発言と食い違う情報が含まれていたとしても、徐々に小出しにすることでそれによる違和感を少なくする。
【0071】
前記(1)は、制限されて隠されていた情報が徐々に明かされることにより達成される。前記(2)は話が飛びすぎる人工無能特有の欠点を解消する。ユーザは自分がしゃべった直後に急に話をそらされると不快感を感じるが、徐々に時間をかけてあいまいに話がそれていくのにはそれほど不快感を感じない。また、情報量が制限され、小出しにされた中に食い違いが出てくると、不快感を感じるよりも、どういう意味かと不思議に思い質問したくなる傾向もある。前記(3)はそれらの傾向を利用している。しかし、記事文が持つ情報を全部明らかにしてしまうと、ユーザの発言意図と食い違う情報が多数出てきてしまい、前記(3)の効果ではカバーしきれなくなる。そこで、一定の制限を設けてそれに達したらやめるものとする。本実施形態では、累積発言文字数カウンタ22にて発言文字数をカウントしておき、文章全体の1/4に達した時点でやめるものとする。
【0072】
以上の仕組みを用いると、先ほどの例では、例えば次のような会話が可能である。
【0073】
ユーザ:「僕は****選手が好きなんだ」
会話システム:「*****の****外野手が」
ユーザ:「君も知っているんだね」(キーワードなし)
会話システム:「首位打者と盗塁王を」(従来の人工無能であれば、ここで全く違う話題になっているか、黙ってしまっている可能性が高いが、本発明では同じ話題を継続できる)
ユーザ:「うん」(キーワードなし)
会話システム:「関西空港着の航空機で」
ユーザ:「はあ?」(キーワードなし)
会話システム:「90年ぶりに更新」
ユーザ:「え?」(キーワードなし)
会話システム:「シーズン242安打」
ユーザ:「すごい記録だよね」(次の発言はキーワード「記録」を使って作られる)
このように、部分的には意味不明なところや食い違いがありながらも(その部分では特にユーザにミステリアスな味わいをあたえ好奇心を刺激しながら)、同じ話題で発言が行なわれ、最初の「僕は****選手が好きなんだ」に対応する会話が成立している。それぞれがあいまいな発言なので、不足した情報をユーザが都合よく補って解釈する効果もある。ここで引用した記事は野球の****選手が帰国したことを伝える報道記事である。本来は、ユーザの発言「僕は****選手が好きなんだ」とは無関係に書かれたものである。このように、会話とは全く無関係に作られた文章を会話に利用することができる。
【0074】
また、前回発言記事文バッファ21に文章がなかった場合、キーワード履歴テーブル20に記録しておいた最近のキーワードを用いて発言する。これにより、発言せずに終わってしまう可能性をさらに下げる。同時に、同じ話題について継続して会話している印象をユーザに与える。これも、話が飛びすぎる欠点を軽減するためのものである。例えば、先ほどの「僕は****選手が好きなんだ」で始まる会話の続きにおいて、キーワード「記録」に基づく会話をした後に、キーワード履歴テーブル20に残っているキーワード「****選手」に基づく会話を再開できる。
【0075】
以下に、上述した会話システムを実現するための具体的な処理手順について、図7乃至図11に示すフローチャートを参照して詳しく説明する。これらのフローチャートで示される処理は、本システムに備えられたCPU11がプログラムを読み込むことで実行する。
【0076】
図7に示すように、本システムの会話処理が起動されると、CPU11は、まず、ユーザの発言の中からキーワードを抽出する(ステップC11)。詳しくは、音声入力部12を通じて入力されたユーザの音声データを音声認識処理して得られるテキストデータの中から会話の切っ掛けとなるキーワードを探す。ここで言うキーワードとは、ユーザの発言内容を他の言葉よりも強く示唆する言葉である。本実施形態では、2文字以上の漢字、カタカナ、数字、またはこれらの組み合わせからなる単語をキーワードとして抽出する。ユーザの発言の中に該当するキーワードがあった場合には(ステップC12のYES)、CPU11は、その抽出したキーワードを不揮発性メモリ17に設けられたキーワード履歴テーブル20に現在日時のデータと共に書き込んだ後(ステップC13)、そのキーワードを用いて会話文データベース18に対するレコード選択処理を行う(ステップC14)。前記キーワード履歴テーブル20は後述する図8の会話処理(2)で用いられる。
【0077】
図9に示すように、レコード選択処理では、CPU11は、前記抽出したキーワードに基づいて会話文データベース18を検索する(ステップD11)。その結果、会話文データベース18に登録された文データの中に当該キーワードを含むレコードがあれば(ステップD12のYES)、CPU11はそのレコードを会話文データベース18から抽出すると共に、時間関連情報が近いレコードで、かつ、前回発言日時が所定日数以内でないレコードを抽出する(ステップD13)。時間関連情報が近いレコードとは、時間的、話題的に近いレコードのことであり、具体的には当該レコードの時間関連情報との差分値が2以内のレコードを言う。また、前回発言日時が所定日数以内でないレコードとは、最近発言されていないレコードのことであり、具体的には3日以内に発言されないレコードを言う。会話文データベース18から該当するレコードを抽出できた場合には(ステップD14のYES)、CPU11はこれらのレコードを発言候補として、そのうちの1つをランダムに選択する(ステップD15)。なお、1つしか抽出できなかった場合にはそれを選択レコードとする。
【0078】
図7に戻って、前記レコード選択処理によって会話文データベース18から発言候補としてのレコードが選択されると、CPU11はそのレコードの文データをユーザに対する返事として発言する(ステップC15)。詳しくは、発言する文データに対応した音声データを生成し、これをD/A変換部15にてアナログ波形に変換した後、音声出力部14を通じて読み上げる。このとき、CPU11は会話文データベース18の中の前記選択レコードに対応した前回発言日時の項目に現在日時を書き込んでおく(ステップC16)。一方、前記レコード選択処理によって会話文データベース18から発言候補としてのレコードが選択されなかった場合には、CPU11は当該キーワードを用いて記事文データベース19に対するレコード選択処理を行う(ステップC17)。このときのレコード選択処理は、会話文データベース18が記事文データベース19に代わるだけで図9と同様である。
【0079】
ここで、記事文データベース19から発言候補としてのレコードが選択された場合には、CPU11はそのレコードの文データに対して記事文切断発言処理を施すことで、その文データを会話として自然な形に直してからユーザに対する返事として発言する(ステップC18)。そして、CPU11は記事文データベース19の中の前記選択レコードに対応した前回発言日時の項目に現在日時を書き込んでおく(ステップC19)。
【0080】
図10に示すように、記事文切断発言処理では、CPU11は、まず、記事文データベース19から抽出した文データ(記事の文章)を不揮発性メモリ17に設けられた前回発言記事文バッファ21に保持しておく(ステップE11)。そして、CPU11はこの前回発言記事文バッファ21に保持した文データを処理対象として記事不適切部分削除処理を行い、その文データから会話として不適切な部分を削除する(ステップE12)。詳しくは、図11に示すように、CPU11は当該文データに含まれる括弧を探し、その括弧の記号とその括弧に挟まれた部分を削除する(ステップF11)。また、CPU11は当該文データから日時を表現する文言を探してこれを削除すると共に(ステップF12)、さらにニュース特有の文言、例えば「****通信社によると」とか「****新聞社の調べたところによると」などの文言を探してこれを削除する(ステップF13)。
【0081】
このようにして、文データから会話として不適切な部分を削除すると、CPU11はその削除後の文データに含まれるキーワードの数を調べて、そのキーワードの数がn個(ここではn=3)以上あれば(ステップE13のYES)、会話文として不適切であると判断して、以下のようにして文章を短文化して会話文として適切な形にしていく。
【0082】
すなわち、CPU11は、当該文データの任意の文字位置を乱数的に指定し、その文字を含む文節または文を句読点などを利用して切り出す(ステップE14)。そして、この切り出した文または文節に含まれるキーワードの数を調べ、それがn個以上であれば(ステップE15のYES)、今度はキーワードを区切りにして文節をさらに短く切断する(ステップE16)。これをキーワードの数がn個より少なくなるまで、具体的にはキーワードの数が2個以下になるまで繰り返す。
【0083】
CPU11はこのようして最終的に得られた文、文節あるいは断片をユーザに対する返事として発言する(ステップE17)。また、CPU11は今回発言した文字数を累積発言文字数カウンタ22に加算して(ステップE18)、その累積発言文字数カウンタ22の値が所定値以下であるか否かを判断する(ステップE19)。詳しくは、発言した文字数の累積値が前回発言記事文バッファ21の記事文章の長さの1/4以下であるか否かを判断する。これは、後述する会話処理(2)で同じ記事文章を小出しにして何らかの発言を行う場合において、ユーザは最初のうちはどういう意味かと不思議に思い質問したくなる傾向があるが、同一記事文の情報を全部明らかにしてしまうと、ユーザの発言意図と食い違う情報が多数出てきてしまい、逆に違和感を与えてしまうことになる。そこで、累積文字数が文章全体の1/4の長さに達した時点で同じ記事文章からの発言を中止するために(ステップE19のNO)、CPU11は前回発言記事文バッファ21を0クリアすると共に前回発言記事文バッファ21を空にしておく(ステップE20)。
【0084】
ここで、ユーザの発言に含まれるキーワードを用いて、会話文データベース18でも記事文データベース19でも返事が作れなかった場合(図7のステップC14→C17の非選択)、あるいは、ユーザの発言にキーワードが含まれていなかった場合において(図7のステップC11のNO)、図8に示す会話処理(2)が実行される。
【0085】
図8に示すように、会話処理(2)では、CPU11は、前回発言記事文バッファ21に文章があるか否かをチェックする(ステップC20)。前回発言記事文バッファ21に文章(前回選択された記事文)があれば(ステップC20のYES)、CPU11はこの文章を利用して前記図10の記事文切断処理を行って発言を行う(ステップC21)。一方、前回発言記事文バッファ21に文章がない場合には(ステップC20のNO)、CPU11はキーワード履歴テーブル20から最近に記録されたキーワードを抽出する(ステップC22)。この場合、今回記録されたキーワードは対象外とする。また、所定時間以上前に選択されているキーワードも対象外とする。このキーワード履歴テーブル20に該当するキーワードがあれば(ステップC23のYES)、CPU11はそのキーワードを用いて再度会話文データベース18や記事文データベース19から返事となる文を抽出して発言を行う(ステップC24〜C29)。ステップC24〜C29の処理は前記図7のステップC14〜C19と同様である。ただし、ここでも返事を作成できなかった場合には、ユーザの発言に対する返事はせずに会話処理を終了することになる。
【0086】
このように、本発明の会話システムでは、ユーザの発言に含まれるキーワードに基づいて会話文データベース18から会話文を見つけ、その会話文と時間関連情報の差が少ない会話文を返事としているので、元々はこれらの会話文は直面している会話とは全く無関係に作られたものであるにも拘わらず、そこから内容的に繋がりがあり、しかも、会話として自然な表現の返事を作り出すことができる。この場合、小説では各会話文の時間間隔を知ることはできないが、会話文の中の改行コードと共に地の文(会話文ではない文)や章の題の改行コードも用い、さらに内容の区切りを示すものとして空白行を考慮して時間関連情報を算出することで、会話文相互の時間的、話題的な関連性を適切に表現する情報が作り出せる。これを用いて会話文を選択するので、ユーザの発言と時間的にも内容的にも繋がりのある適切な文を選択して発言できる。
【0087】
また、小説の中では1回の発言とされている複数の文(一組の引用符に囲まれた文)を分割して、文単位で1回の発言としているので、ユーザの発言との明確な食い違いを生みにくく、多くの場面の会話に適用できる。
【0088】
ユーザ発言の中のキーワードを含む会話文に対する返事の会話文だけではなく、そのキーワードを含む会話文の話者自身の会話文も利用しているので、多くの会話文を選び出すことができ、発言のバラエティが豊富となる。また、これにより、ユーザが発言したキーワードそのものが含まれる返事と、それが含まれない返事の両方が可能となるので、ユーザに会話システムは自分の言ったことを理解しているという強い満足感を、不自然さを感じさせることなく与えることができる。
【0089】
会話文の識別と抽出、時間関連情報の算出が会話文データベース作成の際に行っておくので、会話時のCPU11の処理の負担が軽減する。また、会話文データベース18に会話文のみを抽出して持っているので、会話らしい会話が少ない容量のメモリで実現できる。
【0090】
一方、会話文データベース18とは別に記事文データベース19を用いて発言する場合において、ニュース記事に特有の表現で会話には不自然なものを除外してから発言するので、ニュース記事を流用して発言しているにもか拘わらず不自然さの少ない発言を行うことができる。また、会話の持つ情報量に近くなるように、記事文の一部分を切り出して用いるので、本来は会話に用いるためのものではない書き言葉の文章から会話らしい発言を作り出せる。この場合、句読点やキーワードを利用して文を切り出すので、切れ目が不自然にならない。断片的な発言を行うので、発言の意味があいまいで解釈の余地が広くなり、ユーザが会話の流れに都合よくその発言を解釈してくれる可能性が高まる。
【0091】
また、情報量を量る尺度として、キーワードの数を用いているので、文章を文法的に解析したりする必要がなく、簡単におおむね正しい情報量を見積もれる。断片的な発言で意味があいまいなのでユーザに興味や好奇心を抱かせ、会話を継続する欲求を持たせることができる。発言に利用したニュース記事の文章を記憶しておき、その後の発言で、そこから他の部分を切り出しているので、ユーザが持った興味や好奇心を少しずつ満足させていくことができる。また、これにより同一の話題で複数回の発言を行うことができ、1つの話題について継続して会話している感覚をユーザに与えることができる。これにより、今回のユーザの発言の中にキーワードを見つけられなかった場合や、見つけたとしてもそのキーワードでは発言を作り出せなかった場合であっても、適切な発言を作り出すことができる。
【0092】
また、ニュース記事に含まれているユーザの発言との食い違いが少しずつしか明らかにされないので、一度にニュース記事の内容すべてが明かされるよりもユーザにとって受け入れやすく、ユーザがそれを容認して会話を進めてくれる可能性が高まる。
【0093】
また、ニュース記事の文章を利用した発言では、その文章の持つ情報量のどれだけの割合が既に発言されたかを管理し、その文章の全部を発言せずに一定の割合が発言された時点でやめるので、そのニュース記事の文章のすべての内容が明かされることはなく、ユーザの発言との食い違いをあまり目立たないままにしておくことができる。
【0094】
また、記事文データベース19を用いた発言は、そればかりであれば、断片的な印象や、ぶっきらぼうな印象を与える可能性もあるが、会話文データベース18を用いた発言に混ざってそれがなされるので、会話全体の印象が自然なものとなる。言い換えれば、小説や戯曲などから会話文データベース18を作成した時には、そればかりを用いて発言すると、会話システムがやや喋りすぎの印象を与えてしまうことがあるが、記事文データベース19による発言と組み合わせることでそのような印象を弱めることもできる。
【0095】
また、ユーザの発言の中に含まれていたキーワードを履歴として残しておき、その後会話が進んだ後に、そのキーワードを用いて発言を行うので、話題が維持されて会話が行われているとユーザに感じさせることができる。また、これにより、ユーザの発言の中にキーワードを見つけられなかった場合や、見つけたとしてもそのキーワードでは発言を作り出せなかった場合にも、適切な発言を作り出すことができる。
【0096】
従来の「人工無能」的な会話システムでは、データベースに登録されているパターン(「登録パターン」と称す)と、そのパターンに対応する返事のデータ(「登録返事」と称す)の関係は単純で固定されている。本発明では、データベースに登録されている文データが「登録返事」に対応するわけであるが、それ自身に「登録パターン」も含んでいる。そして、その「登録パターン」と「登録返事」の関係は「多対多」の関係としてアルゴリズムが関連付けられている。例えば、図6に示す記事文データベース19に登録されている文データにおいて、「*****軍放送などによると、〜戦車は底辺の部分が裂けたという。」は、その直前のレコードである「*****自治区**中部の***人入植地近くで14日夜、〜今後、紛争の激化は必至だ。」に含まれる多数の「登録パターン」(キーワード)の「登録返事」であるとともに、直後のレコードである「軍放送によると、〜と声明を出したという。」を「登録返事」とする多数「登録パターン」を含んでいる。そして、それ自身も自分自身が持つ多数の「登録パターン」の「登録返事」である。これにより、いろいろな「登録パターン」に対して多数の適切な「登録返事」が対応できる。このような関係を従来の「人工無能」的な会話システムの方式で登録するのは困難であり、また、大量の記憶領域が必要となってしまう。
【0097】
なお、前記実施形態では、会話文データベース18を小説から作成する例を示したが、例えば戯曲、映画やドラマのシナリオ、落語や漫才などの記録、実際の会話記録などを用いても良い。これらを用いる場合には、会話文の識別や時間関連情報の算出にそれぞれに独特の書式を利用することになる。例えば、戯曲では、それぞれのセリフは「」で囲まれていない場合が多い。セリフを言う役名を行頭に置き、それに続けて一定の空白を設けてセリフが記されていることが多い。会話文ではない文《ト書き》が()に囲まれていたりもする。よって、このような戯曲の場合は、会話文の抽出に「」を利用せずにそれらの書式を利用すれば良い。
【0098】
また、記事文データベース19をインターネット上のニュース記事から作成する例を示したが、書籍など、文章を含むものであればどのようなものを利用しても良い。
【0099】
また、時間関連情報の算出に改行コードと空白行を用いたが、句点(。)、引用符(「」)、章や段落や項目の見出しなどを用いても良い。また、文字数を用いても良い(各文の先頭文字間の文字数を利用するなど)。
【0100】
また、時間関連情報をすべてのレコードに対して持つ例を示したが、時間関連情報の値が大きく変化するところにのみ持つなど、その一部だけを持っても良い。あるいは、時間関連情報を数値ではない形式で持っても良い。例えば、時間関連情報が大きく隔たるところに、空白のレコードなどを設けることにしても良い。
【0101】
また、キーワードを2文字以上の漢字、カタカナ、数字、またはこれらの組み合わせの単語としたが、他のものであっても良い。例えば、文字数の規定を変えても良いし、漢字とひらがなの混じった語句や、ひらがなだけからなる語句を含めたも良い。
【0102】
音声認識され漢字変換された後の文章からキーワードを抽出するものとしたが、漢字変換がされないひらがなでの状態で抽出しても良い。キーワードスポッティングなど、音としての認識の段階で抽出しても良い。これらの場合には、どの語句がキーワードなのかを知るための情報を設ければ良い。例えば、キーワードだけを登録したデータベースを用いれば良い。
【0103】
また、ユーザの発言の中にあるキーワードを会話文データベース18や記事文データベース19に探す例を示したが、ユーザの発言の中にあるもっと複雑なパターンを探しても良い。例えば、複数のキーワードのANDやORの組み合わせ、語順の指定、ワイルドカード文字を含んだ指定、品詞など語句の種類の指定、などがあっても良い。会話文データベース18や記事文データベース19を探す時に用いるパターンは、ユーザの発言の中にあるパターンそのものではなく、そこから作り出されたパターンや、それに対応して選ばれたパターンであっても良い。
【0104】
また、情報量をキーワードの数で量ったが、他の手段を用いても良い。例えば、文字数、漢字の数、読みの数、名詞の数、動詞の数、それらの組み合わせなどを用いても良い。
【0105】
また、記事文から発言を作るときに、情報量を常に一定値以下にしたが、全体的には情報量を下げながら、時には情報量の多い発言をしても良い。例えば、発言に含まれるキーワードの数を1から5までの範囲でランダムに選ぶなどしても良い。
【0106】
また、1回の発言の情報量を削減するために文の一部を切り出す処理は、記事文に対してのみ行ったが、会話文に対して行っても良い。戯曲などには非常に長いセリフもあるが、それに適用すると効果がある場合がある。会話文データベース18で発言されなかった時のみ、記事文データベース19を使うとしたが、例えば会話文データベース18で発言が作成可能な時にも、ある確率で記事文データベース19を用いた発言をしても良い。全体として会話文データベース18での発言が優先的に行われれば良い。
【0107】
また、ユーザ発言の中のキーワードを含む文以後の文を発言の候補としたが、それより前の文も、時間関連情報の差がある程度の範囲であるという条件で、候補に含めても良い。例えば、図4の会話文データベース18に示すようなデータを持つ場合に、ユーザの発言の中に「名曲」というキーワードを見つけた時、前記第1実施形態であれば、「音痴みたいな顔をしているけど。」が選択されることはなかったが、時間関連情報の差が負で絶対値の小さいものも候補として、これが選択できるようにしても良い。
【0108】
記事文データベース19の1つのレコードに改行コードまでの文章を当てはめたが、会話文データベース18のように文単位で当てはめても良い。逆に、会話文データベース18の1つのレコードを改行コードまで、あるいは、終端括弧の」まで(1回の発言全部)としても良い。
【0109】
また、前回発言記事文バッファ21に前回の発言時に選択された文章そのものを記憶させたが、その文章に対応する記事文データベース19のレコードを指定する情報を記憶させても良い。
【0110】
(第2の実施形態)
次に、本発明の第2の実施形態について説明する。
【0111】
図12は本発明の第2の実施形態に係る会話システムのハードウェア構成を示すブロック図である。なお、図1(第1の実施形態)と同一部分には同一符号を付して、その説明は省略するものとし、ここでは異なる点のみについて説明する。第2の実施形態における会話システムは、本来の機能である会話機能の他に、電子ブックリーダ機能と電子辞書機能を持つ。すなわち、図12に示すように不揮発性メモリ17の電子ブックデータ領域には、様々な電子ブックデータ31が記憶されており、会話システムはユーザから指示に応じて、それらを朗読する(読み上げる)ことができる。また、不揮発性メモリ17の電子辞書データ領域には、例えば「国語辞典」や「百科事典」などの様々な電子辞書データ32が記憶されており、ユーザの質問に対して、対応する項目の内容を読み上げることができる。この電子辞書データ32は、見出し語とその見出し語に対応する説明文とからなる。
【0112】
図13および図14は第2の実施形態における会話システムの会話処理の流れを示すフローチャートである。まず、これらのフローチャートで示される処理を説明する前に、理解を容易とするため、第2の実施形態としての会話処理の概要について説明する。
【0113】
第2実施形態では、電子ブックデータ31と電子辞書データ32を利用して会話における発言を作り出すことを特徴としている。電子ブックデータ31は、電子ブックとして提供される書物情報そのものなので、会話文データベース18とは異なり、会話文と会話文でない地の文(非会話文)、さらに空白行、作者名、タイトル、目次などが混在した特定の文章情報(テキストデータ)である。時間関連情報もそこには含まれていない。そこで、電子ブックデータ31の中にユーザ発言の中にあるキーワードを見つけた場合には、それが文章かどうかを判定し(例えば、行毎に句読点や引用符があるかないかで判定すれば良い)、文章でない時(作者名や目次など)はそれを除外し、文章の場合にはそれが会話文であれば、前記第1実施形態における会話文データベース作成処理(図2)に相当する処理を行い、会話文ではない地の文であれば、前記第1実施形態における記事文データベース作成処理(図5)に相当する処理を行う。
【0114】
時間関連情報については、キーワードを見つけた文の近傍についてだけ、キーワードを見つけた文章との相対的な値をその時点で算出して利用する。ここでは、キーワードを見つけた文章が会話文の時は会話文を対象と、地の文(非会話文)であれば地の文を対象とする。これは、すぐ近くにあっても会話文と地の文の内容は普通は全く異なるからである。例えば、図3に示す文章例において、「彼は、いよいよキザになる。眼を細めて、遠くのラジオに耳を傾ける。」という地の文は、その前後の会話文が音楽の話題であるのに対して、登場人物の描写となっている。
【0115】
一方、ユーザ発言の中に含まれるキーワードが電子辞書データ32の中の見出し語の項目に見つかった場合には、その見出し語の説明文に対して、基本的には前記第1の実施形態における記事文データベース処理(図5)に相当する処理を行うが、その際、上述したような記事不適切部分削除処理(図11)に代えて、発言に含むと不適切になる辞書特有の記事や情報などを削除する処理を行う。削除すべき常套的な語句は不揮発性メモリ17に設けられた不適切語句データベース33に予め登録しておいて、これに一致する語句は自動的に削除すれば良い。辞書の書式は一貫しているので、それも利用して発言に不適切な情報は削除する。
【0116】
例えば、キーワード「腹黒」を使って、電子辞書データ32の「国語辞典」の中から以下のような形式のデータが抽出されたとする。
【0117】
はらぐろ・い[腹黒い]
(形)[文]ク はらぐろ・し
心がねじけている。心の中に悪巧みや陰謀をもっている。
「−・い人間」
[派生]――さ(名)
このようなデータの中で「心がねじけている。心の中に悪巧みや陰謀をもっている。」以外のすべてを削除する。この例の場合、句読点のない文は削除するというルールを適用すれば実現できる。あるいは、(形)[文][派生](名)などはこの辞書で予め役割を決められた記述なので、これらを予め不適切語句データベース33に登録しておき、それを参照しながら削除しても良い。この例の場合には、括弧に囲まれた部分は削除するというルールでも良い。また、「−」を含む文は削除する、「」で囲まれる引用文は削除する、見出しの行と次の行は削除する、などのルールを適切に組み合わせて用いても良い。
【0118】
このようにして抽出された「心がねじけている。心の中に悪巧みや陰謀をもっている。」に対して、前記第1の実施形態における記事文切断発言処理と同じように情報量削減のための切り出しを行う。これにより、例えば、
ユーザ:「腹黒い奴だな」
会話システム:「心がねじけている」
などの会話を実現することができる。
【0119】
ここまで述べた第2の実施形態における会話処理の概略である。さらに、第2の実施形態では、前記第1の実施形態では本質的に不可能だった種類の会話も実現できる。すなわち、前記第1の実施形態においては、一般的な「人工無能」的な会話システムと同様に、発言を作り出す素材である会話文データベース18や記事文データベース19に登録されている文の意味を会話システム(のプログラム)は理解していない。しかし、電子辞書データ32の持つ意味ならば大枠が理解できる。これは、例えば「国語辞典」や「百科事典」であれば、通常、見出し語があって、それに続いて記述されていることは、その見出し語に対する説明文であることによる。そこで、それを用いた会話が可能となる。この部分の会話処理が図14に示す会話処理(2)である。
【0120】
会話処理(2)では、電子ブックデータ31や電子辞書データ32からユーザの発言に対する返事を作成できなかった場合に、以下のように、電子辞書データ32の説明文を利用して会話システムの方から辻褄のあった一連の発言ができる。
【0121】
会話システム:「ところで、腹黒いってどういう意味だか知っている?」
ユーザ:「知らない」(ユーザが知らなかった場合)
会話システム:「心がねじけている。心の中に悪巧みや陰謀をもっている。ということなんだよ。どう?勉強になった?」
このように、辻褄のあった会話の流れを実現しているが、「シナリオ」方式のようにシナリオをいちいち作る手間がいらない。ここでも、不適切語句を削除しているので、電子ブックデータ31を流用しているにも拘わらず不自然な会話とはならない。また、この手法を用いて必ず発言が作り出せるので、よくしゃべる会話システムを実現することができる。しかも、電子ブックデータ31の膨大な数の項目が利用できるので、何度この手法を用いても毎回新鮮な話題を提供できる。
【0122】
以下に、第2の実施形態における会話システムを実現するための具体的な処理手順について、図13及び図14に示すフローチャートを参照して詳しく説明する。これらのフローチャートで示される処理は、本システムに備えられたCPU11がプログラムを読み込むことで実行する。
【0123】
図13に示すように、本システムの会話処理が起動されると、CPU11は、まず、ユーザの発言に含まれるキーワードを抽出し、そのキーワードを電子ブックデータ31の中から探す(ステップG11)。そして、電子ブックデータ31の中にキーワードを含む文章があれば(ステップG12のYES)、CPU11はその文章が会話文であるか否かを例えば「」記号等を利用して判断する(ステップG13)。
【0124】
ここで、会話文であった場合には(ステップG13のYES)、CPU11は電子ブックデータ31の中で当該会話文以後に存在する会話文を見つけ出し、その相対的な時間関連情報を算出する(ステップG14)。そして、CPU11はその算出した時間関連情報に基づいて返事とすべき会話文を選出し、これを発言とする(ステップG15)。また、会話文以外の文章であった場合には(ステップG13NO)、CPU11は電子ブックデータ31の中で当該文章以後に存在する文章を見つけ出し、その相対的な時間関連情報を算出する(ステップG16)。そして、CPU11はその算出した時間関連情報に基づいて返事とすべき文章を選出した後(ステップG17)、さらに、その文章に対して前記記事文切断発言処理と同様の処理を施して会話として不適切な部分を削除して発言とする(ステップG18)。
【0125】
一方、ユーザの発言に含まれるキーワードが電子ブックデータ31に存在しなかった場合において(ステップG12のNO)、次にCPU11は、そのユーザの発言に含まれるキーワードを電子辞書データ32の見出し語の項目の中から探す(ステップG19)。ユーザのキーワードと一致する見出し語の項目があれば(ステップG20のYES)、CPU11はその見出し語に対応した説明文から電子辞書特有の記号や表現を削除した後(ステップG21)、さらに、その削除後の説明文に対して記記事文切断発言処理と同様の処理を施して会話として不適切な部分を削除して発言とする(ステップG22)。
【0126】
また、電子辞書データ32にもユーザのキーワードがなく、返事を作り出せない場合には(ステップG20のNO)、図14に示す会話処理(2)が実行される。
【0127】
図14に示すように、会話処理(2)では、CPU11は電子ブックデータ31の中からランダムに項目を選ぶ(ステップG23)。このとき選択された項目の見出し語をWとすると、CPU11は例えば「ところで、Wってどういう意味だか知っている?」といったようユーザに対する質問文を見出し語Wを引用して生成し、これを発言する(ステップG24)。ここで、ユーザの返事が「知っている」といった肯定文であった場合には(ステップG25のYES)、CPU11は例えば「知ってるんだったらいいや」といったような決めセリフを発言して(ステップG26)、ここでの処理を終える。
【0128】
また、ユーザの返事が「知らない」といった肯定文であった場合には(ステップG25のYES)、CPU11は電子ブックデータ31の中から見出し語Wに対応した説明文を抽出し、この説明文から会話として不適切な語句を削除して読み上げると共に、最後に例えば「ということなんだよ。どう?勉強になった?」といったような決めセリフを発言して(ステップG28)、ここでの処理を終える。
【0129】
このように、電子ブックデータ31や電子辞書データ32は、会話システムがユーザと交わしている会話とは本来は全く関係ないが、これを利用して会話らしい発言を作り出すことができる。また、電子ブックデータ31や電子辞書データ32を利用して会話を行うので、別途会話用のデータを持たずに実現することができ、さらに、これらに登録されている膨大な情報を利用して常に広い範囲の話題に対応できるなどの利点がある。
【0130】
なお、前記第2の実施形態では、会話システムが電子ブックデータ31や電子辞書データ32を読み上げるとしたが、表示部を設けて表示しても良い。また、キーワードを見つけた文が会話文であれば発言に用いるものとして会話文を選び、地の文であれば地の文を選ぶとしたが、区別せずに選んでも良い。その場合には奇抜な展開の多い会話となる。
【0131】
要するに、本発明は前記各実施形態に限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で種々に変形することが可能である。更に、前記各実施形態には種々の段階の発明が含まれており、開示される複数の構成要件における適宜な組み合わせにより種々の発明が抽出され得る。例えば、実施形態で示される全構成要件から幾つかの構成要件が削除されても、「発明が解決しようとする課題」で述べた効果が解決でき、「発明の効果」の欄で述べられている効果が得られる場合には、この構成要件が削除された構成が発明として抽出され得る。
【0132】
また、上述した各実施形態において記載した手法は、コンピュータに実行させることのできるプログラムとして、例えば磁気ディスク(フレキシブルディスク、ハードディスク等)、光ディスク(CD−ROM、DVD等)、半導体メモリなどの記録媒体に書き込んで各種装置に適用したり、そのプログラム自体をネットワーク等の伝送媒体により伝送して各種装置に適用することも可能である。本装置を実現するコンピュータは、記録媒体に記録されたプログラムあるいは伝送媒体を介して提供されたプログラムを読み込み、このプログラムによって動作が制御されることにより、上述した処理を実行する。
【0133】
【発明の効果】
以上詳記したように本発明によれば、例えば小説、戯曲、映画やドラマのシナリオ、落語や漫才などの記録、実際の会話記録といったような会話文を含んだ既存の文章情報、あるいは、ニュース記事などのように会話文を含まない既存の文章情報を利用してデータベースを簡単に作成することができ、ユーザの発言に対し、このデータベースから会話として適切な文章を時間関連情報に基づいて選出して発言するようにしたことで、自然な流れで、しかも、ユニークな会話を実現できる。
【0134】
また、例えば電子ブックや電子辞書のように、会話システムがユーザと交わしている会話とは本来は全く関係ないものを利用して、会話らしい発言を作り出すこともできる。
【図面の簡単な説明】
【図1】本発明の第1の実施形態に係る会話システムのハードウェア構成を示すブロック図。
【図2】第1の実施形態における会話システムの会話文データベース作成処理を説明するためのフローチャート。
【図3】前記会話文データベース作成処理の対象となる小説のテキストファイルの一例を示す図。
【図4】前記図3のテキストファイルから作成された会話文データベースの一例を示す図。
【図5】第1の実施形態における会話システムの記事文データベース作成処理を説明するためのフローチャート。
【図6】前記記事文データベース作成処理によって作成される記事文データベースの一例を示す図。
【図7】第1の実施形態における会話システムの会話処理を説明するためのフローチャート。
【図8】第1の実施形態における会話システムの会話処理(2)を説明するためのフローチャート。
【図9】前記会話処理に含まれるレコード選択処理を詳しく説明するためのフローチャート。
【図10】前記会話処理に含まれる記事文切断発言処理を詳しく説明するためのフローチャート。
【図11】前記会話処理に含まれる記事文不適切部分削除処理を詳しく説明するためのフローチャート。
【図12】本発明の第2の実施形態に係る会話システムのハードウェア構成を示すブロック図。
【図13】第2の実施形態における会話システムの会話処理を説明するためのフローチャート。
【図14】第2の実施形態における会話システムの会話処理(2)を説明するためのフローチャート。
【符号の説明】
11…CPU
12…音声入力部
13…A/D変換部
14…音声出力部
15…D/A変換部
16…ワークメモリ
17…不揮発性メモリ
17a…プログラム
18…会話文データベース
19…記事文データベース
20…キーワード履歴テーブル
21…前回発言記事文バッファ
22…累積発言文字数カウンタ
31…電子ブックデータ
32…電子辞書データ
33…不適切語句データベース[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a conversation system used for toys such as a conversational robot, a video game machine, and the like, and relates to a conversation system in which a user can obtain enjoyment and comfort by talking to a computer.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, many conversation systems used for video game machines, toys, and the like usually employ a method (hereinafter referred to as “scenario method”) in which a conversation is performed according to a predetermined scenario. The scenario used in this "scenario method" is made so that the conversation system first makes a statement that limits the topic in consideration of feasibility, and the progress of the conversation after that is made so that the number of branches is minimized. . For this reason, humans (users) cannot take the initiative in conversation, and there are drawbacks such as the flow of conversation is mediocre or unnatural.
[0003]
Therefore, “artificial intelligence” conversation systems and “artificial incompetence” conversation systems are considered as conversation systems other than the “scenario method”. An "artificial intelligence" conversation system is a system that extracts meaning by parsing a user's utterance, understands the intention of the utterance, and creates an answer based on the meaning. Since this system realizes a conversation by performing processing close to human intelligence, it requires a high level of technology and is difficult to deal with any field. That is, it can be applied only to a field where conversation is limited, such as “ticket sale” and “information search”.
[0004]
In contrast, an “artificial incompetence” conversation system is a conversation system that mainly uses an approach commonly referred to as “artificial incompetence”. This realizes what appears to be a conversation on the surface without using a technique such as parsing the user's utterance and extracting meaning. In other words, the system does not understand the meaning of the user's remarks, but can be established as a conversation. In this system, a specific pattern (keyword) is found from a user's remarks, the pattern is compared with each pattern registered in a database prepared in advance, and a reply data group corresponding to the corresponding pattern is output. For example, if the database says “I am a fan of the ABC team” and “I am a fan of the ABC team” as the response data corresponding to the pattern “baseball”, the user says “I like baseball” Then, the conversation system searches the database with “baseball” included in the remark as a keyword and answers “I am a fan of the ABC team”.
[0005]
In this way, the “artificial incompetence” conversation system does not require complicated processing such as parsing and employs pattern matching by a database. Even ambiguous sentences can be handled. In addition, since a fundamental mechanism is provided to generate a response to a user's normal utterance (an utterance that is not in a fixed format such as the “scenario method”), the user can naturally lead conversation. it can.
[0006]
[Problems to be solved by the invention]
In the “artificial incompetent” conversation system described above, the contents and quantity of the database greatly affect the quality of the conversation. If only content that is boring is registered in the database, only a boring conversation can be made, and if the amount of registration is small, the same conversation is repeated. However, enormous work is required to create a database with both quality and quantity. In addition, since the number of engineers involved in database creation is limited, the topics that the conversation system can reply to may be limited to the range of topics familiar to those persons. In addition, it is very difficult to create a database by assuming various conversation flows in advance, so there are many cases where the conversation does not flow naturally.
[0007]
The present invention has been made in view of the above points. A conversation system and a conversation processing program capable of reducing the burden of database creation work, realizing a natural conversation and a unique conversation that can be enjoyed by a user. The purpose is to provide.
[0008]
[Means for Solving the Problems]
The conversation system of the present invention is a conversation system for performing a conversation with a user, and extracts a sentence that can be used as a conversation from existing sentence information, and each sentence extracted by the sentence extraction means. Time-related information calculating means for calculating time-related information indicating temporal and topical distances between the time-related information calculated by the time-related information calculating means to each sentence extracted by the sentence extracting means And a database for storing and a conversation processing means for selecting and uttering an appropriate sentence as a conversation from the database based on the time-related information in response to a user's utterance.
[0009]
According to such a conversation system, for example, existing text information including conversational sentences such as novels, plays, movies and drama scenarios, records of rakugo or comics, actual conversation records, or news articles For existing sentence information that does not include conversational sentences, such as the sentence, sentences that can be used as conversations are extracted from such sentence information, and these sentences indicate the temporal and topical distance between each sentence. Time-related information is added and registered in the database. Then, in response to the user's utterance, an appropriate sentence as a conversation is selected from the database based on the time related information and uttered. In this way, a database can be easily created by using existing text information, and a unique conversation can be performed using the database in a natural manner.
[0010]
The conversation system according to the present invention is a conversation system for performing conversation with a user. The sentence extraction means extracts text usable as conversation from existing sentence information, and the sentence extraction means extracts the sentence. Time-related information calculating means for calculating time-related information indicating temporal and topical distances between the sentences, and time-related information calculated by the time-related information calculating means for each sentence extracted by the sentence extracting means And a database for storing keywords, keyword extracting means for extracting a keyword from a user's remarks, a sentence including the keyword extracted by the keyword extracting means is searched from the database, and a difference from time related information of the sentence Selecting means for selecting sentences with a predetermined value or less as a speech candidate, and using the sentences selected by the selecting means Constituted by and a speech processing means for word.
[0011]
According to such a conversation system, for example, existing text information including conversational sentences such as novels, plays, movies and drama scenarios, records of rakugo or comics, actual conversation records, or news articles For existing sentence information that does not include conversational sentences, such as the sentence, sentences that can be used as conversations are extracted from such sentence information, and these sentences indicate the temporal and topical distance between each sentence. Time-related information is added and registered in the database. Then, for a user's utterance, a keyword that is a starting point for conversation is extracted from the utterance, a sentence including the keyword is searched from the database, and the sentence is temporally and topically based on the time-related information. Sentences close to are selected and used for remarks. In this way, it is possible to easily create a database by using existing sentence information, and by selecting appropriate sentences as conversations using the time-related information from the database and speaking, It is possible to have a unique conversation.
[0012]
Further, in the conversation system having the above-described configuration, information indicating the previous utterance date and time is added to each sentence of the database together with time-related information, and the selection means is uttered within a predetermined number of days based on the previous utterance date and time information. A speech candidate is selected for an unsent sentence. Accordingly, it is possible to avoid frequently speaking the same line, for example, by uttering a sentence remarked within three days as a target.
[0013]
Further, in the conversation system having the above-described configuration, the speech processing means is configured to delete a part inappropriate for conversation from the text selected by the selection means. As a result, for example, when a news article is used as existing text information, it is possible to speak after excluding unnatural things in the conversation with expressions unique to the news article. It is possible to make a remark with little unnaturalness even though he is doing.
[0014]
Further, in the conversation system having the above-described configuration, the speech processing unit deletes an inappropriate part as a conversation from the sentence selected by the selection unit, and changes the sentence according to the number of keywords included in the deleted sentence. It is set as the structure which speaks either of these division | segmentation sentences by dividing | segmenting into multiple. As a result, as existing text information, for example, when a news article is used, the article text is partially cut out and used so that it is close to the amount of information that the conversation has, so that it is originally intended for conversation It is possible to create conversation-like utterances from written sentences that are not.
[0015]
The conversation system of the present invention is a conversation system for performing conversation with a user, and stores storage means for storing specific sentence information in which conversation sentences and non-conversation sentences are mixed, and is stored in the storage means. Search means for searching for sentences including keywords included in the user's remarks from the sentence information, and determination means for determining whether the sentences searched by the search means are conversational sentences or non-conversational sentences; When it is determined that the sentence is a conversation sentence by this determination means, time-related information indicating temporal and topical distance is calculated for the subsequent conversation sentences, and an appropriate sentence as a conversation based on the time-related information. First speech processing means for selecting and speaking, and time-related information indicating temporal and topical distances for subsequent non-conversational sentences when determined by the judging means as non-conversational sentences The Out, select the appropriate sentence as a conversation based on the time-related information, and comprises a second speech processing means to speak with sanitized as conversation from that sentence.
[0016]
According to the conversation system having such a configuration, it is possible to create a speech in a conversation using specific text information in which a conversation sentence and a non-conversation sentence are mixed. The specific sentence information is, for example, an electronic book, and a conversation sentence and a sentence of a ground that is not a conversation sentence are mixed. If the keyword included in the user's utterance is in the conversation sentence, time-related information is calculated for the conversation sentence, and an appropriate sentence is selected as the conversation based on the time-related information. On the other hand, if the keyword included in the user's utterance is in a non-conversational sentence, time-related information is calculated for the non-conversational sentence, and an appropriate sentence is selected as a conversation based on the time-related information. The part that is inappropriate for the conversation is deleted and the speech is made.
[0017]
The conversation system of the present invention is a conversation system for performing conversation with a user, and stores storage means for storing specific dictionary information including headwords and explanations corresponding thereto, and storage in the storage means. Search means for searching for a headword including a keyword included in a user's utterance from the dictionary information obtained, and an explanatory sentence corresponding to the headword searched by the search means is extracted from the dictionary information, and its description A first utterance processing means for uttering by deleting an inappropriate part as a conversation from a sentence.
[0018]
According to the conversation system having such a configuration, it is possible to create a speech in conversation using specific dictionary information such as “Japanese dictionary” and “encyclopedia”. This dictionary information is composed of headwords and corresponding explanations. For a user's utterance, a headword including a keyword included in the utterance is searched, and an explanatory text corresponding to the headword is extracted from the dictionary information. It is deleted and remarked.
[0019]
Further, in the conversation system having the above configuration, when there is no entry word including a keyword included in a user's utterance in the dictionary information, the entry word is selected at random from the dictionary information, The second speech processing means for continuing the conversation by speaking using the explanatory text corresponding to the headword is adopted. As a result, even if the keyword included in the user's utterance is not included in the headword of the dictionary information, the conversation is continued by speaking using the explanatory text corresponding to the headword randomly selected from the dictionary information. be able to.
[0020]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0021]
(First embodiment)
FIG. 1 is a block diagram showing a hardware configuration of a conversation system according to the first embodiment of the present invention. This conversation system is intended to advance a conversation by speaking as if a human is responding to a user's remarks. For example, the conversation system is mounted on toys such as a conversational robot or a video game machine. .
[0022]
FIG. 1 shows a basic configuration when this system is realized by a general-purpose computer. The
[0023]
CPU11 reads the program memorize | stored in the
[0024]
The
[0025]
The
[0026]
The keyword history table 20 is a table for holding as a history the keywords found in the user's remarks and the date and time when the keywords were found. Each time keywords are found during conversation, they are written into the keyword history table 20. In this case, when the storage capacity of the keyword history table 20 is full, data is overwritten from old date and time data. The previous
[0027]
In the conversation system having such a configuration, the user's voice input from the
[0028]
Here, “speech recognition processing” and “read-out processing” are not described in detail because they use generally known methods. In the following, the explanation will be focused on “conversation processing”.
[0029]
First, a process for creating the
[0030]
(A) Conversation sentence database creation processing
In the conversation text database creation process, for example, in the text of a work that was originally created completely unrelated to the conversation you are facing, such as a novel, a drama, a movie or drama scenario, a record of a rakugo or comic story, an actual conversation record, etc. Is used to create a database (conversation sentence database 18). In this case, the text of the conversation part is extracted from the existing text information of this type, and information indicating the temporal and topical distance between these conversation texts (hereinafter referred to as time-related information) is calculated. By registering in the
[0031]
FIG. 2 is a flowchart showing the flow of conversation text database creation processing of the conversation system in the first embodiment. Here, in order to simplify the description, it is assumed that a novel text file is present in, for example, the
[0032]
There are multiple novel text files and they are processed one by one. Extraction of the conversation part may be performed using quotes for conversation symbols such as “” and “” when the target is a novel. For the division into sentence units, a punctuation mark (.) Or the like may be used. The time-related information is information for knowing the closeness of each conversation sentence in time and closeness as a topic. When the value of this time-related information is close, it means that the time when the conversation sentence is spoken is close and there is a high possibility that it is the same topic. In the case of a novel, since the time when each conversation sentence is spoken is not known, the information is created based on a line feed code or the like. If a line feed code is entered, the temporal and semantic connection between sentences will be slightly lost. In novels, blank lines are often provided to separate sentences, so when a blank line is entered, the time-related information values of the preceding and following sentences are largely separated (for example, “10”). When the file changes, it becomes a completely different topic, so a larger value (for example, “100”) is added.
[0033]
The conversation sentence database creation process will be described in detail.
[0034]
As shown in FIG. 2, the
[0035]
Subsequently, the
[0036]
When the processing for all the texts is completed (Yes in Step A18), if there is an unprocessed text file (Yes in Step A20), the same processing as described above is repeated for the text file. At that time, since the topic is completely different, the
[0037]
In this way, a sentence as a conversation sentence is extracted from a text file including the conversation sentence, and is registered in the
[0038]
FIG. 3 shows an example of a novel text file that is the subject of the conversation database creation process (excerpt from Osamu Dazai “Good Buy”). Each line is a sentence up to a line feed code. "..." expresses that there is data before and after the sentence shown here. Note that one line when printed or displayed is different from one line up to the line feed code. Sentences that cannot be displayed on a single line without a line feed code will be displayed on a new line and printed. The time-related information is for reference only and is not in the actual text file. Here, it is assumed that the time-related information of the sentence “Don't be deep enough to fight” is “5000”, and the value calculated therefrom is shown. "Mysterious power (4)" is the title of the chapter. Recognizing such a chapter change, a slightly larger value (eg, “30”) may be added to the time-related information. Here, there is always a blank line before and after, so an example using it was shown.
[0039]
FIG. 4 shows an example of the
[0040]
(B) Article sentence database creation processing
In the article sentence database creation process, a sentence (article sentence database 19) is created by extracting sentences suitable for conversation for news articles and the like. Similar to the conversation sentence database creation processing, the conversation sentence is extracted from the sentence information, and time-related information indicating the temporal and topical distance between these conversation sentences is calculated and registered in the
[0041]
FIG. 2 is a flowchart showing the flow of article database creation processing of the conversation system in the first embodiment. Here, it is assumed that a news article is downloaded from a news site or the like on the Internet and already exists in, for example, the
[0042]
Since the HTML tag is included in the homepage information in addition to the displayed characters, it is deleted. In addition to sentences expressing the contents of articles, there are headlines of other articles accompanied by links, names of other homepages, and the like. Since these do not include a period (.), They are identified and deleted here. In articles on the home page, blank lines are often used even if the content is not a large break, so the added value of the time related information when a blank line is found is set to “1”. There is no problem because a headline or the like is used together with a plurality of blank lines at a place where the content is largely separated, and time-related information is added each time. Here, in order to show a process different from the process of creating the
[0043]
The article database creation process will be specifically described.
[0044]
As shown in FIG. 5, the
[0045]
Here, the
[0046]
Subsequently, the
[0047]
When processing for all texts is completed (Yes in step B18), if there is an unprocessed HTML file (Yes in step B19), the same processing as described above is repeated for the HTML file. At that time, since the article is completely different, the
[0048]
In this way, sentences usable as conversations for news articles and the like are extracted and registered in the
[0049]
(C) Conversation processing
Next, conversation processing using the
[0050]
7 and 8 are flowcharts showing the flow of conversation processing of the conversation system in the first embodiment. FIG. 9 to FIG. 11 are flowcharts showing the flow of the record selection process, article sentence disconnection utterance process, and article sentence inappropriate part deletion process included in the conversation process.
[0051]
First, before explaining the processing shown in these flowcharts, in order to facilitate understanding, the conversation processing of this system will be described with a specific example. Here, the “keyword” indicates a word that suggests more strongly than other words, but in this embodiment, in order to simplify the explanation, two or more kanji characters, katakana, numbers, or these characters are used. Assume that a word consisting of a combination is recognized as a keyword for starting conversation.
[0052]
For example, if the user says "I like music", the keyword in this is "music". Therefore, sentence data having a keyword such as “music” is searched from the
[0053]
One of these is chosen at random and remarked. All of these are remarks related to music, so they are appropriate as issues. Thereby, the conversation system can make the user have the illusion that he / she understands his / her speech, and the expression of the speech itself is extracted from the novel and unique, and the flow of conversation is also natural.
[0054]
In this case, a method of responding to the user by using only the sentence of the person who has spoken the conversation sentence including the keyword in the
[0055]
Here, the time-related information added to the data of each conversation sentence registered in the
[0056]
Moreover, in this embodiment, the place that is said to be a single statement in a novel is divided into two sentences, such as “Do you understand the music? Make one speak. The amount of information included in two sentences is naturally larger than that of one sentence, and as the amount of information increases, there is a higher possibility that information that conflicts with the user's remarks will be included. In order to avoid this and reduce the possibility of discrepancies with the user's remarks, by letting them speak in sentence units, in a novel that was originally created completely unrelated to the conversation that the conversation system is conducting Can be used in various situations.
[0057]
Further, by recording the previous statement date and time of the spoken sentence in the
[0058]
If no reply is found in the
[0059]
First, an unnatural sentence is deleted by an article inappropriate part deletion process (FIG. 11) if it is an expression peculiar to news and used as it is in a conversation.
[0060]
For example, if the user says "I like ***", the record selected for it is "Most selected player of the US Major League League (AVP) *" ******* Outfielder (28) returned home with his wife ** on an aircraft arriving at Kansai Airport on the 9th, winning the top batter and the thief king, and hit the newest hit record for season 242 hits 90 ”Updated for the first time in years.” Note that “***” actually contains the name of a person, the name of a place, etc., but here it is expressed by masking with a * symbol to avoid the description of proper nouns. To do.
[0061]
In the above sentence example, “(MVP)”, “(28)”, and “9 days” are deleted as inappropriate parts. This is because it is clearly unnatural as a conversation to read parentheses as “braces”. Even if the parentheses themselves are not automatically read, it is unnatural to read the contents in the parentheses. In a user's daily conversation, nouns are not followed by nouns of equal rank, and the age of a person is not suddenly said immediately after the noun referring to the person. Words related to the schedule such as “9th” are also meaningful if they are within the month in which this news is issued, but they are meaningless in other months, and are therefore subject to deletion.
[0062]
By deleting these, the sentence becomes:
[0063]
“******* Outfielder selected as the best player in the US Major League Baseball League and A League returned home with his wife *** on an aircraft arriving at Kansai Airport. And the newest hit record of new 242 hits in the season has been updated for the first time in 90 years. "
However, this is quite unnatural as a speech in conversation. The biggest cause is that there is too much information as one statement. In everyday conversation, the amount of information contained in a single statement is very small. In the present embodiment, the amount of conversation information is measured by the number of keywords.
[0064]
For example, “Do you understand the music? I have a face that seems like an idiot.” Contains only two keywords (“music” and “sense of humor”). On the other hand, “**** outfielder of **** who was selected as the best player in the US Major League Baseball League and A League returned home with Mrs. ** on an aircraft arriving at Kansai Airport. "The robber king was acquired and the newest hit record for the season 242 hits was updated for the first time in 90 years." Clearly includes more than two keywords. Therefore, an arbitrary character position is selected at random, and a phrase including the punctuation mark is extracted (a sentence when the sentence including the selected character position does not have a punctuation mark). Here, “sentence” is delimited by punctuation marks, and there are no further punctuation marks.
[0065]
As a result, for example, “US major league” is cut out, “******* outfielder selected as the best player in a league” is cut out. When “US Major League” is cut out, only one keyword is included here, so this is used as it is as a reply. If the phrase “******* outfielder selected as the best player in a league” is cut out, there are still 5 keywords included in this, so An arbitrary character position is randomly selected from this clause, and this time, a part including the character is cut out with a keyword as a delimiter. If there is still too much information in the cut out part, repeat this, and finally, for example, “To the best player in a league” or “****** outfielder And so on.
[0066]
Phrases can no longer be cut out with punctuation marks, but are cut off with keywords as delimiters, so the cut-out part is relatively natural Japanese. If you answer these, you will end up with a somewhat awkward and half-hearted impression, but the answer will be vague and inconspicuous with the user's remarks. It should be noted that the cut-out portion may be edited to add a ending, such as “National League” or “****** outfielder”.
[0067]
In this method, since only a part of the related information is spoken, the user also wants to listen to the remaining part. For example, if the user says “baseball” and “******* outfielder” is answered, then he / she wants to listen to it and “updates after 90 years”. I'm interested in what's been 90 years. By intentionally limiting the amount of information in this way, it is possible to add a mysterious taste to the conversation and to make the user more curious.
[0068]
If no response is made in the
[0069]
That is, when an utterance is made using the
[0070]
As a result, the following three effects can be obtained mainly.
(1) A certain degree of satisfaction is given to the interest and curiosity caused by the mysterious taste of the remarks using the
(2) Giving the user a feeling of continuing conversation about one topic.
(3) Even if the selected article contains information that conflicts with the user's remarks, the discomfort caused by it is reduced by gradually reducing the information.
[0071]
The above (1) is achieved by gradually revealing limited and hidden information. The above (2) eliminates the disadvantages inherent in artificial incompetence where the talk skips too much. The user feels uncomfortable when he is suddenly turned away immediately after he speaks, but does not feel so uncomfortable as the talk gradually shifts over time. Also, if the amount of information is limited and a discrepancy occurs while being dispensed, there is a tendency to wonder and ask what it means rather than feel uncomfortable. Said (3) utilizes those tendencies. However, if all the information of the article is clarified, a lot of information that is inconsistent with the intention of the user will come out, and the effect (3) cannot be covered. Therefore, it is assumed that a certain limit is set and stopped when the limit is reached. In the present embodiment, the number of spoken characters is counted by the cumulative spoken
[0072]
If the above mechanism is used, in the previous example, for example, the following conversation is possible.
[0073]
User: “I like ***** players”
Conversation system: “******* outfielder of *****”
User: “You know it” (no keywords)
Conversation system: “The top batter and the stealing king” (If it is conventional artificial incompetence, it is likely that it is a completely different topic here or it is silent, but the same topic can be continued in the present invention)
User: “Yes” (no keyword)
Conversation system: “On an aircraft arriving at Kansai Airport”
User: “Huh?” (No keyword)
Conversation system: “Updated for the first time in 90 years”
User: “E?” (No keyword)
Conversation system: “Season 242 hits”
User: “It ’s a great record” (the next statement is made using the keyword “record”)
In this way, although there are some unclear points and discrepancies (particularly giving the user a mysterious taste and stimulating curiosity), the same topic was spoken and the first “I The conversation corresponding to “I like **** players” has been established. Since each statement is ambiguous, there is also an effect that the user can supplement the missing information conveniently and interpret it. The article quoted here is a news article reporting that a baseball player has returned home. Originally, it was written regardless of the user's remarks “I like *** players”. In this way, sentences made completely unrelated to conversation can be used for conversation.
[0074]
If there is no sentence in the previous
[0075]
Hereinafter, specific processing procedures for realizing the above-described conversation system will be described in detail with reference to the flowcharts shown in FIGS. The processing shown in these flowcharts is executed by the
[0076]
As shown in FIG. 7, when the conversation processing of this system is started, the
[0077]
As shown in FIG. 9, in the record selection process, the
[0078]
Returning to FIG. 7, when a record as an utterance candidate is selected from the
[0079]
Here, when a record as an utterance candidate is selected from the
[0080]
As shown in FIG. 10, in the article sentence disconnection utterance process, the
[0081]
In this way, when a part inappropriate for conversation is deleted from the sentence data, the
[0082]
That is, the
[0083]
The
[0084]
Here, when a reply is not made in the
[0085]
As shown in FIG. 8, in the conversation process (2), the
[0086]
As described above, in the conversation system of the present invention, the conversation sentence is found from the
[0087]
In addition, a plurality of sentences (sentences surrounded by a set of quotation marks) in a novel are divided into one sentence for each sentence. It is difficult to create clear discrepancies and can be applied to conversations in many situations.
[0088]
Since not only the reply sentence for the conversation sentence containing the keyword in the user's utterance but also the conversation sentence of the speaker of the conversation sentence including the keyword is used, many conversation sentences can be selected and remarked. The variety will be rich. In addition, this allows both a reply that includes the keyword itself spoken and a reply that does not include it, so the user has a strong satisfaction that the conversation system understands what he said. Can be given without feeling unnatural.
[0089]
Since conversation sentence identification and extraction and time-related information are calculated when the conversation sentence database is created, the processing load on the
[0090]
On the other hand, when speaking using the
[0091]
Further, since the number of keywords is used as a measure for measuring the amount of information, it is not necessary to analyze the sentence grammatically, and the amount of information can be estimated easily. Since the meaning is ambiguous due to fragmentary remarks, the user can be interested and curious and have the desire to continue the conversation. Since the text of the news article used for the utterance is stored, and other parts are cut out from the utterance after that, the user's interests and curiosity can be satisfied little by little. In addition, this makes it possible to make a remark a plurality of times on the same topic, and to give the user a feeling of continuing conversation on one topic. As a result, even when a keyword cannot be found in the user's remarks this time, or even when a keyword cannot be created with that keyword, an appropriate remark can be created.
[0092]
Also, since the discrepancy with the user's remarks contained in the news article is revealed little by little, it is easier for the user to accept than the entire contents of the news article are revealed at once, and the user accepts it and talks The possibility of proceeding is increased.
[0093]
In addition, in the utterance using the text of the news article, it manages how much of the amount of information that the text has already been spoken, and when a certain percentage is said without saying the whole sentence Because it stops, the entire contents of the news article are not revealed, and the discrepancy with the user's remarks can be kept inconspicuous.
[0094]
In addition, a statement using the
[0095]
In addition, since the keywords included in the user's remarks are kept as a history, and the conversation proceeds after the conversation has progressed, the user is told that the topic is maintained and the conversation is being performed. Can make you feel. In addition, this makes it possible to create an appropriate utterance even when the keyword cannot be found in the user's utterance, or even if the keyword cannot be produced with the keyword even if it is found.
[0096]
In the conventional “artificial incompetence” conversation system, the relationship between the pattern registered in the database (referred to as “registered pattern”) and the reply data corresponding to that pattern (referred to as “registered reply”) is simple. It is fixed. In the present invention, the sentence data registered in the database corresponds to “registration reply”, but also includes “registration pattern” in itself. The “registration pattern” and “registration reply” are associated with an algorithm as a “many-to-many” relationship. For example, in the sentence data registered in the
[0097]
In the above-described embodiment, an example in which the
[0098]
Moreover, although the example which produces the
[0099]
In addition, a line feed code and a blank line are used to calculate time-related information, but a punctuation mark (.), A quotation mark (""), a chapter, paragraph, or item heading may be used. Also, the number of characters may be used (for example, the number of characters between the first characters of each sentence is used).
[0100]
Moreover, although the example which has time related information with respect to all the records was shown, it may have only a part, such as having only the place where the value of time related information changes greatly. Or you may have time related information in the form which is not a numerical value. For example, a blank record or the like may be provided where time-related information is largely separated.
[0101]
Further, although the keyword is a word of two or more kanji characters, katakana, numbers, or a combination thereof, other keywords may be used. For example, the regulation of the number of characters may be changed, or a phrase that includes kanji and hiragana, or a phrase that consists of only hiragana may be included.
[0102]
The keywords are extracted from the sentence after voice recognition and kanji conversion. However, the keywords may be extracted in a hiragana state where kanji conversion is not performed. It may be extracted at the stage of recognition as sound, such as keyword spotting. In these cases, information for knowing which words are keywords may be provided. For example, a database in which only keywords are registered may be used.
[0103]
Moreover, although the example which searches the keyword which exists in a user's utterance in the
[0104]
Moreover, although the amount of information is measured by the number of keywords, other means may be used. For example, the number of characters, the number of Kanji characters, the number of readings, the number of nouns, the number of verbs, a combination thereof, or the like may be used.
[0105]
In addition, when making a comment from an article, the amount of information is always kept below a certain value. However, it is also possible to make a statement with a large amount of information while reducing the amount of information as a whole. For example, the number of keywords included in a statement may be selected randomly within a range of 1 to 5.
[0106]
In addition, the process of cutting out a part of a sentence in order to reduce the amount of information of one utterance is performed only on an article sentence, but may be performed on a conversation sentence. There are some very long lines in plays, but when applied to them, it may be effective. Although the
[0107]
In addition, the sentence after the sentence including the keyword in the user utterance is set as the candidate for the utterance, but the sentence before that may be included in the candidate on the condition that the difference in the time related information is within a certain range. . For example, in the case of having data as shown in the
[0108]
Although the sentence up to the line feed code is applied to one record of the
[0109]
Moreover, although the sentence itself selected at the time of the last utterance was memorize | stored in the last utterance
[0110]
(Second Embodiment)
Next, a second embodiment of the present invention will be described.
[0111]
FIG. 12 is a block diagram showing a hardware configuration of a conversation system according to the second embodiment of the present invention. The same parts as those in FIG. 1 (first embodiment) are denoted by the same reference numerals, and the description thereof will be omitted. Only different points will be described here. The conversation system in the second embodiment has an electronic book reader function and an electronic dictionary function in addition to the conversation function that is the original function. That is, as shown in FIG. 12, various
[0112]
13 and 14 are flowcharts showing the flow of conversation processing of the conversation system in the second embodiment. First, before explaining the processing shown in these flowcharts, the outline of the conversation processing as the second embodiment will be described for easy understanding.
[0113]
The second embodiment is characterized in that a speech in a conversation is created using the
[0114]
As for the time-related information, only the vicinity of the sentence where the keyword is found is calculated and used at that time relative to the sentence where the keyword is found. Here, when the sentence in which the keyword is found is a conversation sentence, the conversation sentence is targeted, and when the sentence is a ground sentence (non-conversation sentence), the ground sentence is targeted. This is because the content of the conversation sentence and the local sentence are usually completely different even if they are in the immediate vicinity. For example, in the sentence example shown in FIG. 3, the sentence before and after the sentence in the field that says “He will finally become a bruise. Squint his eyes and listen to a distant radio” is the topic of music. In contrast, it is a depiction of the characters.
[0115]
On the other hand, when a keyword included in the user utterance is found in the entry word item in the
[0116]
For example, it is assumed that data in the following format is extracted from the “Japanese dictionary” of the
[0117]
Haraguroi [Black stomach]
(Form) [sentence] ku haraguro, shi
My heart is twisted. He has a trick and a conspiracy in his heart.
"--I human"
[Derived]-Sa (Name)
In this data, delete everything except “The mind is twisted. In this example, this can be realized by applying a rule of deleting a sentence without punctuation. Alternatively, (form) [sentence] [derivation] (name) and the like are descriptions whose roles are determined in advance in this dictionary, so these are registered in advance in the inappropriate word /
[0118]
In order to reduce the amount of information in the same way as the article cut-off speech processing in the first embodiment, the extracted “the heart is twisted. Cut out. This allows, for example,
User: “I ’m a black guy”
Conversation system: “The heart is twisted”
It is possible to realize such conversations.
[0119]
It is an outline of conversation processing in the second embodiment described so far. Furthermore, in the second embodiment, it is possible to realize a kind of conversation that was essentially impossible in the first embodiment. That is, in the first embodiment, the meaning of the sentences registered in the
[0120]
In the conversation process (2), when a reply to the user's utterance cannot be created from the
[0121]
Conversation system: "By the way, do you know what blackness means?"
User: "I don't know" (if the user didn't know)
Conversation system: “The mind is twisted. It means that there are crafts and intrigues in the mind. How did you learn?”
In this way, the flow of conversation with a habit is realized, but there is no need to create scenarios one by one as in the “scenario” method. Again, since inappropriate words are deleted, the unnatural conversation does not occur even though the
[0122]
Hereinafter, a specific processing procedure for realizing the conversation system in the second embodiment will be described in detail with reference to the flowcharts shown in FIGS. 13 and 14. The processing shown in these flowcharts is executed by the
[0123]
As shown in FIG. 13, when the conversation processing of this system is started, the
[0124]
If it is a conversational sentence (YES in step G13), the
[0125]
On the other hand, when the keyword included in the user's statement does not exist in the electronic book data 31 (NO in step G12), the
[0126]
Further, when there is no user keyword in the
[0127]
As shown in FIG. 14, in the conversation process (2), the
[0128]
If the user's reply is an affirmative sentence such as “I don't know” (YES in step G25), the
[0129]
As described above, the
[0130]
In the second embodiment, the conversation system reads out the
[0131]
In short, the present invention is not limited to the above-described embodiments, and various modifications can be made without departing from the scope of the invention at the stage of implementation. Furthermore, the above embodiments include inventions at various stages, and various inventions can be extracted by appropriately combining a plurality of disclosed constituent elements. For example, even if some constituent elements are deleted from all the constituent elements shown in the embodiment, the effects described in “Problems to be solved by the invention” can be solved, and are described in the “Effects of the invention” column. If the effect is obtained, a configuration from which this configuration requirement is deleted can be extracted as an invention.
[0132]
In addition, the method described in each of the embodiments described above is a recording medium such as a magnetic disk (flexible disk, hard disk, etc.), optical disk (CD-ROM, DVD, etc.), semiconductor memory, etc., as a program that can be executed by a computer. The program itself can be applied to various apparatuses, or the program itself can be transmitted through a transmission medium such as a network and applied to various apparatuses. A computer that implements this apparatus reads a program recorded on a recording medium or a program provided via a transmission medium, and performs the above-described processing by controlling operations by this program.
[0133]
【The invention's effect】
As described in detail above, according to the present invention, for example, existing sentence information including conversational sentences such as novels, plays, movies and drama scenarios, records of rakugo and comics, actual conversation records, or news It is possible to easily create a database using existing sentence information that does not include conversational sentences such as articles, etc., and select appropriate sentences as conversations from this database based on time-related information for user's remarks As a result, it is possible to realize a natural conversation and a unique conversation.
[0134]
In addition, for example, a conversation-like utterance can be created by using a conversation system that has nothing to do with the conversation with the user, such as an electronic book or an electronic dictionary.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a hardware configuration of a conversation system according to a first embodiment of the present invention.
FIG. 2 is a flowchart for explaining conversation sentence database creation processing of the conversation system according to the first embodiment.
FIG. 3 is a diagram showing an example of a novel text file that is a target of the conversation sentence database creation process;
4 is a view showing an example of a conversation sentence database created from the text file of FIG. 3. FIG.
FIG. 5 is a flowchart for explaining article database creation processing of the conversation system in the first embodiment;
FIG. 6 is a view showing an example of an article sentence database created by the article sentence database creation process;
FIG. 7 is a flowchart for explaining conversation processing of the conversation system in the first embodiment.
FIG. 8 is a flowchart for explaining conversation processing (2) of the conversation system in the first embodiment;
FIG. 9 is a flowchart for explaining in detail a record selection process included in the conversation process.
FIG. 10 is a flowchart for explaining in detail an article sentence disconnection utterance process included in the conversation process.
FIG. 11 is a flowchart for explaining in detail an article sentence inappropriate part deletion process included in the conversation process;
FIG. 12 is a block diagram showing a hardware configuration of a conversation system according to the second embodiment of the present invention.
FIG. 13 is a flowchart for explaining conversation processing of the conversation system in the second embodiment.
FIG. 14 is a flowchart for explaining conversation processing (2) of the conversation system in the second embodiment;
[Explanation of symbols]
11 ... CPU
12 ... Voice input part
13 ... A / D converter
14 ... Audio output section
15 ... D / A converter
16 ... Work memory
17 ... Non-volatile memory
17a ... Program
18 ... Conversation sentence database
19 ... Article database
20 ... Keyword history table
21 ... Last message buffer
22 ... Cumulative message counter
31 ... Electronic book data
32 ... Electronic dictionary data
33 ... Inappropriate phrase database
Claims (12)
既存の文章情報から会話として利用可能な文章を抽出する文章抽出手段と、
この文章抽出手段によって抽出された各文章間の時間的、話題的な距離を示す時間関連情報を算出する時間関連情報算出手段と、
前記文章抽出手段によって抽出された各文章に前記時間関連情報算出手段によって算出された時間関連情報を付加して記憶するデータベースと、
ユーザの発言に対し、前記データベースから会話として適切な文章を前記時間関連情報に基づいて選択して発言する会話処理手段と
を具備したことを特徴とする会話システム。A conversation system for conversation with a user,
A sentence extraction means for extracting sentences usable as conversation from existing sentence information;
Time-related information calculating means for calculating time-related information indicating temporal and topical distances between the sentences extracted by the sentence extracting means;
A database that stores the time-related information calculated by the time-related information calculating means added to each sentence extracted by the text extracting means;
A conversation system comprising conversation processing means for selecting a sentence appropriate for a conversation from the database based on the time-related information in response to a user's comment.
既存の文章情報から会話として利用可能な文章を抽出する文章抽出手段と、
この文章抽出手段によって抽出された各文章間の時間的、話題的な距離を示す時間関連情報を算出する時間関連情報算出手段と、
前記文章抽出手段によって抽出された各文章に前記時間関連情報算出手段によって算出された時間関連情報を付加して記憶するデータベースと、
ユーザの発言からキーワードを抽出するキーワード抽出手段と、
このキーワード抽出手段によって抽出されたキーワードを含む文章を前記データベースから検索し、その文章の時間関連情報との差分が所定値以下の文章を発言候補として選択する選択手段と、
この選択手段によって選択された文章を利用して発言する発言処理手段と
を具備したことを特徴とする会話システム。A conversation system for conversation with a user,
A sentence extraction means for extracting sentences usable as conversation from existing sentence information;
Time-related information calculating means for calculating time-related information indicating temporal and topical distances between the sentences extracted by the sentence extracting means;
A database that stores the time-related information calculated by the time-related information calculating means added to each sentence extracted by the text extracting means;
Keyword extraction means for extracting keywords from the user's comments;
Search means for searching a sentence including the keyword extracted by the keyword extraction means from the database, and selecting a sentence whose difference from time related information of the sentence is a predetermined value or less as a speech candidate;
A conversation system characterized by comprising speech processing means for speaking using the text selected by the selection means.
前記選択手段は、前記前回発言日時情報に基づいて所定日数以内に発言されていない文章を対象として発言候補の選択を行うことを特徴とする請求項2記載の会話システム。Each sentence of the database is appended with information indicating the previous utterance date and time together with time related information,
The conversation system according to claim 2, wherein the selection unit selects a speech candidate for a sentence that has not been spoken within a predetermined number of days based on the previous speech date information.
会話文と非会話文とが混在する特定の文章情報を記憶する記憶手段と、
この記憶手段に記憶された文章情報の中からユーザの発言に含まれるキーワードを含んだ文章を検索する検索手段と、
この検索手段によって検索された文章が会話文であるか非会話文であるか判断する判断手段と、
この判断手段によって会話文であると判断された場合にそれ以後の会話文を対象として時間的、話題的な距離を示す時間関連情報を算出し、その時間関連情報に基づいて会話として適切な文章を選択して発言する第1の発言処理手段と、
前記判断手段によって非会話文であると判断された場合にそれ以後の非会話文を対象として時間的、話題的な距離を示す時間関連情報を算出し、その時間関連情報に基づいて会話として適切な文章を選択し、その文章から会話として不適切な部分を削除して発言する第2の発言処理手段と
を具備したことを特徴とする会話システム。A conversation system for conversation with a user,
Storage means for storing specific sentence information in which a conversational sentence and a non-conversational sentence are mixed;
Search means for searching for sentences containing keywords included in the user's remarks from the sentence information stored in the storage means;
A determination means for determining whether the sentence searched by the search means is a conversational sentence or a non-conversational sentence;
When it is determined that the sentence is a conversation sentence by this determination means, time-related information indicating a temporal and topical distance is calculated for the subsequent conversation sentences, and an appropriate sentence as a conversation based on the time-related information. First message processing means for selecting and speaking,
When it is determined that the sentence is a non-conversation sentence, time-related information indicating a temporal and topical distance is calculated for the subsequent non-conversation sentence, and appropriate as a conversation based on the time-related information. And a second utterance processing means for uttering by selecting an appropriate sentence and deleting an inappropriate part from the sentence as a conversation.
見出し語とそれに対応する説明文とからなる特定の辞書情報を記憶する記憶手段と、
この記憶手段に記憶された辞書情報の中からユーザの発言に含まれるキーワードを含んだ見出し語を検索する検索手段と、
この検索手段によって検索された見出し語に対応した説明文を前記辞書情報から抽出し、その説明文から会話として不適切な部分を削除して発言する第1の発言処理手段と
を具備したことを特徴とする会話システム。A conversation system for conversation with a user,
Storage means for storing specific dictionary information consisting of headwords and corresponding explanatory text;
Search means for searching for a headword including a keyword included in the user's remarks from dictionary information stored in the storage means;
An explanation sentence corresponding to the headword searched by the retrieval means is extracted from the dictionary information, and a first comment processing means for uttering by deleting an inappropriate part from the explanation sentence as a conversation is provided. A featured conversation system.
前記コンピュータに、
既存の文章情報から会話として利用可能な文章を抽出する機能と、
この抽出された各文章間の時間的、話題的な距離を示す時間関連情報を算出する機能と、
前記抽出された各文章に前記時間関連情報を付加してデータベースに登録する機能と、
ユーザの発言に対し、前記データベースから会話として適切な文章を前記時間関連情報に基づいて選択して発言する機能と
を実行させるための会話処理プログラム。A conversation processing program used in a computer for conversation with a user,
In the computer,
A function to extract sentences that can be used as conversations from existing sentence information;
A function for calculating time-related information indicating temporal and topical distances between the extracted sentences;
A function of adding the time-related information to each extracted sentence and registering it in a database;
A conversation processing program for executing a function of selecting and speaking a sentence appropriate for conversation from the database based on the time-related information in response to a user's comment.
前記コンピュータに、
既存の文章情報から会話として利用可能な文章を抽出する機能と、
この抽出された各文章間の時間的、話題的な距離を示す時間関連情報を算出する機能と、
前記各文章に前記時間関連情報を付加してデータベースに登録する機能と、
ユーザの発言からキーワードを抽出する機能と、
この抽出されたキーワードを含む文章を前記データベースから検索し、その文章の時間関連情報との差分が所定値以下の文章を発言候補として選択する機能と、
この選択された文章を利用して発言する機能と
を実行させるための会話処理プログラム。A conversation processing program used in a computer for conversation with a user,
In the computer,
A function to extract sentences that can be used as conversations from existing sentence information;
A function for calculating time-related information indicating temporal and topical distances between the extracted sentences;
A function of adding the time-related information to each sentence and registering it in a database;
The ability to extract keywords from user statements;
A function that searches the database including the extracted keyword from the database, and selects a sentence whose difference from the time-related information of the sentence is a predetermined value or less as a speech candidate,
A conversation processing program for executing a function to speak using the selected sentence.
前記コンピュータに、
前記メモリに記憶された特定の文章情報の中からユーザの発言に含まれるキーワードを含んだ文章を検索する機能と、
この検索された文章が会話文であるか非会話文であるか判断する機能と、
会話文であると判断された場合にそれ以後の会話文を対象として時間的、話題的な距離を示す時間関連情報を算出し、その時間関連情報に基づいて会話として適切な文章を選択して発言する機能と、
非会話文であると判断された場合にそれ以後の非会話文を対象として時間的、話題的な距離を示す時間関連情報を算出し、その時間関連情報に基づいて会話として適切な文章を選択し、その文章から会話として不適切な部分を削除して発言する機能と
を実行させるための会話処理プログラム。A conversation processing program used in a computer having a function of performing conversation with a user and a memory storing specific sentence information in which a conversation sentence and a non-conversation sentence are mixed,
In the computer,
A function of searching for a sentence including a keyword included in a user's remarks from specific sentence information stored in the memory;
A function for determining whether the retrieved sentence is a conversational sentence or a non-conversational sentence;
When it is determined that it is a conversational sentence, time-related information indicating temporal and topical distance is calculated for the subsequent conversational sentences, and an appropriate sentence is selected as the conversation based on the time-related information. The ability to speak,
When it is determined that the sentence is a non-conversational sentence, time-related information indicating temporal and topical distance is calculated for the subsequent non-conversational sentences, and an appropriate sentence is selected as a conversation based on the time-related information. And a conversation processing program for executing a function that deletes an inappropriate part from the sentence as a conversation.
前記コンピュータに、
前記メモリに記憶された辞書情報の中からユーザの発言に含まれるキーワードを含んだ見出し語を検索する機能と、
この検索された見出し語に対応した説明文を前記辞書情報から抽出し、その説明文から会話として不適切な部分を削除して発言する機能と
を実行させるための会話処理プログラム。A conversation processing program used for a computer having a function of performing conversation with a user and a memory storing specific dictionary information including a headword and an explanatory text corresponding thereto,
In the computer,
A function for searching for a headword including a keyword included in a user's remarks from dictionary information stored in the memory;
A conversation processing program for extracting a description corresponding to the searched entry word from the dictionary information, and executing a function of deleting a part inappropriate for conversation from the description and executing a function.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002233090A JP2004070876A (en) | 2002-08-09 | 2002-08-09 | Conversation system and conversation processing program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002233090A JP2004070876A (en) | 2002-08-09 | 2002-08-09 | Conversation system and conversation processing program |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2004070876A true JP2004070876A (en) | 2004-03-04 |
Family
ID=32018313
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2002233090A Pending JP2004070876A (en) | 2002-08-09 | 2002-08-09 | Conversation system and conversation processing program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2004070876A (en) |
Cited By (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005266085A (en) * | 2004-03-17 | 2005-09-29 | Advanced Telecommunication Research Institute International | Speech synthesis apparatus, character allocation apparatus, and computer program |
| JP2006171719A (en) * | 2004-12-01 | 2006-06-29 | Honda Motor Co Ltd | Interactive information system |
| KR100905744B1 (en) | 2007-12-04 | 2009-07-01 | 엔에이치엔(주) | Method and system for providing conversation dictionary service based on user-created question and answer data |
| JP2015081971A (en) * | 2013-10-22 | 2015-04-27 | 株式会社Nttドコモ | Function execution instruction system and function execution instruction method |
| JP2016024282A (en) * | 2014-07-17 | 2016-02-08 | Kddi株式会社 | Language teaching material generation system, language teaching material generation device, portable terminal, language teaching material generation program, and language teaching material generation method |
| WO2016042600A1 (en) * | 2014-09-16 | 2016-03-24 | 三菱電機株式会社 | Information provision system |
| JP2017068359A (en) * | 2015-09-28 | 2017-04-06 | 株式会社デンソー | Interactive device and interaction control method |
| US10872603B2 (en) | 2015-09-28 | 2020-12-22 | Denso Corporation | Dialog device and dialog method |
| CN113807953A (en) * | 2021-09-24 | 2021-12-17 | 重庆富民银行股份有限公司 | Wind control management method and system based on telephone return visit |
| CN117034953A (en) * | 2023-10-07 | 2023-11-10 | 湖南东良数智科技有限公司 | System for utilizing personal copybook library and intelligent session thereof |
-
2002
- 2002-08-09 JP JP2002233090A patent/JP2004070876A/en active Pending
Cited By (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005266085A (en) * | 2004-03-17 | 2005-09-29 | Advanced Telecommunication Research Institute International | Speech synthesis apparatus, character allocation apparatus, and computer program |
| JP2006171719A (en) * | 2004-12-01 | 2006-06-29 | Honda Motor Co Ltd | Interactive information system |
| KR100905744B1 (en) | 2007-12-04 | 2009-07-01 | 엔에이치엔(주) | Method and system for providing conversation dictionary service based on user-created question and answer data |
| JP2015081971A (en) * | 2013-10-22 | 2015-04-27 | 株式会社Nttドコモ | Function execution instruction system and function execution instruction method |
| JP2016024282A (en) * | 2014-07-17 | 2016-02-08 | Kddi株式会社 | Language teaching material generation system, language teaching material generation device, portable terminal, language teaching material generation program, and language teaching material generation method |
| US9978368B2 (en) | 2014-09-16 | 2018-05-22 | Mitsubishi Electric Corporation | Information providing system |
| WO2016042600A1 (en) * | 2014-09-16 | 2016-03-24 | 三菱電機株式会社 | Information provision system |
| JP2017068359A (en) * | 2015-09-28 | 2017-04-06 | 株式会社デンソー | Interactive device and interaction control method |
| US10872603B2 (en) | 2015-09-28 | 2020-12-22 | Denso Corporation | Dialog device and dialog method |
| CN113807953A (en) * | 2021-09-24 | 2021-12-17 | 重庆富民银行股份有限公司 | Wind control management method and system based on telephone return visit |
| CN113807953B (en) * | 2021-09-24 | 2023-11-03 | 重庆富民银行股份有限公司 | Wind control management method and system based on telephone return visit |
| CN117034953A (en) * | 2023-10-07 | 2023-11-10 | 湖南东良数智科技有限公司 | System for utilizing personal copybook library and intelligent session thereof |
| CN117034953B (en) * | 2023-10-07 | 2023-12-19 | 湖南东良数智科技有限公司 | A system that utilizes personal library and intelligent conversations |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7260533B2 (en) | Text-to-speech conversion system | |
| US8935163B2 (en) | Automatic conversation system and conversation scenario editing device | |
| US7949530B2 (en) | Conversation controller | |
| US6067514A (en) | Method for automatically punctuating a speech utterance in a continuous speech recognition system | |
| US7263488B2 (en) | Method and apparatus for identifying prosodic word boundaries | |
| KR100563365B1 (en) | Hierarchical language model | |
| KR101160193B1 (en) | Affect and Voice Compounding Apparatus and Method therefor | |
| US20050144013A1 (en) | Conversation control apparatus, conversation control method, and programs therefor | |
| JP2006039120A (en) | Dialog apparatus, dialog method, program, and recording medium | |
| JP2003196280A (en) | Text generating method and text generating device | |
| AU2003236049B2 (en) | Conversation control system and conversation control method | |
| JP2004070876A (en) | Conversation system and conversation processing program | |
| Chen | Speech recognition with automatic punctuation | |
| CN101175272B (en) | A method of reading out short text messages by voice | |
| Rühlemann | Integrating corpus-linguistic and conversation-analytic transcription in XML: The case of backchannels and overlap in storytelling interaction | |
| Chi et al. | Neural, neural everywhere: Controlled generation meets scaffolded, structured dialogue | |
| Sloan et al. | Prosody prediction from syntactic, lexical, and word embedding features | |
| JP7297721B2 (en) | Program, device, and method for creating dialogue scenario substituted with verbs according to character attributes | |
| JP2001195081A (en) | Japanese dictation system | |
| JP2004191407A (en) | Conversation system and conversation processing program | |
| Herman | Towards a pragmatics of represented discourse: narrative, speech and context in Woolf's Between the Acts | |
| JP2006106748A (en) | System and method for improving accuracy of speech recognition | |
| JP7172168B2 (en) | Dialogue device, dialogue device control method and program | |
| JP4110011B2 (en) | Conversation control device and conversation control method | |
| JPS5948798A (en) | Synthesization of voice rule |