JP7525449B2 - EXPLAINABILITY DEVICE, EXPLAINABILITY METHOD, AND EXPLAINABILITY PROGRAM - Google Patents
EXPLAINABILITY DEVICE, EXPLAINABILITY METHOD, AND EXPLAINABILITY PROGRAM Download PDFInfo
- Publication number
- JP7525449B2 JP7525449B2 JP2021117064A JP2021117064A JP7525449B2 JP 7525449 B2 JP7525449 B2 JP 7525449B2 JP 2021117064 A JP2021117064 A JP 2021117064A JP 2021117064 A JP2021117064 A JP 2021117064A JP 7525449 B2 JP7525449 B2 JP 7525449B2
- Authority
- JP
- Japan
- Prior art keywords
- neighborhood
- segments
- importance
- explainability
- calculation unit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Machine Translation (AREA)
Description
本発明は、機械学習モデルによる推定結果に対する説明可能化手法に関する。 The present invention relates to a method for explaining the results of estimation using a machine learning model.
従来、機械学習モデルによる推定結果に対する説明可能化手法として、C-Shapley等が知られている(例えば、非特許文献1参照)。説明可能化手法は、推測対象のサンプルに対し、どの特徴がどの程度推測結果に影響しているかを表す説明度を算出するものである。
説明可能化手法をテキストに適用する場合は、コーパスとしてラベル付きの文又は文章を用い、出現する単語を特徴として学習モデルを生成する。そして、説明したいサンプルである文又は文章と学習モデルとを入力として説明可能化手法を適用することで、サンプルの持つ各特徴の説明度が得られる。
Conventionally, C-Shapley and the like have been known as methods for making inference results by machine learning models explainable (for example, see Non-Patent Document 1). The explainability method calculates an explanation degree that indicates the extent to which a feature of a sample to be inferred affects an inference result.
When applying an explainability technique to text, a corpus is used with labeled sentences or texts, and a learning model is generated with the words that appear as features.The explainability technique is then applied to the learning model and the sentences or texts that are samples to be explained, to obtain the explainability of each feature of the sample.
ところで、学習サンプルには、意味的に区切られた複数のセグメントによって、一つの文書が構成されているようなコーパスが存在する。例えば、プライバシポリシーのコーパスであるOPP-115がこのような構成であり、セグメントに対してラベルが付与されている(非特許文献2参照)。
このようなコーパスを扱うときに、セグメントに含まれるどの単語がセグメントのラベル推測に貢献したのかを知りたいのではなく、ある文書に含まれるどのセグメントが文書全体の内容を示すラベルの推測に貢献するかを知りたい場合があった。このような場合、出現する単語を特徴として生成された学習モデルを用いて、従来の説明可能化手法を適用しても、サンプルが含む単語ではなく、セグメントに対して説明度を算出する拡張はできなかった。
Incidentally, there are corpora in the training samples where a single document is composed of multiple semantically separated segments. For example, OPP-115, a corpus of privacy policies, has such a structure, and labels are assigned to the segments (see Non-Patent Document 2).
When dealing with such corpora, there are cases where we want to know which segments in a document contribute to inferring the label that indicates the content of the entire document, rather than which words in the segments contributed to inferring the label of the segment. In such cases, even if we applied conventional explainability methods using a learning model generated with the words that appear as features, it was not possible to extend the method to calculate the explainability for the segments rather than the words contained in the sample.
本発明は、セグメントに対する説明度を算出できる説明可能化手法を提供することを目的とする。 The present invention aims to provide an explainability method that can calculate the degree of explainability for a segment.
本発明に係る説明可能化装置は、文書を構成するセグメントに基づくd次元の学習データにより、当該セグメントに付与されたラベルを学習したモデルに対する説明可能化装置であって、対象文書を構成する複数のセグメントのうち、ランダムに選択したc個のセグメントのそれぞれから抽出した一部の特徴量を連結してd次元の特徴ベクトルを生成して前記モデルに入力することを繰り返し、当該モデルの出力を複数取得して統計処理することにより、各ラベルに対する前記対象文書の全体の確信度を計算する全体確信度計算部と、前記対象文書を構成する複数のセグメントのうち、対象セグメントを含むc個をランダムに選択し、選択したセグメントのそれぞれから抽出した一部の特徴量を要素とするd次元の特徴列を、前記対象セグメントの近傍として複数生成する近傍計算部と、前記近傍の特徴列を前記モデルに入力し、各ラベルに対する前記近傍の第1確信度を計算する近傍第1確信度計算部と、ラベル毎の前記第1確信度及び前記全体の確信度の積に基づいて、前記近傍の第1重要度を計算する近傍第1重要度計算部と、前記近傍の特徴列のうち、前記対象セグメントから抽出された部分を所定値に変換した後、前記モデルに入力し、各ラベルに対する前記近傍の第2確信度を計算する近傍第2確信度計算部と、ラベル毎の前記第2確信度及び前記全体の確信度の積に基づいて、前記近傍の第2重要度を計算する近傍第2重要度計算部と、前記第1重要度と前記第2重要度との差分に基づいて前記対象セグメントの説明度を計算する説明度計算部と、を備える。 The explainability device according to the present invention is an explainability device for a model that has learned labels assigned to segments using d-dimensional learning data based on segments that make up a document, and includes an overall confidence level calculation unit that repeatedly connects some features extracted from each of c randomly selected segments out of the multiple segments that make up a target document to generate a d-dimensional feature vector and inputs the d-dimensional feature vector into the model, and calculates the overall confidence level of the target document for each label by obtaining multiple outputs of the model and performing statistical processing; and an overall confidence level calculation unit that randomly selects c segments that include the target segment out of the multiple segments that make up the target document, and generates a d-dimensional feature sequence whose elements are some features extracted from each of the selected segments, and calculates the confidence level of the target segment. The model includes a neighborhood calculation unit that generates multiple neighborhoods of the target segment, a neighborhood first certainty calculation unit that inputs the feature sequence of the neighborhood to the model and calculates a first certainty of the neighborhood for each label, a neighborhood first importance calculation unit that calculates a first importance of the neighborhood based on the product of the first certainty for each label and the overall certainty, a neighborhood second certainty calculation unit that converts a portion of the feature sequence of the neighborhood extracted from the target segment to a predetermined value and then inputs the converted value to the model and calculates a second certainty of the neighborhood for each label, a neighborhood second importance calculation unit that calculates a second importance of the neighborhood based on the product of the second certainty for each label and the overall certainty, and an explanation calculation unit that calculates an explanation of the target segment based on the difference between the first importance and the second importance.
前記全体確信度計算部及び前記近傍計算部において、セグメント毎に所定の規則に従ってd/c個の特徴量が抽出されてもよい。 The overall confidence calculation unit and the neighborhood calculation unit may extract d/c feature quantities for each segment according to a predetermined rule.
前記所定の規則として、出現頻度に基づく指標による評価が上位の単語に対応する特徴量が抽出されてもよい。 The predetermined rule may be to extract features corresponding to words that rank highly in terms of an index based on frequency of occurrence.
前記近傍計算部は、前記対象セグメントより前から選択するセグメント数、及び後から選択するセグメント数を変動させることにより、c個の特徴列を生成してもよい。 The neighborhood calculation unit may generate c feature sequences by varying the number of segments selected before the target segment and the number of segments selected after the target segment.
本発明に係る説明可能化方法は、文書を構成するセグメントに基づくd次元の学習データにより、当該セグメントに付与されたラベルを学習したモデルに対する説明可能化方法であって、対象文書を構成する複数のセグメントのうち、ランダムに選択したc個のセグメントのそれぞれから抽出した一部の特徴量を連結してd次元の特徴ベクトルを生成して前記モデルに入力することを繰り返し、当該モデルの出力を複数取得して統計処理することにより、各ラベルに対する前記対象文書の全体の確信度を計算する全体確信度計算ステップと、前記対象文書を構成する複数のセグメントのうち、対象セグメントを含むc個をランダムに選択し、選択したセグメントのそれぞれから抽出した一部の特徴量を要素とするd次元の特徴列を、前記対象セグメントの近傍として複数生成する近傍計算ステップと、前記近傍の特徴列を前記モデルに入力し、各ラベルに対する前記近傍の第1確信度を計算する近傍第1確信度計算ステップと、ラベル毎の前記第1確信度及び前記全体の確信度の積に基づいて、前記近傍の第1重要度を計算する近傍第1重要度計算ステップと、前記近傍の特徴列のうち、前記対象セグメントから抽出された部分を所定値に変換した後、前記モデルに入力し、各ラベルに対する前記近傍の第2確信度を計算する近傍第2確信度計算ステップと、ラベル毎の前記第2確信度及び前記全体の確信度の積に基づいて、前記近傍の第2重要度を計算する近傍第2重要度計算ステップと、前記第1重要度と前記第2重要度との差分に基づいて前記対象セグメントの説明度を計算する説明度計算ステップと、をコンピュータが実行する。 The explainability method according to the present invention is an explainability method for a model that has learned labels assigned to segments using d-dimensional learning data based on segments that make up a document, and includes an overall confidence level calculation step of: randomly selecting c segments from among the multiple segments that make up the target document, concatenating some of the features extracted from each of the segments to generate a d-dimensional feature vector, and inputting the d-dimensional feature vector into the model, and obtaining multiple outputs of the model and performing statistical processing to calculate the overall confidence level of the target document for each label; and randomly selecting c segments from among the multiple segments that make up the target document, including the target segment, and generating a d-dimensional feature sequence having some of the features extracted from each of the selected segments as elements, as a neighborhood of the target segment, The computer executes a neighborhood calculation step of generating a neighborhood feature sequence, a neighborhood first confidence calculation step of inputting the neighborhood feature sequence to the model and calculating a first confidence level of the neighborhood for each label, a neighborhood first importance calculation step of calculating a first importance level of the neighborhood based on a product of the first confidence level for each label and the overall confidence level, a neighborhood second confidence calculation step of converting a portion of the neighborhood feature sequence extracted from the target segment to a predetermined value and inputting the converted value to the model and calculating a second confidence level of the neighborhood for each label, a neighborhood second importance calculation step of calculating a second importance level of the neighborhood based on a product of the second confidence level for each label and the overall confidence level, and an explanation calculation step of calculating an explanation level of the target segment based on a difference between the first importance level and the second importance level.
本発明に係る説明可能化プログラムは、前記説明可能化装置としてコンピュータを機能させるためのものである。 The explainability program of the present invention is for causing a computer to function as the explainability device.
本発明によれば、セグメントに対する説明度を算出できる。 According to the present invention, it is possible to calculate the degree of explanation for a segment.
以下、本発明の実施形態の一例について説明する。
本実施形態における説明可能化方法では、通常の単語に対して説明度を算出する手法を拡張し、文書を構成するセグメントに対する説明度を算出する。
まず、通常の説明可能化手法を示し、続いて、本実施形態における拡張内容を説明する。
An example of an embodiment of the present invention will now be described.
In the explainability method of this embodiment, the method of calculating the explainability for normal words is expanded to calculate the explainability for segments that make up a document.
First, a general explainability method will be described, and then the extended content in this embodiment will be described.
本実施形態では、テキストに対する機械学習を想定する。コーパスは、文章(セグメント)とそのラベルからなり、文章は、複数の単語からなる。ラベルは、ここでは0又は1の二値ラベルを想定するが、これには限られず、多値であってもよい。 In this embodiment, machine learning on text is assumed. The corpus consists of sentences (segments) and their labels, and the sentences consist of multiple words. Here, the labels are assumed to be binary labels of 0 or 1, but are not limited to this and may be multi-valued.
テキストにおける機械学習の基本的な実現方式は以下の通りである。
(1)コーパスに含まれる文章に出現する単語から、辞書を作成する。すなわち、出現する単語それぞれに対してIDを割り当てる。
(2)コーパスに含まれる文章を、辞書を用いてID配列に変換する。
(3)文章を変換したID配列とラベルとのペアの集合を入力として、学習アルゴリズムを実行し、学習モデルを得る。
The basic implementation of machine learning on text is as follows:
(1) A dictionary is created from words that appear in sentences contained in the corpus, i.e., an ID is assigned to each word that appears.
(2) The sentences contained in the corpus are converted into an ID array using a dictionary.
(3) A learning algorithm is executed using a set of pairs of ID sequences and labels converted from the sentences as input to obtain a learning model.
推測アルゴリズムは、文章を表すID配列と学習モデルとを入力として、推測ラベル、又は各ラベル(0及び1)の確信度(確率)を出力する。
このとき、C-Shapleyでは、次のように説明度を算出する。
The prediction algorithm takes an ID sequence representing a sentence and a learning model as input, and outputs a predicted label or the confidence (probability) of each label (0 and 1).
At this time, in C-Shapley, the explanation degree is calculated as follows.
学習モデルmがID配列に基づくd次元の入力データx=[x1,…,xd]を入力とし、予想値y∈{0,1}の確信度を返すとする。ただし、mは確率的な関数で、Pm(y|x)=P(m(x)=y)となる。
ここで、s⊂{1,2,…,d}かつk∈sとなるsをkの周りの特徴集合と呼ぶ。また、入力データxに対し、特徴集合s={s1,…,sn}で指定された特徴量だけ抽出した列xs={xs1,…xsn}を特徴列と呼ぶ。なお、特徴列xsを以下Sと記述する。
また、Sの中のxkを0に置き換えたものをS*
kとする。
Let m be the learning model that takes d-dimensional input data x = [ x1 , ..., xd ] based on an ID array as input and returns the confidence of the predicted value y ∈ {0, 1}, where m is a probabilistic function, Pm (y|x) = P(m(x) = y).
Here, s where s ⊂ {1, 2, ..., d} and k ∈ s is called the feature set around k. Also, for input data x, a sequence x s = {x s1 , ..., x sn } obtained by extracting only the features specified in the feature set s = {s 1 , ..., sn } is called a feature sequence. Note that the feature sequence x s will be referred to as S below.
Moreover, x k in S is replaced with 0 to obtain S * k .
学習モデルm、入力データxに対し、特徴列Sの重要度vx(S)は、次のように定義される。
vx(S)=Σi log(Pm(yi|S))・Pm(yi|x) …(1)
For a learning model m and input data x, the importance v x (S) of a feature sequence S is defined as follows.
v x (S) = Σ i log (P m (y i | S))・P m (y i | x) ... (1)
入力データx、特徴k、kの近傍N(特徴列Sの集合)に対しての説明度φN
x(k)は、以下のように表される。
φN
x(k):=ΣS∈N c(S)・(vx(S)-vx(S*
k)),
c(S)=2/((|S|+2)(|S|+1)|S|) …(2)
ここで、説明度の対象は、文書に含まれる各単語である。
The explanation level φ N x (k) for input data x, feature k, and a neighborhood N of k (a set of feature sequences S) is expressed as follows.
φ N x (k):=Σ S∈N c(S)・(v x (S)−v x (S * k )),
c(S)=2/((|S|+2)(|S|+1)|S|)...(2)
Here, the object of the explanatory degree is each word contained in the document.
本実施形態では、複数のセグメントに分割できる文書を扱い、説明度の対象はセグメントである。ただし、学習データのラベルは、セグメントに対して付与されており、学習モデルの生成は通常と同様に行われる。すなわち、学習データは、セグメントのID配列に基づくd次元のベクトル及びラベルである。
ここで、この学習モデルと説明対象の文書を入力として、文書を構成するセグメントに対する説明可能化手法を示す。なお、入力される文書は、意味的に予め分割されているものとする。あるいは、既存の分割ツールが利用されてもよい。
In this embodiment, a document that can be divided into multiple segments is handled, and the target of the explainability is the segment. However, the labels of the training data are assigned to the segments, and the generation of the training model is performed in the usual manner. That is, the training data is a d-dimensional vector and a label based on the ID array of the segment.
Here, we will show a method for making the segments that make up a document explainable by using this learning model and the document to be explained as input. Note that the input document is assumed to have been semantically segmented in advance. Alternatively, an existing segmentation tool may be used.
図1は、本実施形態における説明可能化装置1の機能構成を示す図である。
説明可能化装置1は、制御部10及び記憶部20の他、各種の入出力デバイス及び通信デバイス等を備えた情報処理装置(コンピュータ)である。
FIG. 1 is a diagram showing the functional configuration of an
The
制御部10は、説明可能化装置1の全体を制御する部分であり、記憶部20に記憶された各種プログラムを適宜読み出して実行することにより、本実施形態における各機能を実現する。制御部10は、CPUであってよい。
The
記憶部20は、ハードウェア群を説明可能化装置1として機能させるための各種プログラム、及び各種データ等の記憶領域であり、ROM、RAM、フラッシュメモリ又はハードディスクドライブ(HDD)等であってよい。
具体的には、記憶部20は、本実施形態の各機能を制御部10に実行させるためのプログラム(説明可能化プログラム)の他、学習データ、学習モデル等を記憶する。
The
Specifically, the
制御部10は、全体確信度計算部11と、近傍計算部12と、近傍第1確信度計算部13と、近傍第1重要度計算部14と、近傍第2確信度計算部15と、近傍第2重要度計算部16と、説明度計算部17とを備え、これらの機能部により、文書に含まれる対象セグメントの説明度を出力する。
The
ここで、説明可能化装置1が用いる学習モデルは、学習データとなる文書を構成するセグメントに基づくd次元の特徴ベクトルにより、このセグメントに付与されたラベルを学習したものである。すなわち、学習時の入力である特徴ベクトルの次元数をdとする。
The learning model used by the
全体確信度計算部11は、対象文書全体の確信度Pm(y|x)を次のように計算する。
まず、全体確信度計算部11は、対象文書を構成する複数のセグメントのうち、c個をランダムに選択し、選択したc個のセグメントそれぞれの特徴量をd/cの次元数に圧縮、すなわちd/c個の特徴量(ID)を抽出する。続いて、全体確信度計算部11は、圧縮した特徴量を連結してd次元の特徴ベクトルを生成し、モデルに入力してラベル毎の確信度を得る。
全体確信度計算部11は、これをj回繰り返し、得られた確信度を統計処理(例えば、平均)し、各ラベルに対する対象文書の全体の確信度を計算する。
例えば、0又は1の二値ラベルの場合、Pm(1|x)、及びPm(0|x)=1-Pm(1|x)が算出される。
The overall certainty
First, the overall
The overall confidence
For example, for a binary label of 0 or 1, P m (1|x) and P m (0|x)=1-P m (1|x) are calculated.
ここで、全体確信度計算部11は、セグメント毎に所定の規則に従ってd/c個の特徴量を抽出するが、例えば、先頭からd/c個の単語、あるいは、出現頻度に基づく指標(例えば、TF-IDF)による評価が上位の単語に対応する特徴量を抽出する。
Here, the overall
近傍計算部12は、対象文書のk番目にある対象セグメントの近傍Nを次のように計算する。
すなわち、近傍計算部12は、対象文書を構成する複数のセグメントのうち、対象セグメントを含むc個のセグメントをランダムに選択し、選択したセグメントのそれぞれから抽出した一部の特徴量を要素とするd次元の特徴列を、対象セグメントの近傍として複数生成する。
The
That is, the
近傍計算部12は、例えば、対象セグメントより前から選択するセグメント数、及び後から選択するセグメント数を順に変動させることにより、c個の特徴列を生成してもよい。
The
図2は、本実施形態における近傍の計算処理を例示するフローチャートである。
ステップS1において、近傍計算部12は、対象文書に含まれる複数のセグメントのうち、対象セグメントsegを選ぶ。なお、segは、特徴量(ID)の配列とする。
ステップS2において、近傍計算部12は、変数iを1に初期化する。
FIG. 2 is a flowchart illustrating a neighborhood calculation process according to the present embodiment.
In step S1, the
In step S2, the
ステップS3において、近傍計算部12は、対象文書中で、segより前のセグメントをi-1個(seg1,seg2,…,segi-1)、segより後ろのセグメントをc-i個(segi+1,segi+2,…,segc)ランダムに選ぶ。
In step S3, the
ステップS4において、近傍計算部12は、対象セグメントseg、及びステップS3で選択されたセグメントsegjを、前述の全体確信度計算部と同様に長さd/cに圧縮し、seg’、seg’jとする。
ここで、近傍計算部12は、seg’、seg’jを順につなげた特徴列である、
Si=seg'1, seg'2, …, seg'i-1, seg', seg'i+1, seg'i+2, …, seg'c
を生成する。また、Siにおけるsegに対応する長さd/cの全要素を0の列と置き換えたものをS*
iとする。
In step S4, the
Here, the
S i =seg' 1 , seg' 2 , ..., seg' i-1 , seg', seg' i+1 , seg' i+2 , ..., seg' c
In addition, let S * i be the result of replacing all elements of S i with length d/c corresponding to seg with a string of 0s.
ステップS5において、近傍計算部12は、iに1を加算する。
ステップS6において、近傍計算部12は、i>cか否かを判定する。この判定がYESの場合、処理はステップS7に移り、判定がNOの場合、処理はステップS3に戻る。
In step S5, the
In step S6, the
ステップS7において、近傍計算部12は、近傍N={S1,S2,…,Sc}を出力して処理を終了する。
In step S7, the
なお、この処理は近傍Nを計算する手順の一例であり、c個のセグメントの選択方法はこれに限られない。 Note that this process is just one example of a procedure for calculating the neighborhood N, and the method for selecting c segments is not limited to this.
近傍第1確信度計算部13は、近傍Nに含まれる特徴列Siをモデルに入力し、各ラベルに対するSi毎の第1確信度Pm(y|Si)(y={0,1})を計算する。
例えば、0又は1の二値ラベルの場合、Pm(1|Si)=m(Si)、及びPm(0|Si)=1-m(Si)が算出される。
The neighborhood first confidence
For example, for a binary label of 0 or 1, P m (1|S i )=m(S i ) and P m (0|S i )=1-m(S i ) are calculated.
近傍第1重要度計算部14は、ラベル毎の第1確信度及び全体の確信度の積に基づいて、前述の式(1)に従ってSi毎の第1重要度vx(Si)を計算する。
The neighborhood first
近傍第2確信度計算部15は、近傍Nの特徴列Siのうち、対象セグメントsegから抽出された部分を全て所定値(例えば、0)に変換した後、モデルに入力し、各ラベルに対するSi毎の第2確信度Pm(y|S*
i)を計算する。
The neighborhood second confidence
近傍第2重要度計算部16は、ラベル毎の第2確信度及び全体の確信度の積に基づいて、前述の式(1)に従ってSi毎の第2重要度vx(S*
i)を計算する。
The neighborhood second
説明度計算部17は、第1重要度と第2重要度との差分に基づいて、前述の式(2)に従って対象セグメントの説明度を計算する。
The
これらの機能部により実現する説明可能化方法は、従来の手法の拡張である。比較のため、次に従来の手順を示す。
図3は、従来装置による説明可能化方法の流れを示すフローチャートである。
The explainability method realized by these functional units is an extension of the conventional method. For comparison, the conventional procedure is shown below.
FIG. 3 is a flowchart showing the flow of an explainable method according to a conventional device.
ステップS11において、従来装置は、ラベル付きのセグメント(学習データ)からなるコーパスから学習モデルを生成する。 In step S11, the conventional device generates a learning model from a corpus of labeled segments (learning data).
ステップS12において、従来装置は、サンプルのセグメント(テストデータ)を選択する。 In step S12, the conventional device selects a sample segment (test data).
ステップS13において、従来装置は、生成した学習モデルを用いて、選択したセグメントの確信度を計算する。 In step S13, the conventional device uses the generated learning model to calculate the confidence of the selected segment.
ステップS14において、従来装置は、生成した学習モデルを用いて、説明対象の単語の近傍の確信度を計算する。 In step S14, the conventional device uses the generated learning model to calculate the confidence level of the neighborhood of the word to be explained.
ステップS15において、従来装置は、ステップS14と同一の近傍の重要度を計算する。 In step S15, the conventional device calculates the importance of the same neighborhood as in step S14.
ステップS16において、従来装置は、ステップS14と同一の近傍から対象の単語を除いた場合の確信度を計算する。 In step S16, the conventional device calculates the confidence level when the target word is removed from the same neighborhood as in step S14.
ステップS17において、従来装置は、ステップS16と同様に近傍から対象の単語を除いた場合の重要度を計算する。 In step S17, the conventional device calculates the importance when the target word is removed from the neighborhood, as in step S16.
ステップS18において、従来装置は、ステップS15で算出された重要度と、ステップS17で算出された重要度との差分に基づいて、対象の単語の説明度を計算する。 In step S18, the conventional device calculates the explanatory level of the target word based on the difference between the importance calculated in step S15 and the importance calculated in step S17.
図4は、本実施形態における説明可能化方法の流れを示すフローチャートである。
ステップS21において、説明可能化装置1は、ラベル付きのセグメント(学習データ)からなるコーパスから学習モデルを生成する。
FIG. 4 is a flowchart showing the flow of the explainability method in this embodiment.
In step S21, the
ステップS22において、説明可能化装置1は、サンプルの文書(テストデータ)を選択する。なお、この文書は、予め複数のセグメントに分割されている。
In step S22, the
ステップS23において、説明可能化装置1は、選択した文書から抽出される特徴ベクトルを、学習データの次元に圧縮する。
In step S23, the
ステップS24において、説明可能化装置1は、生成した学習モデルを用いて、ステップS23で圧縮した文書の確信度を計算する。
In step S24, the
ステップS25において、説明可能化装置1は、説明対象のセグメントを含む近傍を計算する。
In step S25, the
ステップS26において、説明可能化装置1は、生成した学習モデルを用いて、説明対象のセグメントの近傍の確信度を計算する。
In step S26, the
ステップS27において、説明可能化装置1は、ステップS26と同一の近傍の重要度を計算する。
In step S27, the
ステップS28において、説明可能化装置1は、ステップS26と同一の近傍から対象のセグメントを除いた場合の確信度を計算する。
In step S28, the
ステップS29において、説明可能化装置1は、ステップS28と同様に近傍から対象のセグメントを除いた場合の重要度を計算する。
In step S29, the
ステップS30において、説明可能化装置1は、ステップS27で算出された重要度と、ステップS29で算出された重要度との差分に基づいて、対象のセグメントの説明度を計算する。
In step S30, the
本実施形態によれば、説明可能化装置1は、セグメント単位で学習されたモデルを用いて、複数のセグメントからなる文書を次元圧縮することで確信度を計算した後、文書中の対象セグメントの近傍に対しても同様に次元圧縮して確信度及び重要度を計算し、この近傍から対象セグメントを除いた場合の重要度との差分に基づいて対象セグメントの説明度を計算する。
このように、説明可能化装置1は、従来の手法を拡張し、セグメントに対する説明度を算出できる。すなわち、文書全体の推定結果に対して、セグメント毎の影響の程度が説明され、例えば、セグメントに対するラベル付けも可能となる。
According to this embodiment, the
In this way, the
次元圧縮の際には、セグメント毎に所定の規則に従って、d/c個の単語が抽出され、c個のセグメントからモデルに対する入力の次元数dの特徴ベクトルが生成される。
これにより、説明可能化装置1は、セグメント単位のモデルを用いて、文書全体、及び対象セグメントの近傍について評価することができる。
このとき、例えば、TF-IDF等の出現頻度に基づく指標による評価が上位の単語が抽出されることにより、適切な特徴ベクトルが生成される。
During dimensionality reduction, d/c words are extracted for each segment according to a predetermined rule, and a feature vector with the number of dimensions d of the input to the model is generated from the c segments.
This allows the
At this time, for example, words with high evaluations based on an index based on the frequency of occurrence such as TF-IDF are extracted, thereby generating an appropriate feature vector.
また、説明可能化装置1は、近傍を計算する際に、対象セグメントより前から選択するセグメント数、及び後から選択するセグメント数を変動させることにより、c個の特徴列を効率的に生成できる。
In addition, when calculating the neighborhood, the
なお、前述の実施形態により、例えば、機械学習モデルの適用範囲を拡張できることから、国連が主導する持続可能な開発目標(SDGs)の目標9「レジリエントなインフラを整備し、持続可能な産業化を推進するとともに、イノベーションの拡大を図る」に貢献することが可能となる。 The above-mentioned embodiment, for example, makes it possible to expand the scope of application of machine learning models, thereby contributing to Goal 9 of the United Nations-led Sustainable Development Goals (SDGs), which is to "build resilient infrastructure, promote sustainable industrialization and foster innovation."
以上、本発明の実施形態について説明したが、本発明は前述した実施形態に限るものではない。また、前述した実施形態に記載された効果は、本発明から生じる最も好適な効果を列挙したに過ぎず、本発明による効果は、実施形態に記載されたものに限定されるものではない。 Although the embodiments of the present invention have been described above, the present invention is not limited to the above-described embodiments. Furthermore, the effects described in the above-described embodiments are merely a list of the most favorable effects resulting from the present invention, and the effects of the present invention are not limited to those described in the embodiments.
説明可能化装置1による説明可能化方法は、ソフトウェアにより実現される。ソフトウェアによって実現される場合には、このソフトウェアを構成するプログラムが、情報処理装置(コンピュータ)にインストールされる。また、これらのプログラムは、CD-ROMのようなリムーバブルメディアに記録されてユーザに配布されてもよいし、ネットワークを介してユーザのコンピュータにダウンロードされることにより配布されてもよい。さらに、これらのプログラムは、ダウンロードされることなくネットワークを介したWebサービスとしてユーザのコンピュータに提供されてもよい。
The explainability method using the
1 説明可能化装置
10 制御部
11 全体確信度計算部
12 近傍計算部
13 近傍第1確信度計算部
14 近傍第1重要度計算部
15 近傍第2確信度計算部
16 近傍第2重要度計算部
17 説明度計算部
20 記憶部
Claims (6)
対象文書を構成する複数のセグメントのうち、ランダムに選択したc個のセグメントのそれぞれから抽出した一部の特徴量を連結してd次元の特徴ベクトルを生成して前記モデルに入力することを繰り返し、当該モデルの出力を複数取得して統計処理することにより、各ラベルに対する前記対象文書の全体の確信度を計算する全体確信度計算部と、
前記対象文書を構成する複数のセグメントのうち、対象セグメントを含むc個をランダムに選択し、選択したセグメントのそれぞれから抽出した一部の特徴量を要素とするd次元の特徴列を、前記対象セグメントの近傍として複数生成する近傍計算部と、
前記近傍の特徴列を前記モデルに入力し、各ラベルに対する前記近傍の第1確信度を計算する近傍第1確信度計算部と、
ラベル毎の前記第1確信度及び前記全体の確信度の積に基づいて、前記近傍の第1重要度を計算する近傍第1重要度計算部と、
前記近傍の特徴列のうち、前記対象セグメントから抽出された部分を所定値に変換した後、前記モデルに入力し、各ラベルに対する前記近傍の第2確信度を計算する近傍第2確信度計算部と、
ラベル毎の前記第2確信度及び前記全体の確信度の積に基づいて、前記近傍の第2重要度を計算する近傍第2重要度計算部と、
前記第1重要度と前記第2重要度との差分に基づいて前記対象セグメントの説明度を計算する説明度計算部と、を備える説明可能化装置。 An explainability device for a model that has learned labels assigned to segments using d-dimensional learning data based on segments constituting a document, comprising:
an overall confidence level calculation unit that calculates an overall confidence level of the target document for each label by repeatedly generating a d-dimensional feature vector by concatenating some feature values extracted from each of c randomly selected segments out of a plurality of segments constituting the target document, and inputting the d-dimensional feature vector into the model, and acquiring and statistically processing a plurality of outputs of the model;
a neighborhood calculation unit that randomly selects c segments including a target segment from among a plurality of segments constituting the target document, and generates a plurality of d-dimensional feature sequences having some feature quantities extracted from each of the selected segments as elements as neighborhoods of the target segment;
a neighborhood first confidence level calculation unit that inputs the neighborhood feature sequence into the model and calculates a first confidence level of the neighborhood for each label;
a neighborhood first importance calculation unit that calculates a first importance of the neighborhood based on a product of the first certainty for each label and the overall certainty;
a neighborhood second certainty calculation unit that converts a portion of the neighborhood feature sequence extracted from the target segment into a predetermined value, inputs the converted value into the model, and calculates a neighborhood second certainty for each label;
a neighborhood second importance calculation unit that calculates a second importance of the neighborhood based on a product of the second certainty for each label and the overall certainty;
An explainability calculation unit that calculates an explainability of the target segment based on a difference between the first importance and the second importance.
対象文書を構成する複数のセグメントのうち、ランダムに選択したc個のセグメントのそれぞれから抽出した一部の特徴量を連結してd次元の特徴ベクトルを生成して前記モデルに入力することを繰り返し、当該モデルの出力を複数取得して統計処理することにより、各ラベルに対する前記対象文書の全体の確信度を計算する全体確信度計算ステップと、
前記対象文書を構成する複数のセグメントのうち、対象セグメントを含むc個をランダムに選択し、選択したセグメントのそれぞれから抽出した一部の特徴量を要素とするd次元の特徴列を、前記対象セグメントの近傍として複数生成する近傍計算ステップと、
前記近傍の特徴列を前記モデルに入力し、各ラベルに対する前記近傍の第1確信度を計算する近傍第1確信度計算ステップと、
ラベル毎の前記第1確信度及び前記全体の確信度の積に基づいて、前記近傍の第1重要度を計算する近傍第1重要度計算ステップと、
前記近傍の特徴列のうち、前記対象セグメントから抽出された部分を所定値に変換した後、前記モデルに入力し、各ラベルに対する前記近傍の第2確信度を計算する近傍第2確信度計算ステップと、
ラベル毎の前記第2確信度及び前記全体の確信度の積に基づいて、前記近傍の第2重要度を計算する近傍第2重要度計算ステップと、
前記第1重要度と前記第2重要度との差分に基づいて前記対象セグメントの説明度を計算する説明度計算ステップと、をコンピュータが実行する説明可能化方法。 A method for making an explanation possible for a model that has learned labels assigned to segments using d-dimensional learning data based on segments that constitute a document, the method comprising the steps of:
an overall confidence level calculation step of generating a d-dimensional feature vector by concatenating some feature amounts extracted from each of c randomly selected segments out of a plurality of segments constituting a target document, and inputting the d-dimensional feature vector into the model repeatedly, and calculating an overall confidence level of the target document for each label by acquiring a plurality of outputs of the model and performing statistical processing;
a neighborhood calculation step of randomly selecting c segments including a target segment from among a plurality of segments constituting the target document, and generating a plurality of d-dimensional feature sequences, each of which has a portion of feature quantities extracted from each of the selected segments as elements, as neighborhoods of the target segment;
a neighborhood first confidence calculation step of inputting the neighborhood feature sequence into the model and calculating a neighborhood first confidence for each label;
a neighborhood first importance calculation step of calculating a first importance of the neighborhood based on a product of the first certainty for each label and the overall certainty;
a neighborhood second confidence calculation step of converting a portion of the neighborhood feature sequence extracted from the target segment into a predetermined value, inputting the converted value into the model, and calculating a neighborhood second confidence for each label;
a neighborhood second importance calculation step of calculating a second importance of the neighborhood based on a product of the second certainty for each label and the overall certainty;
an explanation degree calculation step of calculating an explanation degree of the target segment based on a difference between the first importance and the second importance.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2021117064A JP7525449B2 (en) | 2021-07-15 | 2021-07-15 | EXPLAINABILITY DEVICE, EXPLAINABILITY METHOD, AND EXPLAINABILITY PROGRAM |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2021117064A JP7525449B2 (en) | 2021-07-15 | 2021-07-15 | EXPLAINABILITY DEVICE, EXPLAINABILITY METHOD, AND EXPLAINABILITY PROGRAM |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2023013117A JP2023013117A (en) | 2023-01-26 |
| JP7525449B2 true JP7525449B2 (en) | 2024-07-30 |
Family
ID=85129219
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2021117064A Active JP7525449B2 (en) | 2021-07-15 | 2021-07-15 | EXPLAINABILITY DEVICE, EXPLAINABILITY METHOD, AND EXPLAINABILITY PROGRAM |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP7525449B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2024108650A (en) | 2023-01-31 | 2024-08-13 | Kddi株式会社 | Wireless communication system, route switching method and route switching program |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2018194881A (en) | 2017-05-12 | 2018-12-06 | 株式会社日立製作所 | Document classification system and document classification method |
| JP2021043849A (en) | 2019-09-13 | 2021-03-18 | 株式会社日立製作所 | Computer system and document classification method |
-
2021
- 2021-07-15 JP JP2021117064A patent/JP7525449B2/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2018194881A (en) | 2017-05-12 | 2018-12-06 | 株式会社日立製作所 | Document classification system and document classification method |
| JP2021043849A (en) | 2019-09-13 | 2021-03-18 | 株式会社日立製作所 | Computer system and document classification method |
Non-Patent Citations (1)
| Title |
|---|
| 芥子 育雄、外6名,単語意味ベクトル辞書を用いたTwitterからの評判情報抽出,電子情報通信学会論文誌D,日本,電子情報通信学会,2017年05月23日,第J100-D巻,第4号,p.530-543 |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2023013117A (en) | 2023-01-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12299124B2 (en) | Deep learning based detection of malicious shell scripts | |
| Dekel et al. | Large margin hierarchical classification | |
| JP6962532B1 (en) | Event prediction device and event prediction program | |
| US20090274376A1 (en) | Method for efficiently building compact models for large multi-class text classification | |
| CN112528648A (en) | Method, device, equipment and storage medium for predicting polyphone pronunciation | |
| WO2008137368A1 (en) | Web page analysis using multiple graphs | |
| JP2005158010A (en) | Apparatus, method and program for classification evaluation | |
| CN111046659A (en) | Context information generating method, context information generating apparatus, and computer-readable recording medium | |
| CN111125315A (en) | A technology trend forecasting method and system | |
| US12380220B2 (en) | Automated attribute scraping for security feature implementation prediction | |
| Wicker et al. | A nonlinear label compression and transformation method for multi-label classification using autoencoders | |
| CN114691525A (en) | Test case selection method and device | |
| CN112131363A (en) | Automatic question answering method, device, equipment and storage medium | |
| CN114722198B (en) | Product classification code determination method, system and related device | |
| JP7525449B2 (en) | EXPLAINABILITY DEVICE, EXPLAINABILITY METHOD, AND EXPLAINABILITY PROGRAM | |
| JP5206197B2 (en) | Rule learning method, program and apparatus | |
| JP6509391B1 (en) | Computer system | |
| JP5379812B2 (en) | Data extraction apparatus, data extraction method, and program | |
| CN116956289B (en) | Method for dynamically adjusting potential blacklist and blacklist | |
| Nangi et al. | Autosumm: Automatic model creation for text summarization | |
| CN111126443A (en) | Network representation learning method based on random walk | |
| Dutta et al. | Comparative analysis of various ensemble approaches for web page classification | |
| Mehta et al. | A comparative study on approaches for text quality prediction using machine learning and natural language processing | |
| CN117874223A (en) | Emotion category recognition model training and emotion category recognition method and device | |
| CN107480687A (en) | Information processor and information processing method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20230720 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20240513 |
|
| 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: 20240702 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20240718 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7525449 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |