JP7825441B2 - Speech recognition device and program - Google Patents
Speech recognition device and programInfo
- Publication number
- JP7825441B2 JP7825441B2 JP2022017159A JP2022017159A JP7825441B2 JP 7825441 B2 JP7825441 B2 JP 7825441B2 JP 2022017159 A JP2022017159 A JP 2022017159A JP 2022017159 A JP2022017159 A JP 2022017159A JP 7825441 B2 JP7825441 B2 JP 7825441B2
- Authority
- JP
- Japan
- Prior art keywords
- unit
- encoder
- symbol string
- output
- model
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Machine Translation (AREA)
Description
本発明は、音声認識装置およびプログラムに関する。 The present invention relates to a speech recognition device and program.
音声認識処理のために用いる手法の一つとして、CTC音声認識モデルがある。CTCは、「Connectionist Temporal Classification」(コネクショニスト時間分類)の略である。CTC音声認識モデルは、発音記号等を介さずに、音声と文字列との関係を直接学習するように構成したモデルである。つまり、CTC音声認識モデルは、end-to-end音声認識モデルの手法の一つである。CTC音声認識モデルは、出力記号列に空白文字列<blank>を挿入することと、出力記号列に同一の記号が連続して出現することを許す。これにより、CTC音声認識モデルは、特徴量フレームと出力記号列とを対応させる。 One of the techniques used for speech recognition processing is the CTC speech recognition model. CTC stands for "Connectionist Temporal Classification." The CTC speech recognition model is a model configured to directly learn the relationship between speech and character strings, without using phonetic symbols or other means. In other words, the CTC speech recognition model is an end-to-end speech recognition model technique. The CTC speech recognition model allows the insertion of the blank character string <blank> into the output symbol string, and allows the same symbol to appear consecutively in the output symbol string. In this way, the CTC speech recognition model matches feature frames with output symbol strings.
非特許文献1には、Intermediate Loss Regularization(中間損失正則化)の手法が記載されている。Intermediate Loss Regularizationは、CTC音声認識モデルの中間層にCTC損失関数を算出する手段を設け、複数の層のCTC損失関数の値を重み付けして加算することで学習する手法である。 Non-Patent Document 1 describes a technique called Intermediate Loss Regularization. Intermediate Loss Regularization is a learning technique that involves providing a means for calculating a CTC loss function in the intermediate layer of a CTC speech recognition model, and weighting and adding the values of the CTC loss functions of multiple layers.
非特許文献2には、Shallow Fusion(シャローフュージョン)の手法が記載されている。Shallow Fusionは、テキストデータのみで学習した言語モデルを音声認識に活用する手法の一つである。Shallow Fusionの手法では、推論時に音声認識モデルと言語モデルの推論確率を対数領域で線形補間することによって、認識結果を出力する。 Non-Patent Document 2 describes the Shallow Fusion method. Shallow Fusion is a technique that utilizes a language model trained solely on text data for speech recognition. In the Shallow Fusion method, recognition results are output by linearly interpolating the inference probabilities of the speech recognition model and language model in the logarithmic domain during inference.
例えば日本語では、「橋」(はし)と「端」(はし)のように、異なる記号列であるがその発音が同一または類似となる表現が存在する。CTC音声認識モデルは、出力記号(文字)間の確率が独立であると仮定するモデルである。言い換えれば、出力記号の確率は、隣接する他の記号または近傍の他の記号の確率に依存しない。このため、CTC音声認識モデルは、複数の出力記号列の候補が存在する発音に対して、学習結果として得られた発音と記号列との対応に従って、記号列を出力する。このようなCTC音声認識モデルに、学習時に使用したテキストの話題と異なる話題の音声を認識させると、学習時のテキストに基づいた記号列を出現してしまう傾向がある。例えば、CTC音声認識モデルは、認識対象の音声が天気の話題に関するものであって認識結果として「最低気温」と出力すべき箇所において、「最適音」と出力してしまうことが起こり得る。つまり、CTC音声認識モデルは、推論するテキストの話題に適さない記号列を出力し、認識誤りを引き起こすという問題がある。 For example, in Japanese, there are expressions such as "hashi" (bridge) and "hashi" (edge), which are different symbol sequences but have the same or similar pronunciation. The CTC speech recognition model is a model that assumes that the probabilities between output symbols (characters) are independent. In other words, the probability of an output symbol does not depend on the probabilities of other adjacent or nearby symbols. Therefore, for a pronunciation for which there are multiple candidate output symbol sequences, the CTC speech recognition model outputs a symbol sequence based on the pronunciation and symbol sequence obtained as a training result. When such a CTC speech recognition model is made to recognize speech on a topic different from the topic of the text used during training, it tends to produce a symbol sequence based on the training text. For example, when the speech to be recognized is about the weather, the CTC speech recognition model may output "optimal sound" when the recognition result should be "minimum temperature." In other words, the CTC speech recognition model has the problem of outputting a symbol sequence that is inappropriate for the topic of the text being inferred, resulting in recognition errors.
目的とする話題の音声とテキスト(音声認識結果の正解)との対のデータが入手できれば、そのデータを用いて事前にCTC音声認識モデルの学習を行うこともできるが、そのような音声のデータが事前に入手できるとは限らない。また、そのようなデータの入手が可能であっても、音声に対するアノテーションの作業にはコストがかかる。つまり、従来技術におけるCTC音声認識モデルの出力記号列を所望の話題に適応させることは、不可能または困難である。 If data pairs of speech and text (correct speech recognition results) on a target topic were available, it would be possible to use that data to train a CTC speech recognition model in advance, but such speech data is not always available in advance. Even if such data were available, annotating the speech is costly. In other words, it is difficult or impossible to adapt the output symbol strings of a CTC speech recognition model in conventional technology to a desired topic.
本発明は、上記の課題認識に基づいて行なわれたものであり、推論対象の話題(領域)について音声とテキストとの対のデータが入手できない場合であっても、テキストのみが入手できれば、そのテキストのデータのみを用いて音声認識モデルに学習させ、推論時に話題(領域)に適した記号列を出力させることのできる音声認識装置およびプログラムを提供しようとするものである。 The present invention was developed based on the above-mentioned problem recognition, and aims to provide a speech recognition device and program that can train a speech recognition model using only the text data, even when paired speech and text data is not available for the topic (domain) to be inferred, and output a symbol string appropriate for the topic (domain) during inference, if only the text is available.
[1]上記の課題を解決するため、本発明の一態様による音声認識装置は、音響特徴量のフレームの列を入力し前記音響特徴量のフレームに対応する記号の列として成る出力記号列を出力するように、複数階層で成るモデルを有し、前記複数階層のモデルのそれぞれが機械学習可能に構成されたエンコーダー部と、目的とする領域に属する記号列を入力し、前記エンコーダー部の最終層のモデルに入力するための特徴量を出力するアダプター部と、を備え、前記エンコーダー部の前記複数階層のモデルにおけるある階層のモデルから次の階層のモデルへは中間特徴量が渡されるものであり、前記エンコーダー部は、前記音響特徴量のフレーム列と前記出力記号列との関係に基づく機械学習をした後に、前記アダプター部が出力する前記特徴量を前記エンコーダー部の前記最終層のモデルに入力して前記最終層のモデルからの出力に基づく損失である第1損失を用いて前記最終層のモデルの前記目的とする領域への適応化を行うことを可能として構成された、ものである。 [1] In order to solve the above problem, one aspect of the present invention provides a speech recognition device having a multi-layer model that receives a sequence of acoustic feature frames and outputs an output symbol sequence consisting of a sequence of symbols corresponding to the acoustic feature frames, the device comprising: an encoder unit configured to enable machine learning for each of the multi-layer models; and an adapter unit that receives a symbol sequence belonging to a target domain and outputs features to be input to a final layer model of the encoder unit; intermediate features are passed from a model in a certain layer of the multi-layer model of the encoder unit to a model in the next layer; and the encoder unit is configured to perform machine learning based on the relationship between the acoustic feature frame sequence and the output symbol sequence, and then input the features output by the adapter unit to the final layer model of the encoder unit and adapt the final layer model to the target domain using a first loss that is a loss based on the output from the final layer model.
[2]また、本発明の一態様は、上記の音声認識装置において、前記目的とする領域に属するテキストを基に、前記テキスト内の文字の繰り返し、または前記テキスト内の文字と文字との間への0個以上のブランク記号の挿入、の少なくともいずれかを行うことによって、前記アダプター部に入力するための前記記号列を生成する擬似記号列生成部、をさらに備える。 [2] In one aspect of the present invention, the speech recognition device further includes a pseudo-symbol string generation unit that generates the symbol string to be input to the adapter unit by performing at least one of repeating characters in the text or inserting zero or more blank symbols between characters in the text, based on the text belonging to the target region.
[3]また、本発明の一態様は、上記の音声認識装置において、所定の統計データを基に得られた出力文字確率分布にしたがって、前記目的とする領域に属するテキストに含まれる文字を別の文字で置換する処理を行う置換処理部、をさらに備え、前記擬似記号列生成部は、前記置換処理部が出力する置換処理後の前記目的とする領域に属するテキストを基に、前記記号列を生成する、ものである。 [3] In another aspect of the present invention, the speech recognition device further includes a replacement processing unit that replaces characters included in text belonging to the target region with other characters in accordance with an output character probability distribution obtained based on predetermined statistical data, and the pseudo-symbol string generation unit generates the symbol string based on the text belonging to the target region after the replacement processing output by the replacement processing unit.
[4]また、本発明の一態様は、上記の音声認識装置において、前記擬似記号列生成部は、前記テキスト内の文字を繰り返す際の同一文字の繰り返し回数を、前記音響特徴量のフレーム列と前記出力記号列との関係に基づいて学習済みの前記エンコーダー部における所定の階層の前記モデルから出力される特徴量に基づいて算出される記号列である中間記号列における同一文字の繰り返し回数に関する統計に基づいて決定し、前記テキスト内の文字と文字との間に挿入するブランク記号の連続する個数を、前記中間記号列における前記ブランク記号の連続する個数に関する統計に基づいて決定する、ものである。 [4] In another aspect of the present invention, in the above-described speech recognition device, the pseudo-symbol string generation unit determines the number of times the same character is repeated when repeating characters in the text based on statistics regarding the number of times the same character is repeated in an intermediate symbol string, which is a symbol string calculated based on features output from the model of a predetermined layer in the encoder unit that has been trained based on the relationship between the frame string of the acoustic features and the output symbol string, and determines the number of consecutive blank symbols to be inserted between characters in the text based on statistics regarding the number of consecutive blank symbols in the intermediate symbol string.
[5]また、本発明の一態様は、上記の音声認識装置において、前記アダプター部を学習するために前記アダプター部への入力となる記号列を、前記音響特徴量に基づいて前記エンコーダー部の所定の層のモデルから出力された前記中間特徴量に基づいて生成する記号列生成部と、前記記号列生成部によって生成された前記記号列に基づいて前記アダプター部が出力する特徴量についての損失である第2損失を算出するアダプター部用損失計算部と、をさらに備え、前記アダプター部用損失計算部が算出した前記第2損失を用いて前記アダプター部の機械学習を行えるように構成した、ものである。 [5] In another aspect of the present invention, the speech recognition device further includes a symbol string generation unit that generates a symbol string to be input to the adapter unit for training the adapter unit based on the intermediate features output from a model of a predetermined layer of the encoder unit based on the acoustic features, and an adapter unit loss calculation unit that calculates a second loss, which is a loss for the features output by the adapter unit based on the symbol string generated by the symbol string generation unit, and is configured to perform machine learning on the adapter unit using the second loss calculated by the adapter unit loss calculation unit.
[6]また、本発明の一態様は、上記の音声認識装置において、前記アダプター部用損失計算部は、前記アダプター部から出力される特徴量を前提としたときの正解の出力記号列の尤度に基づく損失と、前記アダプター部から出力される特徴量と前記エンコーダー部において対応する階層のモデルからの出力である特徴量との差を表す損失と、に基づく前記第2損失を算出する、ものである。 [6] In another aspect of the present invention, in the above-described speech recognition device, the adapter loss calculation unit calculates the second loss based on a loss based on the likelihood of a correct output symbol string given the features output from the adapter unit, and a loss representing the difference between the features output from the adapter unit and the features output from a model of the corresponding layer in the encoder unit.
[7]また、本発明の一態様は、上記の音声認識装置において、前記出力記号列の中で繰り返されている文字を集約するとともに、前記出力記号列に含まれる前記ブランク記号を削除することによって得られる文字列を音声認識結果として出力する、ものである。 [7] In another aspect of the present invention, the speech recognition device described above aggregates repeated characters in the output symbol string and deletes the blank symbols contained in the output symbol string, thereby outputting the resulting character string as the speech recognition result.
[8]また、本発明の一態様は、上記の音声認識装置において、前記エンコーダー部は、前記第1損失を用いて前記最終層のモデルの前記目的とする領域への適応化を行う際に、前記音響特徴量のフレーム列に基づいて前記エンコーダー部が有する前記複数階層で成るモデルが出力した記号列と、前記音響特徴量のフレーム列に対応する正解の前記出力記号列と、から得られる第3損失にも基づいた適応化を行う、というものである。なお、本態様は、後述する第2再学習手法を用いるものである。本態様によると、前記目的とする領域(ターゲットドメインと呼ぶ)への適応化を行いながら、エンコーダー部の元の学習を行った領域(ソースドメインと呼ぶ)での認識性能の劣化を防ぐ、あるいは少なくとも抑制することが可能である。 [8] Another aspect of the present invention is that, in the above-described speech recognition device, when the encoder unit adapts the model of the final layer to the target domain using the first loss, the encoder unit also performs adaptation based on a third loss obtained from a symbol sequence output by the multi-layer model of the encoder unit based on the frame sequence of acoustic features and the correct output symbol sequence corresponding to the frame sequence of acoustic features. This aspect uses a second re-training technique described below. According to this aspect, while adapting to the target domain (called the target domain), it is possible to prevent or at least suppress degradation of recognition performance in the domain where the encoder unit was originally trained (called the source domain).
[9]また、本発明の一態様は、音響特徴量のフレームの列を入力し前記音響特徴量のフレームに対応する記号の列として成る出力記号列を出力するように、複数階層で成るモデルを有し、前記複数階層のモデルのそれぞれが機械学習可能に構成されたエンコーダー部と、目的とする領域に属する記号列を入力し、前記エンコーダー部の最終層のモデルに入力するための特徴量を出力するアダプター部と、を備え、前記エンコーダー部の前記複数階層のモデルにおけるある階層のモデルから次の階層のモデルへは中間特徴量が渡されるものであり、前記エンコーダー部は、前記音響特徴量のフレーム列と前記出力記号列との関係に基づく機械学習をした後に、前記アダプター部が出力する前記特徴量を前記エンコーダー部の前記最終層のモデルに入力して前記最終層のモデルからの出力に基づく損失である第1損失を用いて前記最終層のモデルの前記目的とする領域への適応化を行うことを可能として構成された、音声認識装置、としてコンピューターを機能させるためのプログラムである。 [9] Another aspect of the present invention is a program for causing a computer to function as a speech recognition device, comprising: an encoder unit configured to input a sequence of acoustic feature frames and output an output symbol sequence consisting of a sequence of symbols corresponding to the acoustic feature frames; each of the multiple layer models being capable of machine learning; and an adapter unit configured to input a symbol sequence belonging to a target domain and output features to be input to a final layer model of the encoder unit; intermediate features are passed from a model in a certain layer of the multiple layer model of the encoder unit to a model in the next layer; and the encoder unit is configured to perform machine learning based on the relationship between the acoustic feature frame sequence and the output symbol sequence, and then input the features output by the adapter unit to the final layer model of the encoder unit and adapt the final layer model to the target domain using a first loss that is a loss based on the output from the final layer model.
本発明によれば、目的領域のテキストデータのみを用いて、音声認識モデルのドメイン適応を行うことが可能となる。 This invention makes it possible to perform domain adaptation of a speech recognition model using only text data from the target domain.
次に、本発明の一実施形態について、図面を参照しながら説明する。以下では、本実施形態が前提とする技術事項を最初に説明した後で、本実施形態に特有の構成を順次説明する。 Next, one embodiment of the present invention will be described with reference to the drawings. Below, we will first explain the technical aspects that this embodiment is based on, and then explain the configuration unique to this embodiment.
発音記号等を介さずに音声と文字列との関係を直接学習させるEnd-to-end音声認識モデルは、長さTのログメルペクトログラムのような入力音響特徴量系列を、長さLの出力記号列(文字列)に変換するモデルである。この入力音響特徴量系列xは、下の式(1)で表わされる。また、出力記号列yは、下の式(2)で表わされる。 An end-to-end speech recognition model that directly learns the relationship between speech and strings of characters without using phonetic symbols or other methods is a model that converts an input acoustic feature sequence, such as a log-mel spectrogram of length T, into an output symbol sequence (string of characters) of length L. This input acoustic feature sequence x is expressed by equation (1) below. The output symbol sequence y is expressed by equation (2) below.
上の式(1)におけるDは、1フレーム分の音響特徴量x[t]の次元数である。上の式(2)におけるVは、出力記号の集合(ボキャブラリー)である。 D in the above equation (1) is the number of dimensions of the acoustic feature x[t] for one frame. V in the above equation (2) is the set of output symbols (vocabulary).
従来技術に属する手法であるShallow Fusion(非特許文献2)は、推論時に、音声認識モデルの推論確率と言語モデルの推論確率とを対数領域で線形補間する。Shallow Fusionの手法による認識結果y(ハット)は、下の式(3)で表わされる。 Shallow Fusion (Non-Patent Document 2), a conventional technique, linearly interpolates the inference probability of a speech recognition model and the inference probability of a language model in the logarithmic domain during inference. The recognition result y (hat) obtained by the Shallow Fusion technique is expressed by equation (3) below.
式(3)におけるPAM(y|x)は、音声認識モデルの出力記号列の推論確率(入力音響特徴量系列xを前提としたときの出力記号列yの確率)である。また、PLM(y)は、言語モデルの出力記号列の推論確率(出力記号列yの確率)である。この言語モデルPLM(y)は、テキストデータのみを用いて学習し得るものである。一方、音声認識モデルPAM(y|x)は、音声とテキストとの対のデータを用いて学習するものである。 In equation (3), P AM (y|x) is the inference probability of the output symbol string of the speech recognition model (the probability of the output symbol string y given the input acoustic feature sequence x). Also, P LM (y) is the inference probability of the output symbol string of the language model (the probability of the output symbol string y). This language model P LM (y) can be trained using only text data. On the other hand, the speech recognition model P AM (y|x) is trained using paired data of speech and text.
本実施形態の特徴は、テキストデータのみを用いて、言語モデルPLM(y)ではなく、音声認識モデルPAM(y|x)を学習するための構成を有することである。つまり、本実施形態の音声認識装置は、学習用のテキストデータが持つ話題に音声認識モデルを適応化するものである。 A feature of this embodiment is that it is configured to train a speech recognition model P AM (y|x) instead of a language model P LM (y) using only text data. In other words, the speech recognition device of this embodiment adapts a speech recognition model to topics contained in the text data used for training.
次に、CTC音声認識モデルの概要を説明する。CTC音声認識モデル自体は、既存技術に属する手法である。CTC音声認識モデルは、入力される特徴量1フレームごとに1記号を出力する。特徴量のフレーム長と出力記号間の系列長との差は、ブランク記号<blank>を挿入し得ることと、出力記号(文字)を連続させ得ることとで吸収される。一例として、4フレームの音響特徴に対して「天気」という記号列を対応させる場合のアラインメントは、以下の17通りである。なお、ここでは、ブランク記号<blank>を「_」に置き換えて表記している。また、記号と記号との間の区切りを、スラッシュで表わしている。
01: _/_/天/気
02: _/天/_/気
03: _/天/気/_
04: 天/_/_/気
05: 天/_/気/_
06: 天/気/_/_
07: _/天/天/気
08: 天/_/天/気
09: 天/天/_/気
10: 天/天/気/_
11: _/天/気/気
12: 天/_/気/気
13: 天/気/_/気
14: 天/気/気/_
15: 天/気/気/気
16: 天/天/気/気
17: 天/天/天/気
Next, an overview of the CTC speech recognition model will be described. The CTC speech recognition model itself is a method belonging to existing technology. The CTC speech recognition model outputs one symbol for each frame of input features. The difference between the frame length of the features and the sequence length between output symbols is absorbed by allowing the insertion of blank symbols <blank> and the continuation of output symbols (characters). As an example, when associating the symbol string "weather" with four frames of acoustic features, there are the following 17 alignments. Note that here, the blank symbols <blank> are replaced with "_". Furthermore, the separators between symbols are represented by slashes.
01: _/_/Heaven/Ki 02: _/Heaven/_/Ki 03: _/Heaven/Ki/_
04: Heaven/_/_/Ki 05: Heaven/_/Ki/_
06: Heaven/Air/_/_
07: _/Heaven/Heaven/Ki 08: Heaven/_/Heaven/Ki 09: Heaven/Heaven/_/Ki 10: Heaven/Heaven/Ki/_
11: _/Heaven/Ki/Ki 12: Heaven/_/Ki/Ki 13: Heaven/Ki/_/Ki 14: Heaven/Ki/Ki/_
15: Heaven/Ki/Ki/Ki 16: Heaven/Heaven/Ki/Ki 17: Heaven/Heaven/Heaven/Ki
CTC音声認識モデルが推論結果として出力した記号列は、ブランク記号<blank>を消去するとともに、連続した同一の記号を1文字に圧縮することによって、認識結果に変換され得る。つまり、上記の17通りのアラインメントのそれぞれは、「天気」という認識結果に変換される。ただし、正解とする文字が例えば「いい天気」における「いい」のように、正解の認識結果において同一の文字が連続する場合のアラインメントは、これらの「い」と「い」の間に必ずブランク記号<blank>が挿入されなければならない。 The symbol string output by the CTC speech recognition model as an inference result can be converted into a recognition result by deleting blank symbols <blank> and compressing consecutive identical symbols into a single character. In other words, each of the 17 alignments above is converted into the recognition result "weather". However, when the correct character is "ii" in "ii tenki" (good weather), for example, and the correct recognition result contains consecutive identical characters, a blank symbol <blank> must be inserted between the "ii" characters.
CTC音声認識モデルの学習については、次の通りである。CTC音声認識モデルを用いた認識処理では、ニューラルネットワークから抽出された特徴量フレーム列hに対して、出力記号列のアラインメントaの確率を計算する。ここで、特徴量フレーム列hは、下の式(4)で表わされる。また、アラインメントaは、下の式(5)で表わされる。なお、式(4)および式(5)におけるThは、系列の長さである。 The training of the CTC speech recognition model is as follows. In the recognition process using the CTC speech recognition model, the probability of alignment a of an output symbol string is calculated for a feature frame string h extracted from a neural network. Here, the feature frame string h is expressed by the following equation (4). Also, the alignment a is expressed by the following equation (5). Note that T h in equations (4) and (5) is the length of the string.
入力される特徴量フレーム列hを前提とした出力記号列のアラインメントaは、下の式(6)で表わされる。 The alignment a of the output symbol sequence given the input feature frame sequence h is expressed by equation (6) below.
出力記号列yの、あり得るすべてのアライメントにおける確率の総和は、下の式(7)で求められる。 The sum of the probabilities of all possible alignments of the output symbol string y is calculated using equation (7) below:
式(7)におけるβ-1(y)は、出力記号列yと特徴量列hに対してとり得るすべてのアラインメントの集合である。CTC損失関数Lは、上記のP(y|h)の対数をとり、下の式(8)で計算される。 β −1 (y) in equation (7) is the set of all possible alignments for the output symbol string y and feature string h. The CTC loss function L is calculated by taking the logarithm of the above P(y|h) using the following equation (8).
CTC音声認識モデルの学習は、上記の損失関数値Lを最小化するようにニューラルネットワークの内部パラメーターの値を更新することによって行われる。 The CTC speech recognition model is trained by updating the values of the internal parameters of the neural network to minimize the loss function value L above.
本実施形態の音声認識装置が持つ機能のそれぞれは、例えば、コンピューターと、プログラムとで実現することが可能である。また、それらの機能の各々は、必要に応じて、記憶手段を有する。記憶手段は、例えば、プログラム上の変数や、プログラムの実行によりアロケーションされるメモリーである。また、必要に応じて、磁気ハードディスク装置やソリッドステートドライブ(SSD)といった不揮発性の記憶手段を用いるようにしてもよい。また、各機能部の少なくとも一部の機能を、プログラムではなく専用の電子回路として実現してもよい。 Each of the functions of the speech recognition device of this embodiment can be realized, for example, by a computer and a program. Furthermore, each of these functions has a storage means as needed. The storage means is, for example, a program variable or memory allocated by the execution of the program. Furthermore, non-volatile storage means such as a magnetic hard disk drive or solid-state drive (SSD) may also be used as needed. Furthermore, at least some of the functions of each functional unit may be realized as a dedicated electronic circuit rather than a program.
本実施形態の音声認識装置1は、Intermediate CTC(非特許文献1)を前提として構成される。本実施形態での音声認識モデルの概要は、次の通りである。本実施形態の音声認識モデルは、Githubで提供されるオープンソースEspnet(https://github.com/espnet/espnet)をベースとして改良を加えたものである。Intermediate CTCでは、ニューラルネットワークの中間の層でもCTC損失関数の値を計算し、層ごとの重み付けを行った和を最終的な損失関数として、モデルの学習を行う。 The speech recognition device 1 of this embodiment is configured based on Intermediate CTC (Non-Patent Document 1). The outline of the speech recognition model in this embodiment is as follows. The speech recognition model in this embodiment is an improvement on the open source Espnet (https://github.com/espnet/espnet) provided on Github. In Intermediate CTC, the value of the CTC loss function is calculated even in the intermediate layers of the neural network, and the sum of the weighted values for each layer is used as the final loss function for model training.
図1は、本実施形態による音声認識装置1の概略機能構成を示すブロック図である。図示するように、音声認識装置1は、音声供給部10と、畳み込みニューラルネットワーク部20と、第1層エンコーダー部30(Encoderl・30)と、第2層エンコーダー部40(Encoderm・40)と、第3層エンコーダー部50(Encoderh・50)と、目的領域テキスト供給部110と、擬似CTC記号列生成部120と、アダプター部130と、CTC記号列生成部210と、平均二乗誤差損失計算部220と、CTC損失計算部230とを含んで構成される。 1 is a block diagram showing a schematic functional configuration of a speech recognition device 1 according to this embodiment. As shown in the figure, the speech recognition device 1 includes a speech supply unit 10, a convolutional neural network unit 20, a first-layer encoder unit 30 (Encoder l 30), a second-layer encoder unit 40 (Encoder m 40), a third-layer encoder unit 50 (Encoder h 50), a target region text supply unit 110, a pseudo-CTC symbol string generator 120, an adapter unit 130, a CTC symbol string generator 210, a mean squared error loss calculator 220, and a CTC loss calculator 230.
音声供給部10は、音声認識装置1による認識処理の対象となる音声のデータを供給する。音声供給部10は、音声のデータを、畳み込みニューラルネットワーク部20に渡す。音声供給部10は、音声のデータとして、例えばベクトルで表わされる音響特徴量の列を供給する。 The speech supply unit 10 supplies speech data to be subjected to recognition processing by the speech recognition device 1. The speech supply unit 10 passes the speech data to the convolutional neural network unit 20. The speech supply unit 10 supplies, as speech data, a sequence of acoustic features represented by, for example, a vector.
畳み込みニューラルネットワーク部20は、音声供給部10から渡される音声データの畳み込み処理を行う。畳み込みニューラルネットワーク部20は、畳み込み処理の結果として得られる特徴量(後述するh0)を、第1層エンコーダー部30に渡す。 The convolutional neural network unit 20 performs convolution processing on the audio data passed from the audio supply unit 10. The convolutional neural network unit 20 passes the feature value (h 0 described later) obtained as a result of the convolution processing to the first layer encoder unit 30.
第1層エンコーダー部30と、第2層エンコーダー部40と、第3層エンコーダー部50とは、3層構成のエンコーダーである。第1層エンコーダー部30と、第2層エンコーダー部40と、第3層エンコーダー部50とのそれぞれは、セルフアテンションニューラルネットワークを用いて実現される。音声認識装置1は、第1層エンコーダー部30と、第2層エンコーダー部40と、第3層エンコーダー部50とのそれぞれの出力について、損失を計算する機能(CTC損失計算部)を有するが、本図ではその機能を省略している。損失を計算する機能については、図2で説明する。 The first-layer encoder unit 30, the second-layer encoder unit 40, and the third-layer encoder unit 50 are a three-layer encoder. Each of the first-layer encoder unit 30, the second-layer encoder unit 40, and the third-layer encoder unit 50 is implemented using a self-attention neural network. The speech recognition device 1 has a function (CTC loss calculation unit) for calculating losses for the outputs of each of the first-layer encoder unit 30, the second-layer encoder unit 40, and the third-layer encoder unit 50, but this function is omitted in this diagram. The loss calculation function will be explained in Figure 2.
複数の階層のモデルで構成される第1層エンコーダー部30と、第2層エンコーダー部40と、第3層エンコーダー部50とを、あわせて「エンコーダー部」と呼んでもよい。エンコーダー部は、音響特徴量のフレームの列を入力し前記音響特徴量のフレームに対応する記号の列として成る出力記号列を出力するように、複数階層で成るモデルを有し、前記複数階層のモデルのそれぞれが機械学習可能に構成されたものである。エンコーダー部の複数階層のモデルにおけるある階層のモデルから次の階層のモデルへは中間特徴量(後述するhlやhm)が渡される。なお、このエンコーダー部は、前記音響特徴量のフレーム列と前記出力記号列との関係に基づく機械学習をした後に、前記アダプター部が出力する前記特徴量を前記エンコーダー部の前記最終層のモデル(第3層エンコーダー部50)に入力して前記最終層のモデル(第3層エンコーダー部50)からの出力に基づく損失である第1損失を用いて前記最終層のモデル(第3層エンコーダー部50)の前記目的とする領域への適応化を行うことを可能として構成されている。 The first-layer encoder unit 30, the second-layer encoder unit 40, and the third-layer encoder unit 50, which are configured with models in multiple layers, may be collectively referred to as the "encoder unit." The encoder unit has models in multiple layers that input a sequence of acoustic feature frames and output an output symbol sequence consisting of a sequence of symbols corresponding to the frames of the acoustic features, and each of the models in the multiple layers is configured to be capable of machine learning. Intermediate features (h l and h m , described below) are passed from a model in a certain layer to a model in the next layer in the multiple layer models of the encoder unit. Note that this encoder unit is configured to perform machine learning based on the relationship between the frame sequence of the acoustic features and the output symbol sequence, and then input the features output by the adapter unit to the final layer model (third-layer encoder unit 50) of the encoder unit, and adapt the final layer model (third-layer encoder unit 50) to the target domain using a first loss, which is a loss based on the output from the final layer model (third-layer encoder unit 50).
第1層エンコーダー部30は、Encoderl・30とも呼ばれ、畳み込みニューラルネットワーク部20から受け取る特徴量h0を基に、特徴量hlを算出し、第2層エンコーダー部40に渡す。第2層エンコーダー部40は、Encoderm・40とも呼ばれ、第1層エンコーダー部30から受け取る特徴量hlを基に、特徴量hmを算出し、第3層エンコーダー部50に渡す。第3層エンコーダー部50は、Encoderh・50とも呼ばれ、第2層エンコーダー部40から受け取る特徴量hmを基に、特徴量hhを算出し、出力する。 The first layer encoder unit 30, also called Encoder l 30, calculates a feature h l based on the feature h 0 received from the convolutional neural network unit 20 and passes it to the second layer encoder unit 40. The second layer encoder unit 40, also called Encoder m 40, calculates a feature h m based on the feature h l received from the first layer encoder unit 30 and passes it to the third layer encoder unit 50. The third layer encoder unit 50, also called Encoder h 50, calculates a feature h h based on the feature h m received from the second layer encoder unit 40 and outputs it.
なお、特徴量h0、hl、hm、hhのそれぞれは、ベクトルの系列である。 Each of the feature quantities h 0 , h 1 , h m , and h h is a series of vectors.
目的領域テキスト供給部110は、Encoderh・50の適応化を行うためのテキストデータを供給する。目的領域テキスト供給部110は、推論時にEncoderh・50が目的とする領域(ドメイン)に合ったテキストを出力するように、当該領域のテキストを供給する。目的領域テキスト供給部110は、目的領域のテキストを擬似CTC記号列生成部120に渡す。 The target domain text supply unit 110 supplies text data for adapting the Encoder h 50. The target domain text supply unit 110 supplies text for the target domain so that the Encoder h 50 outputs text that matches the target domain during inference. The target domain text supply unit 110 passes the text for the target domain to the pseudo-CTC symbol string generation unit 120.
擬似CTC記号列生成部120は、目的領域テキスト供給部110から渡されるテキスト文字列を基に、擬似的なCTC記号列を生成する。擬似CTC記号列生成部120は、単に「擬似記号列生成部」とも呼ばれる。擬似的なCTC記号列の生成の方法については、後でフローチャート等を参照しながら詳細に説明する。1つのテキスト文字列に対して、複数のCTC記号列が対応し得る。つまり、擬似CTC記号列生成部120は、1つのテキスト文字列に対応して、複数の擬似的なCTC記号列を出力する。言い換えれば、擬似CTC記号列生成部120は、1つのテキスト文字列を、複数通りの擬似的CTC記号列に変換する。なお、擬似CTC記号列生成部120は、目的領域テキスト供給部110が供給するテキストデータに含まれるそれぞれのテキスト文字列に対応して、複数の擬似的CTC記号列を生成することができる。 The pseudo-CTC symbol string generation unit 120 generates a pseudo-CTC symbol string based on the text string passed from the target area text supply unit 110. The pseudo-CTC symbol string generation unit 120 is also simply referred to as the "pseudo-symbol string generation unit." The method for generating a pseudo-CTC symbol string will be described in detail later with reference to flowcharts, etc. Multiple CTC symbol strings may correspond to one text string. In other words, the pseudo-CTC symbol string generation unit 120 outputs multiple pseudo-CTC symbol strings corresponding to one text string. In other words, the pseudo-CTC symbol string generation unit 120 converts one text string into multiple pseudo-CTC symbol strings. The pseudo-CTC symbol string generation unit 120 can generate multiple pseudo-CTC symbol strings corresponding to each text string included in the text data supplied by the target area text supply unit 110.
擬似CTC記号列生成部120は、目的とするドメインに属するテキストを基に、前記テキスト内の文字の繰り返し、または前記テキスト内の文字と文字との間への0個以上のブランク記号の挿入、の少なくともいずれかを行うことによって、アダプター部130に入力するための記号列を生成するものである。擬似CTC記号列生成部120は、前記テキスト内の文字を繰り返す際の同一文字の繰り返し回数を、前記音響特徴量のフレーム列と前記出力記号列との関係に基づいて学習済みの前記エンコーダー部における所定の階層の前記モデルから出力される特徴量に基づいて算出される記号列である中間記号列における同一文字の繰り返し回数に関する統計に基づいて決定してよい。また、擬似CTC記号列生成部120は、前記テキスト内の文字と文字との間に挿入するブランク記号の連続する個数を、前記中間記号列における前記ブランク記号の連続する個数に関する統計に基づいて決定してよい。 The pseudo-CTC symbol string generation unit 120 generates a symbol string to be input to the adapter unit 130 by at least one of repeating characters in the text or inserting zero or more blank symbols between characters in the text, based on text belonging to a target domain. The pseudo-CTC symbol string generation unit 120 may determine the number of times the same character is repeated when repeating characters in the text, based on statistics regarding the number of times the same character is repeated in an intermediate symbol string, which is a symbol string calculated based on features output from the model of a predetermined layer in the encoder unit that has been trained based on the relationship between the frame sequence of the acoustic features and the output symbol string. The pseudo-CTC symbol string generation unit 120 may also determine the number of consecutive blank symbols to insert between characters in the text based on statistics regarding the number of consecutive blank symbols in the intermediate symbol string.
アダプター部130は、Encoderh・50の適応化を行う場合に、擬似CTC記号列生成部120から渡される擬似CTC記号列のそれぞれを、Encoderh・50に入力するための特徴量に変換する。つまり、アダプター部130は、ターゲットとする領域に属する記号列(擬似CTC記号列)を入力し、その記号列に基づいて、前記エンコーダー部の最終層のモデル(Encoderh・50)に入力するための特徴量を出力するものである。 When adapting the Encoder h ·50, the adapter unit 130 converts each pseudo-CTC symbol string passed from the pseudo-CTC symbol string generation unit 120 into a feature to be input to the Encoder h ·50. In other words, the adapter unit 130 inputs a symbol string (pseudo-CTC symbol string) belonging to a target region, and outputs, based on that symbol string, a feature to be input to the final layer model (Encoder h ·50) of the encoder unit.
なお、アダプター部130は、セルフアテンションニューラルネットワークを用いて実現され、学習可能となるように構成されている。つまり、アダプター部130は、学習する。アダプター部130の学習を行う場合には、アダプター部130は、後述するCTC記号列生成部210から渡される記号列を基に、Encoderm・40が出力する特徴量に近い特徴量を生成する。アダプター部130の学習により、アダプター部130が出力する特徴量は、Encoderm・40が出力する特徴量に近づくことが期待される。アダプター部130の学習の際には、後述する平均二乗誤差損失計算部220とCTC損失計算部230とが計算する損失に基づいて、アダプター部130の内部のニューラルネットワークのパラメーターの調整が行われる。つまり、アダプター部130は、後述する「第2損失」を用いて機械学習を行えるように構成されている。 The adapter unit 130 is realized using a self-attention neural network and is configured to be capable of learning. In other words, the adapter unit 130 learns. When training the adapter unit 130, the adapter unit 130 generates features similar to those output by the Encoder m ·40 based on a symbol string passed from a CTC symbol string generation unit 210 (described later). As a result of training the adapter unit 130, it is expected that the features output by the adapter unit 130 will approach the features output by the Encoder m ·40. When training the adapter unit 130, parameters of the neural network inside the adapter unit 130 are adjusted based on losses calculated by a mean squared error loss calculation unit 220 and a CTC loss calculation unit 230 (described later). In other words, the adapter unit 130 is configured to perform machine learning using a "second loss" (described later).
CTC記号列生成部210は、アダプター部130の学習を行う際に、Encoderl・30から出力される特徴量hlを基に、アラインメントal(ハット)を求める。CTC記号列生成部210は、求めたal(ハット)をアダプター部130に渡す。つまり、CTC記号列生成部210は、アダプター部130を学習するためにアダプター部130への入力となる記号列を、音響特徴量に基づいてエンコーダー部の所定の層(Encoderl・30)のモデルから出力された中間特徴量に基づいて生成する。CTC記号列生成部210は、単に「記号列生成部」とも呼ばれる。 When training the adaptor unit 130, the CTC symbol string generation unit 210 obtains alignment a l (hat) based on the feature h l output from the Encoder l 30. The CTC symbol string generation unit 210 passes the obtained a l (hat) to the adaptor unit 130. In other words, the CTC symbol string generation unit 210 generates a symbol string to be input to the adaptor unit 130 for training the adaptor unit 130 based on intermediate features output from a model of a predetermined layer (Encoder l 30) of the encoder unit, based on acoustic features. The CTC symbol string generation unit 210 is also simply referred to as a "symbol string generation unit."
平均二乗誤差損失計算部220とCTC損失計算部230とは、アダプター部130の学習を行う際に、それぞれ、アダプター部130から出力される特徴量hm(ハット)に関する損失を計算する。つまり、平均二乗誤差損失計算部220とCTC損失計算部230とのそれぞれは、アダプター部130の学習のための損失を計算するアダプター部用損失計算部の機能の一部である。平均二乗誤差損失計算部220およびCTC損失計算部230が算出する損失の詳細については、後で説明する。平均二乗誤差損失計算部220とCTC損失計算部230とが算出する損失は、アダプター部130の内部のニューラルネットワークのパラメーターの更新のために用いられる。 The mean squared error loss calculation unit 220 and the CTC loss calculation unit 230 each calculate a loss related to the feature value h m (hat) output from the adaptor unit 130 when training the adaptor unit 130. In other words, the mean squared error loss calculation unit 220 and the CTC loss calculation unit 230 are each part of the function of the adaptor unit loss calculation unit that calculates the loss for training the adaptor unit 130. Details of the losses calculated by the mean squared error loss calculation unit 220 and the CTC loss calculation unit 230 will be described later. The losses calculated by the mean squared error loss calculation unit 220 and the CTC loss calculation unit 230 are used to update the parameters of the neural network inside the adaptor unit 130.
[音声認識機能]
図2は、本実施形態による音声認識装置1が持つ音声認識機能の主要部の機能構成を示すブロック図である。図示するように、音声認識装置1は、畳み込みニューラルネットワーク部20と、Encoderl・30と、CTC損失計算部32と、Encoderm・40と、CTC損失計算部42と、Encoderh・50と、CTC損失計算部52とを含んで構成される。
[Voice recognition function]
2 is a block diagram showing the functional configuration of the main parts of the speech recognition function of the speech recognition device 1 according to this embodiment. As shown in the figure, the speech recognition device 1 includes a convolutional neural network unit 20, an Encoder l 30, a CTC loss calculation unit 32, an Encoder m 40, a CTC loss calculation unit 42, an Encoder h 50, and a CTC loss calculation unit 52.
図示する通り、音声認識モデルは、Convolution(畳み込みニューラルネットワーク部20)、Encoderl・30(低レベルエンコーダー)、Encoderm・40(中間レベルエンコーダー)、Encoderh・50(高レベルエンコーダー)の4つのニューラルネットワークを持つように構成される。これら4つのニューラルネットワークのそれぞれは、複数の層で構成される。なお、Encoderl・30と、Encoderm・40と、Encoderh・50とは、それぞれセルフアテンションネットワークである。この音声認識モデルは、Encoderl・30、Encoderm・40、Encoderh・50の出力から、それぞれ、CTC損失関数値Ll、Lm、Lhを算出する。なお、Convolutionの出力である特徴量h0は、下の式(9)および式(10)の通りである。 As shown in the figure, the speech recognition model is configured to have four neural networks: Convolution (convolutional neural network unit 20), Encoder l 30 (low-level encoder), Encoder m 40 (mid-level encoder), and Encoder h 50 (high-level encoder). Each of these four neural networks is configured with multiple layers. Note that Encoder l 30, Encoder m 40, and Encoder h 50 are each self-attention networks. This speech recognition model calculates CTC loss function values L l , L m , and L h from the outputs of Encoder l 30, Encoder m 40, and Encoder h 50, respectively. The feature value h0 , which is the output of the convolution, is as shown in the following equations (9) and (10).
なお、式(9)において、Thは、特徴量の系列長である。また、Dhは、h0に含まれる個々のベクトルの次元数である。また、式(10)に示すように、h0は、音響特徴量xを入力したときのConvolutionの出力である。 In equation (9), Th is the sequence length of the feature. Dh is the number of dimensions of each vector included in h0 . As shown in equation (10), h0 is the output of convolution when an acoustic feature x is input.
Encoderl・30からの出力hl、Encoderm・40からの出力hm、およびEncoderh・50からの出力hhは、下の式(11)の通りであり、それぞれ、式(12)、式(13)、および式(14)で算出される。 The output h l from Encoder l 30, the output h m from Encoder m 40, and the output h h from Encoder h 50 are as shown in equation (11) below, and are calculated by equations (12), (13), and (14), respectively.
即ち、特徴量hlは、特徴量h0を入力としてEncoderl・30が出力する量である。また、特徴量hmは、特徴量hlを入力としてEncoderm・40が出力する量である。また、特徴量hhは、特徴量hmを入力としてEncoderh・50が出力する量である。 That is, the feature amount h1 is the amount output by the Encoder l 30 when the feature amount h0 is input. The feature amount hm is the amount output by the Encoder m 40 when the feature amount h1 is input. The feature amount hh is the amount output by the Encoder h 50 when the feature amount hm is input.
Encoderl・30、Encoderm・40、およびEncoderh・50が出からの出力に対するそれぞれの損失関数値Ll、Lm、およびLhは、それぞれ下の式(15)、式(16)、および式(17)によって算出される。CTC損失計算部32は、Encoderl・30から出力される特徴量hlを基に、損失Llを算出する。CTC損失計算部42は、Encoderm・40から出力される特徴量hmを基に、損失Lmを算出する。CTC損失計算部52は、Encoderh・50から出力される特徴量hhを基に、損失Lhを算出する。 The loss function values Ll , Lm , and Lh for the outputs from Encoder l 30, Encoder m 40, and Encoder h 50 are calculated by the following formulas (15), (16), and (17), respectively. The CTC loss calculation unit 32 calculates the loss Ll based on the feature value hl output from Encoder l 30. The CTC loss calculation unit 42 calculates the loss Lm based on the feature value hm output from Encoder m 40. The CTC loss calculation unit 52 calculates the loss Lh based on the feature value hh output from Encoder h 50.
ベースモデルにおける目的関数は、例えば上記の損失関数値LlとLmとLhとの平均として、下の式(18)で計算される。 The objective function in the base model is calculated, for example, as the average of the loss function values Ll , Lm , and Lh , using the following equation (18).
つまり、本実施形態が前提とするIntermediate CTCでは、式(18)によって算出されるLoss1を最小化するように、ニューラルネットワークの内部パラメーターを更新することによって学習を行う。 That is, in the Intermediate CTC that is the premise of this embodiment, learning is performed by updating the internal parameters of the neural network so as to minimize Loss 1 calculated by equation (18).
次に、本実施形態の音声認識装置1において、目的とする話題のテキストデータを用いて、音声認識モデルを再学習するための構成について説明する。本実施形態では、テキスト文字列を疑似的にCTC記号列に変換し、その変換結果であるCTC記号列を、後述するニューラルネットワークAdapterで特徴量フレームに変換する。本実施形態では、この特徴量フレームを用いて前述のIntermediate CTC音声認識モデル(本実施形態が前提とするモデル)のEndocerhを再学習することによって、目的とする話題にニューラルネットワークを適応させる。 Next, a configuration for retraining a speech recognition model using text data on a target topic in the speech recognition device 1 of this embodiment will be described. In this embodiment, a text string is converted into a pseudo-CTC symbol string, and the resulting CTC symbol string is converted into a feature frame by a neural network adapter (described later). In this embodiment, this feature frame is used to retrain the Endocer h of the intermediate CTC speech recognition model (the model on which this embodiment is based) described above, thereby adapting the neural network to the target topic.
[Adapterの学習]
図3は、本実施形態による音声認識装置1が持つ、アダプター部130(単に「Adapter」とも呼ぶ)の学習を行うための構成を示すブロック図である。Adapterは、後述する音声認識モデルの再学習において、擬似CTC記号列を、Encoderh・50に入力するための特徴量に変換する役割を果たす。図示するように、音声認識装置1は、畳み込みニューラルネットワーク部20と、Encoderl・30と、Encoderm・40と、Encoderh・50と、アダプター部130と、CTC記号列生成部210と、平均二乗誤差損失計算部220と、CTC損失計算部230とを含んで構成される。
[Adapter Learning]
3 is a block diagram showing a configuration for training the adapter unit 130 (also simply referred to as "Adapter") of the speech recognition device 1 according to this embodiment. The Adapter plays a role in converting pseudo-CTC symbol strings into features to be input to the Encoder h 50 during re-training of the speech recognition model, which will be described later. As shown in the figure, the speech recognition device 1 includes a convolutional neural network unit 20, an Encoder l 30, an Encoder m 40, an Encoder h 50, the adapter unit 130, a CTC symbol string generation unit 210, a mean squared error loss calculation unit 220, and a CTC loss calculation unit 230.
図3に示す各部の機能については、既に説明した通りである。つまり、CTC記号列生成部210は、Encoderl・30から出力される特徴量hlに基づいて、アラインメントal(ハット)を生成する。アダプターは、アラインメントal(ハット)を入力し、特徴量の推定値hm(ハット)を出力する。平均二乗誤差損失計算部220およびCTC損失計算部230がそれぞれ算出する損失に基づいて、アダプター部130の学習が行われる。学習により、アダプター部130は、Encoderm・40が出力する特徴量hmに近い特徴量を出力するようになることが期待される。 The functions of the components shown in Fig. 3 have been described above. That is, the CTC symbol string generation unit 210 generates an alignment a l (hat) based on the feature h l output from the Encoder l 30. The adapter inputs the alignment a l (hat) and outputs an estimated feature value h m (hat). The adapter unit 130 is trained based on the losses calculated by the mean squared error loss calculation unit 220 and the CTC loss calculation unit 230. Through training, the adapter unit 130 is expected to output a feature close to the feature h m output by the Encoder m 40.
ここで、ニューラルネットワークAdapterの学習の詳細について説明する。音声認識装置1は、学習済みのIntermediate CTC音声認識モデル(図3)に音響特徴量xを入力し、下の式(19)および式(20)によって特徴量hmを算出する。 Here, the details of the training of the neural network Adapter will be explained. The speech recognition device 1 inputs the acoustic feature x to the trained Intermediate CTC speech recognition model (FIG. 3), and calculates the feature hm using the following equations (19) and (20).
このhmの算出の過程は、既に式(10)、式(12)、および式(13)で説明した計算と同様である。また、特徴量hlに対して最も尤度の高いアラインメントal(ハット)は、次の式(21)で算出される。 The process of calculating h m is the same as the calculations already explained in equations (10), (12), and (13). The alignment a l (hat) with the highest likelihood for the feature h l is calculated by the following equation (21).
音声認識装置1は、CTCアラインメント系列がEncodermの出力特徴量フレームhmに近づくように、Adapterの学習を行う。つまり、音声認識装置1は、Adapterが持つニューラルネットワークの内部パラメーターを更新する。アラインメントal(ハット)をAdapterに入力したときの出力であるhm(ハット)は、下の式(22)で求められる。 The speech recognition device 1 trains the adapter so that the CTC alignment sequence approaches the output feature frame hm of the encoder m . In other words, the speech recognition device 1 updates the internal parameters of the neural network of the adapter. When the alignment al (hat) is input to the adapter, the output hm (hat) is calculated by the following equation (22).
音声認識装置1は、式(22)のhm(ハット)をhmに近づけるように、Adapterの学習を行う。具体的には、音声認識装置1は、下の式(23)で算出される損失関数値Lmと、式(24)によって算出される損失関数値Lmseに基づいて、Adapterが持つニューラルネットワークの内部パラメーターを更新する。なお、CTC損失計算部230が、式(23)に基づいて、Adapterからの出力であるhm(ハット)を前提としたときの正解の出力記号列であるyの尤度に基づく損失Lmを算出する。また、平均二乗誤差損失計算部220が、式(24)に基づいて、Adapterからの出力であるhm(ハット)とEncoderm・40(Adapterに対応する階層のモデル)からの出力である特徴量との差を表す損失Lmseを算出する。 The speech recognition device 1 trains the Adapter so as to bring hm (hat) in equation (22) closer to hm . Specifically, the speech recognition device 1 updates the internal parameters of the neural network of the Adapter based on the loss function value Lm calculated by the following equation (23) and the loss function value Lmse calculated by equation (24). The CTC loss calculation unit 230 calculates the loss Lm based on the likelihood of y, which is the correct output symbol string, given hm (hat), which is the output from the Adapter. The mean square error loss calculation unit 220 calculates the loss Lmse , which represents the difference between hm (hat), which is the output from the Adapter, and the feature, which is the output from Encoder m ·40 (the model of the layer corresponding to the Adapter), based on equation (24).
式(24)に示す損失関数値Lmseは、平均二乗誤差損失である。音声認識装置1が、Adapterを学習する際の目的関数の一例は、下の式(25)によって計算されるものである。 The loss function value L mse shown in equation (24) is the mean square error loss. An example of the objective function used by the speech recognition device 1 when training the Adapter is calculated by the following equation (25).
なお、式(25)において、αはハイパーパラメーターである。音声認識装置1は、式(25)で表わされる損失Loss2を最小化するように、Adapterが持つニューラルネットワークの内部パラメーターを更新する。この損失Loss2を便宜的に「第2損失」と呼ぶ場合がある。なお、音声認識装置1は、Adapter内の複数層のニューラルネットワークの最終層以外の層についてのパラメーターを更新するように、Adapterの学習を行う。なお、音声認識装置1は、Adapterの学習時には、学習済みのEncoderm・40の最終層のパラメーターの値をそのままAdapterの最終層のパラメーターに流用する。このようにすることで、Encoderm・40の出力が模擬できるように、Adapterの最終層以外の層のパラメーターが調整(更新)される。このようなAdapterの学習を行うことによって、Adapterは、CTC記号列をEncodermの出力特徴量フレームhmに変換するモデルになることが期待される。 In equation (25), α is a hyperparameter. The speech recognition device 1 updates the internal parameters of the neural network of the Adapter so as to minimize the loss Loss 2 expressed in equation (25). This loss Loss 2 may be conveniently referred to as the "second loss." The speech recognition device 1 trains the Adapter so as to update parameters for layers other than the final layer of the multi-layer neural network in the Adapter. When training the Adapter, the speech recognition device 1 reuses the parameter values of the trained final layer of Encoder m ·40 as the parameters of the final layer of the Adapter. In this way, the parameters of the layers other than the final layer of the Adapter are adjusted (updated) so as to simulate the output of Encoder m ·40. By training the Adapter in this way, it is expected that the Adapter will become a model that converts a CTC symbol string into an output feature frame hm of the Encoder m .
[Encoderh・50の再学習]
次に、Encoderh・50の再学習について説明する。Encoderh・50の再学習では、推論対象の音声の話題が含まれるテキスト文字列を学習データとして用いて、推論対象の話題の認識精度を向上させる。以下において、前述のIntermediate CTC音声認識モデルおよびAdapterを学習した音声の話題が属するドメインをソースドメインと呼び、推論対象の音声の話題が属するドメインをターゲットドメインと呼ぶ。Encoderh・50の再学習を行うための手法として、以下に説明する、第1再学習手法および第2再学習手法のいずれかを用いるようにしてよい。本実施形態では、用途等に応じて、第1再学習手法あるいは第2再学習手法のいずれかを任意に選択することができる。
[Relearning Encoder h.50 ]
Next, the retraining of the Encoder h -50 will be described. In the retraining of the Encoder h -50, a text string containing the topic of the speech to be inferred is used as training data to improve the recognition accuracy of the topic to be inferred. Hereinafter, the domain to which the topic of the speech to which the Intermediate CTC speech recognition model and Adapter are trained belongs is referred to as the source domain, and the domain to which the topic of the speech to be inferred belongs is referred to as the target domain. As a method for retraining the Encoder h -50, either a first retraining method or a second retraining method described below may be used. In this embodiment, either the first retraining method or the second retraining method can be selected as desired depending on the application, etc.
[Encoderh・50の再学習: 第1再学習手法]
図4は、本実施形態による音声認識装置1が、第1再学習手法を用いてEncoderh・50の再学習を行うための機能の構成を示すブロック図である。第1再学習手法では、ターゲットドメインのテキストのみを用いたドメイン適応を行う。Encoderh・50の再学習を行うのは、上述したAdapterの学習が完了していることが前提である。図示するように、音声認識装置1は、Encoderh・50と、CTC損失計算部52と、擬似CTC記号列生成部120と、アダプター部130とを含んで構成される。なお、図4には、畳み込みニューラルネットワーク部20と、Encoderl・30と、Encoderm・40も記載している。
[Relearning Encoder h.50 : First Relearning Method]
FIG. 4 is a block diagram showing the functional configuration of the speech recognition device 1 according to this embodiment for relearning the Encoder h 50 using the first relearning method. The first relearning method performs domain adaptation using only text from the target domain. Re-training the Encoder h 50 is performed on the premise that the above-described training of the Adapter has been completed. As shown in the figure, the speech recognition device 1 includes the Encoder h 50, a CTC loss calculation unit 52, a pseudo-CTC symbol string generation unit 120, and an adapter unit 130. Note that FIG. 4 also shows the convolutional neural network unit 20, the Encoder l 30, and the Encoder m 40.
なお、図示する通り、擬似CTC記号列生成部120と、アダプター部130と、Encoderh・50と、CTC損失計算部52とを含む構成を、モデル適応化装置2と呼んでもよい。モデル適応化装置2は、畳み込みニューラルネットワーク部20と、Encoderl・30と、Encoderm・40と、Encoderh・50とを含んで成る音声認識モデルの、少なくとも認識結果出力側の層のエンコーダー(本実施形態ではEncoderh・50のみ)の目的領域への適応化を行う。本実施形態の特徴は、このモデル適応化装置2が、目的とする領域の音声データを必要とせず、その領域のテキストデータのみに基づいて動作する点である。 As shown in the figure, a configuration including the pseudo-CTC symbol string generator 120, adapter unit 130, Encoder h 50, and CTC loss calculator 52 may be referred to as a model adaptation device 2. The model adaptation device 2 adapts at least the encoder of the recognition result output layer (only Encoder h 50 in this embodiment) of a speech recognition model including a convolutional neural network unit 20, Encoder l 30, Encoder m 40, and Encoder h 50 to a target domain. A feature of this embodiment is that the model adaptation device 2 does not require speech data of the target domain, but operates based only on text data in that domain.
なお、図4に示す各部の機能の概略については、既に説明した通りである。つまり、学習済みのアダプター部130は、擬似CTC記号列生成部120が出力する擬似CTC記号列に基づいて、Encoderm・40が出力するであろう特徴量hmに近い特徴量を出力する。Encoderh・50は、そのアダプター部130からの出力に基づいて、特徴量hh,i(ハット)を出力する。Encoderh・50は、CTC損失計算部52が算出する損失に基づいて、内部のニューラルネットワークのパラメーターを調整する。なお、Encoderh・50の再学習のためにCTC損失計算部52が算出する損失を便宜的に「第1損失」と呼ぶ場合がある。つまり、第1損失は、Adapterが出力する特徴量をEncoderh・50のモデルに入力して得られるEncoderh・50からの出力に基づく損失である。 The outline of the functions of each unit shown in FIG. 4 has already been described. That is, the trained adapter unit 130 outputs a feature value similar to the feature value h m that would be output by the Encoder m -40, based on the pseudo-CTC symbol string output by the pseudo-CTC symbol string generation unit 120. The Encoder h -50 outputs a feature value h h,i (hat) based on the output from the adapter unit 130. The Encoder h -50 adjusts the parameters of its internal neural network based on the loss calculated by the CTC loss calculation unit 52. For convenience, the loss calculated by the CTC loss calculation unit 52 for the re-training of the Encoder h -50 may be referred to as the "first loss." That is, the first loss is a loss based on the output from the Encoder h -50 obtained by inputting the feature value output by the Adapter into the model of the Encoder h -50.
図4を参照しながら、第1再学習手法によるEncoderh・50の再学習の詳細について説明する。上でAdapterの学習方法について説明したが、ここでは、学習済みのAdapterを用いて、Encoderh・50の再学習を行う。Encoderh・50の再学習では、認識対象とする音声の話題が含まれるテキスト文字列のみを学習データとして用いる。言い換えれば、Encoderh・50の再学習では、目的とする話題(領域)のテキスト文字列の学習データを用いる。 The details of the relearning of Encoder h -50 using the first relearning method will be described with reference to Figure 4. The method for training the Adapter has been described above, but here, the Encoder h -50 is relearned using a trained Adapter. When relearning Encoder h -50, only text strings containing the topic of the speech to be recognized are used as training data. In other words, when relearning Encoder h -50, training data of text strings of the target topic (domain) is used.
第1再学習手法によるEncoderh・50の再学習においては、音声認識装置1は、まず、学習データであるターゲットドメインのテキスト文字列を基に、後述する擬似CTC記号列変換手法を用いて、N個の擬似的なCTC記号列を生成する。このN個の擬似的なCTC記号列は、下の式(26)で表わされるai(ハット)である。 In relearning Encoder h ·50 using the first relearning method, the speech recognition device 1 first generates N pseudo CTC symbol strings based on text strings of the target domain, which are training data, using a pseudo CTC symbol string conversion method described later. These N pseudo CTC symbol strings are a i (hat) expressed by the following equation (26).
音声認識装置1のCTC損失計算部52は、上記のai(ハット)に対して、下の式(27)および式(28)によって、損失関数値Lh,iを計算する。 The CTC loss calculation unit 52 of the speech recognition device 1 calculates the loss function value L h,i for the above a i (hat) using the following equations (27) and (28).
つまり、i番目の損失関数値(i=1,・・・,N)であるLh,iは、i番目のCTC記号列であるai(ハット)を入力することによってAdapterが出力する特徴量を、Encoderh・50に入力することによって得られるhh,i(ハット)を基に算出される。第1再学習手法によってEncoderh・50の適応化学習を行う際の目的関数は、N個の損失関数値の平均として下の式(29)によって計算される。 That is, L h,i which is the i-th loss function value (i = 1, ..., N) is calculated based on h h,i (hat) obtained by inputting the feature output by the Adapter by inputting the i-th CTC symbol string a i (hat) into Encoder h 50. The objective function when adaptive learning of Encoder h 50 is performed by the first re-learning method is calculated by the following equation (29) as the average of N loss function values.
Encoderhの再学習の過程では、音声認識装置1は、式(29)で表わされるLoss3の値を最小化するように、ニューラルネットワークの内部パラメーターを更新する。ただし、Encoderh・50の再学習の際には、音声認識装置1は、学習済みのAdapterのパラメーターを固定とする。即ち、音声認識装置1は、Encoderh・50の再学習の段階では、Adapterの内部パラメーターを更新せず、Encoderh・50の内部パラメーターの更新を行う。 In the process of relearning Encoder h , the speech recognition device 1 updates the internal parameters of the neural network so as to minimize the value of Loss 3 expressed in equation (29). However, when relearning Encoder h ·50, the speech recognition device 1 fixes the parameters of the trained Adapter. In other words, in the stage of relearning Encoder h ·50, the speech recognition device 1 does not update the internal parameters of the Adapter, but updates the internal parameters of Encoder h ·50.
上記のような再学習を完了したときには、Encoderh・50のニューラルネットワークは、再学習に用いたテキスト文字列の話題に適応していることが期待される。 Upon completing such retraining, the Encoder h.50 neural network is expected to be adapted to the topic of the text strings used for retraining.
[Encoderh・50の再学習: 第2再学習手法]
図5は、本実施形態による音声認識装置1が、第1再学習手法を用いてEncoderh・50の再学習を行うための機能の構成を示すブロック図である。図示するように、音声認識装置1は、Encoderh・50と、CTC損失計算部52と、擬似CTC記号列生成部120と、アダプター部130と、畳み込みニューラルネットワーク部20と、Encoderl・30と、Encoderm・40とを含んで構成される。また、ここでは、Encoderh・50と、CTC損失計算部52と、擬似CTC記号列生成部120と、アダプター部130と、畳み込みニューラルネットワーク部20と、Encoderl・30と、Encoderm・40とを含む構成は、第2再学習手法による処理を実行するモデル適応化装置2として機能する。第2再学習手法では、Encoderh・50の再学習に、ターゲットドメインのテキストだけではなく、ソースドメインの音声テキスト対も用いたドメイン適応を行う。第2再学習手法を用いる場合には、ソースドメインの音声認識精度劣化を軽減する効果が期待される。
[Encoder h.50 Re-learning: Second Re-learning Method]
5 is a block diagram showing a functional configuration for the speech recognition device 1 according to this embodiment to re-train Encoder h 50 using the first re-training method. As shown in the figure, the speech recognition device 1 includes Encoder h 50, a CTC loss calculation unit 52, a pseudo-CTC symbol string generation unit 120, an adapter unit 130, a convolutional neural network unit 20, Encoder l 30, and Encoder m 40. Here, the configuration including Encoder h 50, the CTC loss calculation unit 52, the pseudo-CTC symbol string generation unit 120, the adapter unit 130, the convolutional neural network unit 20, Encoder l 30, and Encoder m 40 functions as a model adaptation device 2 that executes processing using the second re-training method. In the second retraining method, domain adaptation is performed using not only the target domain text but also the source domain speech-text pair when retraining Encoder h ·50. When the second retraining method is used, it is expected to be effective in reducing the deterioration of speech recognition accuracy in the source domain.
第2再学習手法によるEncoderh・50の再学習においては、音声認識装置1は、学習データであるターゲットドメインのテキスト文字列を基に、後述する擬似CTC記号列変換手法を用いて、Nt個の擬似的なCTC記号列を生成する。このNt個の擬似的なCTC記号列は、下の式(30)で表わされるat,i(ハット)である。 In relearning Encoder h ·50 using the second relearning method, the speech recognition device 1 generates Nt pseudo CTC symbol strings based on text strings in the target domain, which are training data, using a pseudo CTC symbol string conversion method described later. These Nt pseudo CTC symbol strings are at ,i (hat) expressed by the following equation (30).
音声認識装置1のCTC損失計算部52は、上記のat,i(ハット)に対して、下の式(31)および式(32)によって、損失関数値Lt,iを計算する。 The CTC loss calculation unit 52 of the speech recognition device 1 calculates the loss function value L t,i for the above a t,i (hat) by the following equations (31) and (32).
また、学習済みのIntermediate CTC音声認識モデルにNs個の音響特徴量の列を入力することによって、損失関数値Ls,jを計算する。この音響特徴量の列は、下の式(33)によって表される。また、損失関数値Ls,jは、式(34)、式(35)、式(36)、および式(37)によって計算される。 Furthermore, a string of Ns acoustic features is input to the trained Intermediate CTC speech recognition model to calculate a loss function value L s,j . This string of acoustic features is expressed by the following formula (33). Furthermore, the loss function value L s,j is calculated by formulas (34), (35), (36), and (37).
つまり、畳み込みニューラルネットワーク部20は、音響特徴量の列xjの畳み込みを行い、Convolution(xj)を出力する。Encoderl・30は、Convolution(xj)を基に、hsl,jを出力する。Encoderm・40は、hsl,jを基に、hsm,jを出力する。Encoderh・50は、hsm,jを基に、hsh,jを出力する。 That is, the convolutional neural network unit 20 performs convolution on the sequence xj of acoustic features and outputs Convolution( xj ) . The Encoder l 30 outputs hsl ,j based on Convolution(xj). The Encoder m 40 outputs hsm ,j based on hsl , j. The Encoder h 50 outputs hsh ,j based on hsm , j.
第2再学習手法における目的関数は、下の式(38)に表わされるLossstである。 The objective function in the second relearning method is Loss st expressed in the following equation (38).
つまり、Lossstは、Nt個の損失関数値Lt,iの平均に対して、Ns個の損失関数値Ls,jの平均を、ソースドメインの認識精度劣化を抑制する正則化項として加えたものである。モデル適応化装置2は、Lossstを最小化するようにモデルのパラメーターを更新することにより、Encoderh・50の再学習を行う。ただし、このとき、Adapterのパラメーターについては学習せず、固定とする。再学習の完了したEncoderh・50は、ソースドメインの音声に対する処理能力を落とさずに、テキスト文字列の話題に適応したニューラルネットワークとなる。 In other words, Loss st is the average of N t loss function values L t,i plus the average of N s loss function values L s,j as a regularization term to suppress degradation of source domain recognition accuracy. The model adaptation device 2 re-trains Encoder h・50 by updating the model parameters so as to minimize Loss st . However, at this time, the Adapter parameters are not trained but are fixed. Once re-training is complete, Encoder h・50 becomes a neural network adapted to the topic of the text string without reducing its processing ability for source domain speech.
上記の式(37)によって算出される損失を便宜的に「第3損失」と呼ぶ。つまり、第3損失は、音響特徴量のフレーム列に基づいてエンコーダー部が有する複数階層(本実施形態では、第1層エンコーダー部30、第2層エンコーダー部40、および第3層エンコーダー部50)で成るモデルが出力した記号列と、音響特徴量のフレーム列に対応する正解の出力記号列と、から得られる(算出される)損失である。つまり、ここで説明する第2再学習手法では、エンコーダー部は、第1損失を用いて最終層のモデルの目的とする領域(ターゲットドメイン)への適応化を行う際に、上記の第3損失にも基づいた適応化を行う。即ち、式(38)で表わされる損失Lossstに基づく再学習を行う。第2再学習手法によると、目的とする領域(ターゲットドメイン)への適応化を行いながら、エンコーダー部の元の学習を行った領域(ソースドメイン)での認識性能の劣化を防ぐ、あるいは少なくとも抑制することが可能である。 The loss calculated by the above formula (37) is conveniently referred to as the "third loss." That is, the third loss is a loss obtained (calculated) from a symbol string output by a model consisting of multiple layers (in this embodiment, the first-layer encoder unit 30, the second-layer encoder unit 40, and the third-layer encoder unit 50) of the encoder unit based on a frame sequence of acoustic features, and a correct output symbol string corresponding to the frame sequence of acoustic features. In other words, in the second relearning method described here, when adapting the final-layer model to a target domain using the first loss, the encoder unit also performs adaptation based on the above-mentioned third loss. That is, relearning is performed based on the loss Loss st expressed by formula (38). The second relearning method makes it possible to prevent or at least suppress degradation of recognition performance in the domain (source domain) where the encoder unit was originally trained, while adapting to a target domain.
以上において説明した第1再学習手法と第2再学習手法とを比較したとき、第1再学習手法を用いる場合の方が、第2再学習手法を用いる場合よりも、ターゲットドメインでの音声認識精度の向上が期待できる。なお、第1再学習手法を用いた場合には、ソースドメインでの音声認識精度は劣化する。第2再学習手法を用いる場合には、ターゲットドメインの音声認識精度の改善効果は小さくなるが、ソースドメインの音声認識精度劣化を軽減する効果が期待できる。 When comparing the first and second relearning methods described above, using the first relearning method is expected to improve speech recognition accuracy in the target domain more than using the second relearning method. However, when using the first relearning method, speech recognition accuracy in the source domain deteriorates. When using the second relearning method, the improvement in speech recognition accuracy in the target domain is smaller, but it is expected to have the effect of reducing deterioration in speech recognition accuracy in the source domain.
[擬似CTC記号列の生成]
次に、テキスト文字列を、疑似的なCTC記号列に変換する方法について説明する。擬似CTC記号列は、上述したEncoderh・50の再学習のために用いたものである。音声認識装置1は、学習用のテキストデータに含まれる文字列を基に、擬似的なCTC記号列の集合を生成する。
[Generation of pseudo CTC symbol strings]
Next, a method for converting a text character string into a pseudo CTC symbol string will be described. The pseudo CTC symbol string was used for relearning the above-mentioned Encoder h.50 . The speech recognition device 1 generates a set of pseudo CTC symbol strings based on character strings included in the training text data.
あるテキスト文字列を疑似的なCTC記号列に変換する場合を考える。例えば、CTC記号列の長さを6に限定した場合、「いい天気」という文字列に対応するCTC記号列は以下の9通りである。
1: _/い/_/い/天/気
2: い/_/_/い/天/気
3: い/_/い/_/天/気
4: い/_/い/天/_/気
5: い/_/い/天/気/_
6: い/い/_/い/天/気
7: い/_/い/い/天/気
8: い/_/い/天/天/気
9: い/_/い/天/気/気
Consider the case where a certain text character string is converted into a pseudo CTC symbol string. For example, if the length of the CTC symbol string is limited to 6, there are nine possible CTC symbol strings corresponding to the character string "Nii Tenki" (good weather).
1: _/ ...
6: I/I/_/I/Heaven/Ki 7: I/_/I/I/Heaven/Ki 8: I/_/I/Heaven/Ki 9: I/_/I/Heaven/Ki/Ki
上記の擬似的なCTC記号列において、「_」は、ブランク記号<blank>を簡略化した表現である。CTC記号列では、「いい」のように同じ記号が連続する箇所には必ずブランク記号<blank>がその間に挿入される。なお、記号と記号との間の区切りを、スラッシュで表わしている。 In the pseudo-CTC symbol string above, "_" is a simplified representation of the blank symbol <blank>. In a CTC symbol string, wherever the same symbol appears consecutively, such as in "ii", a blank symbol <blank> is always inserted between them. Note that the separator between symbols is represented by a slash.
ブランク記号<blank>の位置は、特徴量フレームのうちの発音が存在しない位置(時間帯)であると捉えることができる。上で例示したように、ある文字列(ここでは「いい天気」)に対応するCTC記号列は数多く存在する。つまり、ある文字列に対応するすべてのCTC記号列のパターンを用いてニューラルネットワークの学習を行うと、その学習処理に膨大な時間を必要とする場合もある。一方で、CTC記号列においては、存在し得る記号列であるが現実的には生じにくい記号列も存在する。例えば、「いい天気」という文字列に対して、長さ10のCTC記号列が生成されることを仮定した場合に、「い/_/_/_/_/_/_/い/天/気」といった、「い」と「い」の間に長時間発音が存在しない区間がある場合や、「い/_/い/天/気/気/気/気/気/気」のように特定の記号の繰り返し(発音区間)が所定の長さ以上に長くなるような特徴量フレームは、現実的には生じにくい。したがって、あるテキスト文字列をCTC記号列に変換するときに、現実的に生じ得ると考えられるパターンの記号列のみに限定することもできる。 The position of the blank symbol <blank> can be considered a position (time period) in a feature frame where no pronunciation is present. As shown in the example above, there are many CTC symbol strings corresponding to a certain string (here, "Iiteki" [good weather]). In other words, training a neural network using all CTC symbol string patterns corresponding to a certain string can require an enormous amount of time. On the other hand, there are also CTC symbol strings that are possible but unlikely to occur in reality. For example, if a CTC symbol string of length 10 is generated for the string "Iiteki" [good weather], it is unlikely to occur in reality a feature frame in which there is a long period between "I" and "I" with no pronunciation, such as "I/__/__/__/__/__/__/i/ten/ki," or in which a specific symbol repetition (pronunciation interval) is longer than a predetermined length, such as "i/__/i/ten/ki/ki/ki/ki/ki/ki." Therefore, when converting a text string to a CTC symbol string, it is possible to limit the symbol strings to only those with patterns that are considered to occur in reality.
そこで、本実施形態の音声認識装置1は、学習済みのIntermediate CTCのEncoderlから出力される特徴量フレームhlに基づいて算出されるCTC記号列であるai(ハット)において、統計に基づいて、生じやすい擬似的なCTC記号列への変換を行う。具体的には、音声認識装置1は、同一記号の連続数およびブランク記号<blank>の連続数の統計から生成する確率密度関数に則って、疑似的なCTC記号列への変換を行う。 Therefore, the speech recognition device 1 of this embodiment converts a i (hat), which is a CTC symbol string calculated based on the feature frame h l output from the trained Intermediate CTC Encoder l , into a pseudo CTC symbol string that is likely to occur based on statistics. Specifically, the speech recognition device 1 converts the CTC symbol string into a pseudo CTC symbol string in accordance with a probability density function generated from statistics of the number of consecutive identical symbols and the number of consecutive blank symbols <blank>.
擬似的なCTC記号列を生成するための統計をとるために、例えば、Intermediate CTCの学習に使用した音声データを使用する。音声データを、学習済みのIntermediate CTCに入力し、Encoderlから出力されるal(ハット)を基に統計をとる。具体的には、al(ハット)において、同一の記号(ただしブランク記号を除く)が連続してn回出現した回数をNc(n)とし、ブランク記号<blank>が連続してn回出現した回数をNb(n)とする。これらの回数のデータを基に、同一の記号(ただしブランク記号を除く)の連続数の確率密度関数Pc(n)、およびブランク記号<blank>の連続数の確率密度関数Pb(n)を、それぞれ、下の式(39)および式(40)で求める。つまり、本実施形態では、音声に基づいてエンコーダーから実際に出力される記号列に関する統計に基づいて、確率密度関数を生成する。 To obtain statistics for generating a pseudo-CTC symbol string, for example, speech data used in training the Intermediate CTC is used. The speech data is input to the trained Intermediate CTC, and statistics are obtained based on a l (hat) output from Encoder l . Specifically, the number of times the same symbol (excluding blank symbols) appears consecutively n times in a l (hat) is defined as N c (n), and the number of times the blank symbol <blank> appears consecutively n times is defined as N b (n). Based on these count data, the probability density function P c (n) of the number of consecutive occurrences of the same symbol (excluding blank symbols) and the probability density function P b (n) of the number of consecutive occurrences of blank symbols <blank> are calculated using the following equations (39) and (40), respectively. In other words, in this embodiment, the probability density functions are generated based on statistics regarding the symbol string actually output from the encoder based on speech.
確率密度関数を求めるための計算の例は、次の通りである。音声データの中に、「いい天気」および「明日」という2つの言語表現が含まれる場合を想定する。「いい天気」および「明日」という音声に対してEncoderlが出力するCTC記号列が、それぞれ、「_/_/い/_/い/い/い/_/天/気/_/_/_」および「_/明/明/_/_/_/日/日/_」である場合に、記号の連続数は次の通りである。なお、ブランク記号<blank>を「_」と表している。 An example of calculation for finding a probability density function is as follows. Assume that speech data contains two linguistic expressions, "nice weather" and "tomorrow." If the CTC symbol strings output by Encoder 1 for the speech "nice weather" and "tomorrow" are "_/_/i/_/i/i/i/_/weather/_/_/_" and "_/min/min/_/_/_/day/day/_," respectively, the number of consecutive symbols is as follows: Note that the blank symbol <blank> is represented as "_".
ブランク記号以外の記号(文字)の連続数ごとの出現回数は、以下の通りである。
Nc(0)=0
Nc(1)=3 : (「い」、「天」、「気」が該当)
Nc(2)=2 : (「明/明」、「日/日」が該当)
Nc(3)=1 : (「い/い/い」が該当する)
The number of occurrences of each consecutive symbol (character) other than the blank symbol is as follows:
Nc (0)=0
Nc (1) = 3: (corresponding to "i", "ten", and "ki")
Nc (2) = 2: (applies to "Morning/Morning" and "Sun/Sun")
Nc (3) = 1: (corresponds to "i/i/i")
よって、確率Pc(n)は、次の通りである。
Pc(0)=0/6=0
Pc(1)=3/6=1/2
Pc(2)=2/6=1/3
Pc(3)=1/6
Thus, the probability P c (n) is:
P c (0)=0/6=0
P c (1) = 3/6 = 1/2
P c (2) = 2/6 = 1/3
P c (3) = 1/6
一方、ブランク記号<blank>の連続数ごとの出現回数は、以下の通りである。
Nb(0)=1 : (「天」と「気」の間に「_」が存在しないため、Nb(0)をカウントする)
Nb(1)=4 : (「い」と「い」の間、「い」と「天」の間、「明」の前、「日」の後が該当)
Nb(2)=1 : (「い」の前が該当)
Nb(3)=2 : (「気」の後、「明」と「日」の間が該当)
On the other hand, the number of occurrences of each consecutive blank symbol <blank> is as follows:
N b (0) = 1: (Since there is no "_" between "heaven" and "ki", count N b (0))
N b (1) = 4: (applies between "i" and "i", between "i" and "ten", before "akari", after "hi")
N b (2) = 1: (applies before "i")
N b (3) = 2: (after "ki" (spirit)), between "myo" (light) and "hi" (day)
よって、確率Pb(n)は、次の通りである。
Pb(0)=1/8
Pb(1)=4/8=1/2
Pb(2)=1/8
Pb(3)=2/8=1/4
Therefore, the probability P b (n) is:
P b (0) = 1/8
P b (1) = 4/8 = 1/2
P b (2) = 1/8
P b (3) = 2/8 = 1/4
上記の例は、「いい天気」および「明日」という2つの音声データに基づいて算出した確率値であるが、実際にとる統計はIntermediate CTCの学習に用いたすべての音声データに基づいて作成するものである。これにより、学習に用いた音声データに対応するCTC記号列において、連続して出現する記号(ブランク記号以外、あるいはブランク記号<blank>)の連続数に関する確率(傾向)が把握される。 The above example shows a probability value calculated based on two pieces of speech data, "nice weather" and "tomorrow." However, the actual statistics are created based on all of the speech data used in training Intermediate CTC. This allows us to understand the probability (trend) of the number of consecutive symbols (other than blank symbols, or blank symbols) that appear consecutively in the CTC symbol strings corresponding to the speech data used in training.
図6および図7は、擬似的なCTC記号列への変換の処理の手順を示すフローチャートである。図6と図7とは結合子で結合されており、これら両図で1つのフローチャートである。このフローチャートの処理を実行するのは、擬似CTC記号列生成部120である。以下では、このフローチャートを参照しながら、CTC記号列を生成するための処理の手順を説明する。 Figures 6 and 7 are flowcharts showing the processing steps for conversion into a pseudo-CTC symbol string. Figures 6 and 7 are connected by a connector, and together form a single flowchart. The processing of this flowchart is executed by the pseudo-CTC symbol string generator 120. Below, the processing steps for generating a CTC symbol string will be explained with reference to this flowchart.
このフローチャートの処理では、テキスト文字列cを、CTC記号列ai(ハット)に変換する。このフローチャートの処理を繰り返すことにより、複数の(N個の)CTC記号列ai(ハット)(ただし、i=1,・・・,N)を作り出すことができる。なお、テキスト文字列cは、下の式(41)で表わされる通りである。なお、式(41)において、Vはブランク記号を含まない出力記号(つまり、文字)の集合であり、Jは文字列cの長さ(文字数)である。 In the process of this flowchart, a text string c is converted into a CTC symbol string ai (hat). By repeating the process of this flowchart, multiple (N) CTC symbol strings ai (hat) (where i = 1, ..., N) can be created. The text string c is expressed by the following equation (41). In equation (41), V is a set of output symbols (i.e., characters) that do not contain blank symbols, and J is the length (number of characters) of the string c.
まず図6のステップS1において、擬似CTC記号列生成部120は、ai(ハット)をヌル記号列に設定(初期化)する。 First, in step S1 of FIG. 6, the pseudo-CTC symbol string generator 120 sets (initializes) a i (hat) to a null symbol string.
次のステップS2は、ループ1の始点である。ここで擬似CTC記号列生成部120は、ループ1に関する条件の制御を行う。このフローチャートにおいて、jは、ループ1における繰り返しの指標となる変数である。そして、ループ1の初期条件はj=1である。ループ1の繰り返し時の条件は「+1」(即ち、j=j+1)である。ループ1の終了判定条件は「J」(j≦Jの条件を満たさなくなるようなjの場合にはループを抜ける)である。つまり、ループ1の処理は、j=1のときから、j=Jのときまで、jを1ずつ増分させながら繰り返される。なお、ループ1の終点は、ステップS10である。 The next step S2 is the start of Loop 1. Here, the pseudo-CTC symbol string generation unit 120 controls the conditions for Loop 1. In this flowchart, j is a variable that serves as an index for the iterations in Loop 1. The initial condition for Loop 1 is j = 1. The condition during the iteration of Loop 1 is "+1" (i.e., j = j + 1). The condition for determining whether Loop 1 ends is "J" (the loop is terminated when j is such that the condition j <= J is no longer satisfied). In other words, the processing of Loop 1 is repeated from j = 1 to j = J, with j being incremented by 1. The end point of Loop 1 is Step S10.
次にステップS3において、擬似CTC記号列生成部120は、Pb(n)に従い、確率的にブランク記号<blank>の連続数Nbを選択する。つまり、擬似CTC記号列生成部120は、予め得られた統計に基づいて且つランダムな要素にしたがって連続数Nbを選択する。ステップS3の処理では、確率がゼロでない限りは、Nb=0,1,2,・・・のいずれかであり得る。 Next, in step S3, the pseudo CTC symbol string generator 120 selects the number of consecutive blank symbols <blank> Nb probabilistically in accordance with Pb (n). That is, the pseudo CTC symbol string generator 120 selects the number of consecutive blank symbols Nb based on previously obtained statistics and in accordance with a random element. In the process of step S3, Nb can be any of 0, 1, 2, ... as long as the probability is not zero.
次にステップS4において、擬似CTC記号列生成部120は、その時点での文字の位置jに関して、(j≠1)且つ(c[j-1]==c[j])という条件の真偽を判定する。なお、j=1の場合には条件が偽であることが確定するためc[j-1]を参照しないようにしてもよい。あるいはc[0]が任意の何らかの記号であるという前提を置いてもよい。上記の条件が真の場合(ステップS4:YES)には次のステップS5に進む。上記の条件が偽の場合(ステップS4:NO)には図7のステップS8に飛ぶ。このステップS4における条件判定に基づく分岐は、入力文字列内において同一文字が連続する箇所についてのみ、ステップS5からS7までの処理を実行させるためのものである。 Next, in step S4, the pseudo-CTC symbol string generator 120 determines whether the following conditions are true or false for the current character position j: (j ≠ 1) and (c[j-1] == c[j]). Note that if j = 1, the condition is determined to be false, so c[j-1] may not be referenced. Alternatively, it may be assumed that c[0] is any arbitrary symbol. If the above condition is true (step S4: YES), the process proceeds to step S5. If the above condition is false (step S4: NO), the process jumps to step S8 in Figure 7. The branching based on the condition determination in step S4 is intended to execute the processes of steps S5 to S7 only for locations where the same character appears consecutively in the input string.
次にステップS5に進んだ場合、次の通りである。即ち、ステップS5は、ループ2の始点である。ここで擬似CTC記号列生成部120は、ループ2に関する条件の制御を行う。ループ2の内部の処理が実行される条件は、(Nb=0)である。Nbの初期値(ステップS3において決定されたNb)が0ではない場合には、ループ2の内部の処理は一度も実行されない。Nbの初期値が0である場合は、Nbの値が0である間、ループ2の処理を繰り返す。Nbの値が0ではなくなったときに、ループ2を抜け出す。なお、ループ2の終点は、ステップS7である。 Next, when the process proceeds to step S5, the following occurs. That is, step S5 is the start point of loop 2. Here, the pseudo-CTC symbol string generation unit 120 controls the conditions related to loop 2. The condition for executing the processing inside loop 2 is ( Nb = 0). If the initial value of Nb ( Nb determined in step S3) is not 0, the processing inside loop 2 is never executed. If the initial value of Nb is 0, the processing of loop 2 is repeated while the value of Nb is 0. When the value of Nb is no longer 0, loop 2 is exited. The end point of loop 2 is step S7.
ステップS6は、ループ2の内部における唯一のステップである。ステップS6において、擬似CTC記号列生成部120は、Pb(n)に従い、確率的にブランク記号<blank>の連続数Nbを選択する。なお、Nbの選択を行う都度、異なる確率的要素に基づいた選択を行うこととする。つまり、Nbの選択を繰り返すうちに、Nbとして0以外の値が選択されることが期待できる。 Step S6 is the only step in loop 2. In step S6, the pseudo CTC symbol string generator 120 probabilistically selects the number Nb of consecutive blank symbols <blank> in accordance with Pb (n). Note that each time Nb is selected, it is selected based on a different probabilistic factor. In other words, as the selection of Nb is repeated, it is expected that a value other than 0 will be selected as Nb .
ステップS7は、ループ2の終点である。前記の(Nb=0)の条件が真である場合には、ループ2の処理を繰り返す。(Nb=0)の条件が偽である場合には、ループ2を抜け出して次の図7のステップS8に進む。つまり、ループ2を抜け出した時点で、Nbとして0以外の値が選択されている。 Step S7 is the end point of Loop 2. If the condition (N b = 0) is true, the processing of Loop 2 is repeated. If the condition (N b = 0) is false, Loop 2 is exited and the process proceeds to the next step S8 in Fig. 7. In other words, at the point when Loop 2 is exited, a value other than 0 has been selected as Nb .
図7のステップS8において、擬似CTC記号列生成部120は、既に決定されているNbの値に基づいて、Nb個のブランク記号<blank>を、その時点での記号列ai(ハット)の後側(通常は、右側)に連結する。 In step S8 of FIG. 7, the pseudo-CTC symbol string generator 120 concatenates N b blank symbols <blank> to the rear (usually, to the right) of the current symbol string a i (hat) based on the value of N b that has already been determined.
次にステップS9において、擬似CTC記号列生成部120は、予め求められているPc(n)に従い、確率的に文字(ブランク記号以外の記号)の連続数Ncを選択する。つまり、擬似CTC記号列生成部120は、予め得られた統計に基づいて且つランダムな要素にしたがって連続数Ncを選択する。つまり、確率がゼロでない限りは、Nc=0,1,2,・・・のいずれかであり得る。次に、擬似CTC記号列生成部120は、連続するNc個(Ncは、本ステップにおいて選択された値)の文字c[j]を、その時点での記号列ai(ハット)の後側(通常は、右側)に連結する。 Next, in step S9, the pseudo CTC symbol string generator 120 probabilistically selects the number of consecutive characters (symbols other than blank symbols) Nc in accordance with the predetermined Pc (n). That is, the pseudo CTC symbol string generator 120 selects the number of consecutive characters Nc based on previously obtained statistics and in accordance with a random element. That is, Nc can be any of 0, 1, 2, ... as long as the probability is not zero. Next, the pseudo CTC symbol string generator 120 concatenates Nc consecutive characters c[j] ( Nc is the value selected in this step) to the rear (usually, to the right) of the current symbol string ai (hat).
ステップS10は、ループ1の終点である。前記の条件の通り、jの値を+1(増分1)して、その結果としてjの値が1,2,・・・,Jのいずれかである限りは、ループ1の処理を繰り返す。繰り返しの条件が満たされなくなるとき、即ち、Jを増分することによってjの値がJ+1に達する場合には、ループ1を抜け出して次のS11に進む。つまり、ループ1を抜け出した時点で、変換元の文字列における文字c[1]からc[J]までの処理が完了している。 Step S10 is the end point of Loop 1. As per the above condition, the value of j is incremented by 1 (incremented by 1), and the processing of Loop 1 is repeated as long as the resulting value of j is 1, 2, ..., J. When the condition for repetition is no longer met, that is, when incrementing J causes the value of j to reach J+1, Loop 1 is exited and processing proceeds to the next step, S11. In other words, when Loop 1 is exited, processing of characters c[1] through c[J] in the source string is completed.
次にステップS11において、擬似CTC記号列生成部120は、予め求められているPb(n)に従い、確率的にブランク記号<blank>の連続数Nbを選択する。つまり、擬似CTC記号列生成部120は、予め得られた統計に基づいて且つランダムな要素にしたがって連続数Nbを選択する。つまり、確率がゼロでない限りは、Nb=0,1,2,・・・のいずれかであり得る。次に、擬似CTC記号列生成部120は、連続するNb個(Nbは、本ステップにおいて選択された値)のブランク記号<blank>を、その時点での記号列ai(ハット)の最後に連結する。 Next, in step S11, the pseudo CTC symbol string generator 120 probabilistically selects the number Nb of consecutive blank symbols <blank> in accordance with the predetermined Pb (n). That is, the pseudo CTC symbol string generator 120 selects the number Nb of consecutive symbols based on previously obtained statistics and in accordance with a random element. That is, Nb can be any of 0, 1, 2, ... as long as the probability is not zero. Next, the pseudo CTC symbol string generator 120 concatenates Nb consecutive blank symbols <blank> ( Nb is the value selected in this step) to the end of the current symbol string ai (hat).
このフローチャートで示す処理のうち、ステップS1の処理を初期化処理と捉えることができる。また、ステップS3からS8までの処理を第1フェーズの処理と捉えることができる。第1フェーズの処理は、連続するブランク記号<blank>の連続数を決めてその数のブランク記号<blank>を生成すべき文字列の一部として連結する処理である。また、ステップS9の処理を第2フェーズの処理と捉えることができる。第2フェーズの処理は、連続する文字(ブランク記号以外)の連続数を決めてその数の文字生成すべき文字列の一部として連結する処理である。第1フェーズの処理と第2フェーズの処理とは、変換元のテキスト文字列に含まれる各文字(先頭から順に)について繰り返される(ステップS2とステップS10とで制御されるループ1の処理)。そして、ステップS11の処理を第3フェーズの処理と捉えることができる。第3フェーズの処理は、上記のループ1の処理の後に、即ち入力文字列の最後の文字の後に続くブランク記号<blank>の連続数を決めてその数のブランク記号<blank>を生成すべき文字列の一部として連結する処理である。 Of the processes shown in this flowchart, step S1 can be considered initialization processing. Steps S3 through S8 can be considered first-phase processing. The first-phase processing determines the number of consecutive blank symbols <blank> and concatenates that number of blank symbols <blank> as part of the string to be generated. Step S9 can be considered second-phase processing. The second-phase processing determines the number of consecutive characters (other than blank symbols) and concatenates that number of characters as part of the string to be generated. The first and second phases are repeated for each character (starting from the beginning) contained in the source text string (loop 1 processing controlled by steps S2 and S10). Step S11 can be considered third-phase processing. The third-phase processing follows loop 1 above, i.e., determines the number of consecutive blank symbols <blank> following the last character of the input string and concatenates that number of blank symbols <blank> as part of the string to be generated.
ここで、実例を用いて、上記のフローチャートの処理を説明する。例として、変換元のテキスト文字列が「明日はいい天気」である場合を想定する。 Here, we will explain the processing of the above flowchart using an actual example. As an example, let's assume that the source text string is "Tomorrow will be a nice day."
<第1フェーズの処理>
前述のフローチャートのステップS3における処理として、算出済みのPb(n)にしたがって、確率的にブランク記号<blank>の連続数であるNbを選択する。ここでは選択されたNbが3である場合を想定する。Nb=3が選択される確率は、前記の例ではPb(3)=1/4である。前述のフローチャートのステップS8における処理として、ai(ハット)に3個のブランク記号<blank>を連結すると、ai(ハット)=「_/_/_」となる。ただし、スラッシュは、便宜的に挿入している記号間の区切りである。
<First Phase Processing>
In the process of step S3 of the above-mentioned flowchart, Nb, which is the number of consecutive blank symbols <blank>, is selected probabilistically according to the calculated Pb (n). Here, it is assumed that the selected Nb is 3. In the above example, the probability that Nb = 3 is selected is Pb (3) = 1/4. In the process of step S8 of the above-mentioned flowchart, when three blank symbols <blank> are concatenated to ai (hat), ai (hat) = "_/_/_". Here, the slashes are inserted as separators between symbols for convenience.
<第2フェーズの処理>
前述のフローチャートのステップS9における処理として、算出済みのPc(n)にしたがって、確率的にブランク以外の記号(つまり、文字)の連続数であるNcを選択する。選択されたNcが2である場合を想定する。ここではNc=2が選択される確率は、前記の例ではPc(2)=1/3である。そして、Nc個(即ちここでは2個)の文字「明」の連続を、ai(ハット)に連結する。すると、ai(ハット)=「_/_/_/明/明」となる。スラッシュは、便宜的に挿入している記号間の区切りである。
<Second Phase Processing>
In the process of step S9 of the above-mentioned flowchart, Nc, which is the number of consecutive symbols (i.e., characters) other than blanks, is selected probabilistically according to the calculated Pc (n). Assume that the selected Nc is 2. Here, the probability that Nc = 2 will be selected is Pc (2) = 1/3 in the above example. Then, a sequence of Nc characters (i.e., two in this case) "明" is concatenated with ai (hat). Then, ai (hat) = "_/_/_/明/明". The slashes are inserted as separators between symbols for convenience.
<第1フェーズと第2フェーズの繰り返し>
入力文字列に含まれる残りの文字である「日」、「は」、「い」、「い」、「天」、「気」のそれぞれについても、上記の第1フェーズおよび第2フェーズの処理が繰り返される。
<Repeat the first and second phases>
The above first and second phase processes are repeated for each of the remaining characters in the input character string: "hi", "ha", "i", "i", "ten", and "ki".
<第3フェーズの処理>
上記の繰り返し処理が終了した後に、第3フェーズの処理を行うことにより、CTC記号列に、最後に連続するブランク記号<blank>が付加される。
<Third Phase Processing>
After the above-mentioned repetitive processing is completed, the third phase processing is performed, and consecutive blank symbols <blank> are added to the end of the CTC symbol string.
なお、入力文字列内において同一の文字が連続する場合(「明日はいい天気」における「いい」が該当)には、その連続する文字(「い」と「い」)の間のブランク記号<blank>の数Nbは0にはならない。このことは、フローチャート内のステップS5からS7までの処理によって保証される。 If the same character is repeated in an input character string (such as "ii" in "tomorrow will be a good day"), the number Nb of blank symbols between the consecutive characters ("ii") will not be 0. This is guaranteed by the processing in steps S5 to S7 in the flowchart.
以上のようにして、「明日はいい天気」という文字列を基に、例えば、「_/_/_/明/明/_/日/日/_/_/は/い/_/い/_/天/天/気/_/_」などといったCTC記号列が出力される。なお、N個のCTC記号列ai(ハット)のそれぞれは、確率的要素(文字の連続数またはブランク記号<blank>の連続数)に基づいて生成されるため、偶然に一致する場合の組を除いて互いに異なる記号列となることが充分に期待される。 In this way, based on the character string "Tomorrow will be a nice day," a CTC symbol string such as "__/__/__/min/min/__/day/day/__/__/ha/hi/__/i/__/ten/ten/ki/__/_" is output. Note that since each of the N CTC symbol strings a i (hat) is generated based on a probabilistic element (the number of consecutive characters or the number of consecutive blank symbols <blank>), it is fully expected that the symbol strings will be different from one another except for pairs that match by chance.
[推論時の処理]
次に、モデルの学習が完了した状態における音声認識装置1の推論時の処理について説明する。なお、推論を実行する前提として、目的とする領域のテキストデータを用いたEncoderhの再学習も完了している。
[Processing during inference]
Next, a description will be given of the inference process of the speech recognition device 1 after model training has been completed. Note that, as a prerequisite for executing inference, re-training of Encoder h using text data in the target region has also been completed.
入力される認識対象の音声xに対して、音声認識装置1は、下の式(42)によって、出力特徴量hhを算出する。また、音声認識装置1は、下の式(43)によって、特徴量hhを基に、CTC記号列a(ハット)を求める。 For input speech x to be recognized, the speech recognition device 1 calculates output feature quantities hh using the following equation (42): Furthermore, the speech recognition device 1 obtains a CTC symbol string a (hat) based on the feature quantities hh using the following equation (43):
そして、音声認識装置1は、従来技術におけるCTC音声認識の手法と同様に、求められたCTC記号列a(ハット)に含まれる同一文字の連続を1文字にまとめるとともに、ブランク記号<blank>を削除することにより、音声認識結果のテキストを得る。つまり、音声認識装置1は、出力記号列(a(ハット))の中で繰り返されている文字を集約するとともに、当該出力記号列に含まれるブランク記号を削除することによって得られる文字列を音声認識結果として出力する。 Then, similar to conventional CTC speech recognition techniques, the speech recognition device 1 combines successive occurrences of the same character contained in the obtained CTC symbol string a (hat) into a single character and deletes blank symbols <blank> to obtain text as the speech recognition result. In other words, the speech recognition device 1 combines repeated characters in the output symbol string (a (hat)) and outputs the character string obtained by deleting blank symbols contained in the output symbol string as the speech recognition result.
図8は、本実施形態の音声認識装置1の内部構成の例を示すブロック図である。音声認識装置1は、コンピューターを用いて実現され得る。図示するように、そのコンピューターは、中央処理装置901と、RAM902と、入出力ポート903と、入出力デバイス904や905等と、バス906と、を含んで構成される。コンピューター自体は、既存技術を用いて実現可能である。中央処理装置901は、RAM902等から読み込んだプログラムに含まれる命令を実行する。中央処理装置901は、各命令にしたがって、RAM902にデータを書き込んだり、RAM902からデータを読み出したり、算術演算や論理演算を行ったりする。RAM902は、データやプログラムを記憶する。RAM902に含まれる各要素は、アドレスを持ち、アドレスを用いてアクセスされ得るものである。なお、RAMは、「ランダムアクセスメモリー」の略である。入出力ポート903は、中央処理装置901が外部の入出力デバイス等とデータのやり取りを行うためのポートである。入出力デバイス904や905は、入出力デバイスである。入出力デバイス904や905は、入出力ポート903を介して中央処理装置901との間でデータをやりとりする。バス906は、コンピューター内部で使用される共通の通信路である。例えば、中央処理装置901は、バス906を介してRAM902のデータを読んだり書いたりする。また、例えば、中央処理装置901は、バス906を介して入出力ポートにアクセスする。 Figure 8 is a block diagram showing an example of the internal configuration of the speech recognition device 1 of this embodiment. The speech recognition device 1 can be realized using a computer. As shown in the figure, the computer includes a central processing unit 901, RAM 902, input/output port 903, input/output devices 904 and 905, etc., and bus 906. The computer itself can be realized using existing technology. The central processing unit 901 executes instructions contained in a program read from RAM 902, etc. In accordance with each instruction, the central processing unit 901 writes data to RAM 902, reads data from RAM 902, and performs arithmetic and logical operations. RAM 902 stores data and programs. Each element contained in RAM 902 has an address and can be accessed using the address. Note that RAM is an abbreviation for "random access memory." The input/output port 903 is a port through which the central processing unit 901 exchanges data with external input/output devices, etc. The input/output devices 904 and 905 are input/output devices. Input/output devices 904 and 905 exchange data with the central processing unit 901 via the input/output port 903. The bus 906 is a common communication path used within the computer. For example, the central processing unit 901 reads and writes data from RAM 902 via the bus 906. Also, for example, the central processing unit 901 accesses the input/output port via the bus 906.
なお、上述した実施形態における音声認識装置1の少なくとも一部の機能をコンピューターで実現することができる。その場合、この機能を実現するためのプログラムをコンピューター読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピューターシステムに読み込ませ、実行することによって実現しても良い。なお、ここでいう「コンピューターシステム」とは、OSや周辺機器等のハードウェアを含むものとする。また、「コンピューター読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD-ROM、DVD-ROM、USBメモリー等の可搬媒体、コンピューターシステムに内蔵されるハードディスク等の記憶装置のことをいう。つまり、「コンピューター読み取り可能な記録媒体」とは、非一過性の(non-transitory)コンピューター読み取り可能な記録媒体であってよい。さらに「コンピューター読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムを送信する場合の通信線のように、一時的に、動的にプログラムを保持するもの、その場合のサーバーやクライアントとなるコンピューターシステム内部の揮発性メモリーのように、一定時間プログラムを保持しているものも含んでも良い。また上記プログラムは、前述した機能の一部を実現するためのものであっても良く、さらに前述した機能をコンピューターシステムにすでに記録されているプログラムとの組み合わせで実現できるものであっても良い。 At least some of the functions of the speech recognition device 1 in the above-described embodiment can be implemented by a computer. In this case, a program for implementing this function may be recorded on a computer-readable recording medium, and the program may be loaded into a computer system and executed. Note that the term "computer system" here includes hardware such as an OS and peripheral devices. Furthermore, "computer-readable recording medium" refers to portable media such as flexible disks, optical magnetic disks, ROMs, CD-ROMs, DVD-ROMs, and USB memory, as well as storage devices such as hard disks built into computer systems. In other words, a "computer-readable recording medium" may be a non-transitory computer-readable recording medium. Furthermore, "computer-readable recording medium" may also include media that temporarily and dynamically store programs, such as communication lines used when transmitting programs over networks like the Internet or telephone lines, or media that store programs for a certain period of time, such as volatile memory within the computer systems that serve as servers or clients in such cases. The program may be designed to implement some of the aforementioned functions, or may be capable of implementing the aforementioned functions in combination with a program already stored in the computer system.
なお、ニューラルネットワークの学習(パラメーターの更新)においては、算出された損失に基づく誤差逆伝播法を用いることができる。 In addition, backpropagation based on the calculated loss can be used to train neural networks (update parameters).
以上、実施形態を説明したが、本発明はさらに下記のような変形例でも実施することが可能である。なお、複数の実施形態および変形例を、組み合わせることが可能な限りにおいて、組み合わせて実施してもよい。 The above describes an embodiment, but the present invention can also be implemented in the following modified forms. Note that multiple embodiments and modified forms may be combined to the extent possible.
[変形例1]
上記実施形態では、エンコーダーを3階層(第1層エンコーダー部30(Encoderl・30)と、第2層エンコーダー部40(Encoderm・40)と、第3層エンコーダー部50(Encoderh・50))で実現した。エンコーダーの階層数を他の数としてもよい。例えば、エンコーダーの階層数を4以上としてもよい。そのような場合にも、少なくともエンコーダーの最終層(高レベル側)を含む層について、目的領域のテキストに基づく適応化を行えるようにする。
[Modification 1]
In the above embodiment, the encoder is implemented with three layers (a first layer encoder unit 30 (Encoder l 30), a second layer encoder unit 40 (Encoder m 40), and a third layer encoder unit 50 (Encoder h 50)). The number of layers of the encoder may be other numbers. For example, the number of layers of the encoder may be four or more. Even in such cases, adaptation based on the text of the target region should be possible for at least the layers including the final layer (high-level side) of the encoder.
[変形例2]
図1に示した音声認識装置1の全体を実施する代わりに、図4に示したモデル適応化装置2のみを実施してもよい。その場合にも、モデル適応化装置2は、音声認識モデルの適応化を行うことができる。つまり、モデル適応化装置2は、目的領域のテキストに基づいて、音声認識モデルが目的領域に合った音声認識結果の文字列を出力するように、適応化を行うことができる。
[Modification 2]
Instead of implementing the entire speech recognition device 1 shown in Fig. 1, only the model adaptation device 2 shown in Fig. 4 may be implemented. In this case, the model adaptation device 2 can still adapt the speech recognition model. In other words, the model adaptation device 2 can adapt the speech recognition model based on the text in the target domain so that it outputs a character string as a speech recognition result that matches the target domain.
[変形例3]
話題(分野、領域)ごとに異なるEncoderh・50の再学習を予め行っておいてもよい。その場合には、音声認識対象の話題に合ったEncoderh・50をその都度選択することにより、話題に合った音声認識結果の文字列が出力されることとなる。また、逆に、その都度、目的とする話題のテキストを用いて、Encoderhの学習を行ってもよい。
[Modification 3]
A different Encoder h 50 may be retrained in advance for each topic (field, area). In this case, by selecting the Encoder h 50 that matches the topic of the speech recognition target each time, a character string of the speech recognition result that matches the topic will be output. Conversely, the Encoder h may be trained each time using text on the target topic.
[変形例4]
上記実施形態では、Encoderh・50の再学習のために、擬似CTC記号列生成部120が擬似的なCTC記号列を生成した。変形例として、擬似CTC記号列生成部120を設ける代わりに、目的とする領域に属する記号列(擬似CTC記号列に相当するもの)を外部から与えるようにしてもよい。この場合にも、Adapterは、その記号列に基づいて、Encoderh・50に入力するための特徴量を算出して、出力する。
[Modification 4]
In the above embodiment, the pseudo CTC symbol string generator 120 generates a pseudo CTC symbol string for relearning the Encoder h -50. As a modified example, instead of providing the pseudo CTC symbol string generator 120, a symbol string (corresponding to a pseudo CTC symbol string) belonging to a target region may be provided from outside. In this case as well, the Adapter calculates and outputs features to be input to the Encoder h -50 based on the symbol string.
[変形例5]
変形例5として、テキスト文字列を疑似的なCTC記号列に変換する前に、テキスト文字列における文字の置換処理を行ってもよい。このような置換処理を行うことにより、テキスト文字列は、Encoderl・30が出力する文字列の誤りのパターンに似るという効果がある。そして、そのような置換処理後のテキスト文字列を基に、擬似的なCTC記号列を生成するようにする。つまり、このような誤りを含み得る文字列に対応するCTC記号列を基に、Adapterを介して、Encoderh・50の再学習を行うことができる。これにより、認識性能のさらなる向上を期待することができる。
[Modification 5]
As a fifth modification, before converting a text string into a pseudo-CTC symbol string, a character substitution process may be performed on the text string. This substitution process has the effect of making the text string resemble the error pattern of the string output by Encoder l 30. Then, a pseudo-CTC symbol string is generated based on the text string after this substitution process. In other words, Encoder h 50 can be retrained via Adapter based on the CTC symbol string corresponding to such a string that may contain an error. This is expected to further improve recognition performance.
図9は、音声認識装置1内における、この変形例5による置換処理のための部分の機能構成を示すブロック図である。図示するように、変形例5による音声認識装置1(モデル適応化装置2)は、置換処理部115を備える。置換処理部115は、目標領域テキスト供給部110が供給するテキストデータ(文字列)における文字の置換の処理を行う。置換処理部115は、置換後のテキストデータ(文字列)を、擬似CTC記号列生成部120に渡す。変形例5においては、擬似CTC記号列生成部120は、目的領域テキスト供給部110から渡されるテキスト文字列を基に、置換処理部115が文字の置換を行った後の文字列を用いて、擬似的なCTC記号列を生成する。 Figure 9 is a block diagram showing the functional configuration of the portion of the speech recognition device 1 that performs the replacement process according to Variation 5. As shown in the figure, the speech recognition device 1 (model adaptation device 2) according to Variation 5 includes a replacement processing unit 115. The replacement processing unit 115 performs character replacement processing in the text data (character string) supplied by the target area text supply unit 110. The replacement processing unit 115 passes the text data (character string) after replacement to the pseudo-CTC symbol string generation unit 120. In Variation 5, the pseudo-CTC symbol string generation unit 120 generates a pseudo-CTC symbol string based on the text string passed from the target area text supply unit 110, using the character string after the replacement processing unit 115 has performed character replacement.
変形例5で用いる出力文字確率分布の算出方法は、次の通りである。学習済みのIntermediate CTCに、Intermediate CTCの学習に使用した音声データを入力する。各音声データに対してEncoderl・30が出力した最も高い確率であるアライメントal(ハット)は下の式(44)で表わされる。 The method for calculating the output character probability distribution used in Modification 5 is as follows: The speech data used to train the Intermediate CTC is input to the trained Intermediate CTC. The alignment a l (hat), which is the highest probability output by Encoder l 30 for each speech data, is expressed by the following equation (44).
このal(ハット)の位置t=t´において、下の式(45)である場合を考える。 Consider the case where the position of a l (hat) is t=t' and the following equation (45) holds.
上記の式(45)の場合に、t=t´の位置において、Encoderl・30が各記号v(vはVの要素)を出力する確率を、下の式(46)の通りとする。つまり、式(46)が表す確率は、記号sが記号vによって置換される確率であり、tに依存しない。 In the case of the above equation (45), the probability that Encoder 1-30 outputs each symbol v (v is an element of V) at the position t=t' is as shown in the following equation (46). In other words, the probability expressed by equation (46) is the probability that symbol s is replaced by symbol v, and does not depend on t.
各学習データの各tにおいて、その位置の記号がs(sは、上記の通りVの要素)であった場合に、上記の式(46)の確率を計算し、計算された確率を平均したものを、出力文字確率分布Ps(v)と定義する。この出力文字確率分布が求まると、下の式(47)で表わされる値は、ある文字sが正解の文字である場合に、Encoderl・30が誤って他の文字s´を出力する確率であるとみなせる。 For each t in each piece of training data, when the symbol at that position is s (s is an element of V as described above), the probability of the above formula (46) is calculated, and the average of the calculated probabilities is defined as the output character probability distribution P s (v). Once this output character probability distribution is determined, the value expressed by the following formula (47) can be considered to be the probability that when a certain character s is the correct character, Encoder 1 30 will erroneously output a different character s'.
すべてのs(sはVの要素)に対し、出力文字確率分布Ps(v)を算出し、テキスト文字列の置換処理に利用することができる。 For every s (where s is an element of V), an output character probability distribution P s (v) can be calculated and used in the text string replacement process.
この変形例5におけるテキスト文字列の置換処理は、次のように行われる。つまり、テキスト文字列cに含まれる各文字c[j]に対して、下の式(48)で表わされる出力文字確率分布(上で獲得済み)にしたがって、文字の置換を行う。 The text string replacement process in Variation 5 is performed as follows: For each character c[j] contained in text string c, the character is replaced according to the output character probability distribution (obtained above) expressed by equation (48) below.
例えばテキスト文字列cが「天気予報です」である場合、c[1]=天である。また、文字の置換に関して、下の式(49)および式(50)の通りであるとする。 For example, if the text string c is "Weather forecast," then c[1] = heaven. Furthermore, the character substitution is as shown in equations (49) and (50) below.
この例の場合には、0.8の確率で天から天への置換処理を行う。即ち、天の文字は変化せず、このような置換によって元の文字列cは変化しない。一方、0.1の確率で天から点への置換処理を行う。即ち、天が点に置換されるため、元の文字列cは「点気予報です」に変化する。上記の置換処理を、文字列cに含まれるすべてのc[j]について行うことによって、Encoderl・30が出力する文字列の誤りに類似することを意図した文字列を得ることができる。そして、このような置換処理に基づいて得られるCTC記号列を用いて、Encoderh・50の再学習を行うことができる。 In this example, a substitution process from "heaven" to "heaven" is performed with a probability of 0.8. That is, the character "heaven" remains unchanged, and the original character string c remains unchanged as a result of this substitution. On the other hand, a substitution process from "heaven" to "dot" is performed with a probability of 0.1. That is, since "heaven" is replaced with a dot, the original character string c changes to "Tenki Yoho Desu" (This is a weather forecast). By performing the above substitution process on all c[j] included in character string c, a character string intended to resemble the error in the character string output by Encoder l -30 can be obtained. Then, the CTC symbol string obtained based on this substitution process can be used to re-learn Encoder h -50.
つまり、変形例5において、置換処理部115は、所定の統計データを基に得られた出力文字確率分布にしたがって、目的とする領域に属するテキスト(目標領域テキスト供給部110から供給されるテキスト)に含まれる文字を別の文字で置換する処理を行う。また、擬似CTC記号列生成部120は、この置換処理部115が出力する置換処理後の目的とする領域に属するテキストを基に、CTC記号列を生成する処理を行う。 In other words, in variant 5, the replacement processing unit 115 performs processing to replace characters included in text belonging to the target region (text supplied from the target region text supply unit 110) with other characters in accordance with an output character probability distribution obtained based on predetermined statistical data. Furthermore, the pseudo CTC symbol string generation unit 120 performs processing to generate a CTC symbol string based on the text belonging to the target region after the replacement processing output by the replacement processing unit 115.
以上、この発明の実施形態(変形例を含む)について図面を参照して詳述してきたが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計等も含まれる。 Embodiments of the present invention (including variations) have been described in detail above with reference to the drawings, but the specific configuration is not limited to these embodiments and includes designs that do not deviate from the gist of the present invention.
以上説明したように、本実施形態(変形例を含む)では、テキストデータのみによってend-to-end音声認識モデルを適応化することができる。つまり、テキストデータのみで(音声データなしで)、音声認識モデルをドメイン適応させ、対象ドメインの認識精度を向上させることが可能である。 As described above, in this embodiment (including the modified examples), the end-to-end speech recognition model can be adapted using only text data. In other words, it is possible to domain-adapt the speech recognition model using only text data (without speech data) and improve the recognition accuracy of the target domain.
[構成の効果の検証]
上で説明した実施形態による音声認識装置1の効果を検証するための実証実験を行った。実証実験に用いた第1の音声は、音声学に関する学会発表音声等を収録するCSJコーパスである。このCSJコーパスを用いて、Intermediate CTCの学習、およびAdapterの学習を行った。その後、上で学習済みのIntermediate CTCのうちのEncoderhについて、天気予報のテキストデータを用いて、第1再学習手法および第2再学習手法のそれぞれでの再学習を行った。天気予報のテキストデータによる再学習の前後のそれぞれのEncoderhを用いて、第2の音声である天気予報評価セットとCSJコーパス評価セットにおける文字誤り率(CER、Character Error Rate)を算出した。また、テキスト文字列の置換処理(変形例5で説明した処理)がある場合とない場合との文字誤り率を算出した。
[Verification of the effect of the configuration]
A demonstration experiment was conducted to verify the effectiveness of the speech recognition device 1 according to the embodiment described above. The first speech used in the demonstration experiment was the CSJ corpus, which contains speeches presented at conferences on phonetics. Using this CSJ corpus, training of the Intermediate CTC and training of the Adapter were performed. Then, Encoder h of the trained Intermediate CTC was retrained using weather forecast text data using the first and second retraining methods. Character error rates (CERs) were calculated for the weather forecast evaluation set and the CSJ corpus evaluation set, which were the second speech, using Encoder h before and after retraining using the weather forecast text data. Character error rates were also calculated with and without the text string replacement process (the process described in Variation 5).
第1再学習手法および第2再学習手法の両方に共通する実験の諸元は、次の通りである。
特徴量:ログメルスペクトログラム80次元+ピッチ3次元+Δ+ΔΔの合計249次元
文字種:3260種類
The experimental specifications common to both the first and second relearning methods are as follows:
Feature quantity: 80 dimensions of log-mel spectrogram + 3 dimensions of pitch + Δ + ΔΔ, total of 249 dimensions Character types: 3260 types
使用したモデルは、次の通りである。
Convolution: 畳み込みニューラルネットワーク2層
Encoderl: Conformer 6層
Encoderm: Conformer 3層
Encoderh: Conformer 3層
Adapter: Conformer 6層
生成する疑似CTC記号列数N: 64
The model used is as follows:
Convolution: Convolutional neural network, 2 layers Encoder l : Conformer, 6 layers Encoder m : Conformer, 3 layers Encoder h : Conformer, 3 layers Adapter: Conformer, 6 layers Number of pseudo-CTC symbol strings to be generated N: 64
以下は、Encoderh・50の再学習を行うための、第1再学習手法と第2再学習手法のそれぞれの個別の実験諸元と実験結果である。 Below are the individual experimental specifications and experimental results of the first and second relearning methods for relearning Encoder h ·50.
第1再学習手法(ターゲットドメインのテキストのみを用いたドメイン適応)に関する学習用データは、次の通りである。
1)Intermediate CTCの学習: CSJコーパス
2)Adapterの学習: CSJコーパス
3)Encoderhの再学習: 天気予報テキスト1000文
The training data for the first retraining method (domain adaptation using only text from the target domain) is as follows:
1) Intermediate CTC study: CSJ Corpus 2) Adapter study: CSJ Corpus 3) Encoder re -study: 1,000 weather forecast texts
第1再学習手法に関する評価データは、次の通りである。
1)CSJ評価セットの、eval1、eval2、およびeval3
2)天気予報評価音声2時間分 ただし、Encoderhの再学習に使用した天気予報テキスト1000文の音声は含まれていない。
The evaluation data for the first relearning technique is as follows.
1) eval1, eval2, and eval3 from the CSJ evaluation set
2) Two hours of weather forecast evaluation audio. However, this does not include the audio of the 1,000 sentences of weather forecast text used for relearning Encoder h .
第1再学習手法に関する学習諸元は、次の通りである。
1)Intermediate CTCの学習: 100エポック(epoch)中の、validation loss(検証損失)が最も低かったときのエポックを学習したモデルを使用
2)Adapterの学習: 50エポック中、validation loss が最も低かったときのエポックを学習したモデルを使用
3)Encoderhの再学習: 20エポック中、最もCER(Character Error Rate,文字誤り率)の改善が見られたエポックを学習したモデルを使用
なお、疑似CTC文字列数Nは、64である。
The learning parameters for the first re-learning method are as follows:
1) Training of Intermediate CTC: A model trained on the epoch with the lowest validation loss out of 100 epochs was used. 2) Training of Adapter: A model trained on the epoch with the lowest validation loss out of 50 epochs was used. 3) Retraining of Encoder h : A model trained on the epoch with the greatest improvement in CER (Character Error Rate) out of 20 epochs was used. The number of pseudo-CTC character strings N was 64.
下の表1は、Encoderhの再学習(第1再学習手法の場合)の前後におけるCER(文字誤り率)の比較結果を示す。 Table 1 below shows the comparison results of CER (character error rate) before and after re-training Encoder h (in the case of the first re-training method).
上の表1の通り、天気予報評価音声については、テキスト文字列の置換処理がない場合には、CERは、Encoderhの再学習前の18.7%から15.5%に、3.2%改善した。テキスト文字列の置換処理がある場合(変形例5の場合)には、CERは、Encoderhの再学習前の18.7%から13.7%に、5.0%改善した。逆に、CSJコーパスのeval1、eval2、eval3のそれぞれの音声については、当然ながら、Encoderhの再学習を行ったことにより、CERが悪化している。CSJコーパスの評価データで、Encoderhの再学習後において認識精度が劣化したのは、Encoderhが、元のCSJコーパスの話題から天気予報の話題に適応し直したためである。 As shown in Table 1 above, for the weather forecast evaluation speech, when the text string replacement process was not performed, the CER improved by 3.2%, from 18.7% before Encoder h 's relearning to 15.5%. When the text string replacement process was performed (in the case of Variation 5), the CER improved by 5.0%, from 18.7% before Encoder h 's relearning to 13.7%. Conversely, for the speech of eval1, eval2, and eval3 in the CSJ corpus, the CER naturally deteriorated after Encoder h was relearned. The reason why recognition accuracy deteriorated after Encoder h 's relearning in the evaluation data of the CSJ corpus was because Encoder h was re-adapted from the topic of the original CSJ corpus to the topic of weather forecasts.
天気予報評価音声についての改善の具体例(ただし、テキスト文字列の置換処理がある場合)は、下記の通りである。
評価音声の発話: 「予想最低気温です」
Encoderhの再学習前の認識結果:「予想最適基音です」
Encoderhの再学習後の認識結果:「予想最低気温です」
A specific example of an improvement to the weather forecast evaluation voice (when a text string replacement process is performed) is as follows.
Evaluation voice utterance: "This is the predicted minimum temperature."
Recognition result of Encoder h before relearning: "Predicted optimal fundamental tone"
Recognition result after Encoder h retraining: "This is the predicted minimum temperature."
以上のように、ここに記した実証実験では、天気予報のテキストデータのみを用いてEncoderhの再学習を行い、推論時に天気予報の話題に適した記号列を出力させることが可能となったことを示せた。 As described above, the demonstration experiment described here demonstrated that Encoder h was retrained using only weather forecast text data, and that it was possible to output symbol strings appropriate for the topic of weather forecasts during inference.
第2再学習手法(ターゲットドメインのテキストと、ソースドメインの音声テキスト対とを用いたドメイン適応)に関する学習用データは、次の通りである。
1)Intermediate CTCの学習: CSJコーパス
2)Adapterの学習: CSJコーパス
3)Encoderhの再学習: 天気予報テキスト1000文およびCSJコーパス
The training data for the second retraining method (domain adaptation using text in the target domain and a speech-text pair in the source domain) is as follows:
1) Intermediate CTC training: CSJ Corpus 2) Adapter training: CSJ Corpus 3) Encoder retraining : 1,000 weather forecast texts and the CSJ Corpus
第2再学習手法に関する評価データは、次の通りである。
1)CSJ評価セットの、eval2
2)天気予報評価音声2時間分 ただし、Encoderhの再学習に使用した天気予報テキスト1000文の音声は含まれていない。
The evaluation data for the second relearning method is as follows.
1) eval2 of the CSJ evaluation set
2) Two hours of weather forecast evaluation audio. However, this does not include the audio of the 1,000 sentences of weather forecast text used for relearning Encoder h .
第2再学習手法に関する学習諸元は、次の通りである。
1)Intermediate CTCの学習: 100エポック(epoch)中の、validation loss(検証損失)が最も低かったときのエポックを学習したモデルを使用
2)Adapterの学習: 50エポック中、validation loss が最も低かったときのエポックを学習したモデルを使用
3)Encoderhの再学習: 20エポック中、最もCERの改善が見られたエポックを学習したモデルを使用(下の表2における、第2再学習手法でのEncoderhの再学習後)
ただしエポックに関して、天気予報テキストの学習が一巡した際に1エポックとカウントした。
疑似CTC文字列数Ntは、64である。
疑似CTC文字列と同時に学習するCSJ音声数Nsは、64である。
The learning parameters for the second re-learning method are as follows:
1) Training of Intermediate CTC: Use the model trained at the epoch with the lowest validation loss out of 100 epochs. 2) Training of Adapter: Use the model trained at the epoch with the lowest validation loss out of 50 epochs. 3) Retraining of Encoder h : Use the model trained at the epoch with the greatest improvement in CER out of 20 epochs (after retraining Encoder h using the second retraining method in Table 2 below).
However, regarding epochs, one epoch was counted when the weather forecast text had been learned once.
The number of pseudo CTC character strings Nt is 64.
The number of CSJ speeches Ns to be learned simultaneously with the pseudo-CTC character strings is 64.
下の表2は、Encoderhの再学習(第2再学習手法の場合)の前後におけるCERの比較結果を示す。ただし、表2に示す再学習後の結果は、テキスト文字列の置換処理を行った場合(変形利5)である。 Table 2 below shows the comparison results of CER before and after retraining Encoder h (in the case of the second retraining method). Note that the results after retraining shown in Table 2 are for the case where the text string replacement process (transformation rate 5) was performed.
表2に示す結果において、Encoderhの再学習前と、第2再学習手法でのEncoderhの再学習後との両方において、ソースドメインであるCSJ評価セット(CSJ eval2)のCERは、いずれも、5.2%である。つまり、ソースドメインにおける認識精度は、第2再学習手法での再学習によって劣化していない。一方で、ターゲットドメインである天気予報評価セット(天気予報)におけるCERは、再学習前の18.7%から、第2再学習手法による再学習後の15.3%へと改善されている。 In the results shown in Table 2, the CER for the CSJ evaluation set (CSJ eval2), which is the source domain, is 5.2% both before relearning Encoder h and after relearning Encoder h using the second relearning method. In other words, the recognition accuracy in the source domain is not degraded by relearning using the second relearning method. On the other hand, the CER for the weather forecast evaluation set (weather forecast), which is the target domain, is improved from 18.7% before relearning to 15.3% after relearning using the second relearning method.
表2において、第1再学習手法でのEncoderhの再学習後(4エポックの場合および5エポックの場合)のCERは、比較対象である。これは、ソースドメインの音声認識精度を劣化させずにターゲットドメインの音声認識精度を改善する方法として、テキストデータのみを学習データとして用いた第1再学習手法による再学習を途中で停止させる方法が考えられるためである。つまり、第1再学習手法を用いた場合に、第2再学習手法を用いた場合の天気予報評価セットのCER(15.3%)と同等のCERが達成されるのが、4エポック(CERは15.5%)あるいは5エポック(CERは15.1%)である。第1再学習手法での再学習後4エポックの場合の、CSJ評価セット(CSJ eval2)のCERは5.8%である。また、第1再学習手法での再学習後5エポックの場合の、CSJ評価セット(CSJ eval2)のCERは6.1%である。つまり、4エポックの場合も5エポックの場合も、CSJ評価セット(CSJ eval2)でのCERは、再学習前の5.2%からは劣化している。つまり、ソースドメインの音声認識精度を劣化させないという目的においては、比較対象の第1再学習手法よりも第2再学習手法が有効であることを確認できた。 In Table 2, the CERs after relearning Encoder h using the first relearning method (for 4 epochs and 5 epochs) are compared. This is because stopping relearning using the first relearning method, which uses only text data as training data, midway is considered as a way to improve speech recognition accuracy in the target domain without degrading speech recognition accuracy in the source domain. In other words, when using the first relearning method, a CER equivalent to the CER (15.3%) of the weather forecast evaluation set when using the second relearning method is achieved after 4 epochs (CER is 15.5%) or 5 epochs (CER is 15.1%). The CER of the CSJ evaluation set (CSJ eval2) after 4 epochs of relearning using the first relearning method is 5.8%. Furthermore, after 5 epochs of relearning using the first relearning method, the CER for the CSJ evaluation set (CSJ eval2) was 6.1%. In other words, for both 4 and 5 epochs, the CER for the CSJ evaluation set (CSJ eval2) deteriorated from 5.2% before relearning. In other words, it was confirmed that the second relearning method is more effective than the first relearning method for comparison in terms of not degrading source domain speech recognition accuracy.
以上のように、第1再学習手法と第2再学習手法とは、適宜、使い分けることができる。また、第1再学習手法と第2再学習手法のいずれを用いる場合にも、本実施形態による再学習を行う方法は有効であることを示せた。つまり、予め学習させた汎用音声認識モデルに対し、認識させたい話題の音声に対する認識精度を向上させたい場合を想定する。例えば、流行り始めのスポーツの話題について、音声とテキストとの対のペアが入手できず、テキストのみが入手できる状況であると仮定する。このような状況において、対象スポーツの話題のテキストを用いて、本実施形態の適応化学習(Encoderhの再学習)をすることにより、認識性能を改善することができる。 As described above, the first relearning method and the second relearning method can be used appropriately. Furthermore, it has been shown that the relearning method according to this embodiment is effective when using either the first relearning method or the second relearning method. That is, assume a case where it is desired to improve the recognition accuracy of a pre-trained general-purpose speech recognition model for speech on a desired topic. For example, assume that for a topic about a sport that is just starting to become popular, no speech-text pairs are available, and only the text is available. In such a situation, recognition performance can be improved by performing adaptive training (encoder h relearning) according to this embodiment using text on the topic of the target sport.
本発明は、例えば、音声認識処理や、音声認識のためのモデルの適応化の処理のために利用することができる。このような発明を利用できる業種は、広範囲に渡る。なお、本発明の利用範囲はここに例示したものには限られない。 The present invention can be used, for example, for speech recognition processing and model adaptation processing for speech recognition. Such inventions can be used in a wide range of industries. However, the scope of use of the present invention is not limited to the examples given here.
1 音声認識装置
2 モデル適応化装置
10 音声供給部
20 畳み込みニューラルネットワーク部
30 第1層エンコーダー部(Encoderl)
32 CTC損失計算部
40 第2層エンコーダー部(Encoderm)
42 CTC損失計算部
50 第3層エンコーダー部(Encoderh)
52 CTC損失計算部
110 目的領域テキスト供給部
115 置換処理部
120 擬似CTC記号列生成部(擬似記号列生成部)
130 アダプター部
210 CTC記号列生成部(記号列生成部)
220 平均二乗誤差損失計算部(アダプター部用損失計算部)
230 CTC損失計算部(アダプター部用損失計算部)
901 中央処理装置
902 RAM
903 入出力ポート
904,905 入出力デバイス
906 バス
1 Speech recognition device 2 Model adaptation device 10 Speech supply unit 20 Convolutional neural network unit 30 First layer encoder unit (Encoder 1 )
32 CTC loss calculation unit 40 Second layer encoder unit (Encoder m )
42 CTC loss calculation unit 50 Third layer encoder unit (Encoder h )
52 CTC loss calculation unit 110 target region text supply unit 115 replacement processing unit 120 pseudo CTC symbol string generation unit (pseudo symbol string generation unit)
130 Adapter unit 210 CTC symbol string generator (symbol string generator)
220 Mean square error loss calculation unit (adapter unit loss calculation unit)
230 CTC loss calculation unit (loss calculation unit for adapter unit)
901 Central processing unit 902 RAM
903 Input/output port 904, 905 Input/output device 906 Bus
Claims (8)
目的とする領域に属する記号列を入力し、前記エンコーダー部の最終層のモデルに入力するための特徴量を出力するアダプター部と、
前記目的とする領域に属するテキストを基に、前記テキスト内の文字の繰り返し、または前記テキスト内の文字と文字との間への0個以上のブランク記号の挿入、の少なくともいずれかを行うことによって、前記アダプター部に入力するための前記記号列を生成する擬似記号列生成部と、
を備え、
前記エンコーダー部の前記複数階層のモデルにおけるある階層のモデルから次の階層のモデルへは中間特徴量が渡されるものであり、
前記エンコーダー部は、前記音響特徴量のフレーム列と前記出力記号列との関係に基づく機械学習をした後に、前記アダプター部が出力する前記特徴量を前記エンコーダー部の前記最終層のモデルに入力して前記最終層のモデルからの出力に基づく損失である第1損失を用いて前記最終層のモデルの前記目的とする領域への適応化を行うことを可能として構成された、
音声認識装置。 an encoder unit having a model consisting of multiple layers, which receives a sequence of frames of acoustic features and outputs an output symbol string consisting of a sequence of symbols corresponding to the frames of the acoustic features, and each of the models in the multiple layers is configured to be capable of machine learning;
an adapter unit that receives a symbol string belonging to a target region and outputs a feature quantity to be input to a model in the final layer of the encoder unit;
a pseudo-symbol string generator that generates the symbol string to be input to the adapter unit by performing at least one of repeating characters in the text or inserting zero or more blank symbols between characters in the text, based on the text belonging to the target region;
Equipped with
an intermediate feature is passed from a model in a certain layer to a model in a next layer in the multiple layer models of the encoder unit;
the encoder unit is configured to perform machine learning based on a relationship between a frame sequence of the acoustic features and the output symbol sequence, and then input the features output by the adapter unit to a model of the final layer of the encoder unit, and adapt the model of the final layer to the target domain using a first loss that is a loss based on an output from the model of the final layer.
Voice recognition device.
をさらに備え、
前記擬似記号列生成部は、前記置換処理部が出力する置換処理後の前記目的とする領域に属するテキストを基に、前記記号列を生成する、
請求項1に記載の音声認識装置。 a replacement processing unit that performs processing to replace characters included in the text belonging to the target region with other characters in accordance with an output character probability distribution obtained based on predetermined statistical data;
Furthermore,
the pseudo-symbol string generation unit generates the symbol string based on the text belonging to the target region after the replacement process output by the replacement processing unit.
The speech recognition device according to claim 1 .
前記テキスト内の文字を繰り返す際の同一文字の繰り返し回数を、前記音響特徴量のフレーム列と前記出力記号列との関係に基づいて学習済みの前記エンコーダー部における所定の階層の前記モデルから出力される特徴量に基づいて算出される記号列である中間記号列における同一文字の繰り返し回数に関する統計に基づいて決定し、
前記テキスト内の文字と文字との間に挿入するブランク記号の連続する個数を、前記中間記号列における前記ブランク記号の連続する個数に関する統計に基づいて決定する、
請求項1または2に記載の音声認識装置。 The pseudo-symbol string generation unit
determining the number of times the same character is repeated when repeating characters in the text based on statistics regarding the number of times the same character is repeated in an intermediate symbol string, which is a symbol string calculated based on features output from the model of a predetermined layer in the encoder unit that has been trained based on the relationship between the frame string of the acoustic features and the output symbol string;
determining the number of consecutive blank symbols to be inserted between characters in the text based on statistics regarding the number of consecutive blank symbols in the intermediate symbol string;
3. The speech recognition device according to claim 1 .
前記記号列生成部によって生成された前記記号列に基づいて前記アダプター部が出力する特徴量についての損失である第2損失を算出するアダプター部用損失計算部と、
をさらに備え、
前記アダプター部用損失計算部が算出した前記第2損失を用いて前記アダプター部の機械学習を行えるように構成した、
請求項1から3までのいずれか一項に記載の音声認識装置。 a symbol string generation unit that generates a symbol string to be input to the adapter unit for training the adapter unit based on the intermediate features output from a model of a predetermined layer of the encoder unit based on the acoustic features;
an adapter unit loss calculation unit that calculates a second loss, which is a loss for a feature output by the adapter unit, based on the symbol string generated by the symbol string generation unit;
Furthermore,
The adapter section is configured to perform machine learning on the adapter section using the second loss calculated by the adapter section loss calculation unit.
4. A speech recognition device according to claim 1.
前記アダプター部から出力される特徴量を前提としたときの正解の出力記号列の尤度に基づく損失と、
前記アダプター部から出力される特徴量と前記エンコーダー部において対応する階層のモデルからの出力である特徴量との差を表す損失と、
に基づく前記第2損失を算出する、
請求項4に記載の音声認識装置。 The adapter loss calculation unit
a loss based on the likelihood of a correct output symbol string given the feature values output from the adapter unit;
a loss representing the difference between a feature output from the adapter unit and a feature output from a model of a corresponding layer in the encoder unit;
Calculating the second loss based on
5. The speech recognition device according to claim 4 .
前記出力記号列の中で繰り返されている文字を集約するとともに、前記出力記号列に含まれるブランク記号を削除することによって得られる文字列を音声認識結果として出力する、
請求項1または2に記載の音声認識装置。 The speech recognition device
aggregating repeated characters in the output symbol string and deleting blank symbols contained in the output symbol string, and outputting the resulting character string as a speech recognition result;
3. The speech recognition device according to claim 1 .
請求項1から6までのいずれか一項に記載の音声認識装置。 When adapting the model of the final layer to the target region using the first loss, the encoder unit also performs adaptation based on a third loss obtained from a symbol string output by the model consisting of multiple layers included in the encoder unit based on the frame sequence of the acoustic features and the correct output symbol string corresponding to the frame sequence of the acoustic features.
A speech recognition device according to any one of claims 1 to 6 .
目的とする領域に属する記号列を入力し、前記エンコーダー部の最終層のモデルに入力するための特徴量を出力するアダプター部と、
前記目的とする領域に属するテキストを基に、前記テキスト内の文字の繰り返し、または前記テキスト内の文字と文字との間への0個以上のブランク記号の挿入、の少なくともいずれかを行うことによって、前記アダプター部に入力するための前記記号列を生成する擬似記号列生成部と、
を備え、
前記エンコーダー部の前記複数階層のモデルにおけるある階層のモデルから次の階層のモデルへは中間特徴量が渡されるものであり、
前記エンコーダー部は、前記音響特徴量のフレーム列と前記出力記号列との関係に基づく機械学習をした後に、前記アダプター部が出力する前記特徴量を前記エンコーダー部の前記最終層のモデルに入力して前記最終層のモデルからの出力に基づく損失である第1損失を用いて前記最終層のモデルの前記目的とする領域への適応化を行うことを可能として構成された、
音声認識装置、としてコンピューターを機能させるためのプログラム。 an encoder unit having a model consisting of multiple layers, which receives a sequence of frames of acoustic features and outputs an output symbol string consisting of a sequence of symbols corresponding to the frames of the acoustic features, and each of the models in the multiple layers is configured to be capable of machine learning;
an adapter unit that receives a symbol string belonging to a target region and outputs a feature quantity to be input to a model in the final layer of the encoder unit;
a pseudo-symbol string generator that generates the symbol string to be input to the adapter unit by performing at least one of repeating characters in the text or inserting zero or more blank symbols between characters in the text, based on the text belonging to the target region;
Equipped with
an intermediate feature is passed from a model in a certain layer to a model in a next layer in the multiple layer models of the encoder unit;
the encoder unit is configured to perform machine learning based on a relationship between a frame sequence of the acoustic features and the output symbol sequence, and then input the features output by the adapter unit to a model of the final layer of the encoder unit, and adapt the model of the final layer to the target domain using a first loss that is a loss based on an output from the model of the final layer.
A program that enables a computer to function as a speech recognition device.
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2021188801 | 2021-11-19 | ||
| JP2021188801 | 2021-11-19 |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2023075883A JP2023075883A (en) | 2023-05-31 |
| JP7825441B2 true JP7825441B2 (en) | 2026-03-06 |
Family
ID=86542275
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2022017159A Active JP7825441B2 (en) | 2021-11-19 | 2022-02-07 | Speech recognition device and program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP7825441B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117558263B (en) * | 2024-01-10 | 2024-04-26 | 科大讯飞股份有限公司 | Speech recognition method, device, equipment and readable storage medium |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20210350786A1 (en) | 2020-05-07 | 2021-11-11 | Google Llc | Speech Recognition Using Unspoken Text and Speech Synthesis |
-
2022
- 2022-02-07 JP JP2022017159A patent/JP7825441B2/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20210350786A1 (en) | 2020-05-07 | 2021-11-11 | Google Llc | Speech Recognition Using Unspoken Text and Speech Synthesis |
Non-Patent Citations (1)
| Title |
|---|
| T. Hayasho, 外5名,"Back-Translation-Style Data Augmentation for end-to-end ASR",2018 IEEE Spoken Language Technology Workshop (SLT) [online],2019年02月14日,p.426-433,[取得日 2025年9月24日], 取得先<https://ieeexplore.ieee.org/document/8639619> |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2023075883A (en) | 2023-05-31 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Higuchi et al. | Improved mask-CTC for non-autoregressive end-to-end ASR | |
| CN115440197B (en) | Speech recognition method and system based on domain classification and hot word prefix tree beam search | |
| CN114023316A (en) | TCN-Transformer-CTC-based end-to-end Chinese voice recognition method | |
| US5621859A (en) | Single tree method for grammar directed, very large vocabulary speech recognizer | |
| Sarı et al. | Unsupervised speaker adaptation using attention-based speaker memory for end-to-end ASR | |
| CN113205792A (en) | Mongolian speech synthesis method based on Transformer and WaveNet | |
| CN110556100A (en) | Training method and system of end-to-end speech recognition model | |
| JP2020505650A (en) | Voice recognition system and voice recognition method | |
| WO1992014237A1 (en) | Method for recognizing speech using linguistically-motivated hidden markov models | |
| KR102519618B1 (en) | System and method for end to end neural machine translation | |
| CN112509560A (en) | Voice recognition self-adaption method and system based on cache language model | |
| Stouten et al. | Discovering phone patterns in spoken utterances by non-negative matrix factorization | |
| CN113793600B (en) | Speech recognition method, device, equipment and storage medium | |
| Pakoci et al. | Improvements in Serbian speech recognition using sequence-trained deep neural networks | |
| JP7825441B2 (en) | Speech recognition device and program | |
| Li et al. | Bidirectional LSTM Network with Ordered Neurons for Speech Enhancement. | |
| JP2003208195A5 (en) | ||
| JP4442211B2 (en) | Acoustic model creation method | |
| JP2024027914A (en) | Speech recognition devices and programs | |
| CN118098208A (en) | Method for improving voice recognition effect under automobile loan telephone message examination scene | |
| JPH0895592A (en) | Pattern recognition method | |
| JP2025035715A (en) | Voice recognition device and program | |
| Mak et al. | Maximum penalized likelihood kernel regression for fast adaptation | |
| De Mori et al. | Search and learning strategies for improving hidden Markov models | |
| Li | Cycle-consistent adversarial networks for automatic speech recognition |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A711 Effective date: 20240802 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20240905 |
|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20250107 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20250926 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20251007 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20251128 |
|
| 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: 20260127 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20260224 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7825441 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |