Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7555701B2 - Text processing apparatus, method, device and computer-readable recording medium - Google Patents
[go: Go Back, main page]

JP7555701B2 - Text processing apparatus, method, device and computer-readable recording medium - Google Patents

Text processing apparatus, method, device and computer-readable recording medium Download PDF

Info

Publication number
JP7555701B2
JP7555701B2 JP2019209173A JP2019209173A JP7555701B2 JP 7555701 B2 JP7555701 B2 JP 7555701B2 JP 2019209173 A JP2019209173 A JP 2019209173A JP 2019209173 A JP2019209173 A JP 2019209173A JP 7555701 B2 JP7555701 B2 JP 7555701B2
Authority
JP
Japan
Prior art keywords
output
word
text
time step
external information
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
Application number
JP2019209173A
Other languages
Japanese (ja)
Other versions
JP2021051709A (en
Inventor
シーホン グオ
ティエンシャン リュー
シンユ グオ
アンシン リー
ラン チン
大志 池田
拓 藤本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NTT Docomo Inc
Original Assignee
NTT Docomo Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NTT Docomo Inc filed Critical NTT Docomo Inc
Publication of JP2021051709A publication Critical patent/JP2021051709A/en
Application granted granted Critical
Publication of JP7555701B2 publication Critical patent/JP7555701B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Machine Translation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

本開示はテキスト処理分野に関し、より具体的には、テキスト処理装置、方法、デバイス及びコンピュータ読み取り可能な記録媒体に関する。 The present disclosure relates to the field of text processing, and more specifically to a text processing apparatus, method, device, and computer-readable recording medium.

従来のテキスト処理では、テキスト変換、テキスト生成等のプロセスにおいて、入力されたソーステキストを処理することで最終的なテキスト処理結果を取得することができる。 In conventional text processing, the final text processing result can be obtained by processing the input source text in processes such as text conversion and text generation.

いくつかの場合には、さらに理想的な結果が得られるように、ユーザはテキスト処理プロセスのために何らかの外部情報を指定することができる。このような外部情報は、ユーザが指定したテキストにおける重要な情報であってもよいし、ソーステキストに関連付けられる他のテキスト情報であってもよい。このような外部情報がテキスト処理結果に表れる可能性をより高くするためには、テキスト処理プロセスにおいて外部情報を十分に考慮したテキスト処理方法が必要となる。 In some cases, the user can specify some external information for the text processing process to obtain more ideal results. Such external information may be important information in the text specified by the user, or other text information associated with the source text. To increase the possibility that such external information will appear in the text processing results, a text processing method is required that fully takes the external information into account in the text processing process.

テキスト処理プロセスにおいて外部情報を十分に考慮するために、本開示では、テキスト処理方法、装置、デバイス及びコンピュータ読み取り可能な記録媒体を提供する。 To fully take external information into account in the text processing process, the present disclosure provides a text processing method, apparatus, device, and computer-readable recording medium.

本開示の一態様によれば、ソーステキスト符号化隠れ状態を取得するためにソーステキストを符号化するように構成される符号化部と、復号化隠れ状態を決定するように構成される復号化部と、出力単語を決定するために、外部情報、前記ソーステキスト符号化隠れ状態、前記復号化隠れ状態に基づいて出力単語確率分布を決定するように構成される出力部と、を含むテキスト処理装置が提供される。 According to one aspect of the present disclosure, there is provided a text processing apparatus including an encoding unit configured to encode a source text to obtain a source text encoding hidden state, a decoding unit configured to determine a decoded hidden state, and an output unit configured to determine an output word probability distribution based on external information, the source text encoding hidden state, and the decoded hidden state to determine an output word.

一部の実施例において、前記出力部は、前記外部情報に基づいて、候補出力単語のうち、確率が出力確率閾値以上でありかつ前記外部情報に含まれる単語を現在タイムステップの候補出力単語として決定するように構成される。 In some embodiments, the output unit is configured to determine, based on the external information, among the candidate output words, a word whose probability is equal to or greater than an output probability threshold and is included in the external information as a candidate output word for a current time step.

一部の実施例において、前記出力部は、さらに、現在タイムステップの候補出力単語と直前のタイムステップで決定された候補系列との同時確率、及び直前のタイムステップで決定された候補系列と前記外部情報との類似度に基づいて前記候補出力単語の候補確率を決定し、候補確率の最も高い所定数の候補出力単語を出力単語として決定するように構成される。 In some embodiments, the output unit is further configured to determine candidate probabilities of the candidate output words based on the joint probability between the candidate output word of the current time step and the candidate sequence determined in the immediately preceding time step, and the similarity between the candidate sequence determined in the immediately preceding time step and the external information, and to determine a predetermined number of candidate output words with the highest candidate probabilities as output words.

一部の実施例において、前記符号化部は、さらに、外部情報符号化隠れ状態を取得するために前記外部情報を符号化するように構成され、前記出力部は、前記外部情報符号化隠れ状態と前記復号化隠れ状態との類似度を決定し、前記類似度が現在タイムステップの類似度閾値以上である場合、前記外部情報を出力単語として出力するように構成される。 In some embodiments, the encoding unit is further configured to encode the extrinsic information to obtain an extrinsic information encoded hidden state, and the output unit is configured to determine a similarity between the extrinsic information encoded hidden state and the decoded hidden state, and output the extrinsic information as an output word if the similarity is greater than or equal to a similarity threshold for the current time step.

一部の実施例において、前記出力部は、さらに、前記類似度が前記現在類似度閾値より小さい場合、前記出力単語確率分布における確率の最も高い単語を現在タイムステップの出力単語として決定し、前記現在タイムステップの類似度閾値を調整することで、前記現在タイムステップの類似度閾値より小さい、次のタイムステップの類似度閾値として用いられる調整後の類似度閾値を決定するように構成される。 In some embodiments, the output unit is further configured to determine, if the similarity is less than the current similarity threshold, the word with the highest probability in the output word probability distribution as the output word for the current time step, and to adjust the similarity threshold for the current time step to determine an adjusted similarity threshold that is less than the similarity threshold for the current time step and is to be used as the similarity threshold for the next time step.

一部の実施例において、前記テキスト処理装置は、前記外部情報、前記ソーステキスト符号化隠れ状態及び前記復号化隠れ状態に基づいて現在タイムステップのアテンション分布を決定するように構成されるアテンション生成部をさらに含み、前記出力部は、出力単語を決定するために、前記アテンション分布、前記ソーステキスト符号化隠れ状態、前記復号化隠れ状態に基づいて出力単語確率分布を決定するように構成される。 In some embodiments, the text processing device further includes an attention generation unit configured to determine an attention distribution for a current time step based on the external information, the source text encoding hidden state, and the decoded hidden state, and the output unit is configured to determine an output word probability distribution based on the attention distribution, the source text encoding hidden state, and the decoded hidden state to determine an output word.

一部の実施例において、前記符号化部及び前記復号化部は、トレーニングソーステキスト符号化隠れ状態を取得するためにトレーニングソーステキストを符号化するステップと、トレーニング復号化隠れ状態を決定するステップと、前記外部情報、前記トレーニングソーステキスト符号化隠れ状態、前記トレーニング復号化隠れ状態に基づいて現在タイムステップの出力単語を決定するステップと、トレーニング出力単語と前記外部情報に含まれる単語との間の差異がもっとも小さくなるように、前記符号化部、前記復号化部におけるパラメータを調整するステップとによってトレーニングされる。 In some embodiments, the encoding unit and the decoding unit are trained by the steps of: encoding a training source text to obtain a training source text encoding hidden state; determining a training decoding hidden state; determining an output word for a current time step based on the external information, the training source text encoding hidden state, and the training decoding hidden state; and adjusting parameters in the encoding unit and the decoding unit so that the difference between the training output word and the word contained in the external information is minimized.

本開示の他の一態様によれば、ソーステキスト符号化隠れ状態を取得するためにソーステキストを符号化するステップと、復号化隠れ状態を決定するステップと、出力単語を決定するために、外部情報、前記ソーステキスト符号化隠れ状態、前記復号化隠れ状態に基づいて出力単語確率分布を決定するステップとを含むテキスト処理方法がさらに提供される。 According to another aspect of the present disclosure, there is further provided a text processing method including the steps of encoding a source text to obtain a source text encoding hidden state, determining a decoded hidden state, and determining an output word probability distribution based on external information, the source text encoding hidden state, and the decoded hidden state to determine output words.

一部の実施例において、前記方法は、前記外部情報に基づいて前記候補出力単語のうち、確率が出力確率閾値以上でありかつ前記外部情報に含まれる単語を現在タイムステップの候補出力単語として決定するステップをさらに含む。 In some embodiments, the method further comprises determining, based on the external information, among the candidate output words, a word whose probability is equal to or greater than an output probability threshold and is included in the external information as a candidate output word for a current time step.

一部の実施例において、前記方法は、現在タイムステップの候補出力単語と直前のタイムステップで決定された候補系列との同時確率、及び直前のタイムステップで決定された候補系列と前記外部情報との類似度に基づいて前記候補出力単語の候補確率を決定し、候補確率の最も高い所定数の候補出力単語を出力単語として決定するステップをさらに含む。 In some embodiments, the method further includes a step of determining candidate probabilities of the candidate output words based on the joint probability of the candidate output words of the current time step and the candidate sequence determined in the immediately preceding time step, and the similarity between the candidate sequence determined in the immediately preceding time step and the external information, and determining as output words a predetermined number of candidate output words with the highest candidate probabilities.

一部の実施例において、前記方法は、外部情報符号化隠れ状態を取得するために前記外部情報を符号化するステップと、前記外部情報符号化隠れ状態と前記復号化隠れ状態との類似度を決定し、前記類似度が現在タイムステップの類似度閾値以上である場合、前記外部情報を出力単語として出力するステップとをさらに含む。 In some embodiments, the method further comprises the steps of encoding the extrinsic information to obtain an extrinsic information encoded hidden state, determining a similarity between the extrinsic information encoded hidden state and the decoded hidden state, and outputting the extrinsic information as an output word if the similarity is greater than or equal to a similarity threshold for the current time step.

一部の実施例において、前記方法は、前記類似度が前記現在類似度閾値より小さい場合、前記出力単語確率分布における確率の最も高い単語を現在タイムステップの出力単語として決定し、前記現在タイムステップの類似度閾値を調整することで、前記現在タイムステップの類似度閾値より小さい、次のタイムステップの類似度閾値として用いられる調整後の類似度閾値を決定するステップをさらに含む。 In some embodiments, the method further includes determining the most probable word in the output word probability distribution as the output word for the current time step if the similarity is less than the current similarity threshold, and adjusting the similarity threshold for the current time step to determine an adjusted similarity threshold to be used as the similarity threshold for the next time step, the adjusted similarity threshold being less than the similarity threshold for the current time step.

一部の実施例において、前記方法は、前記外部情報、前記ソーステキスト符号化隠れ状態及び前記復号化隠れ状態に基づいて現在タイムステップのアテンション分布を決定するステップをさらに含み、出力単語を決定するために、外部情報、前記ソーステキスト符号化隠れ状態、前記復号化隠れ状態に基づいて出力単語確率分布を決定するステップは、出力単語を決定するために、前記アテンション分布、前記ソーステキスト符号化隠れ状態、前記復号化隠れ状態に基づいて出力単語確率分布を決定するステップを含む。 In some embodiments, the method further includes determining an attention distribution for a current time step based on the external information, the source text encoding hidden state, and the decoded hidden state, and determining an output word probability distribution based on the external information, the source text encoding hidden state, and the decoded hidden state to determine an output word includes determining an output word probability distribution based on the attention distribution, the source text encoding hidden state, and the decoded hidden state to determine an output word.

本開示のまた別の一態様によれば、プロセッサと、コンピュータ読み取り可能なプログラミングコマンドを記憶したメモリと、と含み、前記コンピュータ読み取り可能なプログラミングコマンドが前記プロセッサによって実行される場合、前記のようなテキスト処理方法を実行するテキスト処理デバイスが提供される。 According to yet another aspect of the present disclosure, there is provided a text processing device including a processor and a memory storing computer-readable programming commands, the text processing device performing the above-described text processing method when the computer-readable programming commands are executed by the processor.

本開示のさらに別の一態様によれば、コンピュータによって実行される場合、前記コンピュータが前記のようなテキスト処理方法を実行するコンピュータ読み取り可能なコマンドが記録されるコンピュータ読み取り可能な記録媒体が提供される。 According to yet another aspect of the present disclosure, there is provided a computer-readable recording medium having recorded thereon computer-readable commands that, when executed by a computer, cause the computer to perform the text processing method as described above.

本開示にかかるテキスト処理方法、装置、デバイス及びコンピュータ読み取り可能な記録媒体を利用することにより、テキストの生成プロセスにおいて、外部情報を利用して現在タイムステップのアテンション分布を決定する、及び/又は外部情報に基づいて現在タイムステップの出力単語を決定することで、テキスト処理プロセスにおいて外部情報の内容を効果的に考慮し、テキスト生成プロセスにおいて外部情報を生成する確率を向上させることができ、外部情報を考慮した場合、テキストを生成する効果を向上させることができる。 By utilizing the text processing method, apparatus, device, and computer-readable recording medium disclosed herein, in the text generation process, the attention distribution for the current time step is determined using external information, and/or the output words for the current time step are determined based on the external information, thereby effectively taking the content of the external information into account in the text processing process, improving the probability of generating the external information in the text generation process, and improving the effectiveness of generating text when the external information is taken into account.

図面を参照して本開示の実施例についてより詳細に説明する。本開示の上記及びその他の目的、特徴及び利点がさらに明らかになる。図面は本開示の実施例に対する理解をさらに深めるためのものであって、明細書の一部として本開示実施例とともに本開示を解釈するために用いられ、本開示を制限するものではない。図面において、同一の符号は通常同じ部品又はステップを示している。 The embodiments of the present disclosure will be described in more detail with reference to the drawings. The above and other objects, features, and advantages of the present disclosure will become more apparent. The drawings are intended to provide a deeper understanding of the embodiments of the present disclosure, and are used to interpret the present disclosure together with the embodiments of the present disclosure as part of the specification, and are not intended to limit the present disclosure. In the drawings, the same reference numerals generally indicate the same parts or steps.

本開示にかかるテキスト処理装置の概略的なブロック図を示している。1 shows a schematic block diagram of a text processing device according to the present disclosure; 本願の実施例にかかる出力確率分布に基づいて候補出力単語を決定する概略的な実施例を示している。1 illustrates a schematic embodiment of determining candidate output words based on output probability distributions according to an embodiment of the present application; 本願の実施例にかかる出力確率分布に基づいて候補出力単語を決定する概略的な実施例を示している。1 illustrates a schematic embodiment of determining candidate output words based on output probability distributions according to an embodiment of the present application; 本開示の実施例にかかるアテンション生成部の概略的なブロック図を示している。1 shows a schematic block diagram of an attention generation unit according to an embodiment of the present disclosure. 本願の実施例にかかるアテンション生成部が現在タイムステップのアテンション分布を決定する概略的なプロセスを示している。1 illustrates a schematic process of an attention generation unit according to an embodiment of the present application determining an attention distribution for a current time step. 本願の実施例にかかるアテンション生成部の他の概略的なブロック図を示している。FIG. 2 shows another schematic block diagram of an attention generation unit according to an embodiment of the present application. 本願の実施例にかかるテキスト処理装置の他の概略的なブロック図を示している。FIG. 2 shows another schematic block diagram of a text processing apparatus according to an embodiment of the present application. 本願にかかるテキスト処理方法の概略的なフローチャートを示している。1 shows a schematic flow chart of a text processing method according to the present application; 本願の実施例にかかる外部情報に基づいて現在タイムステップのアテンション分布を決定する概略的なフローチャートを示している。1 illustrates a schematic flow chart of determining attention distribution for a current timestep based on external information according to an embodiment of the present application; 本願の実施例にかかる外部情報に基づいて現在タイムステップのアテンション分布を決定する他の概略的なフローチャートを示している。13 illustrates another schematic flowchart of determining attention distribution for a current timestep based on external information according to an embodiment of the present application. 本願の実施例にかかる他のテキスト処理方法の概略的なフローチャートを示している。4 shows a schematic flowchart of another text processing method according to an embodiment of the present application; 本願の実施例にかかるもう1つのテキスト処理方法の例示的フローチャートを示している。4 shows an exemplary flowchart of another text processing method according to an embodiment of the present application. 本開示実施例にかかるコンピュータデバイスの概略図である。FIG. 2 is a schematic diagram of a computing device according to an embodiment of the present disclosure.

以下、本開示実施例における図面を参照して、本開示実施例の技術案について明確に、かつ全面的に説明する。記載される実施例が本開示の一部の実施例において、全部の実施例ではないことは明らかである。本開示における実施例に基づいて、当業者が創造的な労働をせずに取得したすべての他の実施例は、本開示の保護範囲に含まれる。 The technical solutions of the embodiments of the present disclosure will be described below clearly and comprehensively with reference to the drawings in the embodiments of the present disclosure. It is clear that the described embodiments are only some of the embodiments of the present disclosure, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments of the present disclosure without creative labor are included in the scope of protection of the present disclosure.

特に定義されない限り、ここで使用される技術的用語又は科学的用語は当業者が理解する通常の意味である。本願で使用される「第一」、「第二」及びそれに類似する単語は何らかの順序、数又は重要性を示すわけではなく、単に異なる構成部分を区別するためのものである。同様に、「含む」や「含まれる」等、それに類似する単語は、当該単語の前に現れる部品或いはものは、当該単語の後に挙げられる部品或いはもの、及びその均等物を含むことを指し、他の部品或いはものを排除しない。「接続する」や「互いに接続する」等、それに類似する単語は、物理的或いは機械的な接続に限定されず、直接的か間接的かを問わず、電気的接続をも含む。「上」、「下」、「左」、「右」等は、単に相対的な位置関係を示すために用いられ、説明対象の絶対的な位置が変わった後、当該相対的な位置もそれに応じて変更される可能性がある。 Unless otherwise defined, technical or scientific terms used herein have the ordinary meaning that one skilled in the art would understand. The words "first", "second" and similar words used herein do not indicate any order, number or importance, but are merely used to distinguish different components. Similarly, words such as "comprise" and "include" and similar words refer to the part or thing that appears before the word including the part or thing listed after the word and its equivalents, and do not exclude other parts or things. Words such as "connect" and "connect to each other" and similar words are not limited to physical or mechanical connections, but also include electrical connections, whether direct or indirect. Words such as "upper", "lower", "left", "right" and the like are used merely to indicate relative positional relationships, and after the absolute position of the described object is changed, the relative positions may be changed accordingly.

以下、テキスト要約の生成を例として本開示の原理について説明する。しかしながら、本開示の原理から逸脱しない限り、本開示によって提供される方法は、例えば、テキスト変換プロセス、機械翻訳プロセス等、他のテキスト処理プロセスに適用されてもよいことは、当業者が理解しうる。 Below, the principles of the present disclosure are described using the generation of a text summary as an example. However, those skilled in the art will appreciate that the method provided by the present disclosure may be applied to other text processing processes, such as, for example, a text conversion process, a machine translation process, etc., without departing from the principles of the present disclosure.

図1は、本開示にかかるテキスト処理装置の概略的なブロック図を示している。図1に示すように、テキスト処理装置100は、符号化部110と、復号化部120と、アテンション生成部130と、出力部140と、を含んでもよい。テキスト処理装置100は、ソーステキストIに対してテキスト処理を行って、対応するテキスト処理結果を生成することができる。例えば、テキスト処理装置100を利用してソーステキストI用の要約を生成してもよい。ソーステキストIは、少なくとも1つの文を含んでもよく、各文は少なくとも1つの単語を含む。 FIG. 1 shows a schematic block diagram of a text processing device according to the present disclosure. As shown in FIG. 1, the text processing device 100 may include an encoding unit 110, a decoding unit 120, an attention generating unit 130, and an output unit 140. The text processing device 100 may perform text processing on a source text I to generate a corresponding text processing result. For example, the text processing device 100 may be used to generate a summary for the source text I. The source text I may include at least one sentence, and each sentence includes at least one word.

本開示によって提供されるテキスト処理装置100は、外部情報を受信し、外部情報に基づいてソーステキストに対するテキスト処理プロセスを実行することができる。一部の実施例において、外部情報とは、予め定義された、ソーステキストの処理結果として期待されるテキスト情報を指す。一部の例において、外部情報は、ソーステキストにおける少なくとも1つの単語又は文である。他の一部の例において、外部情報は、ソーステキストにおける、所定位置の単語又は文であり、例えば、ソーステキストの先頭の文、最後の文、又は任意の他の指定位置のテキスト情報である。また他の一部の例において、外部情報はソーステキストに関連付けられる追加テキストである。例えば、ソーステキストのタイトルである。ある実現形態において、外部情報は、ユーザの入力に基づいて決定される追加テキストであってもよい。本願はここで外部情報の決定方法について限定しない。実際には、テキスト処理プロセスに使用する外部情報をいかなる可能な方法で決定してもよい。 The text processing device 100 provided by the present disclosure can receive external information and perform a text processing process on the source text based on the external information. In some embodiments, the external information refers to predefined text information expected as a processing result of the source text. In some examples, the external information is at least one word or sentence in the source text. In some other examples, the external information is a word or sentence at a predetermined position in the source text, for example, the first sentence, the last sentence, or any other specified position of the source text. In some other examples, the external information is additional text associated with the source text. For example, the title of the source text. In some implementations, the external information may be additional text determined based on a user's input. The present application is not limited here to a method for determining the external information. In fact, the external information used in the text processing process may be determined in any possible manner.

テキスト処理装置100を利用してソーステキストを処理する場合、テキスト処理の各段階で外部情報を考慮することで、外部情報がテキスト処理結果に表れる確率を高めることができる。例えば、ソーステキストにおける文章のタイトルが外部情報として決定された場合、本願によって提供されるテキスト処理装置100から出力されるソーステキストの要約に、文章タイトルにおける単語及び/又は文が必ず現れるか又は現れる可能性が極めて高い。 When processing source text using the text processing device 100, the probability that the external information will appear in the text processing results can be increased by taking external information into consideration at each stage of text processing. For example, if the title of a sentence in the source text is determined as external information, words and/or sentences in the sentence title will definitely appear or are highly likely to appear in the summary of the source text output from the text processing device 100 provided by the present application.

コンピュータでテキスト処理方法を実行する場合、コンピュータは、往々にしてテキストデータを直接に処理できないため、ソーステキスト及び/又は外部情報を処理するとき、まずソーステキストを数値データに変換する必要がある。 When performing text processing methods on a computer, the computer often cannot process text data directly, so when processing source text and/or external information, the source text must first be converted into numerical data.

一部の実施例において、ソーステキストIは自然言語の形で実装される。この場合、テキスト処理装置100は、前処理部(図示せず)をさらに含んでもよい。前処理部は、ソーステキストが符号化部に入力される前にソーステキストを数値データに変換するために用いられてもよい。例えば、ソーステキストIにおける各文に対して単語分割処理を実行することで、各文を複数の単語に分割してもよい。その後、例えば、単語埋め込み(word embedding)の方法で単語分割処理によって得られた複数の単語をそれぞれ特定次元の単語ベクトルに変換してもよい。 In some embodiments, the source text I is implemented in the form of a natural language. In this case, the text processing device 100 may further include a preprocessing unit (not shown). The preprocessing unit may be used to convert the source text into numerical data before the source text is input to the encoding unit. For example, a word segmentation process may be performed on each sentence in the source text I, thereby dividing each sentence into multiple words. Then, for example, the multiple words obtained by the word segmentation process may be converted into word vectors of a specific dimension using a word embedding method.

同様に、外部情報に対応する少なくとも1つの単語ベクトルを取得してその後のテキスト処理に用いるために、外部情報を変換してもよい。 Similarly, the external information may be transformed to obtain at least one word vector corresponding to the external information for subsequent text processing.

一部の実施例において、本開示にかかるソーステキストIは、数値データの形で実現されてもよく、例えば、少なくとも1つの単語ベクトルでソーステキストIを示してもよい。この場合、符号化部110でソーステキストIを直接処理してもよい。テキスト処理装置100から独立して設けられる前処理装置で自然言語に対して前処理を行ってもよい。 In some embodiments, the source text I according to the present disclosure may be realized in the form of numerical data, for example, the source text I may be represented by at least one word vector. In this case, the source text I may be directly processed by the encoding unit 110. Preprocessing of the natural language may also be performed by a preprocessing device provided independently of the text processing device 100.

以下は、外部情報とソーステキストとが自然言語の形であるか、又は数値データの形であるかを区別せず、コンピュータを利用して自然言語の形の外部情報及び/又はソーステキストを処理する必要がある場合、当業者は、必要に応じて自然言語の形の外部情報及び/又はソーステキストを数値データに変換してもよい。 In the following, no distinction is made between whether the external information and the source text are in the form of natural language or in the form of numerical data, and when it is necessary to process the external information and/or the source text in the form of natural language using a computer, a person skilled in the art may convert the external information and/or the source text in the form of natural language into numerical data as necessary.

符号化部110は、ソーステキスト符号化隠れ状態hを取得するために、処理対象であるソーステキストIを符号化するように構成されてもよい。 The encoding unit 110 may be configured to encode a source text I to be processed in order to obtain a source text encoding hidden state h.

一部の実施例において、符号化部110は符号化ネットワークとして実装されてもよい。例示的な符号化ネットワークは、長・短期記憶(LSTM)ネットワークを含み、LSTMネットワークシステムは、例えば、機械翻訳、テキスト要約生成等のタスクに適用されてもよい。なお、符号化ネットワークは、単語ベクトルを符号化可能ないかなる機械学習モデルとして実装されてもよい。 In some embodiments, the encoding unit 110 may be implemented as an encoding network. An exemplary encoding network includes a long short-term memory (LSTM) network, and an LSTM network system may be applied to tasks such as machine translation, text summary generation, etc. Note that the encoding network may be implemented as any machine learning model capable of encoding word vectors.

例えば、ソーステキストIに対応する少なくとも1つの単語ベクトルを入力とする場合、符号化部は、各単語ベクトルx、x、x…にそれぞれ対応するソーステキスト符号化隠れ状態h、h、h…を出力してもよい。ソーステキスト符号化隠れ状態の数とソーステキストの単語ベクトルの数は同じであってもよいし、異なってもよい。例えば、ソーステキストIに基づいてk個の単語ベクトルを生成する場合、符号化部は、k個の対応するソーステキスト符号化隠れ状態を生成するために、これらk個の単語ベクトルを処理してもよい。kは1より大きい整数である。 For example, given at least one word vector corresponding to a source text I as input, the encoder may output source text encoded hidden states h1 , h2, h3... corresponding to each word vector x1, x2 , x3 ... respectively . The number of source text encoded hidden states and the number of source text word vectors may be the same or different. For example, to generate k word vectors based on a source text I, the encoder may process these k word vectors to generate k corresponding source text encoded hidden states, where k is an integer greater than 1.

復号化部120は、復号化隠れ状態sを決定するために用いられてもよい。一部の実施例において、復号化部120は、現在タイムステップの復号化隠れ状態sを取得するために、直前のタイムステップt-1の復号化隠れ状態st-1、及び直前のタイムステップでテキスト処理装置が取得した出力単語xを受信し、st-1とxとを処理してもよい。先頭のタイムステップの処理において、s及びxがデフォルトの初期値として決定されてもよい。復号化隠れ状態sはソーステキストIに対応する複数の復号化隠れ状態s、s、s…を含んでもよい。 The decoding unit 120 may be used to determine a decoded hidden state s. In some embodiments, the decoding unit 120 may receive a decoded hidden state s t-1 of a previous time step t-1 and an output word x t obtained by the text processing device in the previous time step, and process s t-1 and x t to obtain a decoded hidden state s t of a current time step. In the processing of the first time step, s 0 and x 1 may be determined as default initial values. The decoded hidden state s may include multiple decoded hidden states s 1 , s 2 , s 3 ... corresponding to the source text I.

一部の実施例において、復号化部120は、復号化ネットワークとして実装されてもよい。例示的な復号化ネットワークは長・短期記憶ネットワークを含む。なお、復号化ネットワークは、符号化ネットワークの出力を復号化可能ないかなる機械学習モデルとして実装されてもよい。 In some embodiments, the decoder 120 may be implemented as a decoding network. Exemplary decoding networks include long-short-term memory networks. Note that the decoding network may be implemented as any machine learning model capable of decoding the output of the encoding network.

一部の実施例において、前期符号化ネットワーク及び復号化ネットワークは、シーケンス・ツー・シーケンスモデル(Sequence to Sequence, Seq2Seq)で示すことができ、1つの入力系列、(例えば、入力テキストとしての)例えば「WXYZ」をもう1つの出力系列、(例えば、テキスト要約としての)例えば「AXY」に変換することを実現するために用いられてもよい。 In some embodiments, the encoding and decoding networks may be represented as a sequence to sequence (Seq2Seq) model, which may be used to convert one input sequence, e.g., "WXYZ" (e.g., as input text), to another output sequence, e.g., "AXY" (e.g., as a text summary).

アテンション生成部130は、前記ソーステキスト符号化隠れ状態hと前記復号化隠れ状態sとに基づいてアテンション分布Aを決定し、現在タイムステップの後続のテキスト処理プロセスのためのアテンション分布Aを出力するように構成されてもよい。 The attention generation unit 130 may be configured to determine an attention distribution A based on the source text encoding hidden state h and the decoded hidden state s, and to output the attention distribution A for a subsequent text processing process of the current time step.

一部の実施例において、現在タイムステップtのアテンション分布Aは、ソーステキストの符号化アテンション分布であってもよい。 In some implementations, the attention distribution A t at the current time step t may be the encoded attention distribution of the source text.

一部の実装形態において、各タイムステップ(time step)tで現在タイムステップのソーステキスト符号化隠れ状態hと復号化隠れ状態sとを利用して現在タイムステップのソーステキストの符号化アテンション分布aを決定してよい。例えば、式(1)、(2)を利用してソーステキストの符号化アテンション分布aを決定してもよい。
=softmax(e) (1)
tは現在タイムステップを示し、softmaxは正規化指数関数を示し、eは式(2)によって下記のように決定される。

Figure 0007555701000001
iは単語ベクトルのインデクス番号であり、hは第i個の単語ベクトルに対応するソーステキスト符号化隠れ状態であり、v、W、W、battnはトレーニング対象である学習パラメータであり、hは現在タイムステップのソーステキスト符号化隠れ状態であり、sは現在タイムステップの復号化隠れ状態である。 In some implementations, at each time step t, the coding attention distribution a t of the source text of the current time step may be determined using the source text coding hidden state h t and the decoded hidden state s t of the current time step. For example, the coding attention distribution a t of the source text may be determined using equations (1) and (2).
at = softmax( et ) (1)
t denotes the current time step, softmax denotes the normalized exponential function, and e t is determined by equation (2) as follows:
Figure 0007555701000001
i is the index number of the word vector, h i is the source text encoding hidden state corresponding to the i-th word vector, v T , W h , W S , and b attn are the learning parameters to be trained, h is the source text encoding hidden state of the current time step, and s t is the decoding hidden state of the current time step.

他の一部の実施例において、アテンション生成部130は、外部情報及び式(1)によって決定されるソーステキストのアテンション分布aに基づいて、外部情報を含む現在タイムステップのアテンション分布Aを決定し、後続の各部の処理プロセスのための、外部情報を含むアテンション分布Aを出力してもよい。 In some other embodiments, the attention generation unit 130 may determine an attention distribution A t for the current time step including the external information based on the external information and the attention distribution a t of the source text determined by equation (1), and output the attention distribution A t including the external information for the processing process of each subsequent part.

一部の実装形態において、外部情報を含む現在タイムステップのアテンション分布Aは、外部情報を利用してソーステキストのアテンション分布aを調整した後に決定されるものであってもよい。 In some implementations, the attention distribution A t for the current time step including external information may be determined after adjusting the attention distribution a t for the source text using the external information.

他の一部の実施方法において、外部情報を含む現在タイムステップのアテンション分布Aは、ソーステキストのアテンション分布aと外部情報のアテンション分布a’の双方を含んでもよい。 In some other implementations, the attention distribution A t of the current time step including external information may include both the attention distribution a t of the source text and the attention distribution a′ t of the external information.

以下、図3A、図3B及び図4を参照して外部情報を含むアテンション分布Aの決定プロセスについて説明するため、ここでは詳しく説明しない。 The process of determining the attention distribution A t including external information will be described below with reference to FIGS. 3A, 3B, and 4, and will not be described in detail here.

出力部140は、現在タイムステップの出力単語Oを決定するために、前記アテンション分布A、前記ソーステキスト符号化隠れ状態h、前記復号化隠れ状態sに基づいて出力単語確率分布を決定するように構成されてもよい。 The output unit 140 may be configured to determine an output word probability distribution based on the attention distribution A, the source text encoding hidden state h, and the decoding hidden state s to determine an output word O for the current time step.

出力単語確率分布は、生成確率分布Pvocabを含んでもよい。式(3)及び式(4)によって生成確率分布Pvocabを決定してもよい。

Figure 0007555701000002
V’、V、b、b’は、出力部におけるトレーニング対象である学習パラメータであり、h はアテンション分布aに基づいて決定したコンテキストベクトルである。例えば、式(4)によってh を決定してもよい。
Figure 0007555701000003
はアテンション生成部から出力されるアテンション分布Atにおける第i個要素であり、hは第i個の単語ベクトルのソーステキスト符号化隠れ状態である。 The output word probability distribution may include a generation probability distribution P vocab . The generation probability distribution P vocab may be determined according to equations (3) and (4).
Figure 0007555701000002
V', V, b, and b' are learning parameters to be trained in the output unit, and h t * is a context vector determined based on the attention distribution a t . For example, h t * may be determined by equation (4).
Figure 0007555701000003
A i t is the i-th element in the attention distribution A t output from the attention generation unit, and h i is the source text encoding hidden state of the i-th word vector.

一部の実施例において、出力単語確率分布はアテンション生成部130から出力されるアテンション分布Aを含んでもよい。 In some implementations, the output word probability distribution may include the attention distribution A t output from the attention generator 130 .

例えば、前記生成確率分布と前記アテンション分布Aとを重み付け加算することで出力単語確率分布を決定してもよい。 For example, the output word probability distribution may be determined by weighting the generated probability distribution and the attention distribution A.

一部の実装形態において、現在タイムステップのソーステキスト符号化隠れ状態、復号化隠れ状態、アテンション分布及び現在タイムステップの復号化部の入力xに基づいて生成確率分布及びアテンション分布用の重み係数Pgenを決定してもよい。 In some implementations, weighting factors Pgen for the generation probability distributions and attention distributions may be determined based on the source text encoded hidden state of the current time step, the decoded hidden state, the attention distribution and the decoder input xt of the current time step.

例えば、前記生成確率分布及び前記アテンション分布に対して重み付け加算を行うための重み係数Pgenは、式(5)によって示されてもよい。

Figure 0007555701000004
σは、例えばsigmoid関数のような活性化関数を示し、w 、w 、w 及びbptrは、トレーニングパラメータであり、h はタイムステップtで式(4)によって決定されるパラメータであり、sはタイムステップtの復号化隠れ状態であり、xはタイムステップtの復号化部の入力であり、すなわち、直前のタイムステップt-1の出力部の出力である。式(5)によって決定される重み係数Pgenは、スカラーの形によって実装されてもよい。重み係数Pgenを利用して生成確率分布Pvocabとアテンション分布Aとに対して加重平均を行うことで出力単語確率分布を取得することができる。 For example, a weighting coefficient P gen for performing weighted addition on the generated probability distribution and the attention distribution may be represented by equation (5).
Figure 0007555701000004
σ denotes an activation function such as a sigmoid function, w h T , w s T , w x T and b ptr are training parameters, h t * is a parameter determined by equation (4) at time step t, s t is the decoded hidden state at time step t, and x t is the input of the decoder at time step t, i.e., the output of the output unit at the previous time step t-1. The weighting coefficient P gen determined by equation (5) may be implemented in the form of a scalar. The weighting coefficient P gen can be used to perform a weighted average of the generation probability distribution P vocab and the attention distribution A t to obtain the output word probability distribution.

アテンション分布Aにソーステキストのアテンション分布aと外部情報のアテンション分布a’の双方が含まれる場合、ソーステキストのアテンション分布aと外部情報のアテンション分布a’との重み係数パラメータは同じであってもよく、異なってもよい。以下、図4を参照して、生成確率分布Pvocab、ソーステキストのアテンション分布a及び外部情報のアテンション分布a’の重み係数パラメータをそれぞれ決定する方法について説明するため、ここでは詳しく説明しない。 When the attention distribution A t includes both the attention distribution a t of the source text and the attention distribution a′ t of the external information, the weighting coefficient parameters of the attention distribution a t of the source text and the attention distribution a′ t of the external information may be the same or different. Hereinafter, the method of determining the weighting coefficient parameters of the generation probability distribution P vocab , the attention distribution a t of the source text, and the attention distribution a′ t of the external information will be described with reference to FIG. 4, and will not be described in detail here.

一部の実施例において、出力部140は、出力単語確率分布における確率の最も高い単語を現在タイムステップの出力単語に決定してもよい。 In some embodiments, the output unit 140 may determine the word with the highest probability in the output word probability distribution as the output word for the current time step.

他の一部の実施例において、出力部140は、外部情報に基づいて単語確率分布を決定して出力し、現在タイムステップの出力単語を決定してもよい。 In some other embodiments, the output unit 140 may determine and output a word probability distribution based on external information to determine the output word for the current time step.

一部の実装形態において、出力部140は、前記外部情報に基づいて、前記候補出力単語のうち、確率が出力確率閾値以上でありかつ前記外部情報に含まれる単語を現在タイムステップの候補出力単語として決定する。一部の例において、出力部140は、ビームサーチの原則を利用して前記候補出力単語を決定してもよい。 In some implementations, the output unit 140 determines, based on the external information, among the candidate output words, a word whose probability is equal to or greater than an output probability threshold and is included in the external information as a candidate output word for the current time step. In some examples, the output unit 140 may determine the candidate output word by using a beam search principle.

例えば、出力部140は、各タイムステップで少なくとも2つの単語を現在タイムステップの候補出力単語として決定し、その後、候補出力単語を次のタイムステップのテキスト処理プロセスにおいて使用するようにしてもよい。同様に、次のタイムステップにおいても出力部140は少なくとも2つの候補出力単語を決定してもよい。 For example, the output unit 140 may determine at least two words at each time step as candidate output words for the current time step, and then use the candidate output words in the text processing process for the next time step. Similarly, the output unit 140 may determine at least two candidate output words for the next time step.

具体的には、候補出力単語の数が2であることを例として、タイムステップtで2つの候補出力単語a、bを出力することができる。その後、候補出力単語a、bを次のタイムステップのテキスト処理プロセスに使用し、タイムステップt+1の候補出力単語c、dを決定することができる。 Specifically, for example, taking the number of candidate output words as two, two candidate output words a and b can be output at time step t. Then, the candidate output words a and b can be used in the text processing process of the next time step to determine the candidate output words c and d at time step t+1.

図2A及び図2Bでは、本願の実施例にかかる出力確率分布に基づいて候補出力単語を決定する例示的な実施例を示している。 2A and 2B show an example embodiment of determining candidate output words based on an output probability distribution according to an embodiment of the present application.

一部の実施例において、各タイムステップの候補出力単語を決定する場合、出力確率分布における出力確率の最も高い所定数のM個(上記の例では、Mは2である)の単語を候補出力単語として決定する。Mは2以上の整数である。 In some embodiments, when determining candidate output words for each time step, a predetermined number M (in the above example, M is 2) of words with the highest output probability in the output probability distribution are determined as candidate output words. M is an integer equal to or greater than 2.

図2Aに示している出力単語確率分布で出力確率の最も高い2つの単語はw3とw11であり、そのためw3とw11を候補出力単語として決定する。 The two words with the highest output probabilities in the output word probability distribution shown in Figure 2A are w3 and w11, so w3 and w11 are determined as candidate output words.

他の一部の実施例において、各タイムステップの候補出力単語を決定する場合、事前定義の方法で出力確率分布における出力確率の最も高いN個の単語を選出して決定し、これらN個の単語のうちM個の単語を候補出力単語として決定する。NはMより大きい整数である。一部の実装形態において、事前にNの数値を特定してもよい。 In some other embodiments, when determining candidate output words for each time step, N words with the highest output probability in the output probability distribution are selected and determined in a predefined manner, and M words out of these N words are determined as candidate output words. N is an integer greater than M. In some implementations, the value of N may be specified in advance.

他の一部の実施方法において、事前に出力確率閾値を決定し、かつ出力確率が前記出力確率閾値より大きいN個の単語のうちM個の単語を候補出力単語として決定してもよい。 In some other implementation methods, an output probability threshold may be determined in advance, and M words out of N words whose output probabilities are greater than the output probability threshold may be determined as candidate output words.

出力確率の最も高いN個の単語のうち外部情報に含まれる単語が存在しない場合、これらのN個の単語のうち出力確率の最も高いM個の単語を候補出力単語として決定してもよい。 If there is no word included in the external information among the N words with the highest output probabilities, the M words with the highest output probabilities among these N words may be determined as candidate output words.

出力確率の最も高いN個の単語のうち外部情報に含まれる単語が存在する場合、これらのN個の単語に存在する、外部情報に含まれる単語数nがM以上であれば、これらのN個の単語のうち出力確率の最も高くかつ外部情報に含まれるM個の単語を候補出力単語として決定し、N個の単語に存在する、外部情報に含まれる単語数nが所定数Mより小さいであれば、N個の単語のうち外部情報に含まれる単語、及び残りのN-n個の単語のうち出力確率の最も高いM-n個の単語を候補出力単語として決定する。 When there is a word included in the external information among the N words with the highest output probability, if the number n of words included in the external information that are present in these N words is M or more, the M words included in the external information that have the highest output probability among these N words are determined as candidate output words, and if the number n of words included in the external information that are present in the N words is smaller than a predetermined number M, the word included in the external information among the N words and the M-n words with the highest output probability among the remaining N-n words are determined as candidate output words.

図2Bに示すように、出力単語確率分布における最も高い2個の単語はw3とw11であり、出力確率が予め設定した出力確率閾値より大きい単語にはw3、w7及びw11が含まれ、w2とw7は、外部情報に含まれる As shown in FIG. 2B, the two highest words in the output word probability distribution are w3 and w11, and the words with output probabilities greater than the preset output probability threshold include w3, w7, and w11, and w2 and w7 are included in the external information.

この場合、w7が外部情報に含まれかつw7の出力確率が出力確率閾値より大きいため、出力確率がより高いw3を選択するのではなく、w7とw11を候補出力単語として選択する。 In this case, since w7 is included in the external information and the output probability of w7 is greater than the output probability threshold, w7 and w11 are selected as candidate output words rather than selecting w3, which has a higher output probability.

このような方法で外部情報における単語が出力単語として決定される確率を高めることができる。 In this way, the probability that a word in the external information will be determined as the output word can be increased.

タイムステップtに出力した候補出力単語a、bとタイムステップt+1の候補出力単語c、dとを利用して少なくとも4個の出力候補系列ac、ad、bc、bdを決定でき、同時確率の方法で各出力候補系列の出力確率を決定し、4個の出力系列ac、ad、bc、bd候補のうち出力確率の最も高い2つをタイムステップt+1の後の候補テキストとして決定する。 At least four output candidate sequences ac, ad, bc, bd can be determined using the candidate output words a, b output at time step t and the candidate output words c, d at time step t+1, and the output probability of each output candidate sequence is determined using a joint probability method, and the two with the highest output probabilities among the four output sequence candidates ac, ad, bc, bd are determined as candidate texts after time step t+1.

例えば、候補出力単語a、b、c、dの出力確率はそれぞれP、P、P及びPで示すことができる。出力候補系列ac、ad、bc、bdはそれぞれPac=P*P、Pad=P*P、Pbc=P*P、及びPbd=P*Pで示すことができる。Pac>Pad>Pbc>Pbdである場合、タイムステップt+1で出力系列ac、adを後続のテキスト処理に使用する。 For example, the output probabilities of candidate output words a, b, c, d can be denoted as Pa , Pb , Pc , and Pd , respectively. The output candidate sequences ac, ad, bc, bd can be denoted as Pa = Pa * Pc , Pa = Pa * Pd , Pbc = Pb * Pc , and Pbd = Pb * Pd, respectively. If Pa > Pa > Pb > Pbd , the output sequences ac, ad are used for subsequent text processing at time step t+1.

一部の実施例において、さらに外部情報に基づいて出力候補系列を決定してもよい。例えば、式(6)を利用して出力候補系列のペナルティ値を決定できる。式(6)によって決定されるペナルティ値は、出力候補系列の同時出力確率を調整することができる。

Figure 0007555701000005
P(y|x)はタイムステップtで単語xを出力する確率を示し、hは、外部情報を示し、sim(y<t,h)はタイムステップtの前に生成した候補テキスト系列と外部情報との間の類似度を示す。 In some embodiments, the output candidate sequence may be determined based on external information. For example, the penalty value of the output candidate sequence may be determined using Equation (6). The penalty value determined by Equation (6) may adjust the joint output probability of the output candidate sequence.
Figure 0007555701000005
P(y t |x) denotes the probability of outputting word x at time step t, h denotes the external information, and sim(y < t , h) denotes the similarity between the candidate text sequence generated before time step t and the external information.

一実装形態において、いかなる可能なテキスト類似度アルゴリズムでタイムステップtの前に生成した候補テキスト系列と外部情報との間の類似度を決定してもよい。例えば、コサイン類似度の方法を使用してタイムステップtの前に生成した候補テキスト系列と外部情報との間の類似度を決定することができる。 In one implementation, any possible text similarity algorithm may be used to determine the similarity between the candidate text sequences generated before time step t and the external information. For example, a cosine similarity method may be used to determine the similarity between the candidate text sequences generated before time step t and the external information.

上記式(6)を利用して、タイムステップtの前に生成された候補テキスト系列と外部情報との間の類似度が高いほど、ペナルティ値は、出力候補系列の出力確率を増やすために用いられる。一部の実装形態において、ペナルティ値s(x,y)と出力候補系列における出力確率とを乗算又は加算し、タイムステップtの前に生成された候補テキスト系列と外部情報との間の類似度に基づいて出力候補系列を決定する効果を実現することができる。 Using the above formula (6), the higher the similarity between the candidate text sequence generated before time step t and the external information, the more the penalty value is used to increase the output probability of the output candidate sequence. In some implementations, the penalty value s(x,y) can be multiplied or added to the output probability in the output candidate sequence to achieve the effect of determining the output candidate sequence based on the similarity between the candidate text sequence generated before time step t and the external information.

すなわち、外部情報に基づいて上記出力候補系列に使用されるペナルティ値を決定することにより、外部情報が候補テキスト系列に現れる確率を高めることができる。それによって、外部情報が最終的に出力されるテキスト処理結果に表れる確率を高めることができる。 That is, by determining the penalty value to be used for the output candidate sequence based on external information, the probability that the external information will appear in the candidate text sequence can be increased, thereby increasing the probability that the external information will appear in the final output text processing result.

他の実装形態において、前記出力部は、さらに外部情報と前記ソーステキスト符号化隠れ状態との間の類似度を決定し、外部情報と前記ソーステキスト符号化隠れ状態との間の類似度に基づいて現在タイムステップで出力しようとする単語を決定するように構成されてもよい。 In another implementation, the output unit may be further configured to determine a similarity between the external information and the source text coding hidden state, and to determine a word to be output at the current time step based on the similarity between the external information and the source text coding hidden state.

例えば、符号化部110を利用して前記外部情報を符号化して、外部情報符号化隠れ状態を取得するようにしてもよい。 For example, the external information may be encoded using the encoding unit 110 to obtain the external information encoded hidden state.

出力部140は、前記外部情報符号化隠れ状態と前記復号化隠れ状態の類似度を決定するように構成されてもよい。外部情報符号化隠れ状態と前記復号化隠れ状態の類似度が事前定義された類似度閾値以上である場合、前記出力部は、前記外部情報を出力して現在タイムステップの出力とする。 The output unit 140 may be configured to determine a similarity between the extrinsic information encoded hidden state and the decoded hidden state. If the similarity between the extrinsic information encoded hidden state and the decoded hidden state is equal to or greater than a predefined similarity threshold, the output unit outputs the extrinsic information as the output for the current time step.

前記外部情報が単語である場合、前記外部情報を現在タイムステップの単語として出力してもよい。前記外部情報が文である場合、前記外部情報を直接現在タイムステップtの前に生成されたテキスト系列の後に挿入してもよい。 If the extrinsic information is a word, the extrinsic information may be output as the word of the current time step. If the extrinsic information is a sentence, the extrinsic information may be inserted directly after the text sequence generated before the current time step t.

なお、現在タイムステップtの前に既に生成されたテキスト系列は、前記出力確率分布における確率の最も高い単語に基づいて生成されてもよく、出力確率分布における確率の最も高いいくつかの候補出力単語に基づいて生成されてもよい。前記実装方法で説明したプロセスを採用して候補出力単語を決定してもよく、ここでは、詳しく説明しない。 Note that the text sequence already generated before the current time step t may be generated based on the most probable word in the output probability distribution, or may be generated based on some candidate output words with the most probabilities in the output probability distribution. The process described in the implementation method may be adopted to determine the candidate output words, and will not be described in detail here.

外部情報符号化隠れ状態と前記復号化隠れ状態との類似度が事前定義の類似度閾値より小さい場合、前記出力部は復号化部及びアテンション生成部から出力される結果に基づいて現在タイムステップの出力単語確率分布を決定し、現在タイムステップの出力単語確率分布に基づいて現在タイムステップの出力単語を決定する。 If the similarity between the external information encoded hidden state and the decoded hidden state is less than a predefined similarity threshold, the output unit determines an output word probability distribution for the current time step based on the results output from the decoding unit and the attention generation unit, and determines an output word for the current time step based on the output word probability distribution for the current time step.

上記方法を利用して、復号化部から出力される結果と外部情報との間の類似度が比較的高い場合、直接外部情報で復号化部から出力される結果を置き換えてもよい。すなわち、この場合、現在タイムステップの出力後に決定したテキスト系列の結果は直前のタイムステップの出力後に決定したテキスト系列の後に外部情報を挿入して得られた結果である。 Using the above method, if the similarity between the result output from the decoding unit and the external information is relatively high, the result output from the decoding unit may be directly replaced with the external information. That is, in this case, the result of the text sequence determined after the output of the current time step is the result obtained by inserting the external information after the text sequence determined after the output of the previous time step.

その後、次のタイムステップの処理を行う場合、復号化部を利用して外部情報を符号化して次のタイムステップの復号化隠れ状態を得て、後続の復号化プロセスが外部情報の結果を利用できるようにすることで、後の復号化で得られた結果と挿入した外部情報との間のセマンティック一貫性を保証することができる。 Then, when processing the next time step, the decoder can use the extrinsic information to encode the extrinsic information to obtain the decoded hidden state of the next time step, so that the subsequent decoding process can use the results of the extrinsic information, thereby ensuring semantic consistency between the results obtained in the subsequent decoding and the inserted extrinsic information.

外部情報が単語である場合、直前のタイムステップの復号化隠れ状態と外部情報を利用して復号化部の入力として処理を行い、現在タイムステップの復号化隠れ状態を取得することができる。 When the external information is a word, the decoded hidden state of the previous time step and the external information are used as input to the decoding unit, and the decoded hidden state of the current time step can be obtained.

外部情報に複数の単語を含む場合、復号化部で数回のループ処理を行う。第1個目のループにおける復号化部の入力は直前のタイムステップの復号化隠れ状態と外部情報の第1個目の単語であり、その後のループにおける復号化部の入力は前回ループで得られた復号化隠れ状態と外部情報の次の単語である。数回のループにより外部情報における単語毎に処理することができ、全ての外部情報を含む復号化隠れ状態を取得して現在タイムステップの復号化隠れ状態とする。 When the external information contains multiple words, the decoding unit performs several loop processes. The inputs to the decoding unit in the first loop are the decoded hidden state of the previous time step and the first word of the external information, and the inputs to the decoding unit in subsequent loops are the decoded hidden state obtained in the previous loop and the next word of the external information. By performing several loops, it is possible to process each word in the external information, and a decoded hidden state containing all the external information is obtained and used as the decoded hidden state for the current time step.

一部の実装形態において、既に外部情報で復号化部から出力される結果を置き換えてテキスト処理結果に挿入した後は、上記外部情報符号化隠れ状態と前記復号化隠れ状態との類似度比較を実行しない。 In some implementations, after the external information has already replaced the result output by the decoding unit and been inserted into the text processing result, the similarity comparison between the external information encoded hidden state and the decoded hidden state is not performed.

一部の例において、上記類似度閾値は所定のタイムステップtに関する関数によって実装されてもよい。 In some examples, the similarity threshold may be implemented as a function with respect to a given time step t.

前述したように、外部情報符号化隠れ状態と前記復号化隠れ状態の類似度が事前定義された類似度閾値より小さい場合、上記外部情報で復号化部出力を置き換えて出力にする動作を実行せず、出力単語確率分布に基づいて出力結果を決定する。この場合、外部情報が最終のテキスト処理結果に表れる確率を高めるために、前記現在タイムステップの類似度閾値を調整することで調整後の類似度閾値を決定し、前記調整後の類似度閾値は、前記現在タイムステップの類似度閾値より小さく、かつ前記調整後の類似度閾値は次のタイムステップの類似度閾値として使用される。 As described above, if the similarity between the external information encoded hidden state and the decoded hidden state is smaller than a predefined similarity threshold, the operation of replacing the decoder output with the external information and outputting it is not performed, and the output result is determined based on the output word probability distribution. In this case, in order to increase the probability that the external information appears in the final text processing result, the similarity threshold of the current time step is adjusted to determine an adjusted similarity threshold, which is smaller than the similarity threshold of the current time step, and which is used as the similarity threshold of the next time step.

例えば、式(7)を利用して類似度閾値を調整する。

Figure 0007555701000006
εSIM,t+1はタイムステップt+1に使用される類似度閾値であり、εSIM,tはタイムステップtに使用される類似度閾値であり、f(t)は時間tに関する単調減少関数である。例えば、f(t)は式(8)のように実装されてもよい。
Figure 0007555701000007
tは現在タイムステップであり、kは、ソーステキストの長さであり、eは自然対数である。一部の変更例において、kは、ソーステキスト長さに関する関数で表示されてもよい。例えば、kをβとソーステキスト長さの積で表示されてもよく、βは0より大きく1より小さい事前定義されたパラメータである。 For example, equation (7) is used to adjust the similarity threshold.
Figure 0007555701000006
where ε SIM,t+1 is the similarity threshold used for time step t+1, ε SIM,t is the similarity threshold used for time step t, and f(t) is a monotonically decreasing function with respect to time t. For example, f(t) may be implemented as in equation (8).
Figure 0007555701000007
t is the current time step, k is the length of the source text, and e is the natural logarithm. In some variants, k may be expressed as a function of the source text length. For example, k may be expressed as a product of β and the source text length, where β is a predefined parameter greater than 0 and less than 1.

上記方法を利用して、タイムステップ毎に類似度閾値について単調減少の調整を実行することで、外部情報と復号化部の出力結果間の類似度がテキスト処理プロセスにて類似度閾値がより低いレベルまで低減されるため、外部情報と復号化部の出力結果間の類似度が現在タイムステップの類似度閾値より大きくなる確率が増えるようになる。すなわち、外部情報が最終のテキスト処理結果に現れる確率が増えるようになる。 By using the above method to perform a monotonically decreasing adjustment of the similarity threshold for each time step, the similarity between the external information and the output result of the decoding unit is reduced to a lower level in the text processing process, increasing the probability that the similarity between the external information and the output result of the decoding unit will be greater than the similarity threshold for the current time step. In other words, the probability that the external information will appear in the final text processing result increases.

本願によって提供されるテキスト処理装置100はテキスト要約の生成プロセスにおいて、外部情報を利用して現在タイムステップのアテンション分布を決定すると同時に/又は、外部情報に基づいて現在タイムステップの出力単語を決定することで、テキスト処理のプロセス有効に外部情報の内容を考慮することができ、テキスト生成のプロセスにおいて外部情報を生成する確率を高め、外部情報を考慮する場合のテキスト生成の効果が改善できるようになる。 The text processing device 100 provided by the present application uses external information to determine the attention distribution for the current time step during the text summary generation process, and/or determines the output words for the current time step based on the external information, thereby effectively taking the content of external information into account in the text processing process, increasing the probability of generating external information during the text generation process, and improving the effectiveness of text generation when external information is taken into account.

本願によって提供されるテキスト処理装置100を実装する場合、当業者は上記技術案に対して任意の組み合わせをしてもよい。例えば、テキスト処理装置100でソーステキストについてテキスト処理を行うプロセスにおいて、アテンション生成部だけを利用して外部情報に基づいて外部情報を含むアテンション分布を生成し後続のテキスト処理で使用するようにし、かつ後続のテキスト処理プロセスにおいては、外部情報を考慮しないようにしてもよい。例えば、出力部だけを利用して外部情報に基づいて現在タイムステップで出力しようとする単語を決定し、その前の符号化、復号化とアテンション生成プロセスにおいては、外部情報を考慮しないようにしてもよい。さらに、アテンション生成部で、現在タイムステップのアテンション分布を生成する、及び出力部で、現在タイムステップで出力しようとする単語を決定するプロセスにおいて外部情報を考慮することで、テキスト処理結果に外部情報を含む可能性をさらに増やすようにしてもよい。 When implementing the text processing device 100 provided by the present application, a person skilled in the art may make any combination of the above technical solutions. For example, in the process of performing text processing on source text in the text processing device 100, only the attention generation unit may be used to generate an attention distribution including external information based on external information and used in subsequent text processing, and the external information may not be taken into account in the subsequent text processing process. For example, only the output unit may be used to determine the word to be output in the current time step based on external information, and the external information may not be taken into account in the previous encoding, decoding and attention generation processes. Furthermore, the possibility of including external information in the text processing result may be further increased by taking external information into account in the process of generating the attention distribution for the current time step in the attention generation unit and determining the word to be output in the current time step in the output unit.

図3Aで本開示の実施例にかかるアテンション生成部の概略的なブロック図を示している。図3Aに示すアテンション生成部300を利用して、外部情報に基づいてソーステキストのアテンション分布aを調整し、かつ外部情報を含むアテンション分布A’を決定することができる。 3A shows a schematic block diagram of an attention generation unit according to an embodiment of the present disclosure. The attention generation unit 300 shown in FIG. 3A can be used to adjust the attention distribution a t of the source text based on external information and determine the attention distribution A′ including the external information.

図3Aに示すように、アテンション生成部300には、ソーステキストアテンション決定部310、コンテンツ選択部320が含まれる。 As shown in FIG. 3A, the attention generation unit 300 includes a source text attention determination unit 310 and a content selection unit 320.

ソーステキストアテンション決定部310は、前記ソーステキスト符号化隠れ状態と前記復号化隠れ状態に基づいて前記ソーステキストの符号化アテンション分布aを決定するために用いられる。一部の実施例において、前記式(1)を利用してソーステキストの符号化アテンション分布aを決定することができる。 The source text attention determiner 310 is used to determine the coding attention distribution a t of the source text based on the source text coding hidden state and the decoded hidden state. In some embodiments, the coding attention distribution a t of the source text can be determined using Equation (1).

コンテンツ選択部320は、ソーステキストにおける単語毎の選択確率を決定するのに使用されてもよい。一部の実施例において、コンテンツ選択部320は、外部情報に基づいて前記ソーステキストに対する選択確率分布を決定するのに使用されてもよく、前記選択確率分布には、前記ソーステキストに対する単語毎の選択確率が含まれる。 The content selector 320 may be used to determine a selection probability for each word in the source text. In some embodiments, the content selector 320 may be used to determine a selection probability distribution for the source text based on external information, the selection probability distribution including a selection probability for each word in the source text.

一部の実施例において、コンテンツ選択部220コンテンツ選択ネットワーク(例えばLSTMネットワーク)を利用してソーステキストIを処理し前記ソーステキストにおける単語毎の第一選択確率を決定するようにしてもよい。 In some embodiments, the content selector 220 may use a content selection network (e.g., an LSTM network) to process the source text I and determine a first selection probability for each word in the source text.

参考となるテキスト処理結果ref(すなわち予め決定されるトレーニングデータのテキスト処理結果)を利用して使用するコンテンツ選択ネットワークに対してトレーニングを行う。コンテンツ選択ネットワークのトレーニングプロセスにおいて、ソーステキストIと参考となるテキスト処理結果refとに基づいて生成したタグ付け系列をコンテンツ選択ネットワークに入力して処理を行う。タグ付け系列とソーステキストIの単語系列の長さは同じであり、タグ付け系列の第i個要素の値は、ソーステキストIの第i個の単語が参考となるテキスト処理結果refに含まれている否かを識別する内容である。上記方法を利用してコンテンツ選択ネットワークについてトレーニングすることでコンテンツ選択ネットワークは、ソーステキストIを処理しかつ前記ソーステキストにおける単語毎の第一選択確率の結果を出力することができ、第一選択確率はコンテンツ選択ネットワークに基づいてソーステキストIにおけるこの単語が選択され最終のテキスト処理結果に表れる確率を示している。 A reference text processing result ref (i.e., a text processing result of a predetermined training data) is used to train the content selection network used. In the training process of the content selection network, a tagging sequence generated based on a source text I and the reference text processing result ref is input to the content selection network for processing. The tagging sequence and the word sequence of the source text I have the same length, and the value of the i-th element of the tagging sequence identifies whether the i-th word of the source text I is included in the reference text processing result ref. By using the above method to train the content selection network, the content selection network can process the source text I and output a first selection probability result for each word in the source text, where the first selection probability indicates the probability that this word in the source text I will be selected based on the content selection network and appear in the final text processing result.

一部の実施例において、前記ソーステキストにおける外部情報に含まれる少なくとも1つの単語に対して、当該少なくとも1つの単語の選択確率を少なくとも事前定義された確率値λに決定してもよい。例えば、ソーステキストにおける各外部情報に含まれる単語の第二選択確率を事前定義された確率値λに決定し、外部情報に含まれていない他の単語の第二選択確率を0に決定する。 In some embodiments, for at least one word included in the external information in the source text, a selection probability of the at least one word may be determined to be at least a predefined probability value λ, for example, a second selection probability of each word included in the external information in the source text is determined to be a predefined probability value λ, and a second selection probability of other words not included in the external information is determined to be 0.

上記第一選択確率と第二選択確率に基づいてソーステキストにおける単語毎の選択確率を決定してもよい。例えば、ソーステキストにおける単語毎の選択確率を第一選択確率と第二選択確率の和に決定してもよい。上記からわかるように、外部情報に含まれる単語に対してその選択確率は事前定義された確率値λ以上である。 A selection probability for each word in the source text may be determined based on the first selection probability and the second selection probability. For example, the selection probability for each word in the source text may be determined as the sum of the first selection probability and the second selection probability. As can be seen from the above, the selection probability for the words included in the external information is equal to or greater than a predefined probability value λ.

前記選択確率分布に基づいて、コンテンツ選択部220は、前記ソーステキストにおける単語毎に対して、当該単語の選択確率によって当該単語のアテンションが決定できアテンション分布Aが得られるために用いられる。一部の実施例において、コンテンツ選択部220は当該単語の選択確率が所定の選択確率閾値εより低い場合、現在タイムステップのアテンション分布において当該単語に使用されるアテンションをゼロとして決定するように構成されてもよい。また、コンテンツ選択部220は当該単語の選択確率が所定の選択確率閾値ε以上である場合、現在タイムステップのアテンション分布において当該単語に使用されるアテンションをソーステキストの符号化アテンション分布aにおける当該単語のアテンションとして決定するように構成されてもよい。 Based on the selection probability distribution, the content selection unit 220 is used to determine, for each word in the source text, the attention of the word according to the selection probability of the word, to obtain an attention distribution A. In some embodiments, the content selection unit 220 may be configured to determine the attention used for the word in the attention distribution of the current time step as zero if the selection probability of the word is lower than a predetermined selection probability threshold ε. Also, the content selection unit 220 may be configured to determine the attention used for the word in the attention distribution of the current time step as the attention of the word in the encoding attention distribution a t of the source text if the selection probability of the word is equal to or greater than a predetermined selection probability threshold ε.

上記アテンション生成部を利用することで、ソーステキストにおける単語毎に選択確率が生成でき、すなわち、単語毎のアテンションを決定する時、少なくとも式(1)を利用して計算したアテンションの大きさと当該単語の選択確率との双方を考慮すべきである。当該単語の選択確率が所定の選択閾値より低い場合は、当該単語が現在タイムステップに現れる確率が低いと見なしてよく、そのため、後続のテキスト処理プロセスにおいては当該単語のアテンションを考慮しなくてもよい。 By using the attention generation unit, a selection probability can be generated for each word in the source text; that is, when determining the attention for each word, at least both the magnitude of attention calculated using formula (1) and the selection probability of the word should be considered. If the selection probability of the word is lower than a predetermined selection threshold, it may be considered that the word has a low probability of appearing in the current time step, and therefore the attention of the word does not need to be considered in the subsequent text processing process.

式(9)でコンテンツ選択部を利用して決定したアテンション分布の結果を示してもよい。

Figure 0007555701000008
Figure 0007555701000009
はコンテンツ選択によって決定される現在タイムステップのアテンション分布であり、xは現在出力しようとする単語であり、jは現在タイムステップの番号であり、y1:j-1は既に出力したテキスト系列、p(a |x,y1:j-1)は、ソーステキストの符号化アテンション分布であり、例えばp(a |x,y1:j-1)は、前記式(1)、(2)によって計算された結果である。qは上記第一選択確率であり、λ*hint_tagは上記第二選択確率である。外部情報に含まれる第i個の単語に対して、q+λhint_tagの第i項の値はq+λであってもよく、外部情報に含まれていない第k個の単語に対して、q+λhint_tagの第k項の値はqであってもよい。 Equation (9) may represent the result of the attention distribution determined using the content selection unit.
Figure 0007555701000008
Figure 0007555701000009
is the attention distribution of the current time step determined by content selection, x is the word to be currently output, j is the number of the current time step, y1:j-1 is the text sequence already output, p(a j i |x, y 1:j-1 ) is the coding attention distribution of the source text, for example, p(a j i |x, y 1:j-1 ) is the result calculated by the above formulas (1) and (2). q is the first selection probability, and λ*hint_tag is the second selection probability. For the i-th word included in the external information, the value of the i-th term of q+λhint_tag may be q i +λ, and for the k-th word not included in the external information, the value of the k-th term of q+λhint_tag may be q k .

外部情報に含まれた単語の選択確率を少なくとも事前定義された確率値λに設定することで、事前定義された確率値が所定の選択確率閾値εより大きいと、外部情報における単語がコンテンツ選択のステップにフィルタリングされるのを防止でき、外部情報における単語が後続のテキスト処理プロセスに入ることを保証し、これによって外部情報における単語がテキスト処理結果に現れる確率を高めることができる。なお、一部の実装形態において、事前定義された確率値λは所定の選択確率閾値ε以下に設定してもよい。この場合では、単語毎の選択確率を上記第一選択確率と第二選択確率の和に決定することで、外部情報における単語の選択確率を高めることができ、かつ外部情報における単語がテキスト処理結果に現れる確率を高める効果が実装できる。 By setting the selection probability of a word included in the external information to at least a predefined probability value λ, if the predefined probability value is greater than a predetermined selection probability threshold ε, the word in the external information can be prevented from being filtered out in the content selection step, ensuring that the word in the external information enters the subsequent text processing process, thereby increasing the probability that the word in the external information will appear in the text processing results. Note that in some implementations, the predefined probability value λ may be set to be equal to or less than the predetermined selection probability threshold ε. In this case, by determining the selection probability for each word to be the sum of the first selection probability and the second selection probability, the selection probability of the word in the external information can be increased, and the effect of increasing the probability that the word in the external information will appear in the text processing results can be implemented.

図3Bで図3Aに示すアテンション生成部を利用して現在タイムステップのアテンション分布を決定する例示的プロセスを示している。 Figure 3B shows an example process for determining the attention distribution for the current time step using the attention generator shown in Figure 3A.

図3Bに示すように、ソーステキストにおける四つの単語を例とし、コンテンツ選択ネットワークを利用して第一、三項目の単語のアテンションを選択し、後続のテキスト処理プロセスにおいて使用する。 As shown in FIG. 3B, taking four words in the source text as an example, the content selection network is used to select the attention of the first and third words for use in the subsequent text processing process.

図4では本願の実施例のアテンション生成部を利用する他の概略的なブロック図を示している。図4に示すように、アテンション生成部400は、ソーステキストアテンション決定部410と外部情報アテンション決定部420を含んでもよい。図4に示しているアテンション生成部を利用して決定したアテンション分布Aは、ソーステキストのアテンション分布aと外部情報のアテンション分布a’とのの双方を含む。 Fig. 4 shows another schematic block diagram of the attention generation unit of the embodiment of the present application. As shown in Fig. 4, the attention generation unit 400 may include a source text attention determination unit 410 and an external information attention determination unit 420. The attention distribution A determined by using the attention generation unit shown in Fig. 4 includes both the attention distribution a t of the source text and the attention distribution a' t of the external information.

一部の実施例において、ソーステキストアテンション決定部410は式(2)を利用して現在タイムステップのソーステキスト符号化隠れ状態と現在タイムステップの復号化隠れ状態とに基づいてソーステキストにおける単語毎の符号化アテンションパラメータe を決定する。 In some implementations, the source text attention determiner 410 utilizes equation (2) to determine an encoded attention parameter e i t for each word in the source text based on the source text encoded hidden state of the current time step and the decoded hidden state of the current time step.

外部情報アテンション決定部420は、前記ソーステキストにおける単語毎の外部アテンションパラメータを決定するのに使用され、外部情報に含まれる単語の外部アテンションパラメータは所定の第一外部アテンションパラメータに決定され、外部情報に含まれていない単語の外部アテンションパラメータは所定の第二外部アテンションパラメータに決定される。一部の実装形態において、第一外部アテンションパラメータはλ’として設置され、第二外部アテンションパラメータは0に設置されてもよく、λ’は0より大きい値である。 The external information attention determination unit 420 is used to determine an external attention parameter for each word in the source text, and the external attention parameter of the word included in the external information is determined to be a predetermined first external attention parameter, and the external attention parameter of the word not included in the external information is determined to be a predetermined second external attention parameter. In some implementations, the first external attention parameter may be set as λ′, and the second external attention parameter may be set to 0, where λ′ is a value greater than 0.

前記符号化アテンションパラメータと外部アテンションパラメータとに基づいて前記ソーステキストに使用される単語毎のアテンションパラメータを決定する。例えば、単語毎の符号化アテンションパラメータと外部アテンションパラメータとの和を計算すること当該単語のアテンションパラメータe’ を求めることができる。 Determine a word-by-word attention parameter to be used for the source text based on the coded attention parameter and the external attention parameter, for example, calculate the sum of the coded attention parameter for each word and the external attention parameter to obtain the attention parameter e'i ' of the word.

その後、アテンションパラメータe’ に基づいてソーステキストの現在タイムステップのアテンション分布を決定する。例えば、アテンションパラメータe’ に対してsoftmax関数を運用することで、ソーステキストに使用される単語毎の現在タイムステップのアテンションを取得することができる。 Then, the attention distribution of the current time step of the source text is determined based on the attention parameter e'i t . For example, the attention of the current time step for each word used in the source text can be obtained by applying a softmax function to the attention parameter e'i t .

上記方法を利用して、事前定義された外部アテンションパラメータで、ソーステキストにおける外部情報に含まれる単語のアテンションパラメータを調整でき、外部情報に含まれる単語アテンションに対する調整を実装することができる。なお、第一外部アテンションパラメータが0より大きいハイパーパラメータλ’で、第二外部アテンションパラメータが0に設置された場合、外部情報に基づいてソーステキストの単語毎のアテンション分布を調整することで、外部情報に含まれる単語のアテンションがさらに重要になるようにすることができる。 Using the above method, the attention parameter of the words included in the external information in the source text can be adjusted with the predefined external attention parameter, and the adjustment for the attention of the words included in the external information can be implemented. Note that, when the first external attention parameter is a hyperparameter λ' that is greater than 0 and the second external attention parameter is set to 0, the attention distribution of each word in the source text can be adjusted based on the external information, so that the attention of the words included in the external information becomes more important.

上記の例では、第一外部アテンションパラメータをλ’に、第二外部アテンションパラメータを0の場合を例として本願の原理を説明したが、本願の範囲がそれに限られるわけではない。当業者は実際状況に基づいてソーステキストに使用される単語毎の外部アテンションのパラメータを設置してよく、最終的に外部情報に含まれる単語のアテンションがさらに重要になる効果だけを実装できればよい。例えば、第一外部アテンションwpパラメータλ’と設置し、第二外部アテンションをパラメータλ’と設置し、λ’、λ’はいかなる実数であり、λ’>λ’だけ満足すればよい。 In the above example, the principle of the present application is described by taking the first external attention parameter as λ' and the second external attention parameter as 0 as an example, but the scope of the present application is not limited thereto. Those skilled in the art may set the parameters of the external attention for each word used in the source text based on the actual situation, and only the effect of making the attention of the words included in the external information more important can be finally implemented. For example, the first external attention wp parameter is set as λ 1 ', and the second external attention parameter is set as λ 2 ', where λ 1 ' and λ 2 ' are any real numbers, and only λ 1 '>λ 2 ' is satisfied.

一部の実施例において、ソーステキストアテンション決定部410は、前記式(1)、(2)を利用してソーステキストの符号化アテンション分布aを決定するのに使用されてもよい。外部情報アテンション決定部420は、前記外部情報の符号化アテンション分布a’を決定するのに使用されてもよい。 In some embodiments, the source text attention determiner 410 may be used to determine the coding attention distribution a t of the source text using the above formulas (1) and (2). The external information attention determiner 420 may be used to determine the coding attention distribution a′ t of the external information.

この場合、図1で示している符号化部110を利用して前記外部情報を符号化して外部情報符号化隠れ状態h’を取得する。外部情報アテンション部420は、外部情報符号化隠れ状態h’と復号化隠れ状態sとに基づいて外部情報の符号化アテンション分布を決定する。 In this case, the extrinsic information is encoded using the encoding unit 110 shown in FIG. 1 to obtain the extrinsic information encoded hidden state h'. The extrinsic information attention unit 420 determines the extrinsic information encoding attention distribution based on the extrinsic information encoded hidden state h' and the decoded hidden state s.

例えば、上記式(1)、(2)を利用して外部情報の符号化アテンション分布a’を決定し、式(1)、(2)におけるソーステキスト符号化隠れ状態hは、外部情報符号化隠れ状態h’に置き換えられるべきである。 For example, the above equations (1) and (2) are used to determine the extrinsic information coding attention distribution a′ t , and the source text coding hidden state h in equations (1) and (2) should be replaced with the extrinsic information coding hidden state h′.

一部の実装形態において、それぞれ外部情報の符号化アテンション分布a’とソーステキストの符号化アテンション分布aを計算する時、シェアパラメータの式(1)、(2)で計算し、すなわち、外部情報の符号化アテンション分布a’とソーステキストの符号化アテンション分布aを計算する時に使用するパラメータv、W、W、battnは同じであってもよい。他の一部の実施方法において、外部情報の符号化アテンション分布a’とソーステキストの符号化アテンション分布aとを計算するために用いられるトレーニングパラメータに対してそれぞれトレーニングしてもよく、すなわち、外部情報の符号化アテンション分布a’とソーステキストの符号化アテンション分布aを計算する時に使用するパラメータv、W、W、battnは異なってもよい。 In some implementations, the external information coding attention distribution a't and the source text coding attention distribution a't are calculated using the share parameter formulas (1) and (2), i.e., the parameters vT , Wh , Ws , and battn used to calculate the external information coding attention distribution a't and the source text coding attention distribution at may be the same. In other implementations, the external information coding attention distribution a't and the source text coding attention distribution at may be trained on the training parameters used to calculate the external information coding attention distribution a't and the source text coding attention distribution at, i.e., the parameters vT , Wh , Ws , and battn used to calculate the external information coding attention distribution a't and the source text coding attention distribution at may be different.

図4で示しているアテンション生成部400で外部情報の符号化アテンション分布a’とソーステキストの符号化アテンション分布atを生成し、図1で示している出力部で外部情報の符号化アテンション分布a’とソーステキストの符号化アテンション分布aに対して更なる処理を行い、現在タイムステップの出力単語確率分布を決定する。 The attention generation unit 400 shown in Figure 4 generates an encoded attention distribution a't of external information and an encoded attention distribution at of source text, and the output unit shown in Figure 1 performs further processing on the encoded attention distribution a't of external information and the encoded attention distribution at of source text to determine the output word probability distribution for the current time step.

アテンション分布Aにソーステキストのアテンション分布aと外部情報のアテンション分布a’との双方を含む場合、出力単語確率分布は、生成確率分布、ソーステキストのアテンション分布aと外部情報のアテンション分布a’の加重平均で示されてもよい。 When the attention distribution A t includes both the attention distribution a t of the source text and the attention distribution a′ t of the external information, the output word probability distribution may be represented as a weighted average of the generation probability distribution, the attention distribution a t of the source text and the attention distribution a′ t of the external information.

一部の実施例において、式(10)で出力単語確率分布を決定してもよい。

Figure 0007555701000010
生成確率分布Pvocabは、ソーステキストの符号化隠れ状態、復号化隠れ状態及びソーステキストの符号化アテンション分布に基づいて式(3)によって決定されるのであってもよく、
Figure 0007555701000011
は、ソーステキストの符号化アテンション分布における第i個の単語のアテンションを示し、
Figure 0007555701000012
は、外部情報の符号化アテンション分布における第i個の単語のアテンションを示している。Pgenerator、Ppointer、及びPはそれぞれ生成確率分布Pvocab、ソーステキストの符号化アテンション分布a及び外部情報の符号化アテンション分布a’用の重み係数を示している。 In some implementations, the output word probability distribution may be determined by equation (10).
Figure 0007555701000010
The generating probability distribution P vocab may be determined based on the encoded hidden state of the source text, the decoded hidden state, and the encoded attention distribution of the source text according to equation (3):
Figure 0007555701000011
denotes the attention of the i-th word in the coded attention distribution of the source text,
Figure 0007555701000012
denotes the attention of the i-th word in the extrinsic information coding attention distribution. P generator , P pointer , and P T denote the weighting coefficients for the generating probability distribution P vocab , the source text coding attention distribution a t, and the extrinsic information coding attention distribution a′ t, respectively.

一部の実装形態において、現在タイムステップtのソーステキストの符号化隠れ状態、復号化隠れ状態、外部情報の符号化アテンション分布及び直前のタイムステップt-1の出力部の出力に基づいてPgenerator、Ppointer、及びPを決定してもよい。 In some implementations, P generator , P pointer , and P T may be determined based on the encoded hidden state of the source text at the current time step t, the decoded hidden state, the encoded attention distribution of the extrinsic information, and the output of the output unit at the previous time step t −1.

例えば、式(11)に基づいてPgenerator、Ppointer、及びPを決定できる。

Figure 0007555701000013
σは活性化関数を示し、例えばsigmoid関数であり、
Figure 0007555701000014
はトレーニングしようとするパラメータであり、h はタイムステップtでソーステキストの符号化隠れ状態hと復号化隠れ状態sに基づき式(3)、(4)によって決定されるパラメータであり、sはタイムステップtでの復号化隠れ状態であり、xはタイムステップtで復号化部への入力であり、すなわち、直前のタイムステップt-1で出力部の出力であり、a’はアテンション生成部400から出力される外部情報の符号化アテンション分布である。 For example, P generator , P pointer , and PT can be determined based on equation (11).
Figure 0007555701000013
σ denotes an activation function, e.g., a sigmoid function,
Figure 0007555701000014
is the parameter to be trained, h t * is a parameter determined by equations (3) and (4) based on the encoded hidden state h and the decoded hidden state s of the source text at time step t, s t is the decoded hidden state at time step t, x t is the input to the decoding unit at time step t, i.e., the output of the output unit at the immediately preceding time step t-1, and a′ t is the encoded attention distribution of the external information output from the attention generation unit 400.

一部の実施例において、出力部が出力単語確率分布を決定する時、他の方法で決定される確率分布結果を考慮してもよい。例えば、ソーステキストIにおける単語ベクトルの形成した複数の文ベクトル間の相関性を考慮してソーステキストIにおける各単語のソーステキストにおける重要度を決定してもよい。出力単語確率分布は、さらに上記重要度によって形成した単語確率分布を含んでもよい。当業者にとって、出力単語確率分布の生成方式はこれに限られなく、本開示原理を逸脱しない状況で、出力単語確率分布は各種形の単語確率分布を含んでもよい。 In some embodiments, when the output unit determines the output word probability distribution, it may take into account probability distribution results determined by other methods. For example, the importance of each word in the source text I may be determined by considering the correlation between multiple sentence vectors formed by word vectors in the source text I. The output word probability distribution may further include a word probability distribution formed by the above importance. For those skilled in the art, the method of generating the output word probability distribution is not limited to this, and the output word probability distribution may include various forms of word probability distributions without departing from the principles of the present disclosure.

上記方式を利用して、アテンション生成部400で外部情報の現在タイムステップでのアテンション分布a’を決定し、かつ外部情報の現在タイムステップでのアテンション分布a’を現在タイムステップの出力確率分布を決定してもよい。本開示によって提供される実施例において、外部情報の特徴ではなく外部情報のアテンション分布を利用して現在タイムステップの出力確率分布を決定することで、外部情報の特徴における無効情報が現在タイムステップの出力確率分布に与える影響を避けることができる。 Using the above method, the attention generation unit 400 may determine an attention distribution a't at the current time step of the external information, and use the attention distribution a't at the current time step of the external information to determine the output probability distribution of the current time step. In the embodiment provided by the present disclosure, the attention distribution of the external information, rather than the features of the external information, is used to determine the output probability distribution of the current time step, thereby avoiding the influence of invalid information in the features of the external information on the output probability distribution of the current time step.

図5は本願の実施例にかかるテキスト処理装置の他の例示的な一実施例を示している。 Figure 5 shows another exemplary embodiment of a text processing device according to an embodiment of the present application.

図5に示すように、テキスト処理装置500は符号化部510、復号化部520、アテンション生成部530、出力部540及び後処理部550を含んでもよい。符号化部510、復号化部520、アテンション生成部530、出力部540は、図1~図3で説明している符号化部110、復号化部120、アテンション生成部130と出力部140で実装すればよく、ここでは、詳しく説明しない。 As shown in FIG. 5, the text processing device 500 may include an encoding unit 510, a decoding unit 520, an attention generation unit 530, an output unit 540, and a post-processing unit 550. The encoding unit 510, the decoding unit 520, the attention generation unit 530, and the output unit 540 may be implemented using the encoding unit 110, the decoding unit 120, the attention generation unit 130, and the output unit 140 described in FIGS. 1 to 3, and will not be described in detail here.

後処理部550は、外部情報に基づいて前記候補テキストに対して後処理を行うことで、外部情報を含む出力テキストを決定するように構成されてもよい。 The post-processing unit 550 may be configured to perform post-processing on the candidate text based on the external information to determine an output text that includes the external information.

前述のように、符号化部510、復号化部520、アテンション生成部530、出力部540が図1~図3で説明している符号化部110、復号化部120、アテンション生成部130と出力部140に合わせて実装できるので、出力部540は、外部情報を含むテキスト処理結果を出力できる。 As described above, the encoding unit 510, decoding unit 520, attention generation unit 530, and output unit 540 can be implemented in accordance with the encoding unit 110, decoding unit 120, attention generation unit 130, and output unit 140 described in Figures 1 to 3, so that the output unit 540 can output text processing results including external information.

出力部540から出力される結果に既に外部情報を含む場合は、出力部540から出力される結果を直接テキスト処理の結果としてもよい。 If the results output from the output unit 540 already contain external information, the results output from the output unit 540 may be directly treated as the results of text processing.

出力部540から出力される結果に外部情報を含まない場合は、出力部540から出力される結果を候補テキストとし、後処理部550により外部情報に基づいて前記候補テキストについて後処理を行い、外部情報を含む出力テキストを決定するようにする。 If the result output from the output unit 540 does not include external information, the result output from the output unit 540 is set as candidate text, and the post-processing unit 550 performs post-processing on the candidate text based on the external information to determine the output text that includes the external information.

一部の実施例において、外部情報は予め指定された情報を含んでもよい。例えば、外部情報は予め指定された文であり、又は予め指定された単語を含むソーステキストにおける文であってもよい。 In some embodiments, the external information may include pre-specified information. For example, the external information may be a pre-specified sentence, or a sentence in the source text that includes a pre-specified word.

前記予め指定された外部情報が文である場合、後処理部550は、前記候補テキストにおける文と前記外部情報の類似度を決定するように構成されてもよい。前記類似度が所定の候補類似度閾値より大きい場合、前記候補テキストにおける前記文を前記外部情報に置き換えてもよい。 If the pre-specified external information is a sentence, the post-processing unit 550 may be configured to determine a similarity between the sentence in the candidate text and the external information. If the similarity is greater than a pre-defined candidate similarity threshold, the sentence in the candidate text may be replaced with the external information.

事前決定される外部情報が単語である場合、後処理部550は、前記候補テキストにおける文と前記外部情報の類似度を決定し、前記類似度が所定の候補類似度閾値より大きい場合、前記候補テキストにおける前記文を前記外部情報に置き換えるように構成されてもよい。 If the pre-determined external information is a word, the post-processing unit 550 may be configured to determine a similarity between a sentence in the candidate text and the external information, and replace the sentence in the candidate text with the external information if the similarity is greater than a pre-defined candidate similarity threshold.

一部の実装形態において、前記類似度が所定の候補類似度閾値より大きい場合、後処理部550は、前記候補テキストにおける前記文を削除し、外部情報としての文又は、外部情報としての単語を含む文で削除された候補テキストにおける文に置き換えるように構成されてもよい。 In some implementations, if the similarity is greater than a predefined candidate similarity threshold, the post-processing unit 550 may be configured to delete the sentence in the candidate text and replace it with the sentence as external information or the sentence in the deleted candidate text that contains the word as external information.

一部の例において、ソーステキストにおける外部情報と候補テキストにおける余剰情報のソーステキストにおける相関性に基づいて前記残りの情報に外部情報を挿入する。例えば、外部情報と候補テキストにおける余剰情報がソーステキストに現れる順番に基づいて外部情報を候補テキストの余剰情報に挿入する。 In some examples, the external information is inserted into the remaining information based on a correlation in the source text between the external information in the source text and the redundant information in the candidate text. For example, the external information is inserted into the redundant information of the candidate text based on the order in which the external information and the redundant information in the candidate text appear in the source text.

他の一部の実施方法において、前記類似度が所定の候補類似度閾値より小さい場合、後処理部550は、前記外部情報と前記候補テキストにおける文の前記ソーステキストにおける相関性に基づいて、前記候補テキストに外部情報を挿入する。 In some other implementations, if the similarity is less than a predefined candidate similarity threshold, the post-processing unit 550 inserts external information into the candidate text based on the correlation in the source text between the external information and sentences in the candidate text.

前記外部情報と前記候補テキストにおける各文の間の類似度を比較してもよい。前記外部情報と前記候補テキストにおける各文の類似度とも所定の候補類似度閾値より小さい場合、生成したテキスト処理結果に外部情報に類似する情報が含まれてないことを意味する。この場合、外部情報と候補テキストについて直接つづり合いを行い、最終のテキスト処理結果を決定してもよい。 The similarity between the external information and each sentence in the candidate text may be compared. If the similarity between the external information and each sentence in the candidate text is smaller than a predetermined candidate similarity threshold, this means that the generated text processing result does not contain information similar to the external information. In this case, a direct spelling match may be performed between the external information and the candidate text to determine the final text processing result.

例えば、外部情報と候補テキストにおける文がソーステキストに現れる順番に従って、外部情報を候補テキストに挿入することで、最終のテキスト処理結果を決定してもよい。 For example, the final text processing result may be determined by inserting external information into the candidate text according to the order in which the external information and sentences in the candidate text appear in the source text.

本願にかかる上記テキスト処理装置を利用して、効果的にテキスト処理結果に外部情報の内容を追加することができ、テキスト処理結果に期待する外部情報の内容を追加することが保証できる。 By using the text processing device according to the present application, it is possible to effectively add external information to the text processing results, and it is possible to ensure that the expected external information is added to the text processing results.

前記に示すように、図1~図3を参照して示しているテキスト処理装置における符号化部110、復号化部120、アテンション生成部130にはすべてトレーニングする必要のあるパラメータを含んでいる。そのため、機械学習を利用して符号化部110、復号化部120、アテンション生成部130における少なくとも1つに対してトレーニングを行う必要がある。 As described above, the encoding unit 110, the decoding unit 120, and the attention generation unit 130 in the text processing device shown in FIG. 1 to FIG. 3 all contain parameters that need to be trained. Therefore, it is necessary to use machine learning to train at least one of the encoding unit 110, the decoding unit 120, and the attention generation unit 130.

一部の実施例において、所定のソーステキストトレーニングセットを利用して前記符号化部、前記アテンション生成部、前記復号化部に対してトレーニングを行う。前記ソーステキストトレーニングセットは複数のトレーニングソーステキストを含む。 In some embodiments, the encoding unit, the attention generating unit, and the decoding unit are trained using a predefined source text training set. The source text training set includes a plurality of training source texts.

図1で示しているテキスト処理装置を利用してトレーニングソーステキストについて処理を行い、トレーニングソーステキストに対するトレーニングテキスト処理結果を取得することができる。例えば、符号化部を利用してトレーニングソーステキストを符号化してトレーニングソーステキストの符号化隠れ状態を取得することができる。その後、復号化部を利用してトレーニング復号化隠れ状態を決定することができる。またその後、アテンション生成部を利用して前記外部情報、前記トレーニングソーステキスト符号化隠れ状態と前記トレーニング復号化隠れ状態に基づいて現在タイムステップのトレーニングアテンション分布を決定することができる。出力部を利用して、前記トレーニングアテンション分布、前記トレーニングソーステキスト符号化隠れ状態、前記トレーニング復号化隠れ状態に基づいてトレーニング出力単語確率分布を決定することで、トレーニング出力単語を決定することができる。 The text processing device shown in FIG. 1 can be used to process the training source text and obtain a training text processing result for the training source text. For example, an encoding unit can be used to encode the training source text to obtain an encoded hidden state of the training source text. Then, a decoding unit can be used to determine a training decoded hidden state. Then, an attention generation unit can be used to determine a training attention distribution for the current time step based on the external information, the training source text encoded hidden state, and the training decoded hidden state. An output unit can be used to determine a training output word probability distribution based on the training attention distribution, the training source text encoded hidden state, and the training decoded hidden state, thereby determining the training output words.

前記符号化部、前記アテンション生成部、前記復号化部におけるパラメータを調整することで、トレーニングプロセスにおいて使用する損失関数を最小化し、前記符号化部、前記アテンション生成部、前記復号化部に対するトレーニングを実装するようにする。 By adjusting the parameters in the encoding unit, the attention generation unit, and the decoding unit, the loss function used in the training process is minimized, and training is implemented for the encoding unit, the attention generation unit, and the decoding unit.

一部の例において、トレーニングプロセスにおいて使用する損失関数lossは下記の式(12)として実装されてもよい。

Figure 0007555701000015
P(w )はタイムステップtの正解単語がタイムステップtのトレーニング出力単語確率分布における確率値であり、(p label-p )はトレーニング出力単語確率分布における正解の確率値とトレーニング出力単語確率分布における外部情報の確率値間の差異である。トレーニング出力単語に外部情報に含まれる単語が現れた時、(p label-p )の値が小さく、トレーニング出力単語に外部情報に含まれる単語が現れてない時、(p label-p )の値が大きい。 In some examples, the loss function used in the training process may be implemented as the following equation (12):
Figure 0007555701000015
P( wt * ) is the probability value of the correct word at time step t in the training output word probability distribution at time step t, and ( pTtlabel - pTt ) is the difference between the probability value of the correct answer in the training output word probability distribution and the probability value of the external information in the training output word probability distribution. When a word included in the external information appears in the training output words, the value of ( pTtlabel - pTt ) is small , and when a word included in the external information does not appear in the training output words, the value of ( pTtlabel - pTt ) is large.

他の例において、トレーニングプロセスにおいて使用する損失関数lossは下記式(13)、(14)によって実装することができる。

Figure 0007555701000016
Tはテキスト処理プロセスにおける全体タイムステップであり、tは現在タイムステップを示し、P(w )はタイムステップtの正解単語がタイムステップtにトレーニング出力単語確率分布における確率値を示し、-logP(w )は負の対数尤度/クロスエントロピー項を示し、
Figure 0007555701000017
は、ソーステキストの収束メカニズムの損失項を示し、a article tは現在タイムステップtのソーステキストアテンション分布であり、
Figure 0007555701000018
は前の全てのタイムステップソーステキストアテンション分布の合計であり、(p label-p )はトレーニング出力単語確率分布における正解の確率値とトレーニング出力単語確率分布における外部情報の確率値間の差異であり、
Figure 0007555701000019
は、外部情報の収束メカニズム損失項であり、a T_tは現在タイムステップtの外部情報アテンション分布
Figure 0007555701000020
である。γ、βは事前設定したハイパーパラメータである。 In another example, the loss function loss used in the training process can be implemented by the following equations (13) and (14).
Figure 0007555701000016
where T is the overall time step in the text processing process, t denotes the current time step, P( wt * ) denotes the probability that the correct answer word at time step t is in the training output word probability distribution at time step t, and −logP( wt * ) denotes the negative log-likelihood/cross-entropy term.
Figure 0007555701000017
denotes the loss term of the source text convergence mechanism, a i article t is the source text attention distribution at the current time step t,
Figure 0007555701000018
is the sum of all previous time step source text attention distributions, (p T t label -p T t ) is the difference between the probability value of the correct answer in the training output word probability distribution and the probability value of the external information in the training output word probability distribution,
Figure 0007555701000019
is the convergence mechanism loss term of the extrinsic information, and a i T_t is the extrinsic information attention distribution at the current time step t.
Figure 0007555701000020
γ and β are predefined hyperparameters.

図6は本願のテキスト処理方法による例示的フローチャートを示している。図6に示すように、ステップS602において、前記ソーステキストに対して符号化を行い、ソーステキスト符号化隠れ状態を取得することができる。一部の実施例において、符号化ネットワークを利用してソーステキストについて符号化を行ってもよい。例示的符号化ネットワークには長・短期記憶(LSTM)ネットワークを含み、LSTMネットワークベースのシステムは例えば機械翻訳、テキスト要約生成等のタスクに適用される。ここからわかるように、符号化ネットワークは単語ベクトルに対して符号化を行ういかなる機械学習モデルとして実装されてもよい。 FIG. 6 illustrates an exemplary flow chart of the text processing method of the present application. As shown in FIG. 6, in step S602, the source text may be encoded to obtain a source text encoding hidden state. In some embodiments, the source text may be encoded using an encoding network. Exemplary encoding networks include long short-term memory (LSTM) networks, and LSTM network-based systems are applied to tasks such as machine translation, text summary generation, etc. As can be seen, the encoding network may be implemented as any machine learning model that encodes word vectors.

例えば、ソーステキストIに対応する少なくとも1つの単語ベクトルを入力とする場合、符号化ネットワークは各単語ベクトルx、x、x…にそれぞれ対応するソーステキスト符号化隠れ状態h、h、h…を出力する。ソーステキスト符号化隠れ状態の数とソーステキストの単語ベクトルの数は同じでもよいし、異なってもよい。例えば、ソーステキストIに基づいてk個の単語ベクトルを生成する場合、符号化ネットワークはこのk個の単語ベクトルを処理してk個の対応するソーステキスト符号化隠れ状態を生成する。Kは1より大きい整数である。 For example, when at least one word vector corresponding to a source text I is input, the encoding network outputs source text encoded hidden states h1 , h2, h3... corresponding to each word vector x1, x2 , x3 ... respectively . The number of source text encoded hidden states and the number of source text word vectors may be the same or different. For example, when generating k word vectors based on a source text I, the encoding network processes the k word vectors to generate k corresponding source text encoded hidden states, where K is an integer greater than 1.

ステップS604において、復号化隠れ状態を決定できる。一部の実施例において、復号化部120は直前のタイムステップt-1の復号化隠れ状態st-1及び直前のタイムステップテキスト処理装置で得られた出力単語xを受信し、かつst-1とxとを処理することで現在タイムステップの復号化隠れ状態sを取得する。最初のタイムステップの処理でsとxはデフォルトの初期値として決定される。復号化隠れ状態sは、ソーステキストSに対応する複数の復号化隠れ状態s、s、s…を含んでもよい。例示的な復号化ネットワークは長・短期記憶ネットワークを含む。なお、復号化ネットワークは符号化ネットワークの出力に対して復号化を行ういかなる機械学習モデルによって実装されてもよい。 In step S604, a decoded hidden state can be determined. In some embodiments, the decoding unit 120 receives a decoded hidden state s t-1 of the previous time step t-1 and an output word x t obtained by the previous time step text processing device, and obtains a decoded hidden state s t of the current time step by processing s t-1 and x t . In the processing of the first time step, s 0 and x 1 are determined as default initial values. The decoded hidden state s may include multiple decoded hidden states s 1 , s 2 , s 3 ... corresponding to the source text S. An exemplary decoding network includes a long short-term memory network. Note that the decoding network may be implemented by any machine learning model that performs decoding on the output of the encoding network.

ステップS606において、外部情報、前記ソーステキスト符号化隠れ状態と前記復号化隠れ状態に基づいて現在タイムステップのアテンション分布を決定してもよい。 In step S606, an attention distribution for the current time step may be determined based on external information, the source text encoded hidden state, and the decoded hidden state.

一部の実施例において、現在タイムステップtのアテンション分布Aは、ソーステキストの符号化アテンション分布である。例えば、式(1)、(2)を利用してソーステキストの符号化アテンション分布aを決定することができる。 In some implementations, the attention distribution A t at the current time step t is the coded attention distribution of the source text. For example, the coded attention distribution a t of the source text can be determined using equations (1) and (2).

他の一部の実施例において、外部情報及び式(1)に基づいて決定したソーステキストのアテンション分布aに基づいて外部情報を含む現在タイムステップのアテンション分布Aを決定し、かつ外部情報を含むアテンション分布Aを出力し、後続のテキスト処理プロセスにおいて使用する。 In some other embodiments, an attention distribution A t for the current time step including the external information is determined based on the external information and the attention distribution a t of the source text determined based on Equation (1), and the attention distribution A t including the external information is output for use in subsequent text processing processes.

図7で本願の実施例にかかる外部情報に基づいて現在タイムステップのアテンション分布を決定する例示的フローチャートを示している。 Figure 7 shows an exemplary flowchart for determining the attention distribution for the current time step based on external information according to an embodiment of the present application.

ステップS702において、前記ソーステキスト符号化隠れ状態と前記復号化隠れ状態に基づいて前記ソーステキストの符号化アテンション分布を決定する。一部の実施例において、前記式(1)を利用してソーステキストの符号化アテンション分布aを決定することができる。 In step S702, a coding attention distribution of the source text is determined based on the source text coding hidden state and the decoded hidden state. In some embodiments, the coding attention distribution of the source text, a t, can be determined using Equation (1).

ステップS704において、外部情報に基づいて前記ソーステキストに対する選択確率分布を決定し、前記選択確率分布は、前記ソーステキストにおける単語毎に使用される選択確率を含む。 In step S704, a selection probability distribution for the source text is determined based on external information, the selection probability distribution including a selection probability used for each word in the source text.

一部の実施例において、コンテンツ選択ネットワーク(例えばLSTMネットワーク)を利用してソーステキストIについて処理を行うことで、前記ソーステキストにおける単語毎の第一選択確率を決定する。 In some embodiments, a content selection network (e.g., an LSTM network) is used to process the source text I to determine a first selection probability for each word in the source text.

コンテンツ選択ネットワークは、ソーステキストIについて処理を行い前記ソーステキストにおける単語毎の第一選択確率の結果を出力し、第一選択確率はコンテンツ選択ネットワークに基づいてソーステキストIにおけるこの単語が選択され最終のテキスト処理結果に現れる確率を表示する。 The content selection network processes the source text I and outputs a first selection probability result for each word in the source text, where the first selection probability represents the probability that this word in the source text I will be selected based on the content selection network and appear in the final text processing result.

一部の実施例において、前記ソーステキストにおける外部情報に含まれる少なくとも1つの単語について、当該少なくとも1つの単語の選択確率を少なくとも事前定義した確率値λに決定する。例えば、ソーステキストにおける各外部情報に含まれる単語の第二選択確率を事前定義した確率値λに決定し、外部情報に含まれる他の単語の第二選択確率を0に決定する。 In some embodiments, for at least one word included in the external information in the source text, a selection probability of the at least one word is determined to be at least a predefined probability value λ, for example, a second selection probability of each word included in the external information in the source text is determined to be a predefined probability value λ, and the second selection probability of other words included in the external information is determined to be 0.

上記第一選択確率と第二選択確率に基づいてソーステキストにおける単語毎の選択確率を決定する。例えば、ソーステキストにおける単語毎の選択確率を第一選択確率と第二選択確率の合計に決定することができる。わかるように、外部情報に含まれる単語に対して、その選択確率は事前定義した確率値λ以上である。 Based on the first and second selection probabilities, a selection probability of each word in the source text is determined. For example, the selection probability of each word in the source text can be determined as the sum of the first and second selection probabilities. As can be seen, for words included in the external information, the selection probability is equal to or greater than a predefined probability value λ.

ステップS706において、前記ソーステキストにおける各単語に対して当該単語の選択確率に基づいて当該単語のアテンションを決定することで前記アテンション分布を取得することができる。 In step S706, the attention distribution can be obtained by determining the attention for each word in the source text based on the selection probability of the word.

前記選択確率分布に基づいて、ステップS706は、前記ソーステキストにおける各単語に対して当該単語の選択確率に基づいて当該単語のアテンションを決定しアテンション分布Aを取得することを含んでもよい。一部の実施例において、ステップS706は当該単語の選択確率が所定の選択確率閾値εより小さい時、現在タイムステップのアテンション分布における当該単語に使用されるアテンションを0と決定することを含んでもよい。また、ステップS706は当該単語の選択確率が所定の選択確率閾値ε以上である時、現在タイムステップのアテンション分布における当該単語に使用されるアテンションをソーステキストの符号化アテンション分布aにおける当該単語のアテンションに決定することを含んでもよい。 Based on the selection probability distribution, step S706 may include, for each word in the source text, determining an attention for the word based on the selection probability of the word to obtain an attention distribution A. In some embodiments, step S706 may include determining an attention to be used for the word in the attention distribution of the current time step as 0 when the selection probability of the word is less than a predetermined selection probability threshold ε. Also, step S706 may include determining an attention to be used for the word in the attention distribution of the current time step as an attention for the word in the encoding attention distribution a t of the source text when the selection probability of the word is equal to or greater than a predetermined selection probability threshold ε.

上記アテンション生成の方法を利用して、ソーステキストにおける単語毎に選択確率を生成することができ、すなわち、単語毎のアテンションを決定する時、少なくとも式(1)を利用して計算したアテンションの大きさ及び当該単語の選択確率の双方を考慮するべきである。当該単語の選択確率が所定の選択閾値より低い時、当該単語が現在タイムステップに現れる確率が非常に低いと判断できるため、後続のテキスト処理プロセスにおいて当該単語のアテンションを考慮しなくてもよい。 Using the above attention generation method, a selection probability can be generated for each word in the source text; that is, when determining the attention for each word, at least both the magnitude of attention calculated using formula (1) and the selection probability of the word should be considered. When the selection probability of the word is lower than a predetermined selection threshold, it can be determined that the probability of the word appearing in the current time step is very low, so the attention of the word does not need to be considered in the subsequent text processing process.

外部情報に含まれた単語の選択確率を少なくとも事前定義された確率値λに設置し、事前定義された確率値が所定の選択確率閾値εより大きい場合は、外部情報における単語がコンテンツ選択のステップでフィルタリングされないように保証することで、外部情報における単語が後続のテキスト処理プロセスにおいて処理されることを保証し、それによって外部情報における単語がテキスト処理結果に現れる確率を高めることができる。なお、一部の実装形態において、事前定義された確率値λを所定の選択確率閾値ε以下に設置してもよい。この場合、単語毎の選択確率を上記第一選択確率と第二選択確率との合計に決定することで、外部情報における単語の選択確率を増やすことが実装でき、外部情報における単語がテキスト処理結果に現れる確率を高める効果が実装できる。 The selection probability of a word included in the external information is set to at least a predefined probability value λ, and if the predefined probability value is greater than a predetermined selection probability threshold ε, the word in the external information is guaranteed not to be filtered in the content selection step, thereby ensuring that the word in the external information is processed in the subsequent text processing process, thereby increasing the probability that the word in the external information will appear in the text processing results. Note that in some implementations, the predefined probability value λ may be set to be equal to or less than the predetermined selection probability threshold ε. In this case, the selection probability of each word is determined to be the sum of the first selection probability and the second selection probability, thereby implementing the effect of increasing the selection probability of the word in the external information and increasing the probability that the word in the external information will appear in the text processing results.

図8では、本願の実施例にかかる外部情報に基づいて現在タイムステップのアテンション分布を決定するステップの他の一例示的なフローチャートを示している。 Figure 8 shows another exemplary flowchart of steps for determining the attention distribution for the current time step based on external information according to an embodiment of the present application.

ステップS802において、現在タイムステップのソーステキストの符号化アテンションを決定できる。 In step S802, the coding attention of the source text for the current time step can be determined.

一部の実施例において、式(2)を利用して現在タイムステップのソーステキスト符号化隠れ状態と現在タイムステップの復号化隠れ状態に基づいてソーステキストにおける単語毎の符号化アテンションパラメータe を決定することができる。その後、前記式(1)、(2)を利用してソーステキストの符号化アテンション分布aを決定する。 In some embodiments, the coding attention parameter e i t for each word in the source text can be determined based on the source text coding hidden state of the current time step and the decoded hidden state of the current time step using equation (2), and then the coding attention distribution a t for the source text is determined using equations (1) and (2).

ステップS804において、現在タイムステップの外部情報符号化アテンションを決定できる。 In step S804, the extrinsic information coding attention for the current time step can be determined.

一部の実施例において、前記ソーステキストにおける単語毎の外部アテンションパラメータが決定でき、外部情報に含まれる単語の外部アテンションパラメータは所定の第一外部アテンションパラメータに決定され、外部情報に含まれない単語の外部アテンションパラメータは所定の第二外部アテンションパラメータに決定される。一部の実装形態において、第一外部アテンションパラメータはλ’に設置され、第二外部アテンションパラメータは0に設置され、λ’は0より大きい値である。 In some embodiments, an external attention parameter for each word in the source text can be determined, where the external attention parameter for words included in the external information is determined to a first predetermined external attention parameter, and the external attention parameter for words not included in the external information is determined to a second predetermined external attention parameter. In some implementations, the first external attention parameter is set to λ′ and the second external attention parameter is set to 0, where λ′ is a value greater than 0.

ステップS802で決定される前記符号化アテンションパラメータと上記外部アテンションパラメータに基づいて前記ソーステキストにおける単語毎に使用されるアテンションパラメータを決定できる。例えば、単語毎の符号化アテンションパラメータと外部アテンションパラメータの合計を求めることで当該単語のアテンションパラメータe’ を決定してもよい。 Based on the coded attention parameter determined in step S802 and the external attention parameter, the attention parameter to be used for each word in the source text can be determined. For example, the attention parameter e′ i t for a word may be determined by calculating the sum of the coded attention parameter and the external attention parameter for that word.

その後、アテンションパラメータe’ に基づいてソーステキストの現在タイムステップのアテンション分布を決定してもよい。例えば、アテンションパラメータe’ にsoftmax関数を適用することで、ソーステキストの単語毎に使用される現在タイムステップのアテンションを決定することができる。 An attention distribution for the current time step of the source text may then be determined based on the attention parameter e'i't . For example, a softmax function may be applied to the attention parameter e'i't to determine the attention for the current time step to be used for each word of the source text.

上記方法を利用して、事前定義された外部アテンションパラメータを利用してソーステキストにおける外部情報に含まれる単語のアテンションパラメータを調整することができ、外部情報に含まれる単語アテンションの調整を実装することができる。なお、第一外部アテンションパラメータは0より大きいハイパーパラメータλ’に設置され、第二外部アテンションパラメータは0に設置された場合、外部情報に基づいてソーステキストの単語毎のアテンション分布を調整し、外部情報に含まれる単語のアテンションがさらに重要になるようにできる。 Using the above method, the attention parameter of the words included in the external information in the source text can be adjusted using a predefined external attention parameter, and the adjustment of the attention of the words included in the external information can be implemented. Note that, when the first external attention parameter is set to a hyperparameter λ' greater than 0 and the second external attention parameter is set to 0, the attention distribution of each word in the source text can be adjusted based on the external information, so that the attention of the words included in the external information is more important.

一部の実施例において、前記外部情報を符号化することで外部情報符号化隠れ状態h’を取得することができる。また上記式(1)、(2)を利用して外部情報の符号化アテンション分布a’を決定することができ、式(1)、(2)におけるソーステキスト符号化隠れ状態hは、外部情報符号化隠れ状態h’に置き換えられるべきである。 In some embodiments, the extrinsic information can be encoded to obtain an extrinsic information encoded hidden state h', and the extrinsic information encoded attention distribution a't can be determined using the above formulas (1) and (2), and the source text encoded hidden state h in formulas (1) and (2) should be replaced with the extrinsic information encoded hidden state h'.

一部の実装形態において、外部情報の符号化アテンション分布a’とソーステキストの符号化アテンション分布aとをそれぞれ計算する時、シェアパラメータを利用して式(1)、(2)の計算を行い、すなわち外部情報の符号化アテンション分布a’とソーステキストの符号化アテンション分布aを計算する時に使用するパラメータv、W、W、battnは同じであってもよい。他の一部の実施方法において、外部情報の符号化アテンション分布a’とソーステキスト的符号化アテンション分布aとを計算するためのトレーニングパラメータをそれぞれトレーニングし、すなわち、外部情報の符号化アテンション分布a’とソーステキストの符号化アテンション分布aを計算する時に使用するパラメータv、W、W、battnは異なってもよい。 In some implementations, when calculating the external information coding attention distribution a't and the source text coding attention distribution a't , respectively, the share parameters are used to calculate Equations (1) and (2), i.e., the parameters vT , Wh , Ws , and battn used when calculating the external information coding attention distribution a't and the source text coding attention distribution at may be the same. In other implementations, training parameters for calculating the external information coding attention distribution a't and the source text coding attention distribution at are trained, respectively, i.e., the parameters vT , Wh , Ws , and battn used when calculating the external information coding attention distribution a't and the source text coding attention distribution at may be different.

図6に戻り参照すると、ステップS608において前記アテンション分布、前記ソーステキスト符号化隠れ状態、前記復号化隠れ状態に基づいて出力単語確率分布を決定してもよい。 Referring back to FIG. 6, in step S608, an output word probability distribution may be determined based on the attention distribution, the source text encoding hidden state, and the decoding hidden state.

出力単語確率分布は、生成確率分布Pvocabを含んでもよい。式(3)と式(4)を利用して生成確率分布Pvocabを決定できる。 The output word probability distribution may include a generation probability distribution P vocab . Equations (3) and (4) can be used to determine the generation probability distribution P vocab .

一部の実施例において、出力単語確率分布は現在タイムステップのアテンション分布Aを含んでもよい。 In some implementations, the output word probability distribution may include the attention distribution A t for the current timestep.

例えば、前記生成確率分布と前記アテンション分布Aについて重み付け加算を行うことで、出力単語確率分布を決定できる。 For example, the output word probability distribution can be determined by performing a weighted addition of the generated probability distribution and the attention distribution A.

一部の実装形態において、現在タイムステップのソーステキスト符号化隠れ状態、ソーステキスト復号化隠れ状態、アテンション分布及び直前のタイムステップ復号化ネットワークの出力に基づいて生成確率分布とアテンション分布用の重み係数Pgenを決定する。 In some implementations, the weighting factors Pgen for the generation probability distribution and the attention distribution are determined based on the source text encoding hidden state of the current time step, the source text decoding hidden state, the attention distribution and the output of the previous time step decoding network.

例えば、前記生成確率分布及び前記アテンション分布について重み付け加算を行う重み係数Pgenは式(5)のように示すことができる。 For example, the weighting coefficient P gen for performing weighted addition on the generated probability distribution and the attention distribution can be expressed as in Equation (5).

アテンション分布Aにソーステキストのアテンション分布aと外部情報のアテンション分布a’の双方を含む場合、ソーステキストのアテンション分布aと外部情報のアテンション分布a’の重み係数パラメータは同じであってもよく、異なってもよい。 When the attention distribution A t includes both the attention distribution a t of the source text and the attention distribution a′ t of the external information, the weighting coefficient parameters of the attention distribution a t of the source text and the attention distribution a′ t of the external information may be the same or different.

アテンション分布Aにソーステキストのアテンション分布aと外部情報のアテンション分布a’との双方を含む場合、出力単語確率分布は、生成確率分布、ソーステキストのアテンション分布aと外部情報のアテンション分布a’との加重平均で示すことができる。 When the attention distribution A t includes both the attention distribution a t of the source text and the attention distribution a′ t of the external information, the output word probability distribution can be expressed as a weighted average of the generation probability distribution, the attention distribution a t of the source text and the attention distribution a′ t of the external information.

一部の実施例において、式(10)を利用して出力単語確率分布を決定してもよい。 In some implementations, equation (10) may be used to determine the output word probability distribution.

一部の実装形態において、現在タイムステップtのソーステキストの符号化隠れ状態、ソーステキストの復号化隠れ状態、外部情報の符号化アテンション分布及び直前のタイムステップt-1の復号化ネットワークの出力に基づいてPgenerator、Ppointer、及びPを決定してもよい。例えば、式(11)を利用してPgenerator、Ppointer、及びPを決定する。 In some implementations, P generator , P pointer , and P T may be determined based on the encoded hidden state of the source text at the current time step t, the decoded hidden state of the source text, the encoded attention distribution of the extrinsic information, and the output of the decoding network at the previous time step t -1. For example, Equation ( 11) is used to determine P generator , P pointer , and P T.

一部の実施例において、ステップS608は、出力単語確率分布における確率の最も高い単語を現在タイムステップの出力単語に決定することを含んでもよい。 In some implementations, step S608 may include determining the most probable word in the output word probability distribution as the output word for the current time step.

図9は本願の実施例にかかるあるテキスト処理方法の例示的フローチャートを示している。 Figure 9 shows an exemplary flowchart of a text processing method according to an embodiment of the present application.

図9に示すように、ステップS902において、前記ソーステキストについて符号化を行うことでソーステキスト符号化隠れ状態を取得することができる。 As shown in FIG. 9, in step S902, the source text is encoded to obtain a hidden source text encoding state.

ステップS904において、復号化隠れ状態を決定することができる。一部の実施例において、図6に示すステップS604を利用して復号化隠れ状態を決定することができ、は繰り返して説明しない。 In step S904, the decoded hidden state can be determined. In some embodiments, the decoded hidden state can be determined using step S604 shown in FIG. 6, which will not be described again.

ステップS906において、外部情報、前記ソーステキスト符号化隠れ状態、前記復号化隠れ状態に基づいて出力単語確率分布を決定し、出力単語を決定する。 In step S906, an output word probability distribution is determined based on the external information, the source text encoding hidden state, and the decoded hidden state, and an output word is determined.

他の一部の実施例において、ステップS906は、さらに外部情報に基づいて単語確率分布を決定かつ出力することで現在タイムステップの出力単語を決定してもよい。 In some other embodiments, step S906 may further determine and output a word probability distribution based on external information to determine the output word for the current time step.

一実装形態において、ステップS906は、前記外部情報に基づいて、前記候補出力単語において確率が出力確率閾値以上でありかつ前記外部情報に含まれる単語を現在タイムステップの候補出力単語に決定することを含んでもよい。 In one implementation, step S906 may include determining, based on the external information, a word whose probability in the candidate output word is equal to or greater than an output probability threshold and is included in the external information as a candidate output word for the current time step.

例えば、タイムステップ毎に少なくとも2つの単語を現在タイムステップの候補出力単語と決定し、その後、候補出力単語は次のタイムステップのテキスト処理プロセスにおいて使用される。同様に、次のタイムステップにおいても、少なくとも2つの候補出力単語を決定してもよい。 For example, at least two words may be determined for each time step as candidate output words for the current time step, and then the candidate output words may be used in the text processing process for the next time step. Similarly, at least two candidate output words may be determined for the next time step.

具体的に候補出力単語の数が2の場合を例として、タイムステップtにおいて2つの候補出力単語a、bを決定することができる。その後、候補出力単語a、bは次のタイムステップのテキスト処理プロセスに利用され、タイムステップt+1の候補出力単語c、dを決定することができる。 Specifically, for example, when the number of candidate output words is two, two candidate output words a and b can be determined at time step t. Then, the candidate output words a and b can be used in the text processing process of the next time step to determine candidate output words c and d at time step t+1.

一部の実施例において、タイムステップ毎の候補出力単語を決定する時、出力確率分布における出力確率が最も高い所定数のM個(上記の例では、Mは2である)の単語を候補出力単語として決定する。Mは2以上の整数である。 In some embodiments, when determining candidate output words for each time step, a predetermined number M (in the above example, M is 2) of words with the highest output probability in the output probability distribution are determined as candidate output words. M is an integer equal to or greater than 2.

他の一部の実施例において、タイムステップ毎の候補出力単語を決定する時、事前定義された方法に基づいて出力確率分布における選択出力確率が最も高いN個の単語を決定し、かつこれらのN個の単語のうちM個の単語を候補出力単語として決定してもよい。NはMより大きい整数である。一部の実装形態において、予めNの数値を指定してもよい。 In some other embodiments, when determining candidate output words for each time step, N words with the highest selection output probability in the output probability distribution may be determined based on a predefined method, and M words out of these N words may be determined as candidate output words. N is an integer greater than M. In some implementations, the value of N may be specified in advance.

他の一部の実施方法において、出力確率閾値を事前に決定し、出力確率が前記出力確率閾値より大きいN個の単語の中からM個の単語を候補出力単語として決定してもよい。 In some other implementations, an output probability threshold may be determined in advance, and M words from among N words whose output probabilities are greater than the output probability threshold may be determined as candidate output words.

出力確率の最も高いN個の単語のうち外部情報に含まれる単語が存在しない場合、これらのN個の単語のうち出力確率の最も高いM個の単語を候補出力単語として決定する。 If there is no word included in the external information among the N words with the highest output probability, the M words with the highest output probability among these N words are determined as candidate output words.

出力確率の最も高いN個の単語のうち外部情報に含まれる単語が存在する場合、これらのN個の単語に存在する、外部情報に含まれる単語の数nがM以上であるとこれらのN個の単語における出力確率の最も高いかつ外部情報に含まれるM個の単語を候補出力単語として決定する。これらのN個の単語に存在する、外部情報に含まれる単語数nが所定数Mより小さいと、これらのN個の単語における外部情報に含まれる単語と残りのN-n個の単語における出力確率の最も高いM-n個の単語を候補出力単語として決定する。 When there is a word included in the external information among the N words with the highest output probability, if the number n of words included in the external information that are present in these N words is M or more, the M words included in the external information that have the highest output probability among these N words are determined as candidate output words. If the number n of words included in the external information that are present in these N words is less than a predetermined number M, the words included in the external information among these N words and the M-n words with the highest output probability among the remaining N-n words are determined as candidate output words.

タイムステップtに出力した候補出力単語a、bとタイムステップt+1の候補出力単語c、dとを利用して少なくとも4個の出力候補系列ac、ad、bc、bdが決定でき、同時確率の方法で各出力候補系列の出力確率を決定し、4個の出力系列ac、ad、bc、bd候補のうち出力確率の最も高い2つをタイムステップt+1後の候補テキストとして決定する。 At least four output candidate sequences ac, ad, bc, bd can be determined using the candidate output words a, b output at time step t and the candidate output words c, d at time step t+1. The output probability of each output candidate sequence is determined using a joint probability method, and the two with the highest output probabilities among the four output sequence candidates ac, ad, bc, bd are determined as the candidate text after time step t+1.

例えば、候補出力単語a、b、c、dの出力確率はそれぞれP、P、P及びPで示すことができる。出力候補系列ac、ad、bc、bdはそれぞれPac=P*P、Pad=P*P、Pbc=P*P、及びPbd=P*Pで示すことができる。Pac>Pad>Pbc>Pbdである場合、タイムステップt+1で出力系列ac、adを後続のテキスト処理に使用する。 For example, the output probabilities of candidate output words a, b, c, d can be denoted as Pa , Pb , Pc , and Pd , respectively. The output candidate sequences ac, ad, bc, bd can be denoted as Pa = Pa * Pc , Pa = Pa * Pd , Pbc = Pb * Pc , and Pbd = Pb * Pd, respectively. If Pa > Pa > Pb > Pbd , the output sequences ac, ad are used for subsequent text processing at time step t+1.

一部の実施例において、また外部情報に基づいて出力候補系列を決定してもよい。例えば、式(6)を利用して出力候補系列のペナルティ値を決定できる。 In some embodiments, the output candidate sequence may also be determined based on external information. For example, the penalty value for the output candidate sequence may be determined using equation (6).

一実装形態において、いかなる可能なテキスト類似度アルゴリズムでタイムステップtの前に生成した候補テキスト系列と外部情報との間の類似度を決定してもよい。例えば、コサイン類似度の方法を使用してタイムステップtの前に生成した候補テキスト系列と外部情報との間の類似度を決定することができる。 In one implementation, any possible text similarity algorithm may be used to determine the similarity between the candidate text sequences generated before time step t and the external information. For example, a cosine similarity method may be used to determine the similarity between the candidate text sequences generated before time step t and the external information.

上記式(6)を利用して、タイムステップtの前に生成された候補テキスト系列と外部情報との間の類似度が高いほど、ペナルティ値は、出力候補系列の出力確率を増やすために用いられる。一部の実装形態において、ペナルティ値s(x,y)と出力候補系列における出力確率とを乗算又は加算し、タイムステップtの前に生成された候補テキスト系列と外部情報との間の類似度に基づいて出力候補系列を決定する効果を実現することができる。 Using the above formula (6), the higher the similarity between the candidate text sequence generated before time step t and the external information, the more the penalty value is used to increase the output probability of the output candidate sequence. In some implementations, the penalty value s(x,y) can be multiplied or added to the output probability in the output candidate sequence to achieve the effect of determining the output candidate sequence based on the similarity between the candidate text sequence generated before time step t and the external information.

すなわち、外部情報に基づいて上記出力候補系列に使用されるペナルティ値を決定することにより、外部情報が候補テキスト系列に現れる確率を高めることができる。それによって、外部情報が最終的に出力されるテキスト処理結果に表れる確率を高めることができる。 That is, by determining the penalty value to be used for the output candidate sequence based on external information, the probability that the external information will appear in the candidate text sequence can be increased, thereby increasing the probability that the external information will appear in the final output text processing result.

他の実装形態において、ステップS906は部情報と前記ソーステキスト符号化隠れ状態との間の類似度を決定し、外部情報と前記ソーステキスト符号化隠れ状態との間の類似度に基づいて現在タイムステップで出力しようとする単語を決定することを含んでもよい。 In another implementation, step S906 may include determining a similarity between the external information and the source text coding hidden state, and determining a word to be output at the current time step based on the similarity between the external information and the source text coding hidden state.

例えば、符号化ネットワークを利用して前記外部情報を符号化して外部情報符号化隠れ状態を得てもよい。 For example, the extrinsic information may be encoded using a coding network to obtain an extrinsic information encoded hidden state.

ステップS906は、前記外部情報符号化隠れ状態と前記復号化隠れ状態の類似度を決定することを含んでもよい。外部情報符号化隠れ状態と前記復号化隠れ状態との類似度が事前定義された類似度閾値以上である場合、前記外部情報を出力して現在タイムステップの出力としてもよい。 Step S906 may include determining a similarity between the extrinsic information encoded hidden state and the decoded hidden state. If the similarity between the extrinsic information encoded hidden state and the decoded hidden state is greater than or equal to a predefined similarity threshold, the extrinsic information may be output as the output for the current time step.

前記外部情報が単語である場合、前記外部情報を現在タイムステップの単語として出力してもよい。前記外部情報が文である場合、前記外部情報を直接現在タイムステップtの前に生成されたテキスト系列の後に挿入してもよい。 If the extrinsic information is a word, the extrinsic information may be output as the word of the current time step. If the extrinsic information is a sentence, the extrinsic information may be inserted directly after the text sequence generated before the current time step t.

なお、現在タイムステップtの前に既に生成されたテキスト系列は、前記出力確率分布における確率の最も高い単語に基づいて生成されたのであってもよく、出力確率分布における確率の最も高いいくつかの候補出力単語に基づいて生成されてもよい。前記実装方法において説明したプロセスによって採用候補出力単語を決定すればよく、ここでは、詳しく説明しない。 Note that the text sequence already generated before the current time step t may have been generated based on the most probable word in the output probability distribution, or may be generated based on some of the most probable candidate output words in the output probability distribution. The candidate output words to be adopted may be determined by the process described in the implementation method, and will not be described in detail here.

外部情報符号化隠れ状態と前記復号化隠れ状態との類似度が事前定義の類似度閾値より小さい場合、前記復号化ネットワークから出力される結果に基づいて現在タイムステップの出力単語確率分布を決定し、現在タイムステップの出力単語確率分布に基づいて現在タイムステップの出力単語を決定する。 If the similarity between the extrinsic information encoded hidden state and the decoded hidden state is less than a predefined similarity threshold, an output word probability distribution for the current time step is determined based on the results output from the decoding network, and an output word for the current time step is determined based on the output word probability distribution for the current time step.

上記方法を利用して、復号化ネットワークから出力される結果と外部情報との間の類似度がより高い時、直接外部情報で復号化ネットワークから出力される結果を置き換えてもよい。すなわち、この場合、現在タイムステップの出力後に決定したテキスト系列の結果は直前のタイムステップの出力後に決定したテキスト系列の後に外部情報を挿入して得られた結果である。 Using the above method, when the similarity between the result output from the decoding network and the external information is higher, the result output from the decoding network may be directly replaced with the external information. That is, in this case, the result of the text sequence determined after the output of the current time step is the result obtained by inserting the external information after the text sequence determined after the output of the previous time step.

その後、次のタイムステップの処理を行う時、復号化ネットワークを利用して外部情報を符号化して次のタイムステップの復号化隠れ状態を得て、後の復号化プロセスが外部情報の結果を利用できるようにすることで、後の復号化で得られた結果と挿入した外部情報との間のセマンティック一貫性を保証することができる。 Then, when processing the next time step, we use the decoding network to encode the extrinsic information to obtain the decoded hidden state of the next time step, so that the later decoding process can use the results of the extrinsic information, thereby ensuring semantic consistency between the results obtained in the later decoding and the inserted extrinsic information.

外部情報が単語である場合、直前のタイムステップの復号化隠れ状態と外部情報を利用して復号化ネットワークの入力として処理を行い、現在タイムステップの復号化隠れ状態を取得することができる。 When the external information is a word, the decoded hidden state of the previous time step and the external information can be used to process it as the input of the decoding network to obtain the decoded hidden state of the current time step.

外部情報に複数の単語を含む場合、復号化ネットワークで数回のループ処理を行う。第1個目のループにおける復号化ネットワークの入力は直前のタイムステップの復号化隠れ状態と外部情報の第1個目の単語であり、その後のループにおける復号化ネットワークの入力は前回ループで得られた復号化隠れ状態と外部情報の次の単語である。数回のループにより外部情報における単語毎に処理することができ、全ての外部情報を含む復号化隠れ状態を取得して現在タイムステップの復号化隠れ状態とする。 When the external information contains multiple words, the decoding network performs several loop processes. The inputs to the decoding network in the first loop are the decoded hidden state of the previous time step and the first word of the external information, and the inputs to the decoding network in subsequent loops are the decoded hidden state obtained in the previous loop and the next word of the external information. By performing several loops, it is possible to process each word in the external information, and a decoded hidden state containing all the external information is obtained, which becomes the decoded hidden state of the current time step.

一部の実装形態において、既に外部情報で復号化ネットワークから出力される結果に置き換えテキスト処理結果に挿入した後は、上記外部情報符号化隠れ状態と前記復号化隠れ状態との類似度比較を実行しない。 In some implementations, after the external information has already been substituted into the results output by the decoding network and inserted into the text processing results, a similarity comparison between the external information encoded hidden state and the decoded hidden state is not performed.

一部の例において、上記類似度閾値は所定のタイムステップtに関する関数によって実装されてもよい。 In some examples, the similarity threshold may be implemented as a function with respect to a given time step t.

前述したように、外部情報符号化隠れ状態と前記復号化隠れ状態の類似度が事前定義された類似度閾値より小さい場合、上記外部情報で復号化ネットワークの出力を置き換えて出力にする動作を実行せず、出力単語確率分布に基づいて出力結果を決定する。この場合、外部情報が最終のテキスト処理結果に表れる確率を高めるために、前記現在タイムステップの類似度閾値を調整することで調整後の類似度閾値を決定し、前記調整後の類似度閾値は、前記現在タイムステップの類似度閾値より小さく、かつ前記調整後の類似度閾値は次のタイムステップの類似度閾値として使用される。 As described above, if the similarity between the external information encoded hidden state and the decoded hidden state is smaller than a predefined similarity threshold, the operation of replacing the output of the decoding network with the external information is not performed, and the output result is determined based on the output word probability distribution. In this case, in order to increase the probability that the external information appears in the final text processing result, an adjusted similarity threshold is determined by adjusting the similarity threshold of the current time step, the adjusted similarity threshold is smaller than the similarity threshold of the current time step, and the adjusted similarity threshold is used as the similarity threshold of the next time step.

例えば、式(7)を利用して類似度閾値を調整する。 For example, adjust the similarity threshold using equation (7).

タイムステップ毎に類似度閾値について単調減少の調整を実行することで、外部情報と復号化部の出力結果間の類似度がテキスト処理プロセスにて類似度閾値がより低いレベルまで低減されるため、外部情報と復号化ネットワークの出力結果間の類似度が現在タイムステップの類似度閾値より大きくなる確率が増えるようになる。すなわち、外部情報が最終のテキスト処理結果に現れる確率が増えるようになる。 By performing a monotonically decreasing adjustment of the similarity threshold at each time step, the similarity between the external information and the output result of the decoding unit is reduced to a lower level in the text processing process, so that the probability that the similarity between the external information and the output result of the decoding network will be greater than the similarity threshold for the current time step increases. In other words, the probability that the external information will appear in the final text processing result increases.

図10で本願の実施例にかかるあるテキスト処理方法の例示的フローチャートを示している。 Figure 10 shows an exemplary flowchart of a text processing method according to an embodiment of the present application.

ステップS1002において、前記ソーステキスト符号化隠れ状態を取得するためにソーステキストを符号化する。 In step S1002, the source text is encoded to obtain the source text encoded hidden state.

ステップS1004において、復号化隠れ状態を決定する。 In step S1004, the decoded hidden state is determined.

ステップS1006において、前記ソーステキスト符号化隠れ状態と前記復号化隠れ状態とに基づいてタイムステップ毎の出力単語を決定し、候補テキストを決定する。 In step S1006, output words for each time step are determined based on the source text encoded hidden state and the decoded hidden state, and candidate texts are determined.

ステップS1008において、外部情報に基づいて前記候補テキストに対して後処理を行い、外部情報を含む出力テキストを決定する。 In step S1008, post-processing is performed on the candidate text based on the external information to determine an output text that includes the external information.

ステップS1006から出力される結果に外部情報を含まない場合、ステップS1006から出力される結果を候補テキストとし、外部情報に基づいて前記候補テキストに対して後処理を行い、外部情報を含む出力テキストを決定する。 If the result output from step S1006 does not include external information, the result output from step S1006 is set as candidate text, and post-processing is performed on the candidate text based on the external information to determine an output text that includes external information.

一部の実施例において、外部情報は予め指定された情報を含んでもよい。例えば、外部情報は予め指定された文であってもよく、予め指定された単語を含むソーステキストにおける文であってもよい。 In some implementations, the external information may include pre-specified information. For example, the external information may be a pre-specified sentence, or a sentence in the source text that includes a pre-specified word.

前記予め指定された外部情報が文である場合、前記候補テキストにおける文と前記外部情報の類似度を決定してもよい。前記類似度が所定の候補類似度閾値より大きい場合、前記候補テキストにおける前記文を前記外部情報に置き換えてもよい。 If the pre-specified external information is a sentence, a similarity between the sentence in the candidate text and the external information may be determined. If the similarity is greater than a pre-defined candidate similarity threshold, the sentence in the candidate text may be replaced with the external information.

事前決定される外部情報が単語である場合、前記候補テキストにおける文と前記外部情報の類似度を決定し、前記類似度が所定の候補類似度閾値より大きい場合、前記候補テキストにおける前記文を前記外部情報に置き換えてもよい。 If the predetermined external information is a word, a similarity between a sentence in the candidate text and the external information may be determined, and if the similarity is greater than a predetermined candidate similarity threshold, the sentence in the candidate text may be replaced with the external information.

一部の実装形態において、前記類似度が所定の候補類似度閾値より大きい場合、前記候補テキストにおける前記文を削除し、外部情報としての文又は、外部情報としての単語を含む文で削除された候補テキストにおける文に置き換えてもよい。 In some implementations, if the similarity is greater than a predefined candidate similarity threshold, the sentence in the candidate text may be deleted and replaced with an external sentence or a sentence containing the external word in the deleted candidate text.

一部の例において、ソーステキストにおける外部情報と候補テキストにおける余剰情報のソーステキストにおける相関性に基づいて前記残りの情報に外部情報を挿入する。例えば、外部情報と候補テキストにおける余剰情報がソーステキストに現れる順番に基づいて外部情報を候補テキストの余剰情報に挿入する。 In some examples, the external information is inserted into the remaining information based on a correlation in the source text between the external information in the source text and the redundant information in the candidate text. For example, the external information is inserted into the redundant information of the candidate text based on the order in which the external information and the redundant information in the candidate text appear in the source text.

他の一部の実施方法において、前記類似度が所定の候補類似度閾値より小さい場合、前記外部情報と前記候補テキストにおける文の前記ソーステキストにおける相関性に基づいて、前記候補テキストに外部情報を挿入する。 In some other implementations, if the similarity is less than a predefined candidate similarity threshold, external information is inserted into the candidate text based on correlations in the source text between the external information and sentences in the candidate text.

前記外部情報と前記候補テキストにおける各文の間の類似度を比較してもよい。前記外部情報と前記候補テキストにおける各文の類似度とも所定の候補類似度閾値より小さい場合、生成したテキスト処理結果に外部情報に類似する情報が含まれてないことを意味する。この場合、外部情報と候補テキストについて直接つづり合いを行い、最終のテキスト処理結果を決定してもよい。 The similarity between the external information and each sentence in the candidate text may be compared. If the similarity between the external information and each sentence in the candidate text is smaller than a predetermined candidate similarity threshold, this means that the generated text processing result does not contain information similar to the external information. In this case, a direct spelling match may be performed between the external information and the candidate text to determine the final text processing result.

例えば、外部情報と候補テキストにおける文がソーステキストに現れる順番に従って、外部情報を候補テキストに挿入することで、最終のテキスト処理結果を決定してもよい。 For example, the final text processing result may be determined by inserting external information into the candidate text according to the order in which the external information and sentences in the candidate text appear in the source text.

本願にかかる上記テキスト処理方法を利用して、効果的にテキスト処理結果に外部情報の内容を追加することができ、テキスト処理結果に期待する外部情報の内容を追加することが保証できる。 By utilizing the above text processing method according to the present application, it is possible to effectively add external information content to the text processing results, and it is possible to ensure that the expected external information content is added to the text processing results.

本願かかるテキスト処理方法を利用して、テキストの生成プロセスにおいて、外部情報を利用して現在タイムステップのアテンション分布を決定すること及び/又は、外部情報に基づいて現在タイムステップの出力単語を決定することで、テキスト処理のプロセスにおいて外部情報の内容を有効に考慮でき、テキスト生成のプロセスにおいて外部情報を生成する確率を高め、外部情報を考慮する場合にテキストを生成する效果を改善することができる。 By using the text processing method of the present application, in the text generation process, the content of the external information can be effectively taken into account in the text processing process by determining the attention distribution of the current time step using external information and/or determining the output words of the current time step based on the external information, thereby increasing the probability of generating external information in the text generation process and improving the effect of generating text when external information is taken into account.

また、本願の実施例にかかる方法又は装置は、図11に示す計算デバイスの構造によって実装されてもよい。図11で当該計算デバイスの構造を示している。図11に示すように、計算デバイス1100はバス1110、1つ又は少なくとも2つのCPU1120、読み取り専用メモリ(ROM)1130、ランダムアクセスメモリ(RAM)1140、ネットワークに接続された通信ポート1150、入力/出力部品1160、ハードディスク1170等を含んでもよい。計算デバイス1100におけるメモリデバイス、例えばROM1130又はハードディスク1170は本願によって提供されるビデオにおいて目標を検出ための方法の処理及び/又は通信で使用する各種データ又はファイル及びCPUの実行するプログラミングコマンドを記録してもよい。計算デバイス1100はユーザインタフェース1180を含んでもよい。当然のことながら、図11に示す構造は例示的なものであって、異なるデバイスを実装する場合、実際のニーズに応じて図11に示す計算デバイスにおける1つ以上の部品を省略してもよい。 The method or apparatus according to the embodiment of the present application may also be implemented by the structure of a computing device shown in FIG. 11. FIG. 11 shows the structure of the computing device. As shown in FIG. 11, the computing device 1100 may include a bus 1110, one or at least two CPUs 1120, a read-only memory (ROM) 1130, a random access memory (RAM) 1140, a communication port 1150 connected to a network, input/output components 1160, a hard disk 1170, etc. The memory device in the computing device 1100, such as the ROM 1130 or the hard disk 1170, may record various data or files used in the processing and/or communication of the method for detecting a target in a video provided by the present application and programming commands executed by the CPU. The computing device 1100 may include a user interface 1180. Of course, the structure shown in FIG. 11 is exemplary, and when implementing a different device, one or more components in the computing device shown in FIG. 11 may be omitted according to actual needs.

本願の実施例は、さらにコンピュータ読み取り可能な記録媒体によって実装されてもよい。本願の実施例のコンピュータ読み取り可能な記録媒体にコンピュータ読み取り可能なコマンドが記録されている。前記コンピュータ読み取り可能なコマンドはプロセッサによって実行される場合、上記図面で説明している本願の実施例の方法を参照して実行してよい。前記コンピュータ読み取り可能な記録媒体は例えば揮発性メモリ及び/又は非揮発性メモリを含んでもよいがこれに限られない。前記揮発性メモリは例えばランダムアクセスメモリ(RAM)及び/又はキャッシュ(cache)等を含んでもよい。前記非発揮性メモリは例えば読み取り専用メモリ(ROM)、ハードディスク、フラッシュメモリ等を含んでもよい。 The embodiments of the present application may further be implemented by a computer-readable recording medium. Computer-readable commands are recorded on the computer-readable recording medium of the embodiments of the present application. When the computer-readable commands are executed by a processor, they may be executed with reference to the methods of the embodiments of the present application described in the above drawings. The computer-readable recording medium may include, but is not limited to, volatile memory and/or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and/or cache. The non-volatile memory may include, for example, read-only memory (ROM), a hard disk, a flash memory, etc.

当業者が理解できるように、本願に記載される内容は各種の変形及び改善ができる。例えば、上記で説明した各種デバイス又は部品はハードウェアによって実装されてもよく、ソフトウェア、ファームウェア、又はそれらのうち、一部又は全部の組み合わせで実装されもよい。 As will be understood by those skilled in the art, the contents described herein may be modified and improved in various ways. For example, the various devices or components described above may be implemented in hardware, software, firmware, or a combination of some or all of these.

また、本願及び特許請求の範囲に示すように、文脈で例外のケースが明確に示される場合以外、「一」、「一個」、「一種」及び/又は「当該」等単語は単数形を指すわけではなく、複数形を含んでもよい。一般的には、「含む」や「含まれる」は、単に既に明確に符合をつけたステップ及び要素を含むことを示すだけで、これらのステップ及び要素は、網羅的なものではなく、方法又はデバイスは、他のステップ又は要素を含む可能性もある。 Also, as shown in the present application and the claims, unless the context clearly indicates an exception case, words such as "a," "one," "one," "a kind," and/or "the" do not refer to the singular but may include the plural. In general, "comprise" or "comprises" merely indicates the inclusion of steps and elements already clearly labeled, but these steps and elements are not exhaustive and the method or device may include other steps or elements.

また、本願では、本願の実施例にかかるシステムにおける一部のユニットに対して各種の援用をしているが、任意の数の異なるユニットは、ユーザ側及び/又はサーバ側に使用され、実行されうる。前記ユニットは説明的なものであって、前記システムと方法の異なる態様は異なるユニットを使用してもよい。 Furthermore, although various references are made herein to certain units in the systems according to the embodiments of the present application, any number of different units may be used and executed on the user side and/or server side. The units are illustrative, and different aspects of the systems and methods may use different units.

なお、本願では、フローチャートで本願の実施例にかかるシステムが実行する動作について説明している。なお、前の、又は後の動作は順番で実行されなくてもよい。逆に、逆の順序で、又は同時に各ステップを処理してもよい。それとともに、ほかの動作をこれらのプロセスに追加してもよく、又はこれらのプロセスから、あるステップ又は複数のステップを省略してもよい。 Note that in this application, the operations performed by the system according to the embodiment of the application are described using flowcharts. Note that the previous or subsequent operations do not have to be performed in order. Conversely, each step may be processed in the reverse order or simultaneously. Additionally, other operations may be added to these processes, or a step or multiple steps may be omitted from these processes.

特に定義されない限り、ここで使用される全ての用語(技術及び科学的用語を含む)は、当業者が一般的に理解する意味と同じ意味を有している。なお、特に定義されない限り、例えば、通常辞書によって定義される用語は、それらの関連技術の文脈での意味と一致する意味を有し、理想化又は形式上の意味で解釈するものではない。 Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. Unless otherwise defined, for example, terms normally defined by dictionaries have meanings consistent with their meaning in the context of their related art and are not to be construed in an idealized or formal sense.

以上は本発明についての説明であり、本発明を制限するものではない。本発明の複数の例示的な実施例について説明したが、本発明の斬新の教示及び利点から背離しない限り、上記例示的な実施例に対して各種の修正を行ってもよいことは、当業者が理解しうる。したがって、これらの修正意図は請求項で限定する本発明の範囲に含まれるものである。なお、上記は本発明についての説明であり、開示された特定の実施例に限られるものではなく、開示された実施例及び他の実施例に対する修正意図も添付の特許請求の範囲に含まれる。本発明は特許請求の範囲及びその均等物に限定されるものである。 The above is a description of the present invention, but is not intended to limit the present invention. Although several exemplary embodiments of the present invention have been described, those skilled in the art will understand that various modifications may be made to the exemplary embodiments without departing from the novel teachings and advantages of the present invention. Therefore, these modifications are intended to be included within the scope of the present invention, which is defined by the claims. Note that the above is a description of the present invention, and is not limited to the specific embodiments disclosed, and modifications to the disclosed embodiments and other embodiments are also intended to be included within the scope of the appended claims. The present invention is limited to the claims and their equivalents.

Claims (5)

シーケンス・ツー・シーケンスモデルに基づいて、外部情報を考慮してソーステキストの単語ベクトルに対して処理を行うテキスト処理装置であって、
ソーステキスト符号化隠れ状態を取得するために符号化ネットワークを利用してソーステキストの単語ベクトルを符号化するように構成される符号化部と、
復号化ネットワークを利用して前記符号化部の出力を復号化して復号化隠れ状態を決定するように構成される復号化部と、
各タイムステップにおいて、現在タイムステップの前記ソーステキスト符号化隠れ状態と前記復号化隠れ状態とを利用して前記ソーステキストのうちの各単語の符号化アテンションパラメータを計算し、前記符号化アテンションパラメータにsoftmax関数を運用して前記ソーステキストの符号化アテンション分布を計算し、現在タイムステップのアテンション分布とするように構成されるアテンション生成部と、
現在タイムステップの前記アテンション分布及び前記ソーステキスト符号化隠れ状態に基づいてコンテキストベクトルを取得し、前記コンテキストベクトル及び前記復号化隠れ状態に基づいて生成確率分布を計算し、前記生成確率分布と前記アテンション分布とを重み付け加算することで出力単語確率分布を計算し、前記出力単語確率分布のうち、出力確率が予め設定された出力確率閾値以上でありかつ前記外部情報に含まれる単語を現在タイムステップの候補出力単語として決定し、現在タイムステップの候補出力単語と次のタイムステップの候補出力単語に基づいて出力候補系列を決定し、現在タイムステップの候補出力単語の出力確率と次のタイムステップの候補出力単語の出力確率の同時確率に基づいて前記出力候補系列の出力確率を決定し、直前のタイムステップで決定された候補テキスト系列と前記外部情報との類似度に基づいて前記出力候補系列のペナルティ値を決定し、前記類似度が高いほど、ペナルティ値が前記出力候補系列の出力確率を増やすように前記ペナルティ値を利用して前記出力候補系列の出力確率を調整し、調整された前記出力候補系列の出力確率の最も高い所定数の系列における前記候補出力単語を現在タイムステップの出力単語として決定するように構成される出力部と、を含み、
前記外部情報は、予め定義された、ソーステキストの処理結果として期待されるテキスト情報である、テキスト処理装置。
A text processing device that processes word vectors of a source text based on a sequence-to-sequence model while taking into account external information, comprising:
an encoding unit configured to encode word vectors of a source text using an encoding network to obtain a source text encoding hidden state;
a decoder configured to decode an output of the encoder utilizing a decoding network to determine a decoded hidden state;
an attention generating unit configured to calculate, in each time step, an encoding attention parameter for each word in the source text using the source text encoding hidden state and the decoded hidden state of the current time step, and to calculate an encoding attention distribution of the source text by applying a softmax function to the encoding attention parameter, as an attention distribution of the current time step;
an output unit configured to obtain a context vector based on the attention distribution and the source text encoding hidden state of a current time step , calculate a generation probability distribution based on the context vector and the decoded hidden state, calculate an output word probability distribution by performing a weighted addition of the generation probability distribution and the attention distribution , determine a word in the output word probability distribution whose output probability is equal to or greater than a preset output probability threshold and which is included in the external information as a candidate output word of a current time step, determine an output candidate sequence based on the candidate output word of the current time step and the candidate output word of a next time step, determine an output probability of the output candidate sequence based on a joint probability of an output probability of the candidate output word of the current time step and an output probability of the candidate output word of the next time step, determine a penalty value of the output candidate sequence based on a similarity between a candidate text sequence determined in a previous time step and the external information, adjust the output probability of the output candidate sequence using the penalty value such that the higher the similarity, the greater the penalty value increases the output probability of the output candidate sequence, and determine the candidate output word in a predetermined number of sequences having the highest output probability of the adjusted output candidate sequence as the output word of the current time step ,
A text processing device, wherein the external information is predefined text information expected as a result of processing a source text.
前記符号化部及び前記復号化部は、
前記符号化部において、トレーニングソーステキスト符号化隠れ状態を取得するために符号化ネットワークを利用してトレーニングソーステキストを符号化するステップと、
前記復号化部において、復号化ネットワークを利用して前記符号化部の出力を復号化してトレーニング復号化隠れ状態を決定するステップと、
前記外部情報、前記トレーニングソーステキスト符号化隠れ状態、前記トレーニング復号化隠れ状態に基づいて現在タイムステップのトレーニング出力単語を決定するステップと、
前記トレーニング出力単語と前記外部情報に含まれる単語との間の差異がもっとも小さくなるように、前記符号化部、前記復号化部におけるパラメータを調整するステップと、によってトレーニングされる請求項に記載のテキスト処理装置。
The encoding unit and the decoding unit
In the encoding unit, encoding the training source text using an encoding network to obtain a training source text encoding hidden state;
in the decoding unit, decoding the output of the encoding unit using a decoding network to determine training decoded hidden states;
determining training output words for a current time step based on the extrinsic information, the training source text encoded hidden states, and the training decoded hidden states;
2. The text processing apparatus according to claim 1 , wherein the training is performed by adjusting parameters in the encoding unit and the decoding unit so that a difference between the training output words and words included in the external information is minimized.
シーケンス・ツー・シーケンスモデルに基づいて、外部情報を考慮してソーステキストの単語ベクトルに対して処理を行うテキスト処理方法であって、
ソーステキスト符号化隠れ状態を取得するために符号化ネットワークを利用してソーステキストの単語ベクトルを符号化するステップと、
復号化ネットワークを利用して前記符号化ネットワークの出力を復号化して復号化隠れ状態を決定するステップと、
各タイムステップにおいて、現在タイムステップの前記ソーステキスト符号化隠れ状態と前記復号化隠れ状態を利用して前記ソーステキストのうちの各単語の符号化アテンションパラメータを計算し、前記符号化アテンションパラメータにsoftmax関数を運用して前記ソーステキストの符号化アテンション分布を計算し、現在タイムステップのアテンション分布とするステップと、
現在タイムステップの前記アテンション分布及び前記ソーステキスト符号化隠れ状態に基づいてコンテキストベクトルを取得し、前記コンテキストベクトル及び前記復号化隠れ状態に基づいて生成確率分布を計算し、前記生成確率分布と前記アテンション分布とを重み付け加算することで出力単語確率分布を計算し、前記出力単語確率分布のうち、出力確率が予め設定された出力確率閾値以上でありかつ前記外部情報に含まれる単語を現在タイムステップの候補出力単語として決定し、現在タイムステップの候補出力単語と次のタイムステップの候補出力単語に基づいて出力候補系列を決定し、現在タイムステップの候補出力単語の出力確率と次のタイムステップの候補出力単語の出力確率の同時確率に基づいて前記出力候補系列の出力確率を決定し、直前のタイムステップで決定された候補テキスト系列と前記外部情報との類似度に基づいて前記出力候補系列のペナルティ値を決定し、前記類似度が高いほど、ペナルティ値が前記出力候補系列の出力確率を増やすように前記ペナルティ値を利用して前記出力候補系列の出力確率を調整し、調整された前記出力候補系列の出力確率の最も高い所定数の系列における前記候補出力単語を現在タイムステップの出力単語として決定するステップと、を含む、テキスト処理装置に基づくテキスト処理方法。
A text processing method for performing processing on word vectors of a source text based on a sequence-to-sequence model while taking into account external information, comprising:
encoding word vectors of a source text using an encoding network to obtain source text encoding hidden states;
using a decoding network to decode an output of the encoding network to determine a decoded hidden state;
At each time step, calculating an encoding attention parameter for each word in the source text using the source text encoding hidden state and the decoded hidden state of the current time step, and calculating an encoding attention distribution of the source text by applying a softmax function to the encoding attention parameter, which is the attention distribution of the current time step;
determining an output candidate sequence based on a joint probability of an output probability of the candidate output word of the current time step and an output probability of the candidate output word of the next time step; determining a penalty value of the output candidate sequence based on a similarity between a candidate text sequence determined in a previous time step and the external information; adjusting the output probability of the output candidate sequence using the penalty value such that the penalty value increases the output probability of the output candidate sequence as the similarity increases; and determining the candidate output word in a predetermined number of sequences having the highest output probability of the adjusted output candidate sequence as the output word of the current time step .
プロセッサと、
コンピュータ読み取り可能なプログラミングコマンドを記憶したメモリと、と含み、
前記コンピュータ読み取り可能なプログラミングコマンドが前記プロセッサによって実行される場合、請求項に記載のテキスト処理方法を実行するテキスト処理デバイス。
A processor;
a memory having computer readable programming instructions stored therein;
A text processing device which performs the text processing method of claim 3 when the computer readable programming instructions are executed by the processor.
コンピュータによって実行される場合、前記コンピュータが請求項に記載のテキスト処理方法を実行するコンピュータ読み取り可能なコマンドが記録されるコンピュータ読み取り可能な記録媒体。 A computer readable recording medium having computer readable instructions recorded thereon which, when executed by a computer, cause the computer to carry out the text processing method of claim 3 .
JP2019209173A 2019-09-20 2019-11-19 Text processing apparatus, method, device and computer-readable recording medium Active JP7555701B2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910894207.0 2019-09-20
CN201910894207.0A CN112613307A (en) 2019-09-20 2019-09-20 Text processing device, method, apparatus, and computer-readable storage medium

Publications (2)

Publication Number Publication Date
JP2021051709A JP2021051709A (en) 2021-04-01
JP7555701B2 true JP7555701B2 (en) 2024-09-25

Family

ID=75158275

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019209173A Active JP7555701B2 (en) 2019-09-20 2019-11-19 Text processing apparatus, method, device and computer-readable recording medium

Country Status (2)

Country Link
JP (1) JP7555701B2 (en)
CN (1) CN112613307A (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113177406B (en) * 2021-04-23 2023-07-07 珠海格力电器股份有限公司 Text processing method, text processing device, electronic equipment and computer readable medium
CN113673241B (en) * 2021-08-03 2024-04-09 之江实验室 A framework system and method for text summarization generation based on example learning
CN116362238A (en) * 2021-12-17 2023-06-30 珠海金山办公软件有限公司 Text proofreading method and device, electronic device, storage medium
CN116152821A (en) * 2022-10-26 2023-05-23 交叉信息核心技术研究院(西安)有限公司 Character recognition method, device, electronic device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
石垣達也 他4名,コピー機構を用いたクエリ指向ニューラル生成型要約,情報処理学会研究報告,日本,情報処理学会,2019年06月06日,Vol.2019-NL-240 No.3

Also Published As

Publication number Publication date
JP2021051709A (en) 2021-04-01
CN112613307A (en) 2021-04-06

Similar Documents

Publication Publication Date Title
CN110347799B (en) Language model training method and device and computer equipment
JP7555701B2 (en) Text processing apparatus, method, device and computer-readable recording medium
JP7346788B2 (en) Speech recognition model training methods, devices, equipment, and storage media
KR102382499B1 (en) Translation method, target information determination method, related apparatus and storage medium
CN109344413B (en) Translation processing method, translation processing device, computer equipment and computer readable storage medium
CN110795912B (en) Method, device, equipment and storage medium for encoding text based on neural network
CN111651573B (en) A method, device and electronic device for generating intelligent customer service dialogue reply
CN113268996B (en) Method for expanding corpus and training method and product for translation model
CN113655893B (en) A word and sentence generation method, model training method and related equipment
CN111368531B (en) Translation text processing method and device, computer equipment and storage medium
US20200042547A1 (en) Unsupervised text simplification using autoencoders with a constrained decoder
KR20210044559A (en) Method and device for determining output token
CN112487136B (en) Text processing methods, apparatus, devices, and computer-readable storage media
US12368938B2 (en) Method for coherent, unsupervised, transcript-based, extractive summarisation of long videos of spoken content
KR102227939B1 (en) Methods and apparatuses for embedding word considering contextual and morphosyntactic information
CN112446211A (en) Text processing device, method, apparatus, and computer-readable storage medium
JP7555702B2 (en) Text processing apparatus, method, device and computer-readable recording medium
Hori et al. Adversarial training and decoding strategies for end-to-end neural conversation models
CN110913229B (en) RNN-based decoder hidden state determination method, device and storage medium
EP4468194A1 (en) Method for generating summary and system thereof
CN112836526A (en) Multi-language neural machine translation method and device based on gating mechanism
JP2021051711A (en) Text processing apparatus, method, device, and computer-readable recording medium
CN116312459B (en) Speech synthesis method, device, electronic equipment and storage medium
US12019997B2 (en) Method of training real-time simultaneous interpretation model based on external alignment information, and method and system for simultaneous interpretation based on external alignment information
CN114372480B (en) Training method of machine translation model and machine translation method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20221116

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20230825

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230905

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20231102

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20231102

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20231106

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20240130

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20240425

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20240502

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: 20240827

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20240911

R150 Certificate of patent or registration of utility model

Ref document number: 7555701

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150