Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7688601B2 - Prediction device, program, and method for predicting user behavior sequences using sequence prediction model - Google Patents
[go: Go Back, main page]

JP7688601B2 - Prediction device, program, and method for predicting user behavior sequences using sequence prediction model - Google Patents

Prediction device, program, and method for predicting user behavior sequences using sequence prediction model Download PDF

Info

Publication number
JP7688601B2
JP7688601B2 JP2022065617A JP2022065617A JP7688601B2 JP 7688601 B2 JP7688601 B2 JP 7688601B2 JP 2022065617 A JP2022065617 A JP 2022065617A JP 2022065617 A JP2022065617 A JP 2022065617A JP 7688601 B2 JP7688601 B2 JP 7688601B2
Authority
JP
Japan
Prior art keywords
sequence
token
data
control
tokens
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2022065617A
Other languages
Japanese (ja)
Other versions
JP2023156029A (en
Inventor
直人 武田
康孝 西村
敦宣 南川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
KDDI Corp
Original Assignee
KDDI Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by KDDI Corp filed Critical KDDI Corp
Priority to JP2022065617A priority Critical patent/JP7688601B2/en
Publication of JP2023156029A publication Critical patent/JP2023156029A/en
Application granted granted Critical
Publication of JP7688601B2 publication Critical patent/JP7688601B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Description

本発明は、系列予測モデルの技術に関する。特に、ユーザの行動系列を予測する用途に関する。 The present invention relates to sequence prediction model technology. In particular, it relates to applications for predicting user behavior sequences.

従来、系列予測モデルとして、GPT2(Generative Pre-trained Transformer - 2)モデルがある(例えば非特許文献1参照)。これは、自己教師有りの言語生成モデルであって、大量のコーパスから切り取った単語列(文章)の次の単語(Next word prediction)を予測する。GPT2モデルは、任意の単語列を入力すると、次の単語を逐次予測することができ、人間が書いたような文章を生成することができる。例えば「今日は」「良い」という単語列を入力すると、次の単語として最も確率が高い単語「天気」を出力する。次に、「今日は」「良い」「天気」を入力すると、次の単語として最も確率が高い単語「だ」を出力する。
文章:「今日は」「良い」「天気」「だ」
Conventionally, there is a GPT2 (Generative Pre-trained Transformer - 2) model as a sequence prediction model (see, for example, Non-Patent Document 1). This is a self-supervised language generation model that predicts the next word (next word prediction) of a word string (sentence) extracted from a large amount of corpus. When an arbitrary word string is input, the GPT2 model can sequentially predict the next word, and can generate sentences that look like they were written by a human. For example, when the word strings "today" and "good" are input, the word "weather" with the highest probability as the next word is output. Next, when "today", "good", and "weather" are input, the word "is" with the highest probability as the next word is output.
Sentence: "Today is a good day"

図1は、従来技術におけるGPT2モデルの訓練時のデータ構造を表す説明図である。 Figure 1 is an explanatory diagram showing the data structure during training of the GPT2 model in the prior art.

教師データとして、複数のテキスト(文章)があると想定する。GPT2モデルの内部では、以下のように実行される。
(S1)テキストを単語列に分解し、所定長分の単語を、系列データに詰め込む。
(S2)その際、所定長よりも単語数が少なかった場合、直ぐ次のテキストの単語を、系列データに詰め込む。
(S3)テキストの単語を詰め込む途中で、所定長に達した場合、その後の単語は、次の系列データに詰め込む。
Assume that there are multiple texts (sentences) as training data. The GPT2 model is executed as follows.
(S1) The text is broken down into word strings, and words of a predetermined length are packed into sequence data.
(S2) At that time, if the number of words is less than the predetermined length, the words of the immediately next text are padded into the sequence data.
(S3) When a predetermined length is reached while packing the words of the text, the subsequent words are packed into the next sequence data.

図1によれば、以下のように実行される。
テキスト1は、10個の単語(0~9)で構成されており、所定長=14の系列データ1に詰め込む。
ここで、テキスト1の単語数は、所定長よりも少なかったため、系列データ1に、次のテキスト2の単語(0~2)を詰め込む。それでも、系列データ1に空きがあるので、次のテキスト3の単語(0)を詰め込む。途中で切れてしまったテキスト3における残りのトークン(1~5)は、次の系列データ2に詰め込まれる。
このように繰り返して、例えば5つのテキスト1~5は、3つの系列データ1~3に詰め込まれる。
According to FIG. 1, the process is carried out as follows.
Text 1 consists of 10 words (0 to 9) and is packed into sequence data 1 of a given length = 14.
Here, since the number of words in Text 1 is less than the specified length, the words (0-2) from the next Text 2 are stuffed into Sequence Data 1. However, since there is still space in Sequence Data 1, the word (0) from the next Text 3 is stuffed into it. The remaining tokens (1-5) in Text 3 that were cut off midway are stuffed into the next Sequence Data 2.
By repeating this process, for example, five texts 1 to 5 are packed into three sequence data 1 to 3.

図2は、従来技術におけるGPT2モデルの訓練時の処理を表す説明図である。 Figure 2 is an explanatory diagram showing the process of training the GPT2 model in the prior art.

GPT2は、Transformerベースであって、アテンション機構(トークン同士の関連性を示すスコア付け)を有する。各トークンのアテンションは常に、そのトークンよりも前のトークンにかかるような仕組みになっている。これによって、各トークンが、以前のトークンのどこに着目して次の1つのトークンを推定すればよいか、学習することができる。 GPT2 is based on Transformer and has an attention mechanism (scoring that indicates the relevance between tokens). The attention of each token is always focused on the token preceding it. This allows each token to learn which part of the previous token to focus on in order to infer the next token.

GPT2モデルは、図1によって構成した教師データを用いて訓練する。
図2によれば、GPT2モデルに入力可能な所定長=14であるとして、入力データと正解データとを対応付けて訓練する。
入力データ列:0,1,2,3,4,5,6,7,8,9,0,1,2,0
正解データ列: 1,2,3,4,5,6,7,8,9,0,1,2,0,1
このように、GPT2モデルでは、入力データに対して、正解データは、先頭トークンを削除し、末尾トークンを追加したものとする。
これに対して、結果データ列を出力する。
そして、その結果データ列と、正解データ列との差分を、損失関数(一般的にはcross entropy loss)として表現して、訓練を進める。
The GPT2 model is trained using the training data constructed according to FIG.
According to FIG. 2, the predetermined length that can be input to the GPT2 model is 14, and training is performed by associating input data with correct answer data.
Input data sequence: 0,1,2,3,4,5,6,7,8,9,0,1,2,0
Correct data sequence : 1,2,3,4,5,6,7,8,9,0,1,2,0,1
In this way, in the GPT2 model, the correct answer data is obtained by deleting the first token from the input data and adding the last token.
In response to this, a result data string is output.
Then, the difference between the resulting data sequence and the correct data sequence is expressed as a loss function (generally called cross entropy loss) and training is carried out.

前述した入力データ及び正解データの例によれば、トークン1を生成するためには、トークン0のみに着目すればよい(そもそもトークン1以前に、トークン0しか着目するものがない)。また、トークン3を生成するには、アテンション機構によって、トークン1に着目すればよい(トークン0,2は無視してもよい)というように学習することもできる。 According to the example of input data and correct answer data mentioned above, to generate token 1, it is sufficient to focus only on token 0 (to begin with, token 0 is the only token to focus on before token 1). Also, to generate token 3, it is sufficient to focus on token 1 using the attention mechanism (tokens 0 and 2 can be ignored).

このように、図2のGPT2モデルは、前述した図1の系列データ1~3について、先頭の1トークンを削除し且つ末尾の1トークンを追加しながら、訓練を進めることができる。 In this way, the GPT2 model in Figure 2 can be trained by deleting one token from the beginning and adding one token to the end of the sequence data 1 to 3 in Figure 1 described above.

また、他の従来技術として、GPT2モデルでは困難であった文章長を制御する技術もある(例えば非特許文献2参照)。この技術によれば、訓練時に、文章の文頭に「文長を示す値」を追加して訓練する。推定時にも、「文長を示す値」を追加することによって、任意の文章長の文章を生成することができる。 Another conventional technique is to control sentence length, which was difficult with the GPT2 model (see, for example, non-patent document 2). With this technique, a "value indicating sentence length" is added to the beginning of a sentence during training. By adding a "value indicating sentence length" during estimation as well, sentences of any length can be generated.

更に、文章の予測以外の用途として、ユーザの行動系列を予測する技術もある。この技術によれば、宅内に配置したセンサから、データを常時取得し、ユーザの次の行動を予測する。
宅内のユーザ行動は、一般に、一定時間以上かかるであろう「概念的行動(複雑な行動)」として認識できる。例えば「料理」や「皿洗い」のようなものである。
また、概念的行動は、複数の単純な「具体的行動(アクション)」から時系列に構成される。例えば概念的行動「料理」は、例えば以下のようなアクションの連続からなる。
「台所に近づく」->「冷蔵庫を開ける」->「冷蔵庫を閉める」->「コンロを点ける」
Furthermore, as an application other than sentence prediction, there is also a technology for predicting a user's behavioral sequence. According to this technology, data is constantly acquired from sensors placed in the home and the user's next action is predicted.
User actions in the home can generally be recognized as "conceptual actions (complex actions)" that will take a certain amount of time, such as "cooking" or "washing dishes."
In addition, a conceptual behavior is composed of a number of simple "concrete actions" in a time series. For example, the conceptual behavior "cooking" is composed of a series of actions such as the following:
"Approach the kitchen"->"Open the refrigerator"->"Close the refrigerator"->"Turn on the stove"

ここで、早期のタイミング(時点t)で、ユーザの次の行動の系列を予測することができれば、例えば宅内の機器をユーザの行動に先立って最適に制御することができる。例えばユーザの行動に先立って、電気を点けたりすることができる。また、終了時に、ユーザが取らなかった行動(コンロを消していない)を補完して、制御する(コンロを消す)こともできる。 If it were possible to predict the user's next sequence of actions at an early stage (time t), it would be possible to optimally control in-home appliances prior to the user's actions. For example, it would be possible to turn on the lights prior to the user's actions. It would also be possible to complement and control (turn off the stove) the actions that the user did not take at the end (not turning off the stove).

A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, and I. Sutskever. Language Models are Unsupervised Multitask Learners, 2019, pp.1-24.、[online]、[令和4年4月8日検索]、インターネット<URL:https://d4mucfpksywv.cloudfront.net/better-language-models/language_models_are_unsupervised_multitask_learners.pdf>A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, and I. Sutskever. Language Models are Unsupervised Multitask Learners, 2019, pp.1-24., [online], [Retrieved April 8, 2022], Internet <URL: https://d4mucfpksywv.cloudfront.net/better-language-models/language_models_are_unsupervised_multitask_learners.pdf> 長塚光一, 渥美雅保 , 文長制御のための条件付き言語モデル, 2020年度人工知能学会全国大会 (JSAI2020), 2020, pp. 1-4Koichi Nagatsuka, Masayasu Atsumi, Conditional Language Model for Sentence Length Control, 2020 Annual Conference of the Japanese Society for Artificial Intelligence (JSAI2020), 2020, pp. 1-4

ユーザの行動系列を予測するために、前述したGPT2を適用することもできる。その場合、ユーザの概念的行動は、GPT2のテキストに相当し、ユーザの具体的行動(アクション)は、GPT2のトークンに相当する。センサによって観測されたデータであっても、単語列と同等と考えて適用することができる。 The aforementioned GPT2 can also be applied to predict a user's behavioral sequence. In this case, the user's conceptual behavior corresponds to the text in GPT2, and the user's specific behavior (action) corresponds to the token in GPT2. Even data observed by a sensor can be applied by considering it equivalent to a word string.

しかしながら、ユーザの行動系列では、概念的行動毎に終了を判断する必要があるのに対し、GPT2をそのまま適用すると、系列データを延々と生成し続けるという課題が生じる。勿論、非特許文献2のように系列長を同時に学習させることもできるが、ユーザの行動系列の場合、その系列長を予め特定することができない。勿論、系列長を既知として固定することもできるが、多様且つリアルタイムなユーザの行動に適用することは、現実的ではない。 However, in the case of a user's action sequence, it is necessary to determine the end of each conceptual action, and if GPT2 is applied as is, the problem arises that sequence data will continue to be generated endlessly. Of course, it is possible to simultaneously learn the sequence length as in Non-Patent Document 2, but in the case of a user's action sequence, the sequence length cannot be specified in advance. Of course, the sequence length can be fixed as a known value, but it is not realistic to apply it to diverse and real-time user actions.

即ち、ユーザの行動系列の予測に、GPT2のデータ構造をそのまま適用した場合、以下のような課題が生じる。
(1)連続する概念的行動の間では関連性が無い場合がある。
従来技術によれば、前述した図1のように、複数の系列データを連続して詰め込むこととなる。しかしながら、前後の系列データ同士の間に関連性が無い場合、前段の系列データのトークンから後段の系列データのトークンを予測することとなる。特に、異なる概念的行動の間に関連性が無い場合も多い。また、GPT2としては、トークンとしての具体的行動(アクション)の時系列を予測しているに過ぎず、概念的行動毎に予測しているわけではない。
That is, if the data structure of GPT2 is applied as is to predict a user's behavioral sequence, the following problems arise.
(1) There may be no correlation between successive conceptual actions.
According to the conventional technology, multiple sequential data are packed in succession as shown in FIG. 1. However, when there is no correlation between the preceding and succeeding sequential data, the token of the succeeding sequential data is predicted from the token of the preceding sequential data. In particular, there are many cases where there is no correlation between different conceptual actions. Moreover, GPT2 only predicts the time series of concrete actions (actions) as tokens, and does not predict each conceptual action.

(2)ユーザの概念的行動を認識できない。
1つの具体的行動(アクション)しか明示されていない場合、複数の概念的行動が候補となり得る。最初は具体的行動「台所に近づく」で同じであっても、概念的行動「料理」及び「皿洗い」の違いによって、その後の具体的行動の系列も異なってくる。
(2) It is not possible to recognize the user's conceptual behavior.
When only one concrete action is specified, multiple conceptual actions can be candidates . Even if the initial concrete action is the same, "approaching the kitchen," the sequence of subsequent concrete actions will be different depending on the conceptual actions, "cooking" and "washing dishes."

(3)ユーザの行動系列における概念的行動の終了を予測できない。
GPT2モデルを適用した場合、系列データの終了を認識しないために、延々と系列データを生成し続けてしまう。
(3) It is not possible to predict the end of a conceptual action in a user's action sequence.
When the GPT2 model is applied, the end of sequential data is not recognized, and sequential data continues to be generated indefinitely.

そこで、本発明によれば、ユーザの行動における概念的行動を認識した上で、系列予測モデルを用いて次のトークンとなる具体的行動を予測することができる予測装置、プログラム及び方法を提供することを目的とする。 The present invention aims to provide a prediction device, program, and method that can recognize conceptual behavior in a user's actions and predict the specific behavior that will become the next token using a sequence prediction model.

本発明によれば、データセットは複数の系列データからなり、各系列データは複数のトークンからなり、所定長のトークン列を入力し、次のトークンを予測する予測装置において、
複数の系列データの中で最大のトークン数に、制御トークンを加算した数を、系列データの最大長として設定し、
系列データ毎に、当該系列データに関連する制御トークンを付与する制御トークン付与手段と、
系列データ毎に、最大長に満たない後方にパディングを埋めるパディング手段と、
パディングが埋められた系列データ毎に、所定長のトークン列を入力し、次にシフトしたトークン列を予測する系列予測モデルと
を有し、
制御トークンは、ユーザの概念的行動を表し、
系列データのトークンは、概念的行動を区分した複数の具体的行動を表す
ことを特徴とする。
According to the present invention, a data set is made up of a plurality of sequence data, each sequence data being made up of a plurality of tokens, and a prediction device for inputting a token sequence of a predetermined length and predicting the next token comprises:
The maximum number of tokens among the multiple sequential data is added to the control token, and the sum is set as the maximum length of the sequential data.
a control token assigning means for assigning a control token related to each piece of sequential data;
a padding means for padding a portion of each of the sequence data that does not reach a maximum length with padding;
a sequence prediction model for inputting a token sequence of a predetermined length for each of the sequence data filled with padding and predicting a next shifted token sequence ;
Control tokens represent conceptual actions of a user;
Tokens in sequence data represent multiple concrete actions that divide conceptual actions.
It is characterized by:

本発明の予測装置における他の実施形態によれば、
ユーザ周辺状態を表す制御コードを出力する制御コード分類モデルを更に有し、
制御トークン付与手段は、制御コード分類モデルから出力された制御コードを、制御トークンとして含める
ことも好ましい。
According to another embodiment of the prediction device of the present invention,
The control code classification model outputs a control code representing a user surrounding state,
It is also preferable that the control token providing means includes the control code output from the control code classification model as the control token.

本発明の予測装置における他の実施形態によれば、
制御コード分類モデルは、ユーザ周辺に配置された1つ以上の環境センサの計測値を入力し、計測値に基づく特徴量を、制御コードとして出力する
ことも好ましい。
According to another embodiment of the prediction device of the present invention,
It is also preferable that the control code classification model inputs measured values from one or more environmental sensors arranged around the user, and outputs, as a control code, a feature quantity based on the measured values.

本発明の予測装置における他の実施形態によれば、
制御コード分類モデルは、訓練段階として、ユーザ周辺に配置された環境センサの計測値を説明変数とし、ユーザの概念的行動を目的変数として対応付けた教師データを入力し、推定段階として、ユーザ周辺に配置された環境センサの計測値を説明変数として入力し、ユーザの概念的行動及び第1の尤度を出力するものであり、
制御コード分類モデルは、第1の尤度が所定閾値以上となるユーザの概念的行動のみを、制御コードとして出力する
ことも好ましい。
According to another embodiment of the prediction device of the present invention,
The control code classification model inputs teacher data in which measurement values of environmental sensors arranged around the user are used as explanatory variables and the conceptual behavior of the user is associated with a target variable as a training phase, and inputs measurement values of environmental sensors arranged around the user as explanatory variables as an estimation phase, and outputs the conceptual behavior of the user and a first likelihood;
It is also preferable that the control code classification model outputs, as a control code, only a conceptual action of the user for which the first likelihood is equal to or greater than a predetermined threshold value.

本発明の予測装置における他の実施形態によれば、
系列予測モデルは、推定段階について、第2の尤度を出力するものであり、
当該系列予測モデルが、制御トークンを含むトークン列を入力し、第2の尤度が所定閾値以上となる次のトークン列が出力された際に、入力された当該制御トークンを含むトークン列を説明変数とし、出力された当該次のトークン列を目的変数とした教師データとして更に記憶する
ことも好ましい。
According to another embodiment of the prediction device of the present invention,
The sequence prediction model outputs a second likelihood for the estimation stage;
It is also preferable that, when the sequence prediction model receives an input of a token sequence including a control token and outputs a next token sequence in which the second likelihood is equal to or greater than a predetermined threshold, the sequence prediction model further stores the input token sequence including the control token as an explanatory variable and the output next token sequence as a target variable as training data.

本発明の予測装置における他の実施形態によれば、
系列予測モデルは、第1~nの所定長のトークン列を入力し、正解となる第2~n+1の所定長のトークン列を出力するように訓練すると共に、パディングによって1つの系列データの終了を認識する
ことも好ましい。
According to another embodiment of the prediction device of the present invention,
The sequence prediction model is trained to receive a token sequence of a predetermined length from 1 to n and output a token sequence of a predetermined length from 2 to n+1 that is the correct answer, and it is also preferable to recognize the end of one piece of sequence data by padding.

本発明の予測装置における他の実施形態によれば、
第1~m(m<n)のアクションが連続する所定長のトークン列の末尾の第nのトークンがパディングとなる場合、第1~m-1のアクションが連続する所定長のトークン列を入力し、正解となる第2~mのアクションが連続する所定長のトークン列を出力するように訓練する
ことも好ましい。
According to another embodiment of the prediction device of the present invention,
In the case where the nth token at the end of a token string of a predetermined length containing successive actions 1 to m (m<n) is padding, it is also preferable to input a token string of a predetermined length containing successive actions 1 to m-1, and train the system to output a token string of a predetermined length containing successive actions 2 to m, which is the correct answer.

本発明の予測装置における他の実施形態によれば、
系列予測モデルは、出力データのトークン列と、正解データのトークン列との間の誤差を小さくする損失関数を設定する
ことも好ましい。
According to another embodiment of the prediction device of the present invention,
It is also preferable that the sequence prediction model sets a loss function that reduces the error between the token sequence of the output data and the token sequence of the correct answer data.

本発明の予測装置における他の実施形態によれば、
系列データに含まれるトークンは、時系列に並んだものである
ことも好ましい。
According to another embodiment of the prediction device of the present invention,
It is also preferable that the tokens contained in the sequence data are arranged in chronological order.

本発明の予測装置における他の実施形態によれば、
系列予測モデルは、GPT(Generative Pre-trained Transformer)である
ことも好ましい。
According to another embodiment of the prediction device of the present invention,
It is also preferable that the sequence prediction model is a Generative Pre-trained Transformer (GPT).

本発明によれば、データセットは複数の系列データからなり、各系列データは複数のトークンからなり、所定長のトークン列を入力し、次のトークンを予測するようにコンピュータを機能させるプログラムにおいて、
複数の系列データの中で最大のトークン数に、制御トークンを加算した数を、系列データの最大長として設定し、
系列データ毎に、当該系列データに関連する制御トークンを付与する制御トークン付与手段と、
系列データ毎に、最大長に満たない後方にパディングを埋めるパディング手段と、
パディングが埋められた系列データ毎に、所定長のトークン列を入力し、次にシフトしたトークン列を予測する系列予測モデルと
して機能させ、
制御トークンは、ユーザの概念的行動を表し、
系列データのトークンは、概念的行動を区分した複数の具体的行動を表す
ようにコンピュータを機能させることを特徴とする。
According to the present invention, a data set is made up of a plurality of sequence data, each sequence data being made up of a plurality of tokens, and a program for inputting a token string of a predetermined length and causing a computer to function to predict the next token comprises:
The maximum number of tokens among the multiple sequential data is added to the control token, and the sum is set as the maximum length of the sequential data.
a control token assigning means for assigning a control token related to each piece of sequential data;
a padding means for padding a portion of each of the sequence data that does not reach a maximum length with padding;
For each padded sequence data, a sequence prediction model is used to input a token sequence of a given length and predict the next shifted token sequence.
and make it work.
Control tokens represent conceptual actions of a user;
Tokens in sequence data represent multiple concrete actions that divide conceptual actions.
The present invention is characterized in that the computer is made to function in such a manner .

本発明によれば、データセットは複数の系列データからなり、各系列データは複数のトークンからなり、所定長のトークン列を入力し、次のトークンを予測する装置の予測方法において、
装置は、
複数の系列データの中で最大のトークン数に、制御トークンを加算した数を、系列データの最大長として設定し、
系列データ毎に、当該系列データに関連する制御トークンを付与する第1のステップと、
系列データ毎に、最大長に満たない後方にパディングを埋める第2のステップと、
系列予測モデルを用いて、パディングが埋められた系列データ毎に、所定長のトークン列を入力し、次にシフトしたトークン列を予測する第3のステップと
を実行し、
制御トークンは、ユーザの概念的行動を表し、
系列データのトークンは、概念的行動を区分した複数の具体的行動を表す
ことを特徴とする。
According to the present invention, a data set is made up of a plurality of sequence data, each sequence data being made up of a plurality of tokens, and a prediction method for a device for inputting a token sequence of a predetermined length and predicting the next token comprises the steps of:
The device is
The maximum number of tokens among the multiple sequential data is added to the control token, and the sum is set as the maximum length of the sequential data.
a first step of assigning a control token associated with each piece of sequential data to the piece of sequential data;
a second step of filling the trailing portion of each sequence data with padding if the trailing portion does not reach the maximum length;
a third step of inputting a token sequence of a predetermined length for each of the padded sequence data using a sequence prediction model, and predicting a next shifted token sequence ;
Control tokens represent conceptual actions of a user;
Tokens in sequence data represent multiple concrete actions that divide conceptual actions.
It is characterized by:

本発明における予測装置、プログラム及び方法によれば、ユーザの行動における概念的行動を認識した上で、系列予測モデルを用いて次のトークンとなる具体的行動を予測することができる。 The prediction device, program, and method of the present invention can recognize conceptual behavior in a user's actions and then use a sequence prediction model to predict the specific behavior that will become the next token.

従来技術におけるGPT2モデルの訓練時のデータ構造を表す説明図である。FIG. 1 is an explanatory diagram showing a data structure during training of the GPT2 model in the prior art. 従来技術におけるGPT2モデルの訓練時の処理を表す説明図である。FIG. 1 is an explanatory diagram showing the process of training the GPT2 model in the prior art. 本発明における予測装置の機能構成図である。FIG. 2 is a functional configuration diagram of a prediction device according to the present invention. 本発明における系列データの説明図である。FIG. 2 is an explanatory diagram of sequence data in the present invention. 本発明における制御コード分類モデルの説明図である。FIG. 2 is an explanatory diagram of a control code classification model in the present invention. 本発明における予測装置の訓練時の処理を表す第1の説明図である。FIG. 1 is a first explanatory diagram illustrating a process during training of a prediction device according to the present invention. 本発明における予測装置の訓練時の処理を表す第2の説明図である。FIG. 2 is a second explanatory diagram showing the processing during training of the prediction device in the present invention.

以下、本発明の実施の形態について、図面を用いて詳細に説明する。 The following describes in detail the embodiments of the present invention with reference to the drawings.

図3は、本発明における予測装置の機能構成図である。 Figure 3 is a functional configuration diagram of the prediction device of the present invention.

図3によれば、予測装置1は、制御トークン付与部11と、パディング部12と、系列予測モデル13と、制御コード分類モデル14とを有する。また、環境センサを適用するために、計測値収集部101と、系列データ生成部102とを更に有する。これら機能構成部は、予測装置に搭載されたコンピュータを機能させるプログラムを実行することによって実現される。また、これら機能構成部の処理の流れは、予測方法としても理解できる。 As shown in FIG. 3, the prediction device 1 has a control token assignment unit 11, a padding unit 12, a sequence prediction model 13, and a control code classification model 14. In order to apply an environmental sensor, the prediction device 1 further has a measurement value collection unit 101 and a sequence data generation unit 102. These functional components are realized by executing a program that causes a computer installed in the prediction device to function. The processing flow of these functional components can also be understood as a prediction method.

ユーザ周辺には、IoT(Internet of Things)機器として、多種多様な環境センサが配置されている。環境センサとしては、例えば位置センサ、温度センサ、照度センサ、動きセンサ、冷蔵庫センサ、振動センサ、電力センサ、水道センサなどがある。また、計測値として、日時刻も含むものであってもよい。更に、気象サーバから受信した天候情報も含むものであってもよい。
本発明の実施形態としては、ユーザの行動に基づく直近過去の環境センサの計測値から、そのユーザの次の行動を、できる限り高い精度で予測しようとするものである。
A wide variety of environmental sensors are placed around the user as IoT (Internet of Things) devices. Examples of environmental sensors include a position sensor, a temperature sensor, an illuminance sensor, a motion sensor, a refrigerator sensor, a vibration sensor, a power sensor, and a water sensor. The measured values may also include the date and time. Furthermore, the measured values may also include weather information received from a weather server.
An embodiment of the present invention aims to predict the next behavior of a user with as high accuracy as possible from the most recent past measurement values of an environmental sensor based on the user's behavior.

[計測値収集部101]
計測値収集部101は、複数の環境センサから計測値を収集する。収集した計測値は、系列データ生成部102へ出力される。また、制御コード分類モデル14に出力するものであってもよい。これら計測値は、ユーザの行動を表す一部と認識できる。
[Measurement value collection unit 101]
The measurement value collector 101 collects measurement values from a plurality of environmental sensors. The collected measurement values are output to the sequence data generator 102. The measurement values may also be output to the control code classification model 14. These measurement values can be recognized as part of the user's behavior.

[系列データ生成部102]
系列データ生成部102は、環境センサの計測値に基づいて、概念的行動のデータセットとしての「系列データ」を生成する。本発明における系列データは、概念的行動毎に区分した複数の具体的行動(アクション)を含む「トークン」からなる。
[Series Data Generation Unit 102]
The sequence data generator 102 generates "sequence data" as a data set of conceptual behaviors based on the measured values of the environmental sensors. The sequence data in the present invention is made up of "tokens" including multiple concrete behaviors (actions) classified for each conceptual behavior.

図3によれば、例えば1つの概念的行動「料理」は、以下のように時系列の具体的行動(アクション)からなる。
t1:「台所に近づく」
t2:「冷蔵庫を開ける」
t3:「冷蔵庫を閉める」
t4:「コンロを点ける」
・・・・・・
具体的行動(アクション)毎の情報は、センサから取得された計測値に基づくものである。
According to FIG. 3, for example, one conceptual behavior "cooking" is made up of specific behaviors (actions) in a time series as follows:
t1: "Approach the kitchen"
t2: "Open the refrigerator"
t3: "Close the refrigerator"
t4: "Turn on the stove"
...
The information for each specific action is based on the measurement values obtained from the sensors.

そして、具体的行動(アクション)毎に、「トークン」に含められる。トークンは、具体的行動(アクション)を含む情報単位となる。複数のトークンを時系列に並べて、1つの「系列データ」を構成する。系列データは、時系列の複数の具体的行動(アクション)からなる「概念的行動」を意味する情報単位となる。 Each specific action is then included in a "token." A token is an information unit that includes a specific action. Multiple tokens are arranged in chronological order to form a single "sequence data." Sequential data is an information unit that represents a "conceptual action" consisting of multiple specific actions in chronological order.

図4は、本発明における系列データの説明図である。 Figure 4 is an explanatory diagram of sequence data in the present invention.

系列データ生成部102は、複数の系列データの中で最大のトークン数に、制御トークンを加算した数を、系列データの「最大長」として設定する。
最大長=(複数の系列データの中で最大のトークン数)+(制御トークンの数)
尚、制御トークンの数は、基本的に1とするが、勿論、2以上であってもよい。
The sequence data generator 102 sets the maximum number of tokens among the multiple sequence data plus the control token as the "maximum length" of the sequence data.
Maximum length = (maximum number of tokens among multiple sequence data) + (number of control tokens)
The number of control tokens is basically one, but it may of course be two or more.

図4によれば、系列データ1~5の中で、系列データ4がデータ長=16で最も長い。また、制御トークンの数を1とした場合、以下のように、系列データの最大長=17と設定する。
最大長17=複数の系列データの中で最大のトークン数16+制御トークンの数1
4, among sequential data sets 1 to 5, sequential data set 4 has the longest data length of 16. If the number of control tokens is 1, the maximum length of sequential data set is set to 17 as follows.
Maximum length 17 = Maximum number of tokens in multiple sequence data 16 + Number of control tokens 1

即ち、概念的行動毎に、1つの系列データとして構成する。これによって、全ての系列データのトークン数を統一すると共に、1つの系列データの複数のトークンが、異なる系列データに分割されないようにする。 In other words, each conceptual behavior is composed as a single piece of sequence data. This unifies the number of tokens in all sequence data, and prevents multiple tokens in one sequence data from being split into different sequence data.

[制御トークン付与部11]
制御トークン付与部11は、系列データ毎に、当該系列データに関連する「制御トークン」を付与する。
制御トークンは、ユーザの「概念的行動」を表す。
制御トークンに含める制御コードは、ユーザによって指定されたものであってもよいし、制御コード分類モデル14から出力されたものであってもよい。制御コードは、ユーザの概念的行動に応じて、ユーザ周辺状態を表す情報に基づくものである。
[Control token granting unit 11]
The control token assigner 11 assigns a "control token" related to each piece of sequential data to the corresponding piece of sequential data.
Control tokens represent the "conceptual actions" of a user.
The control code included in the control token may be specified by the user or may be output from the control code classification model 14. The control code is based on information representing the user surroundings in response to the user's conceptual behavior.

概念的行動を最初に明確にすることは、その後の具体的行動の時系列の予測精度を高めることとなる。例えば概念的行動「料理」であれば、「台所に近づく」の次に「冷蔵庫を開ける」ことが予測されやすくなるであろう。また、概念的行動「皿洗い」であれば、「台所に近づく」の次に「蛇口をひねる」ことが予測されやすくなるであろう。そのように、概念的行動をトークンに含めることによって、時系列の具体的行動を予測しやすくなる。 Clarifying the conceptual behavior first increases the accuracy of predicting the time series of subsequent concrete behaviors. For example, if the conceptual behavior is "cooking," it will be easier to predict that "approaching the kitchen" will be followed by "opening the refrigerator." Similarly, if the conceptual behavior is "washing dishes," it will be easier to predict that "approaching the kitchen" will be followed by "turning on the tap." In this way, by including conceptual behaviors in tokens, it becomes easier to predict concrete behaviors over time.

[パディング部12]
パディング部12は、系列データ毎に、最大長に満たない後方にパディングを埋める。パディングによって、概念的行動の系列の終了を明示する。
図4によれば、例えば以下ようにパディングが埋め込まれる。
系列データ1については、1個の制御トークンと、10個のトークン(0~9)とを埋め込む。そして、最大長=17に満たない後方の6個のトークンにパディングを埋める。
系列データ2については、1個の制御トークンと、3個のトークン(0~2)とを埋め込む。そして、最大長=17に満たない後方の13個のトークンにパディングを埋める。
系列データ3については、1個の制御トークンと、6個のトークン(0~5)とを埋め込む。そして、最大長=17に満たない後方の10個のトークンにパディングを埋める。
系列データ4については、1個の制御トークンと、16個のトークン(0~15)とを埋め込む。
系列データ5については、1個の制御トークンと、5個のトークン(0~4)とを埋め込む。そして、最大長=17に満たない後方の11個のトークンにパディングを埋める。
[Padding section 12]
The padding unit 12 fills the remaining part of each sequence data with padding to indicate the end of the sequence of conceptual actions.
According to FIG. 4, for example, padding is embedded as follows:
For sequence data 1, one control token and 10 tokens (0 to 9) are embedded. Then, padding is added to the last 6 tokens that do not reach the maximum length of 17.
For sequence data 2, one control token and three tokens (0 to 2) are embedded. Then, padding is added to the last 13 tokens that do not reach the maximum length of 17.
For sequence data 3, one control token and six tokens (0 to 5) are embedded. Then, padding is added to the last 10 tokens that do not reach the maximum length of 17.
For sequence data 4, one control token and 16 tokens (0 to 15) are embedded.
For sequence data 5, one control token and five tokens (0 to 4) are embedded. Then, padding is added to the last 11 tokens that do not reach the maximum length of 17.

図5は、本発明における制御コード分類モデルの説明図である。 Figure 5 is an explanatory diagram of the control code classification model in the present invention.

[制御コード分類モデル14]
制御コード分類モデル14は、ユーザ周辺状態を表す「制御コード」を出力する。ユーザ周辺情報は、環境センサから受信した計測値であってもよい。
また、制御コード分類モデル14は、所定時間(例えば30秒毎)毎に、多種多様な環境センサ(動きセンサや開閉センサ等)から収集した1つ以上の計測値に応じて、制御コードを推定し続ける。
[Control Code Classification Model 14]
The control code classification model 14 outputs a "control code" representing the user surroundings state. The user surroundings information may be measurements received from environmental sensors.
In addition, the control code classification model 14 continues to estimate the control code according to one or more measurement values collected from a wide variety of environmental sensors (motion sensors, opening/closing sensors, etc.) at predetermined time intervals (for example, every 30 seconds).

制御コード分類モデル14の実施形態として、例えば以下のような制御コードを出力する。
<第1の実施形態:特徴量となる制御コードの出力>
<第2の実施形態:概念的行動となる制御コードの出力>
As an embodiment of the control code classification model 14, for example, the following control codes are output.
First embodiment: Output of control code serving as feature quantity
Second embodiment: Output of control code representing conceptual behavior

<第1の実施形態:特徴量となる制御コードの出力>
制御コード分類モデル14は、ユーザ周辺に配置された1つ以上の環境センサの計測値を入力し、計測値に基づく特徴量(feature)を、制御コードとして出力する。例えばニューラルネットワークを用いた時系列の特徴量を出力するものであってもよい。
図5によれば、例えば冷蔵庫センサによってドアの開閉が検出され、電力センサによってコンロの電力が検出される場合、制御コード分類モデル14から抽出される特徴量は、例えば概念的行動「料理」を意味するかもしれない。
また、例えば振動センサによって台所の振動が検出され、水道センサによって水道の使用が検出される場合、制御コード分類モデル14から抽出される特徴量は、例えば概念的行動「皿洗い」を意味するかもしれない。
即ち、トークンは、系列データの概念的行動として進行中の具体的行動を意味し、環境センサの計測値と何らかの関連性を持つと考えられる。
First embodiment: Output of control code serving as feature quantity
The control code classification model 14 receives measurement values from one or more environmental sensors arranged around the user, and outputs a feature based on the measurement values as a control code. For example, it may output a time-series feature using a neural network.
According to FIG. 5, for example, if a refrigerator sensor detects whether the door is open or closed, and a power sensor detects the power of a stove, the feature extracted from the control code classification model 14 may represent, for example, the conceptual action “cooking.”
Also, for example, if a vibration sensor detects vibrations in the kitchen and a water sensor detects water use, the feature extracted from the control code classification model 14 may represent, for example, the conceptual action "washing dishes."
That is, a token represents a concrete ongoing action as a conceptual action of sequence data, and is considered to have some sort of relationship with the measured values of the environmental sensors.

<第2の実施形態:概念的行動となる制御コードの出力>
制御コード分類モデル14は、教師有り学習エンジンであって、例えば以下のように機能する。
(訓練段階)ユーザ周辺に配置された「1つ以上の環境センサの計測値」を説明変数とし、ユーザの「概念的行動」を目的変数として対応付けた教師データを入力して、訓練する。
(推定段階)ユーザ周辺に配置された「1つ以上の環境センサの計測値」を説明変数として入力し、ユーザの「概念的行動」及び「第1の尤度」を出力する。
そして、制御コード分類モデル14は、第1の尤度が所定閾値以上となるユーザの概念的行動のみを、制御コードとして出力する。第1の尤度を判定することによって、推定の確信度の高い制御コードのみを出力することができる。
Second embodiment: Output of control code representing conceptual behavior
The control code classification model 14 is a supervised learning engine and functions, for example, as follows.
(Training stage) Training is performed by inputting teacher data that associates the "measurement values of one or more environmental sensors" placed around the user as explanatory variables with the user's "conceptual behavior" as a response variable.
(Estimation stage) "Measurement values of one or more environmental sensors" placed around the user are input as explanatory variables, and the user's "conceptual behavior" and "first likelihood" are output.
Then, the control code classification model 14 outputs, as a control code, only the conceptual actions of the user for which the first likelihood is equal to or greater than a predetermined threshold value. By determining the first likelihood, it is possible to output only control codes with a high degree of certainty of estimation.

制御コード分類モデル14から第1の尤度を出力するために、例えばLightGBM(Light Gradient Boosting Machine)や多層パーセプトロン(Multilayer perceptron)を利用することができる。LightGBMとは、決定木アルゴリズムに基づいた勾配ブースティング(Gradient Boosting)の機械学習エンジンである。多層パーセプトロンとは、少なくとも3つの層からなる順伝播型ニューラルネットワークの機械学習エンジンである。 To output the first likelihood from the control code classification model 14, for example, a LightGBM (Light Gradient Boosting Machine) or a multilayer perceptron can be used. LightGBM is a gradient boosting machine learning engine based on a decision tree algorithm. A multilayer perceptron is a forward propagation neural network machine learning engine consisting of at least three layers.

[系列予測モデル13]
系列予測モデル13は、パディングが埋められた系列データ毎に、所定長nのトークン列を入力し、次にシフトしたトークン列を予測する。
所定長nは、系列予測モデル13に入力可能なデータ長であって、前述した最大長以下(n≦max_length)となるものである。所定長nは、系列予測モデルに依存するものである。
[Series Prediction Model 13]
The sequence prediction model 13 inputs a token sequence of a predetermined length n for each padded sequence data, and predicts the next shifted token sequence.
The predetermined length n is the data length that can be input to the sequence prediction model 13 and is equal to or less than the maximum length mentioned above (n≦max_length). The predetermined length n depends on the sequence prediction model.

系列予測モデル13自体は、GPT2モデルであってもよい。本発明によれば、既存の言語生成モデルを、ユーザの行動予測に適用する。 The sequence prediction model 13 itself may be a GPT2 model. According to the present invention, an existing language generation model is applied to predicting user behavior.

系列予測モデル13は、第1~nの所定長のトークン列を入力し、正解となる第2~n+1の所定長のトークン列を出力するように訓練すると共に、パディングによって1つの系列データの終了を認識する。
本発明によれば、ユーザの概念的行動(系列データ)毎に、その終了を認識することが重要となるが、終了までのトークン数は異なる。本発明は、文章のように先出したトークンから延々に予測するものではなく、具体的行動(アクション)単位で、ユーザの次の具体的行動を予測し、概念的行動毎に異なる行動の終了タイミングまでを予測するものとする。
The sequence prediction model 13 is trained to input a token sequence of a predetermined length from 1 to n and output a token sequence of a predetermined length from 2 to n+1 which is the correct answer, and also recognizes the end of one piece of sequence data by padding.
According to the present invention, it is important to recognize the end of each conceptual action (sequence data) of the user, but the number of tokens until the end is different. The present invention does not make endless predictions from the preceding tokens like a sentence, but predicts the user's next concrete action in concrete action units, and predicts the end timing of the action, which differs for each conceptual action.

図6は、本発明における予測装置の訓練時の処理を表す第1の説明図である。 Figure 6 is a first explanatory diagram showing the processing during training of the prediction device of the present invention.

図6によれば、例えば系列予測モデル13は、所定長=14として、以下のように訓練される。
入力データのトークン列:F,0,1,2,3,4,5,6,7,8,9,10,11,12
正解データのトークン列: 0,1,2,3,4,5,6,7,8,9,10,11,12,13
出力データのトークン列: *,*,*,*,*,*,*,*,*,*, *, *, *, *
この場合、正解データの末尾のトークン13を予測するように学習する。
According to FIG. 6, for example, the sequence prediction model 13 is trained as follows, with the predetermined length=14.
Input data token sequence: F,0,1,2,3,4,5,6,7,8,9,10,11,12
Correct answer token sequence: 0,1,2,3,4,5,6,7,8,9,10,11,12,13
Output data token sequence: *,*,*,*,*,*,*,*,*,*,*,*,*, *, *, *, *
In this case, the machine learns to predict token 13 at the end of the correct data.

系列予測モデル13は、予測データとしての出力データのトークン列と、正解データのトークン列との間の誤差を小さくする損失関数を設定する。損失関数としては、例えばクロスエントロピー(Cross entropy)誤差であってもよい。
これによって、出力データのトークン列が、正解データのトークン列との誤差が小さくなるように訓練される。
The sequence prediction model 13 sets a loss function that reduces the error between the token sequence of the output data as prediction data and the token sequence of the correct answer data. The loss function may be, for example, a cross entropy error.
This allows training to be performed so that the token sequence of the output data is trained to reduce the error between the token sequence of the correct answer data and the output data.

図6によれば、制御トークンFを含むトークン0~12から、トークン13のみを予測する。概念的行動を表す制御トークンと、トークン0~12とを関連付けて学習することができる。また、予測されるトークン13も、概念的行動を表す制御トークンと、トークン0~12とに基づいて予測することができる。 According to Figure 6, only token 13 is predicted from tokens 0 to 12, which include control token F. It is possible to learn by associating the control tokens representing conceptual behavior with tokens 0 to 12. In addition, the predicted token 13 can also be predicted based on the control tokens representing conceptual behavior and tokens 0 to 12.

尚、図6によれば、トークン13のみを予測するべく訓練しているように見えるが、系列予測モデル13の内部として、トークン0が入力されただけで、次のトークン1を予測することとができるように学習する。また、トークン0,1が入力されると、次のトークン2を予測することができるように学習する。これを繰り返すと、最終的に、トークンF,0,1,2,3,4,5,6,7,8,9,10,11,12を入力すると、トークン13を予測することができる。 Note that, according to Figure 6, it appears that the model is trained to predict only token 13, but inside sequence prediction model 13, it learns to be able to predict the next token, 1, when only token 0 is input. Also, when tokens 0 and 1 are input, it learns to be able to predict the next token, 2. By repeating this process, eventually, when tokens F, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, and 12 are input, it will be able to predict token 13.

図7は、本発明における予測装置の訓練時の処理を表す第2の説明図である。 Figure 7 is a second explanatory diagram showing the processing during training of the prediction device of the present invention.

図7によれば、入力データのトークン列の末尾が、パディングとなるものである。
<系列データのトークン列:F,0,1,2,3,4,5,6,7,8,9,P,P,P> 所定長n=14
入力データのトークン列:F,0,1,2,3,4,5,6,7,8,P,P,P,P,
正解データのトークン列: 0,1,2,3,4,5,6,7,8,9,P,P,P,P
出力データのトークン列: *,*,*,*,*,*,*,*,*,*,*,*,*,*
According to FIG. 7, the end of the token string of the input data is padding.
<Token sequence of sequence data: F,0,1,2,3,4,5,6,7,8,9,P,P,P> Predetermined length n = 14
Input data token sequence: F,0,1,2,3,4,5,6,7,8,P,P,P,P,
Token sequence of the correct data: 0,1,2,3,4,5,6,7,8,9,P,P,P,P
Output data token sequence: *,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*

ここで、第1~m(m<n)のアクションが連続する所定長のトークン列の末尾の第nのトークンがパディングとなっている場合、第1~m-1のアクションが連続する所定長のトークン列を入力し、正解となる第2~mのアクションが連続する所定長のトークン列を出力するように訓練する。 Here, if the nth token at the end of a token string of a given length containing successive actions 1 to m (m < n) is padding, the system is trained to input a token string of a given length containing successive actions 1 to m-1, and output a token string of a given length containing successive actions 2 to m, which is the correct answer.

前述の例によれば、系列データ1におけるアクションのトークン列は、0~9の10個(m=10)であり、所定長n(=14)よりも短くなるために、末尾がパディングとなっている。この場合、第1~m-1(トークン0~8)のアクションが連続する所定長nのトークン列を入力し、正解となる第2~m(トークン1~9)のアクションが連続する所定長nのトークン列を出力するように訓練する。
これは、系列予測モデル13に対して、パディング前の最後のトークン9を予測するように訓練することを意味する。最終的に、系列予測モデル13が、パディングしか予測しなくなった場合に、1つの概念的行動の予測が完了したものとする。
In the above example, the action token sequence in sequence data 1 is 10 tokens (m=10) from 0 to 9, which is shorter than the predetermined length n (=14), so the end is padded. In this case, a token sequence of the predetermined length n, in which actions 1 to m-1 (tokens 0 to 8) are consecutive, is input, and training is performed so that a token sequence of the predetermined length n, in which actions 2 to m (tokens 1 to 9) are consecutive, which is the correct answer, is output.
This means training the sequence prediction model 13 to predict the last token 9 before the padding. Finally, when the sequence prediction model 13 predicts only the padding, it is considered that the prediction of one conceptual behavior is completed.

<教師データの更なる蓄積について>
系列予測モデル13は、推定段階について、第2の尤度を出力するとする。
ここで、当該系列予測モデル13が、制御トークンを含むトークン列を入力し、第2の尤度が所定閾値以上となる次のトークン列が出力された際に、入力された当該制御トークンを含むトークン列(概念的行動の制御トークン+時系列の具体的行動のトークン列)を説明変数とし、出力された当該次のトークン列(時系列の具体的行動のトークン列)を目的変数とした教師データとして更に記憶する。所定閾値を、尤度の信頼性指標とする。
制御トークンは、ユーザの概念的行動に基づくものであるので、系列予測モデル13は、訓練段階について、更新された教師データによって再訓練することができる。
これによって、教師データを増加させていき、系列予測モデル13の精度を高めることができる。
<Further accumulation of training data>
It is assumed that the sequence prediction model 13 outputs a second likelihood for the estimation stage.
Here, when the sequence prediction model 13 receives a token sequence including a control token and outputs a next token sequence in which the second likelihood is equal to or greater than a predetermined threshold, the sequence prediction model 13 further stores the input token sequence including the control token (control token of conceptual behavior + token sequence of time-series specific behavior) as an explanatory variable and the output next token sequence (token sequence of time-series specific behavior) as a target variable as teacher data. The predetermined threshold is used as a reliability index of the likelihood.
Since the control tokens are based on the conceptual behavior of the user, the sequence prediction model 13 can be retrained with updated teacher data for the training phase.
This allows the amount of training data to be increased, and the accuracy of the sequence prediction model 13 to be improved.

以上、詳細に説明したように、本発明における予測装置、プログラム及び方法によれば、ユーザの行動における概念的行動を認識した上で、系列予測モデルを用いて次のトークンとなる具体的行動を予測することができる。 As described above in detail, the prediction device, program, and method of the present invention can recognize conceptual behavior in a user's actions and then use a sequence prediction model to predict the specific behavior that will become the next token.

尚、これにより、「宅内機器から収集されたユーザの行動に基づくビッグデータの利用が促進する」ことから、国連が主導する持続可能な開発目標(SDGs)の目標9「レジリエントなインフラを整備し、持続可能な産業化を推進するとともに、イノベーションの拡大を図る」に貢献することが可能となる。 Furthermore, this will "promote the use of big data based on user behavior collected from home devices," which will contribute to Goal 9 of the United Nations-led Sustainable Development Goals (SDGs), which is to "build resilient infrastructure, promote sustainable industrialization and foster innovation."

前述した本発明の種々の実施形態について、本発明の技術思想及び見地の範囲の種々の変更、修正及び省略は、当業者によれば容易に行うことができる。前述の説明はあくまで例であって、何ら制約しようとするものではない。本発明は、特許請求の範囲及びその均等物として限定するものにのみ制約される。 With respect to the various embodiments of the present invention described above, various changes, modifications, and omissions within the scope of the technical ideas and viewpoints of the present invention can be easily made by a person skilled in the art. The above description is merely an example and is not intended to be restrictive in any way. The present invention is limited only by the scope of the claims and their equivalents.

1 予測装置
101 計測値収集部
102 系列データ生成部
11 制御トークン付与部
12 パディング部
13 系列予測モデル
14 制御コード分類モデル

REFERENCE SIGNS LIST 1 Prediction device 101 Measurement value collection unit 102 Sequence data generation unit 11 Control token assignment unit 12 Padding unit 13 Sequence prediction model 14 Control code classification model

Claims (12)

データセットは複数の系列データからなり、各系列データは複数のトークンからなり、所定長のトークン列を入力し、次のトークンを予測する予測装置において、
複数の系列データの中で最大のトークン数に、制御トークンを加算した数を、系列データの最大長として設定し、
系列データ毎に、当該系列データに関連する制御トークンを付与する制御トークン付与手段と、
系列データ毎に、最大長に満たない後方にパディングを埋めるパディング手段と、
パディングが埋められた系列データ毎に、所定長のトークン列を入力し、次にシフトしたトークン列を予測する系列予測モデルと
を有し、
制御トークンは、ユーザの概念的行動を表し、
系列データのトークンは、概念的行動を区分した複数の具体的行動を表す
ことを特徴とする予測装置。
A data set is made up of a plurality of sequence data, each sequence data being made up of a plurality of tokens, and a prediction device for inputting a token sequence of a predetermined length and predicting the next token,
The maximum number of tokens among the multiple sequential data is added to the control token, and the sum is set as the maximum length of the sequential data.
a control token assigning means for assigning a control token related to each piece of sequential data;
a padding means for padding a portion of each of the sequence data that does not reach a maximum length with padding;
a sequence prediction model for inputting a token sequence of a predetermined length for each of the sequence data filled with padding and predicting a next shifted token sequence ;
Control tokens represent conceptual actions of a user;
Tokens in sequence data represent multiple concrete actions that divide conceptual actions.
A prediction device comprising:
ユーザ周辺状態を表す制御コードを出力する制御コード分類モデルを更に有し、
制御トークン付与手段は、制御コード分類モデルから出力された制御コードを、制御トークンとして含める
ことを特徴とする請求項に記載の予測装置。
The control code classification model outputs a control code representing a user surrounding state,
2. The prediction device according to claim 1 , wherein the control token providing means includes a control code output from the control code classification model as a control token.
制御コード分類モデルは、ユーザ周辺に配置された1つ以上の環境センサの計測値を入力し、計測値に基づく特徴量を、制御コードとして出力する
ことを特徴とする請求項に記載の予測装置。
3. The prediction device according to claim 2 , wherein the control code classification model inputs measured values of one or more environmental sensors arranged around the user, and outputs a feature quantity based on the measured values as a control code.
制御コード分類モデルは、訓練段階として、ユーザ周辺に配置された環境センサの計測値を説明変数とし、ユーザの概念的行動を目的変数として対応付けた教師データを入力し、推定段階として、ユーザ周辺に配置された環境センサの計測値を説明変数として入力し、ユーザの概念的行動及び第1の尤度を出力するものであり、
制御コード分類モデルは、第1の尤度が所定閾値以上となるユーザの概念的行動のみを、制御コードとして出力する
ことを特徴とする請求項に記載の予測装置。
The control code classification model inputs teacher data in which measurement values of environmental sensors arranged around the user are used as explanatory variables and the conceptual behavior of the user is associated with a target variable as a training phase, and inputs measurement values of environmental sensors arranged around the user as explanatory variables as an estimation phase, and outputs the conceptual behavior of the user and a first likelihood;
4. The prediction device according to claim 3 , wherein the control code classification model outputs, as a control code, only a conceptual action of the user for which the first likelihood is equal to or greater than a predetermined threshold value.
系列予測モデルは、推定段階について、第2の尤度を出力するものであり、
当該系列予測モデルが、制御トークンを含むトークン列を入力し、第2の尤度が所定閾値以上となる次のトークン列が出力された際に、入力された当該制御トークンを含むトークン列を説明変数とし、出力された当該次のトークン列を目的変数とした教師データとして更に記憶する
ことを特徴とする請求項に記載の予測装置。
The sequence prediction model outputs a second likelihood for the estimation stage;
5. The prediction device according to claim 4, wherein the sequence prediction model inputs a token sequence including a control token, and when a next token sequence in which the second likelihood is equal to or greater than a predetermined threshold is output, further stores the input token sequence including the control token as an explanatory variable and the output next token sequence as a target variable as training data.
系列予測モデルは、第1~nの所定長のトークン列を入力し、正解となる第2~n+1の所定長のトークン列を出力するように訓練すると共に、パディングによって1つの系列データの終了を認識する
ことを特徴とする請求項1からのいずれか1項に記載の予測装置。
The prediction device according to any one of claims 1 to 5, characterized in that the sequence prediction model is trained to input a token sequence of 1 to n of a predetermined length and output a token sequence of 2 to n+1 of a predetermined length as a correct answer, and recognizes the end of one piece of sequence data by padding.
第1~m(m<n)のアクションが連続する所定長のトークン列の末尾の第nのトークンがパディングとなる場合、第1~m-1のアクションが連続する所定長のトークン列を入力し、正解となる第2~mのアクションが連続する所定長のトークン列を出力するように訓練する
ことを特徴とする請求項に記載の予測装置。
The prediction device according to claim 6, characterized in that, when the nth token at the end of a token string of a predetermined length in which actions 1 to m (m<n) are consecutive is padding, the prediction device is trained to input a token string of a predetermined length in which actions 1 to m-1 are consecutive, and to output a token string of a predetermined length in which actions 2 to m are consecutive, which is the correct answer.
系列予測モデルは、出力データのトークン列と、正解データのトークン列との間の誤差を小さくする損失関数を設定する
ことを特徴とする請求項1からのいずれか1項に記載の予測装置。
6. The prediction device according to claim 1, wherein the sequence prediction model sets a loss function that reduces an error between a token sequence of the output data and a token sequence of the correct answer data.
系列データに含まれるトークンは、時系列に並んだものである
ことを特徴とする請求項1からのいずれか1項に記載の予測装置。
6. The prediction device according to claim 1, wherein tokens included in the sequence data are arranged in a time series.
系列予測モデルは、GPT(Generative Pre-trained Transformer)である
ことを特徴とする請求項1からのいずれか1項に記載の予測装置。
6. The prediction device according to claim 1 , wherein the sequence prediction model is a Generative Pre-trained Transformer (GPT).
データセットは複数の系列データからなり、各系列データは複数のトークンからなり、所定長のトークン列を入力し、次のトークンを予測するようにコンピュータを機能させるプログラムにおいて、
複数の系列データの中で最大のトークン数に、制御トークンを加算した数を、系列データの最大長として設定し、
系列データ毎に、当該系列データに関連する制御トークンを付与する制御トークン付与手段と、
系列データ毎に、最大長に満たない後方にパディングを埋めるパディング手段と、
パディングが埋められた系列データ毎に、所定長のトークン列を入力し、次にシフトしたトークン列を予測する系列予測モデルと
して機能させ、
制御トークンは、ユーザの概念的行動を表し、
系列データのトークンは、概念的行動を区分した複数の具体的行動を表す
ようにコンピュータを機能させることを特徴とするプログラム。
A data set is made up of a plurality of sequence data, each sequence data being made up of a plurality of tokens, and a program for inputting a token sequence of a predetermined length and causing a computer to function to predict the next token,
The maximum number of tokens among the multiple sequential data is added to the control token, and the sum is set as the maximum length of the sequential data.
a control token assigning means for assigning a control token related to each piece of sequential data;
a padding means for padding a portion of each of the sequence data that does not reach a maximum length with padding;
For each padded sequence data, a sequence prediction model is used to input a token sequence of a given length and predict the next shifted token sequence.
and make it work.
Control tokens represent conceptual actions of a user;
Tokens in sequence data represent multiple concrete actions that divide conceptual actions.
A program that causes a computer to function in such a manner .
データセットは複数の系列データからなり、各系列データは複数のトークンからなり、所定長のトークン列を入力し、次のトークンを予測する装置の予測方法において、
装置は、
複数の系列データの中で最大のトークン数に、制御トークンを加算した数を、系列データの最大長として設定し、
系列データ毎に、当該系列データに関連する制御トークンを付与する第1のステップと、
系列データ毎に、最大長に満たない後方にパディングを埋める第2のステップと、
系列予測モデルを用いて、パディングが埋められた系列データ毎に、所定長のトークン列を入力し、次にシフトしたトークン列を予測する第3のステップと
を実行し、
制御トークンは、ユーザの概念的行動を表し、
系列データのトークンは、概念的行動を区分した複数の具体的行動を表す
ことを特徴とする予測方法。
A data set is made up of a plurality of sequence data, each sequence data being made up of a plurality of tokens, and a prediction method for a device for inputting a token sequence of a predetermined length and predicting the next token, comprising:
The device is
The maximum number of tokens among the multiple sequential data is added to the control token, and the sum is set as the maximum length of the sequential data.
a first step of assigning a control token associated with each piece of sequential data to the piece of sequential data;
a second step of filling the trailing portion of each sequence data with padding if the trailing portion does not reach the maximum length;
a third step of inputting a token sequence of a predetermined length for each of the padded sequence data using a sequence prediction model, and predicting a next shifted token sequence ;
Control tokens represent conceptual actions of a user;
Tokens in sequence data represent multiple concrete actions that divide conceptual actions.
A prediction method comprising:
JP2022065617A 2022-04-12 2022-04-12 Prediction device, program, and method for predicting user behavior sequences using sequence prediction model Active JP7688601B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2022065617A JP7688601B2 (en) 2022-04-12 2022-04-12 Prediction device, program, and method for predicting user behavior sequences using sequence prediction model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2022065617A JP7688601B2 (en) 2022-04-12 2022-04-12 Prediction device, program, and method for predicting user behavior sequences using sequence prediction model

Publications (2)

Publication Number Publication Date
JP2023156029A JP2023156029A (en) 2023-10-24
JP7688601B2 true JP7688601B2 (en) 2025-06-04

Family

ID=88421289

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2022065617A Active JP7688601B2 (en) 2022-04-12 2022-04-12 Prediction device, program, and method for predicting user behavior sequences using sequence prediction model

Country Status (1)

Country Link
JP (1) JP7688601B2 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020154684A (en) 2019-03-20 2020-09-24 俊幸 常本 Information processing system, information processing method and program
WO2021171732A1 (en) 2020-02-28 2021-09-02 日本電信電話株式会社 Learning device, text generating device, learning method, text generating method, and program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020154684A (en) 2019-03-20 2020-09-24 俊幸 常本 Information processing system, information processing method and program
WO2021171732A1 (en) 2020-02-28 2021-09-02 日本電信電話株式会社 Learning device, text generating device, learning method, text generating method, and program

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
宮澤 和貴,"GPT-2を用いた人の動作予測",一般社団法人 人工知能学会 第35回全国大会(2021) [online],一般社団法人 人工知能学会,2021年12月31日,p.1-4
横山 想一郎,"深層学習を用いた言語モデルによる俳句生成におけるトークン単位選択" ,情報処理学会 研究報告 知能システム(ICS) 2020-ICS-198 [online] ,日本,情報処理学会,2020年02月29日,p.1-7,ISSN:2188-885X
永塚 光一,"文長制御のための条件付き言語モデル",一般社団法人 人工知能学会 第34回全国大会(2020) [online],一般社団法人 人工知能学会,2020年12月31日,p.1-4
風間 健太郎,時系列Transformerによる環境要因を考慮したニホンジカの行動予測,電子情報通信学会技術研究報告 Vol.121 No.382 [online] IEICE Technical Report,日本,一般社団法人電子情報通信学会,2022年02月21日,第121巻第382号,p.19-24,ISSN:2432-6380

Also Published As

Publication number Publication date
JP2023156029A (en) 2023-10-24

Similar Documents

Publication Publication Date Title
Wang et al. A survey on curriculum learning
Wang et al. Efficient meta lifelong-learning with limited memory
CN112541060B (en) An end-to-end task-based dialogue learning framework and method based on adversarial training
CN108388425B (en) A method for automatic code completion based on LSTM
Rocktäschel et al. Reasoning about entailment with neural attention
Moravvej et al. An LSTM-based plagiarism detection via attention mechanism and a population-based approach for pre-training parameters with imbalanced classes
US20220215267A1 (en) Processes and methods for enabling artificial general intelligence capable of flexible calculation, prediction, planning and problem solving with arbitrary and unstructured data inputs and outputs
CN109325231A (en) A Method for Generating Word Vectors from Multi-task Models
Kostadinov Recurrent neural networks with Python quick start guide: sequential learning and language modeling with tensorflow
CN114519353B (en) Model training method, emotion message generation method and device, equipment and medium
Thukral et al. Layout-agnostic human activity recognition in smart homes through textual descriptions of sensor triggers (tdost)
CN115186147B (en) Dialogue content generation method and device, storage medium and terminal
Le et al. Neural stored-program memory
CN114091429A (en) Text abstract generation method and system based on heterogeneous graph neural network
CN110457714A (en) A Natural Language Generation Method Based on Temporal Topic Model
CN113139057A (en) Domain-adaptive chemical potential safety hazard short text classification method and system
CN118051625A (en) A method and device for optimizing scene generation model, storage medium, and electronic device
JP7606808B2 (en) Prediction device, program, and method for predicting user behavior sequences using sequence prediction model
CN115953215B (en) Search type recommendation method based on time and graph structure
JP7688601B2 (en) Prediction device, program, and method for predicting user behavior sequences using sequence prediction model
Saputra et al. Classification of Indonesian News using LSTM-RNN Method
CN116049365A (en) Text Question Answering System Based on Machine Reading Comprehension
Huyck et al. Extended category learning with spiking nets and spike timing dependent plasticity
CN114818690A (en) Comment information generation method and device and storage medium
Nayak et al. Next Word Prediction Using Machine Learning Techniques

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20240618

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20250321

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20250328

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20250417

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20250523

R150 Certificate of patent or registration of utility model

Ref document number: 7688601

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150