JP7155758B2 - Information processing device, information processing method and program - Google Patents
Information processing device, information processing method and program Download PDFInfo
- Publication number
- JP7155758B2 JP7155758B2 JP2018158653A JP2018158653A JP7155758B2 JP 7155758 B2 JP7155758 B2 JP 7155758B2 JP 2018158653 A JP2018158653 A JP 2018158653A JP 2018158653 A JP2018158653 A JP 2018158653A JP 7155758 B2 JP7155758 B2 JP 7155758B2
- Authority
- JP
- Japan
- Prior art keywords
- sentence
- language model
- specified
- elements
- input
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Description
本発明は、情報処理装置、情報処理方法及びプログラムに関する。 The present invention relates to an information processing device, an information processing method, and a program.
コンピュータが文章を自動生成する文章生成技術がある。例えば特許文献1では、再帰型ニューラルネットワーク(RNN;Recurrent Neural Network、以下では「RNN」と記す)を用いて、コンピュータに入力された文書を要約した説明文を生成する説明文生成方法等が開示されている。
There is a sentence generation technology in which a computer automatically generates sentences. For example,
しかしながら、特許文献1に係る発明は文書の要約を行っているに過ぎず、ユーザが指定したテキストから、当該テキストを含む文章を自動生成するに至っていない。
However, the invention according to
一つの側面では、ユーザが指定したテキストを含む文章を適切に生成することができる情報処理装置等を提供することを目的とする。 An object of one aspect of the present invention is to provide an information processing apparatus and the like capable of appropriately generating sentences including text specified by a user.
一つの側面では、情報処理装置は、所定単位の文字又は文字列である各要素から構成される文章において、前記各要素の次に出現する前記要素を前記文章の順に学習した言語モデルを記憶する記憶部と、生成する文章に含める前記要素の指定入力を受け付ける受付部と、前記言語モデルに、指定された前記要素のいずれかを入力して前記要素の次に出現する要素を取得し、指定された前記要素及び取得した要素を前記言語モデルに入力して更に次に出現する要素を取得する処理を繰り返し、指定された前記要素及び取得した各要素を含む文章を生成する生成部と、生成した前記文章を出力する出力部とを備え、前記生成部は、前記言語モデルの学習に用いた学習元文章の先頭に存在する要素を前記言語モデルに入力して前記要素の次に出現する要素を取得し、前記先頭の要素及び取得した前記次に出現する要素を含む先頭フレーズを生成し、または、前記学習元文章の先頭に存在する要素を前記言語モデルに入力して前記要素の次に出現する要素を取得し、前記先頭の要素及び取得した要素を前記言語モデルに入力して更に次に出現する要素を取得する処理を繰り返し、前記先頭の要素及び取得した各要素を含む先頭フレーズを生成し、生成した先頭フレーズ及び前記指定された要素を含む文章を生成する。 In one aspect, an information processing device stores a language model obtained by learning, in the order of the sentence, the elements that appear next to each element in a sentence composed of elements that are characters or character strings of a predetermined unit. a storage unit, a reception unit that receives input for specifying the elements to be included in a sentence to be generated , and an element that appears next to the element by inputting one of the specified elements to the language model, and specifying the element a generation unit that repeats the process of inputting the specified element and the obtained element into the language model and obtaining the element that appears next, and generates a sentence containing the specified element and the obtained elements ; and an output unit that outputs the sentence that has been written, and the generation unit inputs an element that exists at the beginning of the learning source sentence used for learning the language model to the language model, and an element that appears next to the element and generate a head phrase that includes the head element and the element that appears next to the obtained element, or input the element that exists at the head of the learning source sentence into the language model and next to the element Obtaining an appearing element, inputting the first element and the obtained element to the language model, and repeating the process of obtaining the next appearing element, and obtaining the first phrase including the first element and each obtained element Generate a sentence containing the generated head phrase and the specified element .
一つの側面では、ユーザが指定したテキストを含む文章を適切に生成することができる。 In one aspect, it is possible to appropriately generate sentences that include user-specified text.
以下、本発明をその実施の形態を示す図面に基づいて詳述する。
(実施の形態1)
図1は、文章生成システムの構成例を示す模式図である。本実施の形態では、ユーザが指定した語句に基づき、契約書の文章を自動生成する文章生成システムについて説明する。文章生成システムは、情報処理装置1、端末2、2、2…を含む。各装置は、インターネット等のネットワークNを介して通信接続されている。
Hereinafter, the present invention will be described in detail based on the drawings showing its embodiments.
(Embodiment 1)
FIG. 1 is a schematic diagram showing a configuration example of a sentence generation system. In this embodiment, a text generation system that automatically generates a text of a contract based on words specified by a user will be described. The text generation system includes an
情報処理装置1は、種々の情報処理、情報の送受信が可能な情報処理装置であり、例えばサーバ装置、パーソナルコンピュータ等である。本実施の形態では情報処理装置1がサーバ装置であるものとし、以下の説明では簡潔にサーバ1と読み替える。サーバ1は、学習用の契約書群を用いて、契約書に出現する語句を学習する機械学習を行い、契約書内の任意の箇所に出現する語句を、直前までに出現する語句から推定可能な言語モデルを生成する。言語モデルは、自然言語の文章が生成される確率をモデル化したものであり、例えばN-gramモデル、隠れマルコフモデルなどがある。後述するように、本実施の形態においてサーバ1は、学習用に与えられる契約書群からRNNを言語モデルとして構築し、当該RNNを用いて契約書用の文章を生成する。
The
端末2は、契約書を作成する各ユーザが使用する端末装置であり、例えばパーソナルコンピュータ、多機能端末等である。端末2は、作成する契約書の文章に含める語句を指定する指定入力を受け付け、指定された語句(以下では適宜に「指定語句」と呼ぶ)を含む文章の生成をサーバ1に要求する。端末2は、生成された文章をサーバ1から受信し、ユーザに提示する。
The
図2は、サーバ1の構成例を示すブロック図である。サーバ1は、制御部11、主記憶部12、通信部13、補助記憶部14を備える。
制御部11は、一又は複数のCPU(Central Processing Unit)、MPU(Micro-Processing Unit)、GPU(Graphics Processing Unit)等の演算処理装置を有し、補助記憶部14に記憶されたプログラムPを読み出して実行することにより、サーバ1に係る種々の情報処理、制御処理等を行う。主記憶部12は、SRAM(Static Random Access Memory)、DRAM(Dynamic Random Access Memory)、フラッシュメモリ等の一時記憶領域であり、制御部11が演算処理を実行するために必要なデータを一時的に記憶する。通信部13は、通信に関する処理を行うための処理回路等を含み、外部と情報の送受信を行う。
FIG. 2 is a block diagram showing a configuration example of the
The
補助記憶部14は大容量メモリ、ハードディスク等であり、制御部11が処理を実行するために必要なプログラムP、その他のデータを記憶している。また、補助記憶部14は、言語モデル141、キーワードDB142、及び置換辞書143を記憶している。言語モデル141は、上述の如く、学習用の契約書群から生成される言語モデルのデータであり、各種契約書に含まれる各条項のモデルデータである。後述するように、本実施の形態でサーバ1は、契約書に含まれる文章のカテゴリ(契約書の種別、及び契約書内の条項)毎に言語モデル141を生成して補助記憶部14に記憶してある。
The
キーワードDB142は、各種契約書の各条項に頻出するキーワードを格納したデータベースである。例えばサーバ1は、機械学習を行って学習用の契約書群から言語モデル141を生成する際に、出現頻度に応じて契約書内の各条項のキーワードを抽出し、キーワードDB142に格納しておく。
The
置換辞書143は、同義語、類義語等のような関連ある複数の語句を対応付けて格納したテーブルである。後述するようにユーザから語句の指定を受けて文章を生成する際に、サーバ1は置換辞書143を参照して、ユーザが指定した語句を置換して文章を生成する。
The
なお、補助記憶部14はサーバ1に接続された外部記憶装置であってもよい。また、サーバ1は複数のコンピュータからなるマルチコンピュータであってもよく、ソフトウェアによって仮想的に構築された仮想マシンであってもよい。
Incidentally, the
また、本実施の形態においてサーバ1は上記の構成に限られず、例えば可搬型記憶媒体に記憶された情報を読み取る読取部、操作入力を受け付ける入力部、画像を表示する表示部等を含んでもよい。
Further, in the present embodiment, the
図3は、キーワードDB142及び置換辞書143のレコードレイアウトの一例を示す説明図である。キーワードDB142は、種別列、条項列、キーワード列を含む。種別列は、キーワードの抽出元である契約書の種別を記憶している。条項列は、契約書の種別と対応付けて、キーワードの抽出元である契約書内の各条項を記憶している。キーワード列は、契約書の種別及び条項と対応付けて、各種別の契約書の各条項から抽出した一又は複数のキーワードを記憶している。
FIG. 3 is an explanatory diagram showing an example of the record layout of the
置換辞書143は、対象語列、置換語列を含む。対象語列は、ユーザが指定した語句について、置換辞書143を用いた置換対象とする対象語を記憶している。置換語列は、対象語と対応付けて、対象語を置換した語句を記憶している。
The
図4は、文章学習処理に関する説明図である。図4では、サーバ1が学習用の契約書の文章を学習する機械学習を行い、複数の言語モデル141、141、141…を生成する様子を概念的に図示してある。以下では、サーバ1が実行する処理の概要について説明する。
FIG. 4 is an explanatory diagram relating to sentence learning processing. FIG. 4 conceptually shows how the
サーバ1は、学習用の契約書群を外部から取得し、各契約書の文章(学習元文章)に出現する語句を学習する機械学習を行う。例えばサーバ1は、人手で作成された既存の契約書を学習用の契約書として用いて学習を行う。サーバ1はまず、各々の契約書から、その契約書の種別、及び契約書に含まれる各条項を判別し、カテゴリ(種別及び条項)毎に契約書内の文章を分類する文書の構造化を行う。そしてサーバ1は、構造化した契約書の各文章を、カテゴリ毎に学習して別々の言語モデル141を生成する。
The
契約書の種別は、契約内容を大別する分類であり、例えば秘密保持契約、業務委託契約、共同研究契約などである。なお、上記はいずれも一例であって、契約書の種別は特に限定されない。図4左側に一例として、秘密保持契約に係る契約書を概念的に図示してある。図4で太線枠に示すように、一般的な契約書は、複数の条項に区分して契約内容が記述される。サーバ1は、契約書の条項毎に、各条項の文章を学習する。なお、本明細書で「文章」と言う場合、文章は一文(センテンス)に限定されず、複数の文から成る文章、又は一文よりも短い文章も含まれ得る。後述するように、サーバ1は、各種別の契約書の各条項に出現する語句を、契約書における各語句の並び順に従って学習する。これによりサーバ1は、各条項に応じた言語モデル141を生成する。
The type of contract is a classification that broadly categorizes the content of the contract, such as a nondisclosure agreement, outsourcing agreement, joint research agreement, and the like. All of the above are examples, and the type of contract is not particularly limited. As an example on the left side of FIG. 4, a contract relating to a confidentiality agreement is conceptually illustrated. As shown in the thick line frame in FIG. 4, a general contract is divided into a plurality of clauses and the contents of the contract are described. The
まずサーバ1は、複数の学習用契約書を、契約書の種別に応じて分類する。例えばサーバ1は、契約書の書類名等から契約書の種別を判別する。図4に示す契約書では、サーバ1はタイトルの「秘密保持契約書」から、当該契約書が秘密保持契約に係る契約書であることを判別する。
First, the
さらにサーバ1は、契約書内の各条項に相当する文章部分を特定し、契約書内の文章を条項毎に分類する。例えばサーバ1は、各条項のタイトルに相当する小見出し(サブタイトル)に基づいて条項を特定する。図4の例では、サーバ1は「第1条」の小見出し「目的」から、当該文章部分を契約の目的に関する条項として判別する。
Further, the
なお、上記ではサーバ1が契約書のタイトル名、小見出し等からルールベースで契約書のカテゴリ(種別及び条項)を判別するものとしたが、本実施の形態はこれに限定されるものではない。例えばサーバ1は、tf-idf法等を用いて各契約書の文章の類似度を、文章に含まれる単語の出現頻度に応じて算出し、文章同士の類似度を算出して契約書の構造化を行ってもよい。
In the above description, the
サーバ1は各契約書について上述の処理を繰り返し、複数の学習用契約書それぞれの種別を判別し、各契約書に記述されている各条項を判別する。すなわちサーバ1は、契約書の構造化を行う。サーバ1は、構造化した各契約書においてカテゴリ(種別及び条項)が共通する文章を元に、各言語モデル141を生成する。例えば図4右側に示すように、サーバ1は、種別が「秘密保持契約」であり、かつ、条項が「損害賠償」で共通する各契約書の文章を元に、一の言語モデル141を生成する。その他の言語モデル141についても同様に、サーバ1は文章のカテゴリに応じて言語モデル141を生成する。
The
図5は、言語モデル141に関する説明図である。本実施の形態でサーバ1は、言語モデル141としてRNNを構築する。例えばサーバ1は、RNNの一種であるLSTM(Long Short-Term Memory)を構築する。
FIG. 5 is an explanatory diagram of the
サーバ1は、上記のようにカテゴリ毎に分類した文章をRNNに入力し、各カテゴリの文章に出現する語句を学習する。ここでサーバ1はまず、RNNに入力する文章に対して形態素解析等の自然言語処理を行い、所定単位の文字又は文字列である語句(要素)毎に分割する。この分割単位は、例えば単語、文節等の単位であるが、特に限定されない。例えばサーバ1は、複数の語句を格納した辞書(不図示)を予め記憶しておき、当該辞書に格納された語句に従って文章を分割する。
The
なお、サーバ1は単語、文節等の単位ではなく、その他の単位で文章を分割してもよい。その他の分割単位としては、サブワード(部分語)と呼ばれる単位が想定され得る。サブワードは通常の分かち書きとは異なり、文章中に出現する頻度に応じて文章を区分した語句の単位である。一般的に文章の最小構成単位として用いられる「単語」は、文章中の文字又は文字列を意味、文法等の観点から最小化した単位であるが、サブワードは意味、文法等による単位ではなく、文章中で用いられる頻度に応じて最小化した単位である。サブワード単位で分割した場合、サーバ1は契約書特有の専門用語も分割可能であるため、より好適に文書の分割を行うことができる。このように、サーバ1は所定単位の文字又は文字列である要素毎に契約書の文章を分割可能であればよく、分割単位とする要素は単語等の単位に限定されない。
It should be noted that the
サーバ1は、分割した各語句をRNNに係る入力層に入力し、機械学習を行う。図5に、RNNの構成を概念的に図示する。図5に示すように、RNNは、入力層、中間層(隠れ層)、及び出力層を有する。入力層は、文章の先頭から末尾に亘って順に出現する各語句の入力をそれぞれ受け付ける複数のニューロンを有する。出力層は、入力層の各ニューロンに対応して、各ニューロンに入力される語句の次に出現する語句をそれぞれ推定して出力する複数のニューロンを有する。そして中間層は、入力層の各ニューロンへの入力値(語句)に対して出力層の各ニューロンにおける出力値(語句)を演算するための複数のニューロンを有する。中間層の各ニューロンは、過去の入力値に関する中間層での演算結果を用いて次の入力値に関する演算を行うことで、直前までに出現する一又は複数の語句から次の語句を推定する。
The
なお、図5に示すRNNの構成は一例であって、本実施の形態はこれに限定されるものではない。例えば中間層は一層に限定されず、二層以上であってもよい。また、入力層及び出力層のニューロンの数は同数に限定されず、例えば入力に対して出力の数は少なくともよい。 Note that the configuration of the RNN shown in FIG. 5 is an example, and the present embodiment is not limited to this. For example, the intermediate layer is not limited to one layer, and may be two or more layers. Also, the number of neurons in the input layer and the number of output layers are not limited to the same number, and for example, the number of outputs may be at least as many as the inputs.
また、本実施の形態でサーバ1はRNNのアルゴリズムに従って学習を行うが、例えばその他の深層学習、N-gramモデル、SVM(Support Vector Machine)、ベイジアンネットワーク、決定木など、他のアルゴリズムに従って学習を行い、言語モデル141を生成してもよい。
In addition, although the
サーバ1は、学習用文章の各語句を、当該文章内での並び順に従って入力層の各ニューロンに入力し、出力層の各ニューロンから出力値を得る。図5の例では、サーバ1は学習用文章の各語句「甲」、「及び」、「乙」、「が」…を、文章内での順番に従い、対応する入力層の各ニューロンに入力する。サーバ1は、中間層を経て出力層の各ニューロンでの演算を行い、文章内の任意の位置(順番)に出現する語句の生起確率を、直前までに出現する語句に基づいて算出し、次に出現する語句を推定する。図5の例では、サーバ1は1番目の語句「甲」に基づき、2番目に出現する語句の生起確率を算出して推定を行う。また、サーバ1は1番目、2番目の語句「甲」、「及び」に基づき、3番目の語句の生起確率を算出して推定を行う。以下同様にして、サーバ1は各語句を推定する。
The
サーバ1は、推定した語句を実際の語句(正解値)と比較し、出力層の各ニューロンからの出力値が正解値に近似するよう各ニューロンのパラメータを調整し、RNNを構築する。例えばサーバ1は、「甲」に続く語句として推定した語句が、実際の語句「及び」となるように、各ニューロンでの重み等を調整する。これによりサーバ1は、学習用文章の正順序における語句の並び順を学習した言語モデル141を生成する。
The
サーバ1は上述の処理を各カテゴリの文章について行い、RNNに係る言語モデル141を、契約書のカテゴリ毎に生成する。
The
また、サーバ1は上記の学習時に、併せて各カテゴリの文章に高頻度で出現するキーワードを抽出してキーワードDB142に格納しておく。例えばサーバ1は、文章内での各語句の出現頻度を計算し、出現頻度が閾値以上の語句をキーワードとして抽出する。サーバ1は、キーワードとして抽出した語句を、抽出元である文章のカテゴリ(種別及び条項)と対応付けてキーワードDB142に格納する。後述するように、サーバ1は、生成する契約書の文章に含める語句をユーザが指定する場合に、キーワードとして抽出した語句をユーザに提示して指定入力を受け付ける。
In addition, the
図6は、文章生成処理に関する説明図である。図7は、端末2が表示する画面イメージ図である。図6では、ユーザが指定した複数の語句から契約書の文章を生成する様子を概念的に図示している。図7では、文章生成時における端末2の表示画面を模式的に図示している。図6及び図7に基づき、言語モデル141を用いた文章生成処理について説明する。
FIG. 6 is an explanatory diagram regarding the text generation process. FIG. 7 is a screen image diagram displayed by the
まずサーバ1は、端末2から、ユーザが文章の作成を希望する契約書のカテゴリと、当該文章に含めたい複数の語句とを指定する指定入力を受け付ける。例えば図7に図示する入力画面を介して、サーバ1は端末2から各種情報の指定入力を受け付ける。
First, the
入力画面は、例えば条項選択欄71、キーワード選択欄72、テキスト入力欄73を含む。条項選択欄71は、入力画面上部に既に表示されている種別の契約書の条項をプルダウンメニューとして表示し、作成を希望する文章の条項をユーザが選択するための選択欄である。図7に示すように、条項選択欄71において端末2は、入力画面上部に表示されている契約書の種別「秘密保持契約」に含まれる各種条項をプルダウンで表示し、いずれかの条項の選択入力を受け付ける。これにより端末2は、ユーザが作成を希望する契約書の種別及び条項、すなわちカテゴリの指定入力を受け付ける。
The input screen includes, for example, a
キーワード選択欄72は、条項選択欄71で選択された条項のキーワードをプルダウンメニューとして表示し、作成する文章に含めたいキーワードをユーザが選択するための選択欄である。サーバ1は条項選択欄71で選択された条項のキーワードをキーワードDB142から読み出して端末2に出力し、端末2は当該キーワードをキーワード選択欄72にプルダウンで表示し、いずれかのキーワードの選択入力を受け付ける。
The
テキスト入力欄73は、作成する文章に含めたい任意のキーワード(語句)をユーザがテキスト入力するための入力欄である。端末2はキーワード選択欄72で提示したキーワードから選択入力を受け付けるだけでなく、テキスト入力欄73において任意のキーワードの入力を受け付ける。
The
なお、テキスト入力欄73によりユーザが任意のテキストをキーワードとして入力した場合、ユーザが自由に入力を行うため、入力されるテキストの内容によっては言語モデル141を用いても当該テキストから契約書の文章を生成することが困難となる虞がある。そこでサーバ1は、置換辞書143を用いてユーザが入力したテキストを変換し、変換後のテキストをキーワードとして用いてもよい。図7の例の場合、サーバ1は、ユーザが入力したテキスト「文書による許諾」に含まれる語句「文書」及び「許諾」を「書面」及び「承諾」に変換し、変換後のテキストをキーワードとして用いる。これにより、言語モデル141による文章生成が困難になる事態を防止する。
When the user inputs arbitrary text as a keyword in the
上述の如く、端末2は、ユーザが作成を希望する契約書のカテゴリ、及び当該条項の文章に含める複数の語句(キーワード)の指定入力を受け付ける。生成ボタン74への操作入力を受け付けた場合、端末2は入力内容をサーバ1に出力し、指定された語句を含む文章の生成を要求する。
As described above, the
図6に戻って、サーバ1は、ユーザが指定したカテゴリの言語モデル141を用い、指定された複数の語句を含む文章を生成して端末2に出力する。図6では、ユーザがカテゴリとして種別「秘密保持契約」の条項「知的財産権」を指定し、かつ、文章に含める語句として「発明」及び「共有」が指定された場合を図示している。この場合、サーバ1は契約書の種別が「秘密保持契約」であり、かつ、条項が「知的財産権」である言語モデル141を用い、文章を生成する。
Returning to FIG. 6 , the
サーバ1はまず、指定された複数の語句のうち、いずれかの語句から、最終的に出力する文章の候補(以下では「候補文」と呼ぶ)を複数生成する。図6では、語句「発明」から複数の候補文が生成される様子を図示している。サーバ1は、当該語句をRNNに係る入力層に入力し、当該語句に基づき次の語句の生起確率を算出して、2番目の語句として生起確率が高い一又は複数の語句を出力として得る。次にサーバ1は、2番目の語句を入力層に入力して、1番目の語句「発明」と、2番目の語句とに基づき次の語句の生起確率を算出して、3番目の語句として生起確率が高い一又は複数の語句を出力として得る。
First, the
このように、サーバ1は直前までの語句から次の語句の生起確率を算出し、次の語句を推定していく。サーバ1は上述の処理を繰り返し、一の語句から複数の文章を生成する。この場合にサーバ1は、生成した各文章の妥当性を評価するためのスコアを、文章生成の際に算出された各語句の生起確率に基づいて算出し、スコアが高い文章を候補文とする。例えばサーバ1は、文章全体のスコアとして、文章に含まれる各語句の生起確率の平均値を用いる。サーバ1は、生起確率の平均値が閾値以上の文章を候補文とする。
In this way, the
なお、サーバ1は生起確率の平均値をスコアとして用いることで候補文を決定したが、他の基準で候補文を決定してもよい。例えばサーバ1は、生起確率が閾値以下の語句を含む文章、つまり不適切な語句を含む文章を除外することで、候補文を決定してもよい。
Although the
また、上記ではユーザが指定した複数の語句のうち、単一の語句から候補文を生成したが、本実施の形態はこれに限定されるものではない。例えばサーバ1は、ユーザが指定した3以上の語句のうち、2以上の語句から複数の候補文を生成し、残る指定語句を含む候補文を選択するようにしてもよい。つまりサーバ1は、ユーザが指定した複数の語句のうち、一部の語句を用いて候補文を生成可能であればよく、当該一部の語句は単一の語句に限定されない。
Also, in the above description, candidate sentences are generated from a single word out of a plurality of words specified by the user, but the present embodiment is not limited to this. For example, the
サーバ1は、生成した複数の候補文から、ユーザが指定した複数の語句のうち、文章生成に用いていない他の指定語句を含む候補文を、端末2に出力する文章として選択する。図6の例では、サーバ1は「発明」以外の語句「共有」を含む、点線矩形枠で囲んだ候補文を出力文章として選択する。
The
上述の如く、サーバ1は、生成した複数の候補文から、指定された複数の語句を全て含み、かつ、文章全体のスコアが高い候補文を選択する。なお、選択する候補文は単一であってもよく、複数であってもよい。サーバ1は、選択した候補文を端末2に出力する。端末2は、図7に示すようにサーバ1から出力された候補文を表示し、ユーザに提示する。
As described above, the
図8は、文章学習処理の処理手順の一例を示すフローチャートである。図8に基づき、文章学習処理の処理内容について説明する。
サーバ1の制御部11は、学習用の契約書群を取得する(ステップS11)。制御部11は、取得した各契約書の文章を、契約書の種別、契約書内の条項等のカテゴリに応じて構造化する処理を行い、各契約書内の文章をカテゴリ毎に分類する(ステップS12)。
FIG. 8 is a flow chart showing an example of the procedure of sentence learning processing. Based on FIG. 8, the contents of the sentence learning process will be described.
The
制御部11は、カテゴリ毎に分類した各文章を、所定単位の文字又は文字列である複数の語句(要素)に分割する(ステップS13)。例えば制御部11は、単語、文節等の意味単位で文章を分割してもよく、サブワード等の出現頻度に応じた単位で文章を分割してもよい。
The
制御部11は、分割した文章の各語句を、文章における並び順に従って学習する機械学習処理を行い、カテゴリ毎に言語モデル141を生成する(ステップS14)。例えば制御部11は、RNN(LSTM)のアルゴリズムに基づく機械学習を行い、文章の先頭から順に出現する一又は複数の語句から、当該一又は複数の語句に続いて出現する語句を推定する言語モデル141を生成する。制御部11は、カテゴリ毎に別々の言語モデル141を生成する。制御部11は、生成した各カテゴリの言語モデル141を補助記憶部14に格納する。
The
また、制御部11は、各カテゴリの文章内での出現頻度に基づき、各カテゴリの文章のキーワードを抽出してキーワードDB142に記憶する(ステップS15)。制御部11は、一連の処理を終了する。
Further, the
図9は、文章生成処理の処理手順の一例を示すフローチャートである。図9に基づき、文章生成処理の処理内容について説明する。
サーバ1の制御部11は、図7で例示した入力画面を介して、生成する文章のカテゴリを指定する指定入力を端末2から受け付ける(ステップS31)。上述の如く、文章のカテゴリは契約書の種別、条項等である。制御部11は、同じく図7で例示した入力画面を介して、生成する文章に含める複数の語句を指定する指定入力を端末2から受け付ける(ステップS32)。例えば制御部11は、キーワードDB142を参照して、ステップS31で指定されたカテゴリの文章のキーワードを複数提示し、ユーザによる選択入力を受け付ける。また、制御部11はユーザから任意の語句のテキスト入力を受け付けてもよい。また、任意の語句のテキスト入力を受け付けた場合、制御部11は置換辞書143を用いて、入力された語句を置換してもよい。
FIG. 9 is a flow chart showing an example of a processing procedure of sentence generation processing. Based on FIG. 9, the processing contents of the text generation processing will be described.
The
制御部11は、ステップS31で指定されたカテゴリの言語モデル141を用いて、ステップS32で指定された複数の語句のうち、いずれかの語句から候補文を複数生成する(ステップS33)。例えば制御部11は、指定語句のいずれかをRNNである言語モデル141に入力し、指定語句に続く語句を出力として得る。さらに制御部11は、指定語句と、出力された語句とに基づいて次に続く語句を出力として得る。制御部11は当該処理を繰り返し、複数の文章を生成する。制御部11は、文章を生成する際に算出した各語句の生起確率に基づいて各パターンの文章全体のスコア(例えば生起確率の平均値)を算出する。制御部11は、算出したスコアに応じて候補文を決定する。例えば制御部11は、スコアが閾値以上の文章を候補文に決定する。
Using the
制御部11は、生成した複数の候補文のうち、ステップS33で候補文を生成する際に用いた語句以外の他の指定語句を含む候補文を、最終的に出力する文章として選択する(ステップS34)。制御部11は、選択した文章を端末2に出力し(ステップS35)、一連の処理を終了する。
The
なお、上記ではユーザが指定した複数の語句を用いて文章を生成したが、単一の指定語句のみから文章を生成してもよい。 In the above description, a sentence is generated using a plurality of words specified by the user, but a sentence may be generated only from a single specified word.
また、上記では生成する文章の一例として契約書を挙げたが、生成する文章は契約書に限定されず、他の文書に係るものであってもよい。 In addition, although the contract is given as an example of the text to be generated above, the text to be generated is not limited to the contract, and may relate to other documents.
また、上記では、サーバ1は学習用契約書の文章に出現する各語句を先頭から末尾に亘り文章通りの正順序で学習して言語モデル141を生成したが、本実施の形態はこれに限定されるものではない。例えばサーバ1は、後述する実施の形態5のように文章の先頭及び末尾を入れ替え、文章の末尾から先頭に亘る逆順序で各語句を学習した言語モデル141を生成し、逆順序の言語モデル141から文章を生成するようにしてもよい。また、例えばサーバ1は、正順序及び逆順序の双方向で学習を行ったbidirectional RNNを言語モデル141として構築し、当該言語モデル141を用いて文章を生成してもよい。このように、サーバ1は文章内の語順を学習した言語モデル141から文章を生成可能であればよく、その語順は正順序であるか、又は逆順序であるかを問わず、また、正順序及び逆順序の双方向を学習して言語モデル141を構築してもよい。
In the above description, the
以上より、本実施の形態1によれば、学習用契約書の文章内に出現する各語句を、その文章の順に学習した言語モデル141を用いることで、ユーザが指定した語句を含む文章を適切に生成することができる。
As described above, according to the first embodiment, by using the
また、本実施の形態1によれば、ユーザが指定した複数の語句から文章を生成することで、より適切な文章を生成することができる。 Moreover, according to the first embodiment, by generating a sentence from a plurality of words specified by the user, it is possible to generate a more appropriate sentence.
また、本実施の形態1によれば、言語モデル141から生成した文章のスコアを各語句の生起確率から算出することで、当該文章の妥当性を評価し、適切な文章をユーザに提示することができる。
Further, according to the first embodiment, by calculating the score of a sentence generated from the
また、本実施の形態1によれば、文章のカテゴリ毎に言語モデル141を用意し、ユーザが指定したカテゴリに対応する言語モデル141から文章を生成することで、より適切な文章をユーザに提示することができる。
Further, according to the first embodiment, a
また、本実施の形態1によれば、ユーザが任意に入力した語句から文章を生成する際に、置換辞書を用いて入力された語句を置換することで、言語モデル141を用いても文章を生成困難となるような事態を防止することができる。
Further, according to the first embodiment, when a sentence is generated from a word arbitrarily input by the user, the sentence is generated using the
(実施の形態2)
本実施の形態では、言語モデル141に基づいて文章の先頭に頻出するフレーズを生成し、当該フレーズから、ユーザが指定した語句を含む文章を生成する形態について述べる。なお、実施の形態1と重複する内容については同一の符号を付して説明を省略する。
図10は、実施の形態2の概要を示す説明図である。図10に基づき、本実施の形態でサーバ1が実行する文章生成処理について説明する。
(Embodiment 2)
In this embodiment, a form is described in which phrases that frequently appear at the beginning of sentences are generated based on the
FIG. 10 is an explanatory diagram showing an overview of the second embodiment. Based on FIG. 10, the sentence generation process which the
本実施の形態に係るサーバ1はまず、言語モデル141を用いて、契約書の文章先頭に出現するであろうと推定される複数の語句、すなわち頻出の先頭フレーズを生成する。例えばサーバ1は、言語モデル141の生成時に用いた学習用契約書の文章、すなわち学習元文章において、文章先頭に存在する語句から言語モデル141を用いて先頭フレーズを生成する。図10の例では、「甲」が学習元文章の先頭に存在する語句に該当する。サーバ1は言語モデル141を参照しながら、学習元文章の先頭語句に続く語句として、一定値以上の生起確率を有する語句を選択する。さらにサーバ1は、選択した語句に続く語句として、一定値以上の生起確率を有する語句を選択する。サーバ1は当該処理を繰り返し、一定値以上の生起確率を有する語句を、先頭語句に続く語句として順々に選択し、文章を生成していく。
The
サーバ1は、上記のように文章先頭から順に生起確率が一定値以上の語句を選択していき、複数の語句を先頭フレーズとして生成する。例えばサーバ1は、ユーザが指定した語句のいずれか(図10では「発明」又は「共有」)が出現するまで文章生成を行い、指定語句が出現した時点で、指定語句より前に位置する一又は複数の語句を先頭フレーズとして特定すればよい。あるいはサーバ1は、文章の先頭から所定語数の語句を生成し、当該所定語数の語句から、意味、文法等のまとまりを持ったフレーズ部分を特定してもよい。文章先頭からどこまでの語句を先頭フレーズとして特定するか、その手法は特に問わない。
As described above, the
サーバ1は、生成した先頭フレーズから、ユーザが指定した語句を含む文章を生成する。具体的には、サーバ1は、ユーザが指定した複数の語句のうち、いずれかの語句を先頭フレーズの次の語句として配置する。そしてサーバ1は、先頭フレーズ及び指定語句をRNN(言語モデル141)に入力し、指定語句に続く語句を推定して複数の候補文を生成する。
The
後の処理は実施の形態1と同様であり、サーバ1は文章生成に用いていない他の指定語句を含む候補文を最終的に出力する文章として選択し、端末2に出力する。
The subsequent processing is the same as in the first embodiment, and the
図11は、実施の形態2に係る文章生成処理の処理手順の一例を示すフローチャートである。
生成する文章のカテゴリの指定入力を受け付け(ステップS31)、当該文章に含める複数の語句の指定入力を受け付けた後(ステップS32)、サーバ1の制御部11は、以下の処理を実行する。制御部11は、ステップS31で指定されたカテゴリの言語モデル141に基づき、当該カテゴリの文章の先頭に出現するフレーズ(複数の語句)を生成する(ステップS201)。制御部11は、生成したフレーズと、ステップS31で指定された複数の語句のうちいずれかの語句とに基づいて、複数の候補文を生成する(ステップS202)。具体的には、制御部11は先頭フレーズの次に指定語句のいずれかを配置してRNNに入力し、後続の語句を推定して文章を生成する。制御部11は、処理をステップS34に移行する。
FIG. 11 is a flowchart illustrating an example of a processing procedure of sentence generation processing according to the second embodiment.
After accepting input specifying the category of the sentence to be generated (step S31) and accepting input specifying multiple words to be included in the sentence (step S32), the
以上より、本実施の形態2によれば、言語モデル141に基づいて先頭フレーズを生成し、当該フレーズの次に指定語句を配置して後続の語句を生成していくことで、より好適に文章を生成することができる。
As described above, according to the second embodiment, the first phrase is generated based on the
(実施の形態3)
本実施の形態では、ユーザが指定した順序で指定語句が出現する文章を生成する形態について説明する。
図12は、実施の形態3の概要を示す説明図である。図12に基づき、本実施の形態に係るサーバ1が実行する文章生成処理について説明する。
(Embodiment 3)
In this embodiment, a form in which a sentence is generated in which specified words appear in the order specified by the user will be described.
FIG. 12 is an explanatory diagram showing an overview of the third embodiment. The text generation process executed by the
本実施の形態でサーバ1は、図7で例示した画面と同様の入力画面において、複数の語句の指定入力を受け付けるだけでなく、当該複数の語句が文章内で出現する順序の指定入力を受け付ける。そしてサーバ1は、指定された順序で各語句が出現する文章を生成する。
In the present embodiment, the
例えば図12に示すように、「発明」が1番目の語句、「帰属」が2番目の語句、「協議」が3番目の語句として指定された場合を考える。この場合、サーバ1は1番目の語句として指定された「発明」をRNN(言語モデル141)に入力し、後続の語句を推定して複数の候補文を生成する。
For example, as shown in FIG. 12, consider a case where "invention" is specified as the first word, "attribution" as the second word, and "consultation" as the third word. In this case, the
サーバ1は、生成した複数の候補文のうち、文章生成に用いていない他の指定語句がユーザにより指定された順序で出現する文章を選択する。図12の例では、「発明」以外の指定語句「帰属」及び「協議」を含み、かつ、2番目に指定された語句「帰属」が3番目に指定された語句「協議」よりも先に出現する文章を選択する。サーバ1は、選択した文章を端末2に出力する。
The
図13は、実施の形態3に係る文章生成処理の処理手順の一例を示すフローチャートである。
生成する文章のカテゴリの指定入力を受け付けた後(ステップS31)、サーバ1の制御部11は以下の処理を実行する。制御部11は、生成する文章に含める複数の語句と、各語句が文章内で出現する順序とを指定する指定入力を受け付ける(ステップS301)。制御部11は、指定された複数の語句のうち、いずれかの語句から候補文を複数生成する(ステップS302)。そして制御部11は、複数の候補文から、ステップS301で指定された順序で各指定語句が出現する候補文を、最終的に出力する文章として選択する(ステップS303)。制御部11は処理をステップS35に移行する。
FIG. 13 is a flowchart illustrating an example of a processing procedure of sentence generation processing according to the third embodiment.
After receiving the designation input of the category of the text to be generated (step S31), the
以上より、本実施の形態3によれば、指定された順序で指定語句が出現する文章を生成することで、より正確な文章の生成を行うことができる。 As described above, according to the third embodiment, a more accurate sentence can be generated by generating a sentence in which specified words appear in a specified order.
(実施の形態4)
本実施の形態では、ユーザが指定した複数の語句を全て含む候補文が生成されない場合、候補文に含まれる語句を指定語句に置き換えて、指定語句を全て含む文章を生成する形態について説明する。
図14は、実施の形態4の概要を示す説明図である。図14に基づき、本実施の形態に係るサーバ1が実行する文章生成処理について説明する。
(Embodiment 4)
In this embodiment, when a candidate sentence containing all of a plurality of words specified by the user is not generated, the words included in the candidate sentence are replaced with the specified words to generate a sentence including all the specified words.
FIG. 14 is an explanatory diagram showing an overview of the fourth embodiment. The text generation process executed by the
本実施の形態に係るサーバ1は、実施の形態1と同様に、ユーザが指定した複数の語句のうち、いずれかの語句に基づいて複数の候補文を生成する。この場合に、ユーザが指定した語句によっては、候補文生成に用いていない他の指定語句を含む文章が候補文として生成されない可能性もある。例えば図14の上側に模式的に示すように、「発明」及び「共有」が指定された場合に、語句「発明」から複数の候補文が生成されたものの、候補文のいずれにも「共有」が含まれないような可能性もある。
この場合にサーバ1は、候補文に含まれる語句を指定語句に置換しながら、文章のスコアに応じて端末2に出力する文章を選択する。例えばサーバ1はまず、上記のようにして生成された複数の候補文のうち、スコアが最も高い候補文を選択する。そしてサーバ1は、選択した候補文に含まれる各語句を残りの指定語句に置換して、複数の候補文を新たに生成する。図14の例では、スコアが最も高い点線矩形枠で囲んだ文章について、「発明」に続く2番目の語句、3番目の語句、4番目の語句…をそれぞれ残りの指定語句「共有」に置換した候補文を生成する。
In this case, the
なお、上記では指定語句「発明」以外の全ての語句を総当たりで指定語句「共有」に置換しているが、本実施の形態はこれに限定されるものではない。例えばサーバ1は、指定語句「発明」を除く各語句のうち、残りの指定語句「共有」と同一品詞の語句に絞って指定語句「共有」に置換し、候補文を生成してもよい。すなわちサーバ1は、候補文生成に用いていない他の指定語句(要素)と同一品詞の語句を、当該他の指定語句に変換して候補文を生成する。同一品詞の間で変換を行うことで、より適切な候補文を作成することができると共に、文章生成に伴う処理負荷を軽減することができる。
In the above description, all words other than the specified word "invention" are replaced with the specified word "shared" in round robin, but the present embodiment is not limited to this. For example, the
サーバ1は、生成した各候補文の語句をRNN(言語モデル141)に入力して生起確率を算出し、各候補文のスコアを算出する。そしてサーバ1は、スコアが高い候補文を選択する。例えばサーバ1は、スコアが閾値以上の候補文を選択する。このようにしてサーバ1は、複数の指定語句を全て含み、かつ、スコアが閾値以上の候補文を生成する。サーバ1は、生成した候補文を端末2に出力し、ユーザに提示する。
The
図15は、実施の形態4に係る文章生成処理の処理手順の一例を示すフローチャートである。
ステップS32で指定された複数の語句のうち、いずれかの語句を用いて複数の候補文を生成した後(ステップS33)、サーバ1の制御部11は以下の処理を実行する。制御部11は、ステップS32で指定された複数の語句のうち、ステップS33で文章を生成する際に用いた語句以外の他の指定語句を含む候補文があるか否かを判定する(ステップS401)。指定語句を含む候補文があると判定した場合(S401:YES)、制御部11は処理をステップS34に移行する。
FIG. 15 is a flowchart illustrating an example of a processing procedure of sentence generation processing according to the fourth embodiment.
After generating a plurality of candidate sentences using any one of the plurality of phrases specified in step S32 (step S33), the
指定語句を含む候補文がないと判定した場合(S401:NO)、制御部11は、ステップS33で生成した候補文に含まれる各語句を指定語句に置換しながら、新たな候補文を生成する(ステップS402)。例えば制御部11は、ステップS33で生成した複数の候補文のうち最もスコアが高い候補文を選択し、当該候補文に含まれる各語句を、文章生成に用いていない指定語句に置換して複数の候補文を新たに生成する。この場合に制御部11は、例えば候補文に含まれる各語句のうち、文章生成に用いていない指定語句(他の要素)と同一品詞の語句を指定語句に置換することで新たな候補文を生成する。
When it is determined that there is no candidate sentence containing the designated word (S401: NO), the
制御部11は、言語モデル141を用いて新たに生成した複数の候補文それぞれのスコアを算出し、スコアが高い候補文を、最終的に出力する文章として選択する(ステップS403)。例えば制御部11は、スコアが閾値以上の候補文を選択する。制御部11は処理をステップS35に移行する。
The
以上より、本実施の形態4によれば、指定語句を全て含む文章が生成されない場合であっても、文章内の語句を置き換えることで、指定語句を含む文章を適切に生成することができる。 As described above, according to the fourth embodiment, even when a sentence including all specified words is not generated, a sentence including the specified words can be appropriately generated by replacing the words in the sentence.
また、本実施の形態4によれば、上記の置換を同一品詞の間で行うことで、指定語句を含む文章をより適切に生成することができる。 Further, according to the fourth embodiment, by performing the above replacement between the same part of speech, it is possible to more appropriately generate a sentence including the designated word/phrase.
(実施の形態5)
本実施の形態では、学習用契約書から正順序の言語モデル141(第1の言語モデル)だけでなく逆順序の言語モデル141(第2の言語モデル)を生成し、両方の言語モデル141を組み合わせて文章を生成する形態について説明する。
図16は、実施の形態5に係る文章学習処理に関する説明図である。図16では、学習用契約書に出現する語句の並び順を、文章の末尾から逆順序で学習する様子を概念的に図示している。
(Embodiment 5)
In this embodiment, not only the forward order language model 141 (first language model) but also the reverse order language model 141 (second language model) are generated from the learning contract, and both
FIG. 16 is an explanatory diagram of sentence learning processing according to the fifth embodiment. FIG. 16 conceptually illustrates how words appearing in a learning contract are learned in reverse order from the end of the sentence.
サーバ1は実施の形態1と同様に、学習用契約書の文章を所定単位の語句毎に分割し、文章の先頭から末尾に亘って正順序で各語句を学習して言語モデル141を生成する。本実施の形態ではさらに、サーバ1は文章の各語句を逆順序に並び替え、文章の末尾から逆順序で各語句を学習して、逆順序の言語モデル141を生成する。
As in the first embodiment, the
例えばサーバ1は、正順序の学習処理を完了後、学習用文章の先頭から末尾までを入れ替え、末尾の語句を先頭にした逆順序に並び替える。すなわち、図16に示すように、サーバ1は「甲」、「及び」、「乙」、「が」、…「通知」、「する」と続く語句を、「する」、「通知」、「に」、「相手方」、…「及び」、「甲」という順序に並び替える。サーバ1は、図3で示したRNNと同様の構成を有する逆順序学習用のRNNの入力層に、並び替えた各語句を入力する。そしてサーバ1は、文章の末尾から逆順序で出現する一又は複数の語句に基づき、当該一又は複数の語句の直前に出現する語句を推定するRNNを構築する。つまりサーバ1は、文章内の任意の位置の語句を、当該語句に続く後続の語句から推定するRNNを構築する。
For example, after completing the learning process in the forward order, the
図17は、実施の形態5に係る文章生成処理に関する説明図である。ユーザが指定した語句から文章を生成する場合、サーバ1は、正順序及び逆順序の双方の言語モデル141から算出される各語句の生起確率を組み合わせて、文章を生成する。
FIG. 17 is an explanatory diagram of sentence generation processing according to the fifth embodiment. When generating sentences from words specified by the user, the
例えばサーバ1は、まず正順序の言語モデル141を用いて候補文を生成する。具体的には実施の形態1と同様に、サーバ1は複数の指定語句のいずれかから複数の候補文を生成する。そしてサーバ1は、残りの指定語句を含む候補文を選択する。ここで、図17に例示する候補文が選択された場合を考える。
For example, the
サーバ1は候補文の語句の並び順を逆順序に変換し、言語モデル141に入力して各語句の生起確率を算出する。そしてサーバ1は、逆順序の言語モデル141から算出した生起確率に基づき、候補文が適切な文章であるか否か判定する。例えばサーバ1は、各語句の生起確率を所定の閾値と比較し、閾値以下の語句があるか否かを判定する。これによりサーバ1は、逆順序の言語モデル141から、不適切な語句があるかをチェックする。
The
生起確率が閾値以下の語句があると判定した場合、例えばサーバ1は逆順序の言語モデル141を用いて、該当語句を別の語句に置換する。すなわちサーバ1は、該当語句を校正する。例えばサーバ1は、該当語句の直後から出現する一又は複数の語句(図17では「に」の直後から出現する「相手方」、「と」、「の」…の語句)より、該当語句の位置に出現する語句を推定し、語句を置換する。これによりサーバ1は、候補文をより適切な文章に校正する。サーバ1は、校正後の文章を端末2に出力する。
When determining that there is a word whose occurrence probability is equal to or lower than the threshold, the
図18は、実施の形態5に係る文章学習処理の処理手順の一例を示すフローチャートである。
契約書の文章を複数の語句に分割した後(ステップS13)、サーバ1の制御部11は以下の処理を実行する。制御部11は、分割した文章の各語句を、文章における並び順に従って学習する機械学習処理を行い、正順序の言語モデル141を生成する(ステップS501)。次に制御部11は、文章の先頭から末尾までを並び替え、各語句の並び順を逆順序に変換する(ステップS502)。そして制御部11は、各語句を逆順序で学習した言語モデル141を生成する(ステップS503)。制御部11は、ステップS501で生成した正順序の言語モデル141と、ステップS503で生成した逆順序の言語モデル141とを補助記憶部14に格納し、処理をステップS15に移行する。
18 is a flowchart illustrating an example of a processing procedure of sentence learning processing according to Embodiment 5. FIG.
After dividing the text of the contract into a plurality of words (step S13), the
図19は、実施の形態5に係る文章生成処理の処理手順の一例を示すフローチャートである。
生成する文章に含める複数の語句の指定入力を受け付けた後(ステップS32)、サーバ1の制御部11は以下の処理を実行する。制御部11は、正順序の言語モデル141に基づき、ステップS32で指定された複数の語句のうち、いずれかの語句から候補文を複数生成する(ステップS521)。制御部11は、生成した複数の候補文から、ステップS521で用いていない指定語句を含む候補文を選択する(ステップS522)。
19 is a flowchart illustrating an example of a processing procedure of sentence generation processing according to Embodiment 5. FIG.
After receiving the designation input of a plurality of words to be included in the sentence to be generated (step S32), the
制御部11は、ステップS522で選択した候補文に含まれる各語句の並び順を逆順序に変換する(ステップS523)。そして制御部11は、逆順序の言語モデル141に基づき、候補文に含まれる各語句の生起確率を算出する(ステップS524)。制御部11は、逆順序の言語モデル141から算出した生起確率に応じて、最終的に出力する文章を決定する(ステップS525)。例えば制御部11は、逆順序の言語モデル141を用いて候補文に含まれる各語句の生起確率を所定の閾値と比較し、閾値以下の語句があるか否かを判定する。閾値以下の語句がないと判定した場合、制御部11は、候補文を出力文章に決定する。また、例えば制御部11は、閾値以下の語句があると判定した場合、逆順序の言語モデル141を用いて該当語句を別の語句に置換(校正)する処理を行い、置換後の候補文を最終的に出力する文章に決定してもよい。制御部11は処理をステップS35に移行する。
The
なお、逆順序の言語モデル141から候補文を生成して、正順序の言語モデル141によりチェックを行うようにしてもよい。
Alternatively, candidate sentences may be generated from the
以上より、本実施の形態5によれば、正順序及び逆順序の言語モデル141を組み合わせて文章を生成することで、より適切な文章をユーザに提示することができる。
As described above, according to the fifth embodiment, a more appropriate sentence can be presented to the user by generating a sentence by combining the forward-order and reverse-
また、本実施の形態5によれば、正順序又は逆順序のいずれかの言語モデル141から候補文を生成し、他方の言語モデル141を用いて候補文をチェックすることで、より適切に文章を生成することができる。
Further, according to the fifth embodiment, candidate sentences are generated from either the forward-order or reverse-
(実施の形態6)
図20は、上述した形態のサーバ1の動作を示す機能ブロック図である。制御部11がプログラムPを実行することにより、サーバ1は以下のように動作する。
記憶部201は、所定単位の文字又は文字列である各要素から構成される文章において、前記各要素の次に出現する前記要素を前記文章の順に学習した言語モデルを記憶する。受付部202は、生成する文章に含める前記要素の指定入力を受け付ける。生成部203は、前記言語モデルを参照して、指定された前記要素に基づき文章を生成する。出力部204は、生成した前記文章を出力する。
(Embodiment 6)
FIG. 20 is a functional block diagram showing the operation of the
The
本実施の形態6は以上の如きであり、その他は実施の形態1から5と同様であるので、対応する部分には同一の符号を付してその詳細な説明を省略する。 The sixth embodiment is as described above, and the other parts are the same as those of the first to fifth embodiments.
今回開示された実施の形態はすべての点で例示であって、制限的なものではないと考えられるべきである。本発明の範囲は、上記した意味ではなく、特許請求の範囲によって示され、特許請求の範囲と均等の意味及び範囲内でのすべての変更が含まれることが意図される。 The embodiments disclosed this time are illustrative in all respects and should not be considered restrictive. The scope of the present invention is indicated by the scope of the claims rather than the above-described meaning, and is intended to include all modifications within the scope and meaning equivalent to the scope of the claims.
1 サーバ(情報処理装置)
11 制御部
12 主記憶部
13 通信部
14 補助記憶部
P プログラム
141 言語モデル
142 キーワードDB
143 置換辞書
2 端末
1 server (information processing device)
11
143
Claims (12)
生成する文章に含める前記要素の指定入力を受け付ける受付部と、
前記言語モデルに、指定された前記要素のいずれかを入力して前記要素の次に出現する要素を取得し、指定された前記要素及び取得した要素を前記言語モデルに入力して更に次に出現する要素を取得する処理を繰り返し、指定された前記要素及び取得した各要素を含む文章を生成する生成部と、
生成した前記文章を出力する出力部と
を備え、
前記生成部は、
前記言語モデルの学習に用いた学習元文章の先頭に存在する要素を前記言語モデルに入力して前記要素の次に出現する要素を取得し、前記先頭の要素及び取得した前記次に出現する要素を含む先頭フレーズを生成し、または、前記学習元文章の先頭に存在する要素を前記言語モデルに入力して前記要素の次に出現する要素を取得し、前記先頭の要素及び取得した要素を前記言語モデルに入力して更に次に出現する要素を取得する処理を繰り返し、前記先頭の要素及び取得した各要素を含む先頭フレーズを生成し、
生成した先頭フレーズ及び前記指定された要素を含む文章を生成する
情報処理装置。 a storage unit that stores a language model obtained by learning, in the order of the sentence, the elements appearing next to the elements in a sentence composed of elements that are characters or character strings of a predetermined unit;
a receiving unit that receives a specified input of the element to be included in the generated text;
Input any of the specified elements into the language model to obtain an element appearing next to the element, input the specified element and the obtained element into the language model, and then appear next. a generation unit that repeats the process of acquiring elements to generate sentences that include the specified elements and the acquired elements ;
and an output unit that outputs the generated text ,
The generating unit
An element existing at the beginning of a learning source sentence used for learning the language model is input to the language model, an element appearing next to the element is acquired, and the element appearing at the beginning and the element appearing next to the acquired element are obtained. or input an element existing at the beginning of the learning source sentence into the language model to obtain an element that appears next to the element, and convert the first element and the obtained element to the Repeat the process of inputting to the language model and acquiring the next appearing element to generate a leading phrase including the leading element and each acquired element,
Generate a sentence containing the generated first phrase and the specified element
Information processing equipment.
前記言語モデルが出力した要素を含む前記先頭フレーズを生成する
ことを特徴とする請求項1に記載の情報処理装置。 The language model calculates the probability of occurrence of the element appearing next based on the input leading element , and outputs the element for which the occurrence probability of a certain value or more is calculated,
2. The information processing apparatus according to claim 1 , wherein the head phrase including the element output by the language model is generated.
生成する文章に含める前記要素の指定入力を受け付ける受付部と、
前記言語モデルに、指定された前記要素のいずれかを入力して前記要素の次に出現する要素を取得し、指定された前記要素及び取得した要素を前記言語モデルに入力して更に次に出現する要素を取得する処理を繰り返し、指定された前記要素及び取得した各要素を含む文章を生成する生成部と、
生成した前記文章を出力する出力部と
を備え、
前記受付部は、複数の前記要素の指定入力を受け付け、
前記生成部は、指定された前記複数の要素のうちのいずれかの要素を前記言語モデルに入力して次に出現する要素を複数取得し、複数の前記次に出現する要素のそれぞれについて、前記言語モデルに入力された前記指定された要素及び前記次に出現する要素を前記言語モデルに入力して更に次に出現する要素を取得する処理を繰り返し、前記指定された要素及び前記次に出現する要素を含む複数の前記文章を生成し、
前記複数の文章から、前記言語モデルに入力された要素以外に指定された他の前記要素を含むかを判断して、前記文章を選択する選択部を備え、
前記出力部は、選択した前記文章を出力する
ことを特徴とする情報処理装置。 a storage unit that stores a language model obtained by learning, in the order of the sentence, the elements appearing next to the elements in a sentence composed of elements that are characters or character strings of a predetermined unit;
a receiving unit that receives a specified input of the element to be included in the generated text;
Input any of the specified elements into the language model to obtain an element appearing next to the element, input the specified element and the obtained element into the language model, and then appear next. a generation unit that repeats the process of acquiring elements to generate sentences that include the specified elements and the acquired elements;
an output unit that outputs the generated text;
with
The reception unit receives designation input of a plurality of the elements,
The generation unit inputs any one of the specified plurality of elements to the language model to obtain a plurality of elements that appear next, and for each of the plurality of elements that appear next, Repeating the process of inputting the specified element input to the language model and the next appearing element into the language model and obtaining the next appearing element, and generating a plurality of said sentences containing an element to
A selection unit that selects the sentences by determining whether the sentences contain other elements specified in addition to the elements input to the language model from the plurality of sentences,
The information processing apparatus, wherein the output unit outputs the selected text.
前記選択部は、指定された順序で前記複数の要素が出現する前記文章を選択する
ことを特徴とする請求項3に記載の情報処理装置。 The reception unit receives an input specifying the order in which the plurality of elements appear in the sentence,
The information processing apparatus according to claim 3 , wherein the selection unit selects the sentence in which the plurality of elements appear in a designated order.
前記言語モデルを用いて、生成した複数の文章のそれぞれに含まれる各要素の生起確率を算出し、前記各要素の生起確率に基づき、前記複数の文章のそれぞれの妥当性を示すスコアを算出する算出部を備え、
前記選択部は、前記スコアが所定値以上の文章を選択する
ことを特徴とする請求項3又は4に記載の情報処理装置。 If the sentence including the other element is not generated, the generating unit sequentially replaces each element included in the generated sentence with the other element to generate a plurality of sentences ;
Using the language model, the probability of occurrence of each element contained in each of the plurality of generated sentences is calculated, and based on the probability of occurrence of each element, a score indicating the validity of each of the plurality of sentences is calculated. a calculator,
5. The information processing apparatus according to claim 3 , wherein the selection unit selects sentences whose score is equal to or greater than a predetermined value .
ことを特徴とする請求項5に記載の情報処理装置。 6. The information processing apparatus according to claim 5 , wherein among the elements included in the generated sentence, the generation unit replaces an element having the same part of speech as the other element with the other element.
前記各要素の生起確率に基づき、生成した前記文章の妥当性を示すスコアを算出する算出部を備え、
前記出力部は、算出した前記スコアが所定値以上の前記文章を出力する
ことを特徴とする請求項1~6のいずれか1項に記載の情報処理装置。 The generation unit generates the sentence by calculating the probability of occurrence of each element following the specified element based on the language model,
A calculation unit that calculates a score indicating the validity of the generated sentence based on the probability of occurrence of each element,
The information processing apparatus according to any one of claims 1 to 6 , wherein the output unit outputs the text whose calculated score is equal to or greater than a predetermined value .
前記生成部は、
前記第1又は第2の言語モデルを用いて前記文章を生成し、
生成した前記文章に含まれる前記要素の並び順を逆順序に変換し、
前記第2又は第1の言語モデルを用いて、変換後の前記文章に含まれる各要素の生起確率を算出し、
前記出力部は、算出した前記各要素の生起確率が所定値以上である場合に前記文章を出力する
ことを特徴とする請求項1~7のいずれか1項に記載の情報処理装置。 The storage unit stores a first language model that has learned the elements in forward order from the beginning to the end of the sentence, and a second language model that has learned the elements by rearranging the elements from the beginning to the end of the sentence in reverse order. store the language model and
The generating unit
generating the sentence using the first or second language model ;
Converting the arrangement order of the elements included in the generated sentence to reverse order,
Using the second or first language model, calculate the occurrence probability of each element contained in the converted sentence,
The information processing apparatus according to any one of claims 1 to 7 , wherein the output unit outputs the text when the calculated probability of occurrence of each element is equal to or greater than a predetermined value .
前記受付部は、生成する文章の前記カテゴリの指定入力を受け付け、
前記生成部は、指定された前記カテゴリに対応する前記言語モデルに基づき、前記文章を生成する
ことを特徴とする請求項1~8のいずれか1項に記載の情報処理装置。 The storage unit stores a plurality of the language models that differ according to categories of sentences,
The receiving unit receives a specified input of the category of the sentence to be generated,
The information processing apparatus according to any one of claims 1 to 8 , wherein the generation unit generates the sentence based on the language model corresponding to the designated category.
前記受付部は、テキスト入力により前記要素の指定入力を受け付け、
前記置換辞書を参照して、入力された前記要素を置換する置換部を備え、
前記生成部は、置換された前記要素に基づき前記文章を生成する
ことを特徴とする請求項1~9のいずれか1項に記載の情報処理装置。 the storage unit stores a replacement dictionary for replacing the element;
The receiving unit receives a specified input of the element by text input,
a replacement unit that refers to the replacement dictionary and replaces the input element;
The information processing apparatus according to any one of claims 1 to 9 , wherein the generation unit generates the sentence based on the replaced element.
文章内で各要素の次に出現する前記要素を前記文章の順に学習した言語モデルに、指定された前記要素のいずれかを入力して前記要素の次に出現する要素を取得し、指定された前記要素及び取得した要素を前記言語モデルに入力して更に次に出現する要素を取得する処理を繰り返し、指定された前記要素及び取得した各要素を含む文章を生成し、
生成した前記文章を出力する
処理であって、
前記言語モデルの学習に用いた学習元文章の先頭に存在する要素を前記言語モデルに入力して前記要素の次に出現する要素を取得し、前記先頭の要素及び取得した前記次に出現する要素を含む先頭フレーズを生成し、または、前記学習元文章の先頭に存在する要素を前記言語モデルに入力して前記要素の次に出現する要素を取得し、前記先頭の要素及び取得した要素を前記言語モデルに入力して更に次に出現する要素を取得する処理を繰り返し、前記先頭の要素及び取得した各要素を含む先頭フレーズを生成し、
生成した先頭フレーズ及び前記指定された要素を含む文章を生成する
処理をコンピュータが実行することを特徴とする情報処理方法。 Receiving a specified input of an element that is a character or a character string of a predetermined unit to be included in the generated sentence,
Input any of the specified elements to a language model that has learned the elements that appear next to each element in the sentence in the order of the sentence, acquire the element that appears next to the element, and obtain the element that appears next to the specified element. Repeating the process of inputting the element and the obtained element into the language model and obtaining the element that appears next, generating a sentence containing the specified element and each obtained element ,
A process of outputting the generated text,
An element existing at the beginning of a learning source sentence used for learning the language model is input to the language model, an element appearing next to the element is acquired, and the element appearing at the beginning and the element appearing next to the acquired element are obtained. or input an element existing at the beginning of the learning source sentence into the language model to obtain an element that appears next to the element, and convert the first element and the obtained element to the Repeat the process of inputting to the language model and acquiring the next appearing element to generate a leading phrase including the leading element and each acquired element,
Generate a sentence containing the generated first phrase and the specified element
An information processing method characterized in that a computer executes processing.
文章内で各要素の次に出現する前記要素を前記文章の順に学習した言語モデルに、指定された前記要素のいずれかを入力して前記要素の次に出現する要素を取得し、指定された前記要素及び取得した要素を前記言語モデルに入力して更に次に出現する要素を取得する処理を繰り返し、指定された前記要素及び取得した各要素を含む文章を生成し、
生成した前記文章を出力する
処理であって、
前記言語モデルの学習に用いた学習元文章の先頭に存在する要素を前記言語モデルに入力して前記要素の次に出現する要素を取得し、前記先頭の要素及び取得した前記次に出現する要素を含む先頭フレーズを生成し、または、前記学習元文章の先頭に存在する要素を前記言語モデルに入力して前記要素の次に出現する要素を取得し、前記先頭の要素及び取得した要素を前記言語モデルに入力して更に次に出現する要素を取得する処理を繰り返し、前記先頭の要素及び取得した各要素を含む先頭フレーズを生成し、
生成した先頭フレーズ及び前記指定された要素を含む文章を生成する
処理をコンピュータに実行させることを特徴とするプログラム。 Receiving a specified input of an element that is a character or a character string of a predetermined unit to be included in the generated sentence,
Input any of the specified elements to a language model that has learned the elements that appear next to each element in the sentence in the order of the sentence, acquire the element that appears next to the element, and obtain the element that appears next to the specified element. Repeating the process of inputting the element and the obtained element into the language model and obtaining the element that appears next, generating a sentence containing the specified element and each obtained element ,
A process of outputting the generated text,
An element existing at the beginning of a learning source sentence used for learning the language model is input to the language model, an element appearing next to the element is acquired, and the element appearing at the beginning and the element appearing next to the acquired element are obtained. or input an element existing at the beginning of the learning source sentence into the language model to obtain an element that appears next to the element, and convert the first element and the obtained element to the Repeat the process of inputting to the language model and acquiring the next appearing element to generate a leading phrase including the leading element and each acquired element,
Generate a sentence containing the generated first phrase and the specified element
A program characterized by causing a computer to execute processing .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018158653A JP7155758B2 (en) | 2018-08-27 | 2018-08-27 | Information processing device, information processing method and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018158653A JP7155758B2 (en) | 2018-08-27 | 2018-08-27 | Information processing device, information processing method and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2020035019A JP2020035019A (en) | 2020-03-05 |
JP7155758B2 true JP7155758B2 (en) | 2022-10-19 |
Family
ID=69668142
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2018158653A Active JP7155758B2 (en) | 2018-08-27 | 2018-08-27 | Information processing device, information processing method and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP7155758B2 (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7373099B2 (en) * | 2021-04-30 | 2023-11-02 | インダストリアル・ドリーム株式会社 | text generation system |
JP7058851B1 (en) | 2021-08-06 | 2022-04-25 | 株式会社セルシス | How and programs to create and / or edit works |
JP7345034B1 (en) | 2022-10-11 | 2023-09-14 | 株式会社ビズリーチ | Document creation support device, document creation support method, and document creation support program |
JP7427303B1 (en) | 2023-07-23 | 2024-02-05 | 株式会社Stayway | Information processing system, program and information processing method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016105232A (en) | 2014-12-01 | 2016-06-09 | 日本電信電話株式会社 | Language model creation device, language model creation method, program, and recording medium |
JP2018045656A (en) | 2016-09-16 | 2018-03-22 | ヤフー株式会社 | Learning device, program parameter, and learning method |
JP2018045594A (en) | 2016-09-16 | 2018-03-22 | トヨタ自動車株式会社 | Sentence generator and sentence generation method |
JP2018055670A (en) | 2016-09-27 | 2018-04-05 | パナソニックIpマネジメント株式会社 | Similar sentence generation method, similar sentence generation program, similar sentence generation apparatus, and similar sentence generation system |
-
2018
- 2018-08-27 JP JP2018158653A patent/JP7155758B2/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016105232A (en) | 2014-12-01 | 2016-06-09 | 日本電信電話株式会社 | Language model creation device, language model creation method, program, and recording medium |
JP2018045656A (en) | 2016-09-16 | 2018-03-22 | ヤフー株式会社 | Learning device, program parameter, and learning method |
JP2018045594A (en) | 2016-09-16 | 2018-03-22 | トヨタ自動車株式会社 | Sentence generator and sentence generation method |
JP2018055670A (en) | 2016-09-27 | 2018-04-05 | パナソニックIpマネジメント株式会社 | Similar sentence generation method, similar sentence generation program, similar sentence generation apparatus, and similar sentence generation system |
Non-Patent Citations (3)
Title |
---|
尾形朋哉 他3名,キーワードに基づくニューラル文生成のためのリランキング,言語処理学会第23回年次大会 発表論文集[online],日本,言語処理学会,2017年03月06日,679-682頁 |
浅川伸一,ニューラルネットワーク物語生成モデル,第49回ことば工学研究会資料(SIG-LSE-B501),日本,社団法人人工知能学会 ことば工学事務局,2015年09月25日,15-21頁 |
高橋瑞希 他2名,Web検索と単語n-gramモデルを用いた文生成手法の性能評価,言語処理学会第16回年次大会発表論文集,日本,言語処理学会,2010年03月08日,391-394頁 |
Also Published As
Publication number | Publication date |
---|---|
JP2020035019A (en) | 2020-03-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11222167B2 (en) | Generating structured text summaries of digital documents using interactive collaboration | |
US11188711B2 (en) | Unknown word predictor and content-integrated translator | |
US10311146B2 (en) | Machine translation method for performing translation between languages | |
JP7155758B2 (en) | Information processing device, information processing method and program | |
US11150875B2 (en) | Automated content editor | |
CN111444320B (en) | Text retrieval method and device, computer equipment and storage medium | |
JP5257071B2 (en) | Similarity calculation device and information retrieval device | |
US20170185581A1 (en) | Systems and methods for suggesting emoji | |
US9514098B1 (en) | Iteratively learning coreference embeddings of noun phrases using feature representations that include distributed word representations of the noun phrases | |
US10997223B1 (en) | Subject-specific data set for named entity resolution | |
JP5809381B1 (en) | Natural language processing system, natural language processing method, and natural language processing program | |
US11593557B2 (en) | Domain-specific grammar correction system, server and method for academic text | |
US11082369B1 (en) | Domain-specific chatbot utterance collection | |
US20220012437A1 (en) | Translating method using visually represented elements, and device therefor | |
CN114341841A (en) | Building answers to queries by using depth models | |
KR20230061001A (en) | Apparatus and method for correcting text | |
US20190303437A1 (en) | Status reporting with natural language processing risk assessment | |
JP7279099B2 (en) | Dialogue management | |
US20230123328A1 (en) | Generating cascaded text formatting for electronic documents and displays | |
KR102552811B1 (en) | System for providing cloud based grammar checker service | |
JP5528376B2 (en) | Document simplifying apparatus and program | |
US11501088B1 (en) | Techniques for generating natural language text customized to linguistic preferences of a user | |
US20230169257A1 (en) | Device for generating combined sentences of images and characters | |
JP6303508B2 (en) | Document analysis apparatus, document analysis system, document analysis method, and program | |
JP6886196B2 (en) | Language learning support device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20210622 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20220427 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20220531 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20220707 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20220906 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20220919 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 7155758 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |