JP7817129B2 - Code creation support system, method, and program - Google Patents
Code creation support system, method, and programInfo
- Publication number
- JP7817129B2 JP7817129B2 JP2022156487A JP2022156487A JP7817129B2 JP 7817129 B2 JP7817129 B2 JP 7817129B2 JP 2022156487 A JP2022156487 A JP 2022156487A JP 2022156487 A JP2022156487 A JP 2022156487A JP 7817129 B2 JP7817129 B2 JP 7817129B2
- Authority
- JP
- Japan
- Prior art keywords
- template
- cells
- data type
- cell
- deliverable
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Stored Programmes (AREA)
Description
本開示は、計算ノートブックにより作成された成果物からコンピュータシステムに組み込むためのプログラムコードを作成する技術に関する。 This disclosure relates to technology for creating program code for incorporation into a computer system from the results created by a computational notebook.
データサイエンティストの多くは、ジュピターノートブックに代表される計算ノートブックで人工知能の開発を行っている。計算ノートブックは、データ分析を行うための環境ツールである。データサイエンティストは、計算ノートブック上でセルと呼ばれるプログラム断片を作成し、複数のセルを所望の順番で実行し、各セルの実行結果を確認しながらデータ分析を行う。前述のデータ分析の結果として得られる成果物である計算ノートブック形式の人工知能モデルは、コンピュータシステムに組み込んで利用することができる。 Many data scientists develop artificial intelligence using computational notebooks, such as Jupyter Notebook. Computational notebooks are environmental tools for data analysis. Data scientists create program fragments called cells in the computational notebook, execute multiple cells in the desired order, and perform data analysis while checking the execution results of each cell. The output obtained as a result of the aforementioned data analysis, an artificial intelligence model in computational notebook format, can be incorporated into a computer system and used.
しかし、計算ノートブックは、コンピュータシステムへ組み込むプログラムコードそのものを作成するためのものではなく、データ分析を行うために作られている。そのため、計算ノートブック上ではセル単位の処理の実行順序を明確に定めることは行われない。計算ノートブックで作成した成果物をコンピュータシステムへ組み込むためには、その成果物を基にして、処理単位の実行順序を明確に規定してコンピュータシステムで実行可能にしたプログラムコードを作成した上でそのプログラムコードを組み込む必要があり、煩雑な作業となっている。そのため、計算ノートブックで作成した成果物のコンピュータシステムへの組み込みを容易にする技術が求められている。 However, computational notebooks are designed for data analysis, not for creating program code to be incorporated into computer systems. As a result, the execution order of cell-level processing is not clearly defined in computational notebooks. In order to incorporate the results created in computational notebooks into a computer system, it is necessary to use the results as a basis to create program code that clearly defines the execution order of processing units and is executable on a computer system, and then incorporate that program code, which is a cumbersome task. Therefore, there is a need for technology that makes it easier to incorporate results created in computational notebooks into computer systems.
特許文献1には、計算ノートブックの成果物をノードとリンクによるグラフ形式で提示することにより、作成者以外のアナリスト等が成果物の構造等を理解することを手助けする技術が開示されている。 Patent Document 1 discloses a technology that helps analysts other than the creator understand the structure of a calculation notebook by presenting the results of the calculation notebook in a graph format with nodes and links.
上述したように、計算ノートブックによる成果物をコンピュータシステムで利用する場合、その成果物を基にしてコンピュータシステムの仕様等を考慮してコンピュータシステム上で実行可能なプログラムコードを作成する必要がある。しかしながら、特許文献1の技術は、計算ノートブックの成果物をグラフ形式で提示するものであり、成果物の把握の手助けにはなるが、コンピュータシステムで実行可能なプログラムコードの作成を容易にするとは言えないものであった。 As mentioned above, when using the results of a calculation notebook on a computer system, it is necessary to create program code that can be executed on the computer system based on the results, taking into account the specifications of the computer system, etc. However, the technology in Patent Document 1 presents the results of the calculation notebook in a graphical format, which helps to understand the results, but does not make it easy to create program code that can be executed on a computer system.
本開示に含まれるひとつの目的は、計算ノートブックによる成果物のコンピュータシステムへの組み込みを容易にする技術を提供することである。 One objective of this disclosure is to provide technology that makes it easier to incorporate the results of a computational notebook into a computer system.
本開示に含まれるひとつの態様によるコード作成支援システムは、プログラムの断片であるセルの単位で処理を記述したデータ分析の成果物におけるセル間の変数の依存関係を抽出するセル間依存関係抽出処理部と、前記成果物のセル間の変数の中から機械学習モデルを特定し、前記機械学習モデルを変数として他のセルに渡しているセルを検出し、検出された前記セルから変数の依存関係を遡るように辿って特定データ型を検出する入力データ型特定処理部と、入力データ型に対応付けて記憶されたプログラムコードのテンプレートから、検出された前記特定データ型と一致する入力データ型に対応付けられているテンプレートをマッチングの対象として特定し、前記成果物における前記テンプレートと整合する部分を探索するテンプレートマッチング処理部と、を有する。 One aspect of the code creation assistance system included in the present disclosure includes an inter-cell dependency extraction processing unit that extracts inter-cell variable dependencies in a data analysis result in which processing is described in units of cells, which are program fragments; an input data type identification processing unit that identifies a machine learning model from among the inter-cell variables in the result, detects cells that pass the machine learning model as a variable to other cells, and detects a specific data type by tracing back the variable dependencies from the detected cell; and a template matching processing unit that identifies, as a matching target, a template associated with an input data type that matches the detected specific data type from program code templates stored in association with the input data type, and searches for a portion of the result that matches the template.
本開示に含まれるひとつの態様によれば、計算ノートブックによる成果物のコンピュータシステムへの組み込みを容易にすることが可能となる。 One aspect of the present disclosure makes it easier to incorporate the results of a calculation notebook into a computer system.
以下、本発明の実施形態について図面を参照して説明する。 Embodiments of the present invention will be described below with reference to the drawings.
図1は、本開示の実施形態の少なくとも一つに対応する、コード作成支援システムの構成例を示す概念図である。 Figure 1 is a conceptual diagram showing an example configuration of a code creation support system corresponding to at least one embodiment of the present disclosure.
図1に示すコード作成支援システム1は、本実施形態においては、コンピュータなどの情報処理装置である。情報処理装置は、各種の情報処理を行うことができる。なお、1以上のクライアント端末および1以上のサーバ装置等を通信可能に接続することによって、複数の装置がコード作成支援システム1を構成してもよい。 In this embodiment, the code creation support system 1 shown in FIG. 1 is an information processing device such as a computer. The information processing device is capable of performing various types of information processing. Note that the code creation support system 1 may be made up of multiple devices, such as one or more client terminals and one or more server devices, which are communicatively connected.
コード作成支援システム1は、プロセッサ10とメモリ20とを有する。コード作成支援システム1は、外部ネットワーク100を介して外部装置と通信可能な通信部30を有する。プロセッサ10、メモリ20、および通信部30はバスを介して通信可能に接続されている。 The code creation support system 1 has a processor 10 and a memory 20. The code creation support system 1 has a communication unit 30 that can communicate with external devices via an external network 100. The processor 10, memory 20, and communication unit 30 are connected to each other so that they can communicate with each other via a bus.
コード作成支援システム1は、マウスやキーボード等の入力装置、および、ディスプレイやスピーカ等の出力装置をさらに備えていてもよい。 The code creation support system 1 may further include input devices such as a mouse and keyboard, and output devices such as a display and speakers.
プロセッサ10は、例えばCPU(Central Processing Unit)、GPU(Graphics Processing Unit)、FPGA(Field-Programmable Gate Array)等で構成される。プロセッサ10は、コード作成支援システム1の各部の動作を全体的に統括するための制御処理、外部装置との間のデータの入出力処理、データの計算処理、およびデータの記憶処理を行う。 The processor 10 is composed of, for example, a CPU (Central Processing Unit), GPU (Graphics Processing Unit), FPGA (Field-Programmable Gate Array), etc. The processor 10 performs control processing to oversee the overall operation of each part of the code creation support system 1, data input/output processing with external devices, data calculation processing, and data storage processing.
メモリ20は、例えばHDD(Hard Disk Drive)などの磁気記憶媒体、RAM(Random Access Memory)、ROM(Read Only Memory)、SSD(Solid State Drive)などの半導体記憶媒体等を有する。その他、磁気テープメディアなどの公知の記憶媒体もメモリ20に含まれ得る。メモリ20は、プロセッサ10が実行する各種プログラム(OS、アプリケーションソフト等)や各種データを格納している。また、メモリ20は、後述のテンプレート情報21を記憶する。 The memory 20 includes, for example, magnetic storage media such as HDDs (Hard Disk Drives), and semiconductor storage media such as RAMs (Random Access Memory), ROMs (Read Only Memory), and SSDs (Solid State Drives). Other well-known storage media, such as magnetic tape media, may also be included in the memory 20. The memory 20 stores various programs (OS, application software, etc.) and various data executed by the processor 10. The memory 20 also stores template information 21, which will be described later.
プロセッサ10は、メモリ20に保持されたプログラムを実行することにより、セル間依存関係抽出処理部11、入力データ型特定処理部12、およびテンプレートマッチング処理部13の各機能を実現する。 The processor 10 executes the programs stored in the memory 20 to realize the functions of the inter-cell dependency extraction processing unit 11, the input data type identification processing unit 12, and the template matching processing unit 13.
セル間依存関係抽出処理部11は、プログラムの断片であるセルの単位で処理を記述したデータ分析の成果物におけるセル間の変数の依存関係を抽出する。入力データ型特定処理部12は、成果物のセル間の変数の中から機械学習モデルを特定し、機械学習モデルを変数として他のセルに渡しているセルを検出し、検出されたセルから変数の依存関係を遡るように辿って特定データ型を検出する。テンプレートマッチング処理部13は、入力データ型に対応付けて記憶されたプログラムコードのテンプレートから、検出された特定データ型と一致する入力データ型に対応付けられているテンプレートをマッチングの対象として特定し、成果物におけるテンプレートと整合する部分を探索する。 The inter-cell dependency extraction processing unit 11 extracts the dependency relationships between cells in a data analysis result in which processing is described in units of cells, which are program fragments. The input data type identification processing unit 12 identifies a machine learning model from the variables between the cells in the result, detects cells that pass the machine learning model as a variable to other cells, and detects a specific data type by tracing back the variable dependencies from the detected cells. The template matching processing unit 13 identifies, as a matching target, a template associated with an input data type that matches the detected specific data type from program code templates stored in association with the input data type, and searches for parts of the result that match the template.
成果物は、ジュピターノートブックに代表される計算ノートブックにより作成された成果物である。 The deliverables are those created using computational notebooks, such as Jupyter Notebooks.
図2は、本開示の実施形態の少なくとも一つに対応する、コード作成支援システムにおける処理の流れを例示する概念図である。 Figure 2 is a conceptual diagram illustrating the processing flow in a code creation assistance system corresponding to at least one embodiment of the present disclosure.
プロセッサ10は計算ノートブックNBを取得する。計算ノートブックNBは、例えばジュピターノートブックについては、拡張子「.ipynb」形式のファイル等である。計算ノートブックNBはメモリ20に保存されていてよい。また、プロセッサ10は計算ノートブックNBを、外部ネットワーク100を介して外部装置から取得してもよい。外部装置にはクラウドサーバ等が含まれる。 The processor 10 acquires the calculation notebook NB. For example, in the case of a Jupyter notebook, the calculation notebook NB is a file with the extension ".ipynb". The calculation notebook NB may be stored in the memory 20. The processor 10 may also acquire the calculation notebook NB from an external device via the external network 100. The external device may include a cloud server, etc.
プロセッサ10は、取得した計算ノートブックNBに基づいて、セル間依存関係抽出処理部11、入力データ型特定処理部12、およびテンプレートマッチング処理部13等の各種機能に係る処理を実行する。 Based on the acquired calculation notebook NB, the processor 10 executes processing related to various functions, such as the inter-cell dependency extraction processing unit 11, the input data type identification processing unit 12, and the template matching processing unit 13.
テンプレートマッチング処理部13がマッチングの対象とするテンプレートは、テンプレート情報21としてメモリ20に格納されている。テンプレートは、入力データ型に対応付けて記憶されたプログラムコードのテンプレートである。 The templates that the template matching processing unit 13 matches are stored in memory 20 as template information 21. The templates are program code templates stored in association with the input data type.
テンプレート情報21は、データ型毎のテンプレートを含む。機械学習においては推論処理、学習処理、評価処理等が行われるところ、テンプレート情報21は例えば、推論処理用のテンプレート、学習処理用のテンプレート、および評価処理用のテンプレートをそれぞれ1種類以上含んでいる。すなわちメモリ20には、入力データ型毎に、学習データを学習して機械学習モデルを構築する学習処理のテンプレートと、機械学習モデルの推論精度を評価する評価処理のテンプレートと、機械学習モデルにより推論を行う推論処理のテンプレートとが記憶されている。 Template information 21 includes templates for each data type. Machine learning involves processes such as inference, learning, and evaluation, and template information 21 includes, for example, one or more templates for inference, learning, and evaluation. That is, for each input data type, memory 20 stores a learning process template that learns learning data and builds a machine learning model, an evaluation process template that evaluates the inference accuracy of the machine learning model, and an inference process template that performs inference using the machine learning model.
プロセッサ10は、計算ノートブックNBに基づいて作成したプログラムコードをシステム組込パイプラインPLに出力する。 The processor 10 outputs the program code created based on the calculation notebook NB to the system embedded pipeline PL.
図3は、本開示の実施形態の少なくとも一つに対応する、テンプレート情報のデータ構造を例示する概念図である。 Figure 3 is a conceptual diagram illustrating the data structure of template information corresponding to at least one embodiment of the present disclosure.
データ型毎テンプレートは、入力データ型情報と対応付けられた状態でメモリ20に記憶される。例えば、入力データ型情報とデータ型毎テンプレートとを列挙した表データ等の形態でメモリ20に記憶されていてよい。テンプレートマッチング処理部13は、成果物から3つのテンプレート、すなわち学習処理のテンプレートと、評価処理のテンプレートと、推論処理のテンプレートのそれぞれに整合する部分を探索する。なお、探索については図11を参照して後述する。 Templates for each data type are stored in memory 20 in association with input data type information. For example, they may be stored in memory 20 in the form of table data listing input data type information and templates for each data type. The template matching processing unit 13 searches the deliverable for parts that match each of the three templates, namely the learning process template, the evaluation process template, and the inference process template. The search will be described later with reference to Figure 11.
図4は、本開示の実施形態の少なくとも一つに対応する、データ型毎テンプレートを示す概念図である。 Figure 4 is a conceptual diagram showing templates for each data type, corresponding to at least one embodiment of the present disclosure.
テンプレートには、1つ以上の構成要素の入力データの個数およびデータ型と、該構成要素間の変数の依存関係とが制約条件として規定されている。なお、テンプレートには、1つ以上の構成要素の出力データの個数およびデータ型がさらに規定されていてもよい。データ型とは、例えば数値型や後述のテキスト型などの、変数の型を意味する。データ数とは、データが何種類あるか、すなわちデータの個数を意味する。例えばあるタスクの入力データが、数値型の変数aと、テキスト型の変数bと、テキスト型の変数cである場合、入力データ数は3である。 A template specifies the number and data type of input data for one or more components, as well as the variable dependencies between those components, as constraints. The template may also specify the number and data type of output data for one or more components. Data type refers to the type of variable, such as numeric or the text type described below. The number of data items refers to the number of different types of data, i.e., the number of pieces of data. For example, if the input data for a task is numeric variable a, text variable b, and text variable c, the number of input data items is three.
構成要素の例として、プログラムに含まれるタスクがある。タスクは、そのテンプレートにより実行される処理フローの断片である。図4に示したデータ型毎テンプレートには、構成要素としてtask1、task2、およびtask3等の複数のタスクが示されている。タスクには実行順序があり、図4に示したデータ型毎テンプレートでは、task1、task2、およびtask3の順番で実行される。なお、タスクは1タスク毎に順次実行されるとは限らず、複数のタスクが並列的に同時に実行される場合もある。 An example of a component is a task included in a program. A task is a fragment of the processing flow executed by that template. The data type template shown in Figure 4 shows multiple tasks, such as task1, task2, and task3, as components. Tasks have an execution order, and in the data type template shown in Figure 4, they are executed in the order task1, task2, and task3. Note that tasks are not necessarily executed one by one sequentially; multiple tasks may be executed simultaneously in parallel.
図5は、本開示の実施形態の少なくとも一つに対応する、データ型毎テンプレートを例示する概念図である。 Figure 5 is a conceptual diagram illustrating templates for each data type, corresponding to at least one embodiment of the present disclosure.
人工知能による処理には、学習、評価、推論などの複数の処理が含まれる。本実施形態では、数値型データについての学習テンプレート、評価テンプレート、および推論テンプレートを例示する。 Artificial intelligence processing includes multiple processes such as learning, evaluation, and inference. In this embodiment, learning templates, evaluation templates, and inference templates for numerical data are illustrated as examples.
図5に示した各テンプレートにおける、白抜きの矩形は処理を表わしている。例えばpreprocessは前処理を、split(in row)はデータの分割処理を意味する。白抜きの矩形は図4におけるtask1などのタスクに対応する。一方、点付きの矩形はデータを表わしている。例えば、dfと記載された点付き矩形は、例えば、複数のデータ列を行列形式で表現したデータフレームを意味している。 In each template shown in Figure 5, the open rectangles represent processing. For example, "preprocess" means preprocessing, and "split (in row)" means data splitting. The open rectangles correspond to tasks such as task1 in Figure 4. On the other hand, the dotted rectangles represent data. For example, the dotted rectangle labeled "df" represents a data frame that expresses multiple data columns in matrix format.
学習テンプレートについて説明する。なお、テンプレートに含まれる各タスクを実行する際の実行主体は、例えばプロセッサ10であるとして説明する。 The learning template will now be described. Note that the execution entity for executing each task included in the template will be the processor 10, for example.
タスクT101においてプロセッサ10は、ラベル付きのデータを入力データとして取得する。プロセッサ10は、入力データをロードして再構築し、対象データdfを出力する。 In task T101, processor 10 obtains labeled data as input data. Processor 10 loads and reconstructs the input data, and outputs target data df.
タスクT102においてプロセッサ10は、入力データである対象データdfに対して前処理を行う。前処理は機械学習において一般的な処理であるため、詳しい説明は省略する。タスクT102の出力データは、前処理後の対象データdfとなる。 In task T102, processor 10 performs preprocessing on the input data, target data df. Preprocessing is a common process in machine learning, so a detailed explanation will be omitted. The output data of task T102 is the preprocessed target data df.
タスクT103においてプロセッサ10は、入力データである前処理後の対象データdfを、学習用データtrain_dfとテストデータtest_dfとに、行方向に分割する。タスクT102の出力データは、分割後の学習用データtrain_dfとテストデータtest_dfの2種類となる。 In task T103, processor 10 divides the input data, preprocessed target data df, row-wise into training data train_df and test data test_df. The output data of task T102 is two types: the divided training data train_df and test data test_df.
タスクT104においてプロセッサ10は、入力データである学習用データtrain_dfを用いて学習モデルのトレーニングを行う。学習モデルのトレーニングは機械学習において一般的な処理であるため、詳しい説明は省略する。トレーニング後の学習済みモデルがタスクT104の出力データとなり、後述のタスクT106の入力データになる。なお、入力データまたは出力データとしての学習済みモデルは、重みデータの集合のみでもよく、重みデータとネットワーク構造を示すデータの双方であってもよい。 In task T104, processor 10 trains the learning model using the input data, training data train_df. Training a learning model is a common process in machine learning, so a detailed explanation will be omitted. The trained model after training becomes the output data for task T104 and the input data for task T106, which will be described later. Note that the trained model as input data or output data may be just a set of weight data, or it may be both weight data and data indicating the network structure.
タスクT105においてプロセッサ10は、入力データであるテストデータtest_dfの中から、説明変数df_fを抽出してタスクT106へと出力し、目的変数dfを抽出してタスクT107へと出力する。 In task T105, processor 10 extracts explanatory variable df_f from the input data, test data test_df, and outputs it to task T106, and extracts objective variable df and outputs it to task T107.
タスクT106においてプロセッサ10は、入力データである説明変数df_fを、タスクT104で得られた学習済みモデルに入力する。その結果、学習済みモデルから予測結果Prediction_resultが出力される。 In task T106, processor 10 inputs the explanatory variable df_f, which is input data, into the trained model obtained in task T104. As a result, the trained model outputs a prediction result Prediction_result.
タスクT107においてプロセッサ10は、入力データである予測結果Prediction_resultと入力データである目的変数dfとを用いて予測結果を評価し、評価結果resultを出力する。 In task T107, processor 10 evaluates the prediction result using the input data, prediction_result, and the input data, objective variable df, and outputs the evaluation result, result.
次に、評価テンプレートについて説明する。なお、タスクT201、T202、T205およびT207は、タスクT101、T102、T105およびT107とそれぞれ同様の処理であるため、説明を省略する。 Next, we will explain the evaluation template. Note that tasks T201, T202, T205, and T207 perform the same processing as tasks T101, T102, T105, and T107, respectively, and therefore will not be explained here.
タスクT203においてプロセッサ10は、入力データである前処理後の対象データdfを、テストデータtest_dfに割り当てる。 In task T203, the processor 10 assigns the preprocessed target data df, which is the input data, to the test data test_df.
タスクT206においてプロセッサ10は、入力データである説明変数df_fを、既に導入済みである学習済みモデルに入力する。その結果、学習済みモデルから予測結果Prediction_resultが出力される。 In task T206, the processor 10 inputs the explanatory variable df_f, which is input data, into the trained model that has already been introduced. As a result, the trained model outputs a prediction result Prediction_result.
次に、推論テンプレートについて説明する。なお、タスクT301およびT302は、タスクT101およびT102とそれぞれ同様の処理であるため、説明を省略する。 Next, we will explain the inference template. Note that tasks T301 and T302 perform the same processing as tasks T101 and T102, respectively, so their explanation will be omitted.
タスクT303においてプロセッサ10は、入力データである前処理後の対象データdfを、推論対象データdf_fに割り当てる。 In task T303, the processor 10 assigns the preprocessed target data df, which is the input data, to the inference target data df_f.
タスクT306においてプロセッサ10は、入力データである推論対象データdf_fを、既に導入済みである学習済みモデルに入力する。その結果、学習済みモデルから推論結果Prediction_resultが出力される。 In task T306, the processor 10 inputs the inference target data df_f, which is the input data, into the trained model that has already been introduced. As a result, the trained model outputs the inference result Prediction_result.
以上、数値型データについてのデータ型毎テンプレートとして、学習テンプレート、評価テンプレート、および推論テンプレートの3種類を例示した。これらのテンプレートは、データ型に応じて異なるテンプレートが設けられていてよい。例えば、時系列型のデータ型に対応した学習テンプレート、評価テンプレートおよび推論テンプレートが設けられ、さらに、テキスト型のデータ型に対応した学習テンプレート、評価テンプレートおよび推論テンプレートが設けられていてもよい。 The above provides examples of three types of templates for each data type of numeric data: learning templates, evaluation templates, and inference templates. Different templates may be provided depending on the data type. For example, learning templates, evaluation templates, and inference templates may be provided for time-series data types, and further learning templates, evaluation templates, and inference templates may be provided for text data types.
図6は、本開示の実施形態の少なくとも一つに対応する、データ型情報を例示する概念図である。 Figure 6 is a conceptual diagram illustrating data type information corresponding to at least one embodiment of the present disclosure.
データ型として、(a)時系列型、(b)画像型、および(c)テキスト型を例示する。入力データ型には、これら3つのデータ型のうち少なくとも1つが含まれる。 Example data types are (a) time series type, (b) image type, and (c) text type. The input data type includes at least one of these three data types.
時系列型のデータタイプは、例えばDataFrameである。DataFrameは、Timestamp型のカラムと、Number型のカラムとを有する。Timestamp型のカラムは、Nullを許容しない。Number型のカラムはNullを許容する。DataFrameとしてはNullを許容しない。 An example of a time series data type is DataFrame. DataFrame has a Timestamp column and a Number column. Timestamp columns do not allow nulls. Number columns allow nulls. DataFrames do not allow nulls.
画像型の場合、データタイプはイメージ(画像そのもの)であり、Nullを許容しない。画像のフォーマットは、pngフォーマット、jpgフォーマット、bmpフォーマットのうちいずれかである。画像のサイズは、幅および高さが共に固定値である。 For image types, the data type is image (the image itself) and does not allow null. The image format is either png, jpg, or bmp. The image size has fixed values for both width and height.
テキスト型の場合、データタイプはTextである。言語は、英語や日本語など、各国の言語であり、ここでは英語である。文字コードは、例えばUTF-8やUNICODEなどであり、ここではUTF-8である。 For text data, the data type is Text. The language is the language of the country, such as English or Japanese; in this case, it is English. The character code is, for example, UTF-8 or UNICODE; in this case, it is UTF-8.
なお、テンプレート情報21に含まれる入力データ型情報は、図6に示したようなデータ型の情報のすべてを含んでいる必要はない。例えば(a)時系列型のデータ型には0001、(b)画像型のデータ型には0002、(c)テキスト型のデータ型には0003等のように参照番号などを予め設定しておき、テンプレート情報21には入力データ型情報として参照番号が含まれるようにしてもよい。 Note that the input data type information included in template information 21 does not need to include all of the data type information shown in FIG. 6. For example, reference numbers may be set in advance, such as 0001 for (a) time series data types, 0002 for (b) image data types, and 0003 for (c) text data types, and template information 21 may include the reference numbers as input data type information.
また、(a)時系列型、(b)画像型、および(c)テキスト型以外のデータ型を規定するデータ型情報がテンプレート情報21(図3参照)に入力データ型情報として含まれていてもよい。データ型として、前述のDataframeの他に、tensor、numpy array、dataset等がある。 In addition, data type information specifying data types other than (a) time series type, (b) image type, and (c) text type may be included as input data type information in template information 21 (see Figure 3). In addition to the aforementioned Dataframe, data types include tensor, numpy array, dataset, etc.
図7は、本開示の実施形態の少なくとも一つに対応する、セル間依存関係抽出処理の処理例を示すフローチャートである。 Figure 7 is a flowchart showing an example of inter-cell dependency extraction processing corresponding to at least one embodiment of the present disclosure.
セル間依存関係抽出処理部11は、計算ノートブックの成果物から、プログラムコードを含むセルを抽出する(S101)。 The inter-cell dependency extraction processing unit 11 extracts cells containing program code from the calculation notebook deliverables (S101).
セル間依存関係抽出処理部11は、抽出されたセルにおける、セル内の変数への代入を行う命令(A)と、変数を参照または利用している命令(B)とをそれぞれ特定する(S102)。 The inter-cell dependency extraction processing unit 11 identifies, for the extracted cell, the instruction (A) that assigns to the variable in the cell and the instruction (B) that references or uses the variable (S102).
セル間依存関係抽出処理部11は、抽出された各セルの入力変数および出力変数と、各セル間の依存関係とを決定する(S103)。例えばセル間依存関係抽出処理部11は、第1セルで代入された変数が第2セルで参照または利用されている場合に、第1セルの出力変数が第2セルの入力変数であるという依存関係を特定する。 The inter-cell dependency extraction processing unit 11 determines the input variables and output variables of each extracted cell and the dependencies between each cell (S103). For example, when a variable assigned in a first cell is referenced or used in a second cell, the inter-cell dependency extraction processing unit 11 identifies a dependency in which the output variable of the first cell is an input variable of the second cell.
セル間依存関係抽出処理部11は、S103によって抽出された依存関係を参照して、ある変数における命令(A)の後に前記変数に対する命令(B)が実行される順番になるように、セルを順序づける(S104)。セルの順序は次のようにして決定できる。図11に示して後述する方法で2つのセル間における出力変数と入力変数を抽出した場合、セル1の出力変数をセル2の入力変数としていることが分かる。このとき、セル2はセル1の出力に依存していると言えるため、セル1の後にセル2を実行しなければならないことが分かる。 The inter-cell dependency extraction processing unit 11 refers to the dependencies extracted in S103 and orders the cells so that the instruction (B) for a certain variable is executed after the instruction (A) for that variable (S104). The order of the cells can be determined as follows. When the output and input variables between two cells are extracted using the method shown in Figure 11 and described below, it can be seen that the output variable of cell 1 is used as the input variable of cell 2. In this case, it can be said that cell 2 depends on the output of cell 1, and therefore it can be seen that cell 2 must be executed after cell 1.
セル間依存関係抽出処理部11は、抽出されたセルを依存関係に基づいて接続した成果物を実行し、処理が正常終了することを確認する(S105)。セル間依存関係抽出処理部11は、成果物の実行時に、各セルの実行の前後のポイントで入力変数と出力変数の値を参照し、入力データと出力データのデータ型情報を作成する。 The inter-cell dependency extraction processing unit 11 executes the deliverable in which the extracted cells are connected based on their dependencies, and confirms that the processing has completed successfully (S105). When executing the deliverable, the inter-cell dependency extraction processing unit 11 references the values of the input and output variables before and after the execution of each cell, and creates data type information for the input and output data.
なお、セル間依存関係抽出処理部11は、参照した入力変数と出力変数の値から、変数のデータ型および付帯するスキーマ情報を推定することにより、入力データと出力データのデータ型情報を作成する。 The inter-cell dependency extraction processing unit 11 creates data type information for the input and output data by inferring the data types of the variables and associated schema information from the values of the referenced input and output variables.
図8は、本開示の実施形態の少なくとも一つに対応する、依存関係が抽出された成果物のセルを例示する概念図である。 Figure 8 is a conceptual diagram illustrating an example of a cell of a deliverable from which dependencies have been extracted, according to at least one embodiment of the present disclosure.
図8に示した成果物は、図7のステップS105において実行する成果物に対応する。図8に示した成果物は、セル1、セル2およびセル3の3つのセルを有している。セルの実行順序は、セル1、セル2、セル3の順である。 The deliverable shown in Figure 8 corresponds to the deliverable executed in step S105 of Figure 7. The deliverable shown in Figure 8 has three cells: Cell 1, Cell 2, and Cell 3. The execution order of the cells is Cell 1, Cell 2, and Cell 3.
セル1は、変数var1に100を代入する命令を有している。この命令は、セル内の変数var1への代入を行う命令(A)である。 Cell 1 contains an instruction to assign 100 to variable var1. This instruction is instruction (A) that assigns a value to variable var1 within the cell.
セル2は、変数var2に、function1(var1,…)の実行結果を代入する命令を有している。この命令は、セル内の変数var2への代入を行う命令(A)である。また、function1の入力パラメータとしてvar1が挙げられているので、この命令は、変数var1を参照または利用している命令(B)である。 Cell 2 has an instruction to assign the execution result of function1 (var1, ...) to variable var2. This instruction is an instruction (A) that assigns to variable var2 within the cell. Also, because var1 is listed as an input parameter of function1, this instruction is an instruction (B) that references or uses variable var1.
セル3は、function2(var1,var2,…)を実行する命令を有している。function2の入力パラメータとしてvar1とvar2とが挙げられているので、この命令は、変数var1およびvar2を参照または利用している命令(B)である。 Cell 3 has an instruction to execute function2 (var1, var2, ...). Because var1 and var2 are listed as input parameters for function2, this instruction is an instruction (B) that references or uses variables var1 and var2.
次に、依存関係について説明する。セル1で代入が行われた変数var1が、セル2とセル3とで参照されている。したがって、変数var1はセル1についての出力変数である。また、変数var1はセル2およびセル3についての入力変数である。 Next, we will explain dependencies. The variable var1, which is assigned in cell 1, is referenced in cells 2 and 3. Therefore, variable var1 is an output variable for cell 1. Also, variable var1 is an input variable for cells 2 and 3.
セル2で代入が行われた変数var2がセル3で参照されている。したがって、変数var2はセル2についての出力変数である。また、変数var2はセル3についての入力変数である。 The variable var2, which is assigned in cell 2, is referenced in cell 3. Therefore, variable var2 is an output variable for cell 2. Also, variable var2 is an input variable for cell 3.
図9は、本開示の実施形態の少なくとも一つに対応する、入力データ型特定処理の処理例を示すフローチャートである。 Figure 9 is a flowchart showing an example of input data type identification processing corresponding to at least one embodiment of the present disclosure.
入力データ型特定処理部12は、成果物における各セルの出力変数のデータ型情報を参照し、事前に定義されている人工知能モデル(AIモデル)を型情報に持つセルを抽出する(S201)。例えば、入力データ型特定処理部12は、既知の人工知能モデルの型情報をメモリ20等に予め登録しておき、成果物における各セルの出力変数のデータ型情報をそれと照合することにより、登録済みの型情報に合致する人工知能モデル(AIモデル)を型情報に持つセルを抽出する。なお、Python(登録商標)などのプログラミング言語を用いた場合には、ソースコードからデータ型情報を直接参照することはできないが、S105において正常動作するかを確認する場合に、各セルを実行する前後の入力変数および出力変数の値を保存するなどの方法によって、実行時にどのようなデータ型情報が格納されるかを推定し、その結果を用いデータ型情報を取得することができる。 The input data type identification processor 12 references the data type information of the output variables of each cell in the deliverable and extracts cells whose type information is a predefined artificial intelligence model (AI model) (S201). For example, the input data type identification processor 12 pre-registers type information of known artificial intelligence models in memory 20, etc., and compares the data type information of the output variables of each cell in the deliverable with this information to extract cells whose type information is an artificial intelligence model (AI model) that matches the registered type information. Note that when using a programming language such as Python (registered trademark), data type information cannot be directly referenced from the source code. However, when checking for normal operation in S105, it is possible to estimate what data type information will be stored during execution by, for example, saving the values of input and output variables before and after executing each cell, and then use the results to obtain data type information.
入力データ型特定処理部12は、セルが抽出できたか否かを判定する(S202)。抽出できた場合(S202:YES)はS203に処理が遷移する。抽出できなかった場合(S202:NO)はステップS210に処理が遷移する。ステップS210は失敗処理である。失敗処理は一般的な処理であるため詳しい説明を省略する。 The input data type identification processing unit 12 determines whether the cell was extracted (S202). If the cell was extracted (S202: YES), processing proceeds to S203. If the cell was not extracted (S202: NO), processing proceeds to step S210. Step S210 is failure processing. Failure processing is a common process, so a detailed explanation will be omitted.
ステップS201で抽出されたセルをセルXとする。入力データ型特定処理部12は、抽出されたセルXに対して変数を出力しているセルを抽出する(S203)。 The cell extracted in step S201 is designated as cell X. The input data type identification processing unit 12 extracts cells that output variables for the extracted cell X (S203).
入力データ型特定処理部12は、セルXにおける入力変数のデータ型情報を取得し、そのデータ型情報がテンプレート情報21の入力データ型情報と同一条件であるかを確認する(S204)。ステップS201において発見されたデータあるいはデータ型と、テンプレート情報の型情報が一致するかを確認する方法としては、クラス名の一致、値の条件の一致、あるいは、クラス名がテンプレート情報に記載されれる入力データ型情報のクラスのサブクラスである、などの条件で確認することができる。なお、テンプレート情報21に含まれる全ての入力データ型情報に対して、この確認を行ってよい。確認できた場合、該当するテンプレート情報のデータ行のエントリYが見つかった、と判断する。 The input data type identification processing unit 12 obtains the data type information of the input variable in cell X and checks whether the data type information has the same conditions as the input data type information in the template information 21 (S204). Methods for checking whether the data or data type discovered in step S201 matches the type information in the template information include checking whether the class names match, whether the value conditions match, or whether the class name is a subclass of the class of the input data type information described in the template information. This check may be performed for all input data type information included in the template information 21. If this check is successful, it is determined that entry Y in the data row of the corresponding template information has been found.
入力データ型特定処理部12は、該当するテンプレート情報21のエントリYが見つかったか否かを判定する。見つかった場合(S205:YES)はステップS206に処理が遷移する。見つからなかった場合(S205:NO)は処理終了となる。なお、ここでは、入力データ型特定処理部12は、ステップS205にて該当するテンプレート情報21のエントリYが見つからなかった場合(S205:NO)に、処理終了とする処理フロー例を示したが、他の処理フローも可能である。例えば、入力データ型特定処理部12は、ステップS205にて該当するテンプレート情報21のエントリYが見つからなかった場合(S205:NO)に、ステップS207に移行することにしてもよい。 The input data type identification processing unit 12 determines whether or not a corresponding entry Y of the template information 21 has been found. If it has been found (S205: YES), processing proceeds to step S206. If it has not been found (S205: NO), processing ends. Note that, while an example processing flow has been shown here in which the input data type identification processing unit 12 ends processing if a corresponding entry Y of the template information 21 has not been found in step S205 (S205: NO), other processing flows are also possible. For example, if a corresponding entry Y of the template information 21 has not been found in step S205 (S205: NO), the input data type identification processing unit 12 may proceed to step S207.
入力データ型特定処理部12は、エントリYに含まれる情報に基づいて、データ型毎テンプレートを取得する。取得したテンプレートがこれまでに合致したテンプレートと異なる場合、利用するテンプレートの配列Zに、当該取得したテンプレートを追加して記録する(S206)。 The input data type identification processing unit 12 acquires a template for each data type based on the information contained in entry Y. If the acquired template differs from the previously matched templates, the acquired template is added to the array Z of templates to be used and recorded (S206).
入力データ型特定処理部12は、セルXに変数を出力しているセルがあるか否かを判定する(S207)。ある場合(S207:YES)はステップS208に処理が遷移する。ない場合(S207:NO)はステップS209に処理が遷移する。 The input data type identification processing unit 12 determines whether there is a cell that is outputting a variable in cell X (S207). If there is (S207: YES), processing proceeds to step S208. If there is not (S207: NO), processing proceeds to step S209.
ステップS208において入力データ型特定処理部12は、セルXに変数を出力しているセルを、新たなセルXとする。そしてステップS203へと処理が戻り、探索を再帰的に繰り返す。 In step S208, the input data type identification processing unit 12 designates the cell that is outputting a variable to cell X as the new cell X. Processing then returns to step S203, and the search is repeated recursively.
ステップS209において入力データ型特定処理部12は、テンプレートの配列Zを結果として返す。 In step S209, the input data type identification processing unit 12 returns the template array Z as the result.
図10は、本開示の実施形態の少なくとも一つに対応する、入力データ型特定処理の動作例を示す概念図である。 Figure 10 is a conceptual diagram showing an example of the operation of input data type identification processing corresponding to at least one embodiment of the present disclosure.
図10には、計算ノートブックの成果物が示されている。(1)にて、成果物から人工知能モデルを出力しているセルを検出する(ステップS201)。(2)にて、検出されたセルからセル間の依存関係をさかのぼり(ステップS203~S208)、特定データ型を検出する(ステップS204~S205)。更に、(3)にて、検出された特定データ型に対応するテンプレートを取得し(ステップS206)、それをマッチング処理の対象とする(ステップS209)。 Figure 10 shows the result of a calculation notebook. In (1), the cell that outputs the artificial intelligence model is detected from the result (step S201). In (2), the dependencies between cells are traced back from the detected cell (steps S203 to S208), and a specific data type is detected (steps S204 to S205). Furthermore, in (3), a template corresponding to the detected specific data type is obtained (step S206), and this is used as the target for matching processing (step S209).
図11は、本開示の実施形態の少なくとも一つに対応する、テンプレートマッチング処理の処理例を示すフローチャートである。 Figure 11 is a flowchart showing an example of template matching processing corresponding to at least one embodiment of the present disclosure.
下記のステップS301からS307までの処理は、1つのテンプレートに対するマッチング処理に対応する。ここで、ステップS209におけるテンプレートZの配列には複数のテンプレートが含まれることがあるが、テンプレートマッチング処理部13は、複数のテンプレートに対してそれぞれ、ステップS301からS307までの処理を行ってよい。 The processing from steps S301 to S307 below corresponds to the matching process for one template. Here, the array of template Z in step S209 may include multiple templates, and the template matching processing unit 13 may perform the processing from steps S301 to S307 for each of the multiple templates.
テンプレートマッチング処理部13は、依存関係に基づいて接続された任意の部分セル列を抽出する(S301)。部分セル列とは、成果物に含まれるセルを依存関係に基づいて接続(ステップS105参照)したセルのまとまりのことを言う。部分セル列は、必ずしも複数のセルのまとまりでなくてもよく、単独のセルであってもよい。 The template matching processing unit 13 extracts any partial cell string that is connected based on dependency relationships (S301). A partial cell string is a group of cells that are included in the deliverable and are connected based on dependency relationships (see step S105). A partial cell string does not necessarily have to be a group of multiple cells, but can also be a single cell.
テンプレートマッチング処理部13は、成果物におけるセルの入力データの個数およびデータ型と、セル間の変数の依存関係とに基づいて、部分セル列とテンプレートとを比較することにより、部分セル列とテンプレートとが整合する部分を探索する(S302)。ここでいう整合とは、入力データの個数およびデータ型と、セル間の変数の依存関係が、テンプレートに完全一致することであってもよいし、部分的に一致することであってもよい。 The template matching processing unit 13 searches for a portion where the partial cell string matches the template by comparing the partial cell string with the template based on the number and data type of input data for cells in the deliverable and the variable dependency between cells (S302). "Matching" here refers to a complete match or a partial match between the number and data type of input data and the variable dependency between cells with the template.
整合する部分がある場合、テンプレートマッチング処理部13は、その部分セル列をテンプレートの整合する部分と対応付ける(S303)。 If a matching portion is found, the template matching processing unit 13 associates the partial cell string with the matching portion of the template (S303).
テンプレートマッチング処理部13は、図11に示した処理の開始以後に抽出されたすべてのセルがテンプレートの構成要素に整合したか否かを判定する(S304)。整合した場合(S304:YES)はステップS307に処理が遷移する。整合しなかった場合(S304:NO)はステップS305に処理が遷移する。 The template matching processing unit 13 determines whether all cells extracted since the start of the process shown in FIG. 11 match the components of the template (S304). If they match (S304: YES), the process proceeds to step S307. If they do not match (S304: NO), the process proceeds to step S305.
ステップS305においてテンプレートマッチング処理部13は、成果物に含まれる1以上の部分セル列につき、すべての組み合わせを試したか否かを判定する(S305)。すべての組み合わせを試し済みである場合(S305:YES)はステップS306に処理が遷移する。すべての組み合わせを試していない場合(S305:NO)はステップS301に処理が戻り、次の部分セル列を抽出する。 In step S305, the template matching processing unit 13 determines whether all combinations have been tried for one or more partial cell strings included in the deliverable (S305). If all combinations have been tried (S305: YES), processing proceeds to step S306. If not all combinations have been tried (S305: NO), processing returns to step S301, where the next partial cell string is extracted.
ステップS306においてテンプレートマッチング処理部13は、成果物の部分セル列がテンプレートに含まれる構成要素にマッチした度合いであるマッチ度を算出する。例えば、部分セル列に含まれるセルのうち、テンプレートに含まれるタスクと整合するセルの割合をマッチ度として算出してもよい。テンプレートマッチング処理部13は、マッチ度が所定の閾値以上であるテンプレートについて、少なくともマッチ度を出力する。なお、テンプレートマッチング処理部13はマッチ度以外の情報を出力してもよい。例えば、マッチ度が所定の閾値以上であるテンプレート情報の一部または全部や、部分セル列についての情報をさらに出力してもよい。 In step S306, the template matching processing unit 13 calculates the degree of match, which is the degree to which the partial cell string of the deliverable matches the components included in the template. For example, the degree of match may be calculated as the proportion of cells included in the partial cell string that match the tasks included in the template. The template matching processing unit 13 outputs at least the degree of match for templates whose degree of match is equal to or greater than a predetermined threshold. Note that the template matching processing unit 13 may also output information other than the degree of match. For example, it may further output some or all of the template information whose degree of match is equal to or greater than a predetermined threshold, or information about the partial cell string.
ステップS307においてテンプレートマッチング処理部13は、抽出されたフローを結果として出力し、そのフローがテンプレートに100%準拠していることを示す情報を出力する。なお、フローとは、テンプレートに整合したセルを接続したまとまりのことを言う。フローとは、例えば部分セル列である。 In step S307, the template matching processing unit 13 outputs the extracted flow as a result, and outputs information indicating that the flow is 100% compliant with the template. Note that a flow refers to a group of connected cells that match the template. A flow is, for example, a partial cell string.
図12は、本開示の実施形態の少なくとも一つに対応する、セルとテンプレートとのマッチング例を示す概念図である。 Figure 12 is a conceptual diagram showing an example of matching between a cell and a template, corresponding to at least one embodiment of the present disclosure.
計算ノートブックの成果物が、セル1からセル9までを含んでいるとする。テンプレートマッチング処理部13は、依存関係に基づいて接続された任意の部分セル列を抽出する(S301)。例えば、セル2、セル3およびセル4で構成される部分セル列を抽出する。 Let's say the calculation notebook product includes cells 1 to 9. The template matching processing unit 13 extracts any partial cell string connected based on dependency relationships (S301). For example, it extracts a partial cell string consisting of cells 2, 3, and 4.
テンプレートマッチング処理部13は、成果物におけるセルの入力データの個数およびデータ型と、セル間の変数の依存関係とに基づいて、部分セル列とテンプレートとを比較することにより、部分セル列とテンプレートとが整合する部分を探索する(S302)。探索の結果、セル2、セル3およびセル4で構成される部分セル列は、タスクT102と整合する。そのためテンプレートマッチング処理部13は、セル2、セル3およびセル4で構成される部分セル列を、テンプレートの整合する部分であるタスクT102と対応付ける(S303)。 The template matching processing unit 13 searches for a portion where the partial cell string matches the template by comparing the partial cell string with the template based on the number and data type of input data for cells in the deliverable and the variable dependencies between cells (S302). As a result of the search, the partial cell string consisting of cells 2, 3, and 4 matches task T102. Therefore, the template matching processing unit 13 associates the partial cell string consisting of cells 2, 3, and 4 with task T102, which is the matching portion of the template (S303).
テンプレートマッチング処理部13は、他の部分セル列についても同様の処理を行う(S301からS305のループ)。その結果、セル1がタスクT101に、セル5がタスクT103に、セル6がタスクT104に、セル7がタスクT105に、セル8がタスクT106に、セル9がタスクT107に、それぞれ対応付けられる。 The template matching processing unit 13 performs similar processing for the other partial cell strings (loop from S301 to S305). As a result, cell 1 is associated with task T101, cell 5 with task T103, cell 6 with task T104, cell 7 with task T105, cell 8 with task T106, and cell 9 with task T107.
すると、全てのセルがテンプレートの構成要素にマッチしたことになるので(S304:YES)、テンプレートマッチング処理部13は、抽出されたフローを結果として出力し、そのフローがテンプレートに100%準拠していることを示す情報を出力する。この場合のフローとは、テンプレートに整合したセルを接続したまとまりのことを意味する。より具体的には、セル1からセル9を接続したまとまりを結果として出力する。 As a result, all cells match the components of the template (S304: YES), so the template matching processing unit 13 outputs the extracted flow as a result and outputs information indicating that the flow is 100% compliant with the template. In this case, a flow refers to a group of connected cells that match the template. More specifically, the group of connected cells from cell 1 to cell 9 is output as the result.
以上のように、コード作成支援システム1が、プログラムの断片であるセルの単位で処理を記述したデータ分析の成果物におけるセル間の変数の依存関係を抽出するセル間依存関係抽出処理部11を有する。コード作成支援システム1が、成果物のセル間の変数の中から機械学習モデルを特定し、機械学習モデルを変数として他のセルに渡しているセルを検出し、検出されたセルから変数の依存関係を遡るように辿って特定データ型を検出する入力データ型特定処理部12を有する。コード作成支援システム1が、入力データ型に対応付けて記憶されたプログラムコードのテンプレートから、検出された特定データ型と一致する入力データ型に対応付けられているテンプレートをマッチングの対象として特定し、成果物におけるテンプレートと整合する部分を探索するテンプレートマッチング処理部13を有する。これにより、データ分析の成果物の中から、コンピュータシステムに適用しやすいテンプレートに整合する部分を探索するので、計算ノートブックによる成果物のコンピュータシステムへの組み込みを容易にすることができる。 As described above, the coding support system 1 includes an inter-cell dependency extraction processing unit 11 that extracts inter-cell variable dependencies in a data analysis deliverable that describes processing at the cell-by-cell level, which are program fragments. The coding support system 1 includes an input data type identification processing unit 12 that identifies a machine learning model from among the variables between cells in the deliverable, detects cells that pass the machine learning model as a variable to other cells, and detects a specific data type by tracing back the variable dependencies from the detected cell. The coding support system 1 includes a template matching processing unit 13 that identifies, as a matching target, a template associated with an input data type that matches the detected specific data type from program code templates stored in association with the input data type, and searches for a portion of the deliverable that matches the template. This searches for a portion of the data analysis deliverable that matches a template that is easily applicable to a computer system, making it easier to incorporate the deliverable into a computer system using a calculation notebook.
成果物は、計算ノートブックにより作成された成果物である。これにより、計算ノートブックによる成果物のコンピュータシステムへの組み込を容易にすることができる。 The artifact is a work product created using the calculation notebook. This makes it easy to incorporate the artifact created by the calculation notebook into a computer system.
入力データ型毎に、学習データを学習して機械学習モデルを構築する学習処理のテンプレートと、機械学習モデルの推論精度を評価する評価処理のテンプレートと、機械学習モデルにより推論を行う推論処理のテンプレートとが記憶されている。テンプレートマッチング処理部は、成果物から3つのテンプレートのそれぞれに整合する部分を探索する。これにより、成果物から学習、評価、推論という機械学習における典型的な処理に相当するテンプレートに整合する部分をそれぞれ探索するので、機械学習に係る成果物のコンピュータシステムへの組み込みが容易になる。 For each input data type, a learning process template is stored: one for learning the training data and constructing a machine learning model; one for evaluating the inference accuracy of the machine learning model; and one for inference processing that performs inference using the machine learning model. The template matching processing unit searches the deliverables for parts that match each of the three templates. This searches the deliverables for parts that match templates corresponding to the typical machine learning processes of learning, evaluation, and inference, making it easy to incorporate machine learning deliverables into computer systems.
テンプレートマッチング処理部13は、成果物の部分セル列がテンプレートに含まれる構成要素にマッチした度合いであるマッチ度を算出する。テンプレートマッチング処理部13は、マッチ度が所定の閾値以上であるテンプレートについて、少なくともマッチ度を出力する。これにより、成果物とテンプレートのマッチ度を可視化し、マッチ度に応じた成果物の修正や、コンピュータシステムへの組み込みを行うことができる。 The template matching processing unit 13 calculates the degree of match, which is the degree to which the partial cell string of the deliverable matches the components included in the template. The template matching processing unit 13 outputs at least the degree of match for templates whose degree of match is equal to or greater than a predetermined threshold. This makes it possible to visualize the degree of match between the deliverable and the template, and to modify the deliverable according to the degree of match or incorporate it into a computer system.
テンプレートには、1つ以上の構成要素の入力データの個数およびデータ型と、該構成要素間の変数の依存関係とが制約条件として規定されている。テンプレートマッチング処理部13は、成果物におけるセルの入力データの個数およびデータ型とセル間の変数の依存関係とに基づいて、成果物の各部分セル列とテンプレートと比較することにより、テンプレートと整合する部分を探索する。これにより、入力変数の個数および入力データ型が整合する部分セル列をテンプレートの構成要素に当てはめることができる。 The template specifies the number and data type of input data for one or more components, as well as the variable dependencies between those components, as constraints. The template matching processing unit 13 searches for parts that match the template by comparing each partial cell string of the deliverable with the template based on the number and data type of input data for cells in the deliverable and the variable dependencies between cells. This makes it possible to match partial cell strings with a matching number of input variables and input data types to the components of the template.
入力データ型には、画像型、時系列型、テキスト型のうち少なくとも1つが含まれる。これにより、画像型、時系列型、テキスト型という機械学習に用いられる特定のデータ型に応じて、テンプレートとの整合を探索することができる。 The input data type includes at least one of image, time series, and text. This allows matching with templates to be searched for according to the specific data types used in machine learning: image, time series, and text.
セル間依存関係抽出処理部11は、プログラムコードを含むセルを成果物から抽出し、セル内の変数への代入を行う命令と、変数を参照または利用する命令とをそれぞれ特定し、第1セルで代入された変数が第2セルで参照または利用されている場合に、第1セルの出力変数が第2セルの入力変数であるという依存関係を特定する。これにより、成果物に含まれるセルは実行の時系列順に並んでいるとは限らないところ、各セルにおける変数の扱いに基づいてセル間の依存関係を確実に特定することができる。 The inter-cell dependency extraction processing unit 11 extracts cells containing program code from the deliverable, identifies the instructions that assign to variables in the cells and the instructions that reference or use the variables, and identifies a dependency where the output variable of the first cell is an input variable of the second cell when a variable assigned in a first cell is referenced or used in a second cell. This makes it possible to reliably identify inter-cell dependencies based on the handling of variables in each cell, even though the cells included in the deliverable are not necessarily arranged in chronological order of execution.
プロセッサ10とメモリ20とを備えたコード作成支援システム1による、コード作成支援方法が、プログラムの断片であるセルの単位で処理を記述したデータ分析の成果物におけるセル間の変数の依存関係を抽出するセル間依存関係抽出処理を有する。コード作成支援方法が、成果物のセル間の変数の中から機械学習モデルを特定し、機械学習モデルを変数として他のセルに渡しているセルを検出し、検出されたセルから変数の依存関係を遡るように辿って特定データ型を検出する入力データ型特定処理を有する。コード作成支援方法が、入力データ型に対応付けて記憶されたプログラムコードのテンプレートから、検出された特定データ型と一致する入力データ型に対応付けられているテンプレートをマッチングの対象として特定し、成果物におけるテンプレートと整合する部分を探索するテンプレートマッチング処理を有する。これにより、データ分析の成果物の中から、コンピュータシステムに適用しやすいテンプレートに整合する部分を探索するので、計算ノートブックによる成果物のコンピュータシステムへの組み込みを容易にすることができる。 A code creation support method using a code creation support system 1 equipped with a processor 10 and memory 20 includes an inter-cell dependency extraction process that extracts inter-cell variable dependencies in a data analysis deliverable in which processing is described in units of cells, which are program fragments. The code creation support method includes an input data type identification process that identifies a machine learning model from among the variables between cells in the deliverable, detects cells that pass the machine learning model as a variable to other cells, and detects a specific data type by tracing back the variable dependencies from the detected cell. The code creation support method also includes a template matching process that identifies, as a matching target, a template associated with an input data type that matches the detected specific data type from program code templates stored in association with the input data type, and searches for a portion of the deliverable that matches the template. This searches for a portion of the data analysis deliverable that matches a template that is easily applicable to a computer system, making it easier to incorporate the deliverable into a computer system using a calculation notebook.
コード作成支援プログラムが、プロセッサ10とメモリ20とを備えたコード作成支援システム1に、プログラムの断片であるセルの単位で処理を記述したデータ分析の成果物におけるセル間の変数の依存関係を抽出するセル間依存関係抽出機能を実現させる。コード作成支援プログラムがコード作成支援システムに、成果物のセル間の変数の中から機械学習モデルを特定し、機械学習モデルを変数として他のセルに渡しているセルを検出し、検出されたセルから変数の依存関係を遡るように辿って特定データ型を検出する入力データ型特定機能を実現させる。コード作成支援プログラムがコード作成支援システムに、入力データ型に対応付けて記憶されたプログラムコードのテンプレートから、検出された特定データ型と一致する入力データ型に対応付けられているテンプレートをマッチングの対象として特定し、成果物におけるテンプレートと整合する部分を探索するテンプレートマッチング機能を実現させる。これにより、データ分析の成果物の中から、コンピュータシステムに適用しやすいテンプレートに整合する部分を探索するので、計算ノートブックによる成果物のコンピュータシステムへの組み込みを容易にすることができる。 The code creation support program causes the code creation support system 1, which includes a processor 10 and memory 20, to implement an inter-cell dependency extraction function that extracts inter-cell variable dependencies in a data analysis result in which processing is described at the cell level, which are program fragments. The code creation support program causes the code creation support system to implement an input data type identification function that identifies a machine learning model from among the variables between cells in the result, detects cells that pass the machine learning model as a variable to other cells, and traces back the variable dependencies from the detected cell to detect a specific data type. The code creation support program causes the code creation support system to implement a template matching function that identifies, as a matching target, a template associated with an input data type that matches the detected specific data type from program code templates stored in association with the input data type, and searches for portions of the result that match the template. This searches for portions of the data analysis result that match templates that are easily applicable to a computer system, making it easier to incorporate the result into a computer system using a calculation notebook.
上述した本発明の実施形態は、本発明の説明のための例示であり、本発明の範囲をそれらの実施形態にのみ限定する趣旨ではない。当業者は、本発明の範囲を逸脱することなしに、他の様々な態様で本発明を実施することができる。 The above-described embodiments of the present invention are illustrative examples of the present invention and are not intended to limit the scope of the present invention to these embodiments alone. Those skilled in the art may implement the present invention in various other forms without departing from the scope of the present invention.
10…プロセッサ、11…セル間依存関係抽出処理部、12…入力データ型特定処理部、13…テンプレートマッチング処理部、20…メモリ、30…通信部、100…外部ネットワーク 10... Processor, 11... Inter-cell dependency extraction processing unit, 12... Input data type identification processing unit, 13... Template matching processing unit, 20... Memory, 30... Communication unit, 100... External network
Claims (9)
前記成果物のセル間の変数の中から機械学習モデルを特定し、前記機械学習モデルを変数として他のセルに渡しているセルを検出し、検出された前記セルから変数の依存関係を遡るように辿って特定データ型を検出する入力データ型特定処理部と、
入力データ型に対応付けて記憶されたプログラムコードのテンプレートから、検出された前記特定データ型と一致する入力データ型に対応付けられているテンプレートをマッチングの対象として特定し、前記成果物における前記テンプレートと整合する部分を探索するテンプレートマッチング処理部と、
を有するコード作成支援システム。 an inter-cell dependency extraction processing unit that extracts dependencies between variables in cells in a data analysis result in which processing is described in units of cells, which are program fragments;
an input data type identification processing unit that identifies a machine learning model from variables between cells of the deliverable, detects cells that pass the machine learning model as a variable to other cells, and detects a specific data type by tracing back the dependency relationships of variables from the detected cells;
a template matching processing unit that identifies a template associated with an input data type that matches the detected specific data type as a matching target from among program code templates stored in association with the input data type, and searches for a portion in the deliverable that matches the template;
A code creation support system having the above.
請求項1に記載のコード作成支援システム。 The deliverable is a deliverable created by a calculation notebook.
The code creation support system according to claim 1 .
前記テンプレートマッチング処理部は、前記成果物から3つの前記テンプレートのそれぞれに整合する部分を探索する、
請求項1に記載のコード作成支援システム。 For each input data type, a learning process template for learning learning data to construct a machine learning model, an evaluation process template for evaluating the inference accuracy of the machine learning model, and an inference process template for performing inference using the machine learning model are stored;
the template matching processing unit searches the deliverable for a portion that matches each of the three templates;
The code creation support system according to claim 1 .
請求項1に記載のコード作成支援システム。 the template matching processing unit calculates a degree of match, which is a degree to which the partial cell string of the deliverable matches the constituent element included in the template, and outputs at least the degree of match for the template whose degree of match is equal to or greater than a predetermined threshold.
The code creation support system according to claim 1 .
前記テンプレートマッチング処理部は、前記成果物におけるセルの入力データの個数およびデータ型とセル間の変数の依存関係とに基づいて、前記成果物の各部分セル列と前記テンプレートと比較することにより、前記テンプレートと整合する部分を探索する、
請求項1に記載のコード作成支援システム。 The template defines, as constraints, the number and data type of input data of one or more components and dependency relationships between variables of the components;
the template matching processing unit searches for a part that matches the template by comparing each partial cell string of the deliverable with the template based on the number and data type of input data of cells in the deliverable and the dependency relationship between variables between cells;
The code creation support system according to claim 1 .
プログラムコードを含むセルを前記成果物から抽出し、
前記セル内の変数への代入を行う命令と、変数を参照または利用する命令とをそれぞれ特定し、
第1セルで代入された変数が第2セルで参照または利用されている場合に、前記第1セルの出力変数が前記第2セルの入力変数であるという依存関係を特定する、
請求項1に記載のコード作成支援システム。 The inter-cell dependency extraction processing unit
extracting cells containing program code from the deliverable;
Identifying an instruction that assigns an assignment to a variable in the cell and an instruction that references or uses the variable,
Identifying a dependency in which, when a variable assigned in a first cell is referenced or used in a second cell, an output variable of the first cell is an input variable of the second cell;
The code creation support system according to claim 1 .
プログラムの断片であるセルの単位で処理を記述したデータ分析の成果物におけるセル間の変数の依存関係を抽出し、
前記成果物のセル間の変数の中から機械学習モデルを特定し、前記機械学習モデルを変数として他のセルに渡しているセルを検出し、検出された前記セルから変数の依存関係を遡るように辿って特定データ型を検出し、
入力データ型に対応付けて記憶されたプログラムコードのテンプレートから、検出された前記特定データ型と一致する入力データ型に対応付けられているテンプレートをマッチングの対象として特定し、前記成果物における前記テンプレートと整合する部分を探索する、
ことを実行するコード作成支援方法。 An information processing device including a processor and a memory,
Extracting the dependencies between variables in the data analysis results that describe processing in units of cells, which are fragments of programs,
Identifying a machine learning model from variables between cells of the deliverable, detecting cells that pass the machine learning model as a variable to other cells, tracing back the dependency relationships of variables from the detected cells to detect a specific data type,
identifying, as a matching target, a template associated with an input data type that matches the detected specific data type from among program code templates stored in association with the input data type, and searching for a portion in the deliverable that matches the template;
How to help write code that does this.
プログラムの断片であるセルの単位で処理を記述したデータ分析の成果物におけるセル間の変数の依存関係を抽出し、
前記成果物のセル間の変数の中から機械学習モデルを特定し、前記機械学習モデルを変数として他のセルに渡しているセルを検出し、検出された前記セルから変数の依存関係を遡るように辿って特定データ型を検出し、
入力データ型に対応付けて記憶されたプログラムコードのテンプレートから、検出された前記特定データ型と一致する入力データ型に対応付けられているテンプレートをマッチングの対象として特定し、前記成果物における前記テンプレートと整合する部分を探索する、
ことを実行させるためのコード作成支援プログラム。 An information processing device having a processor and a memory,
Extracting the dependencies between variables in the data analysis results that describe processing in units of cells, which are fragments of programs,
Identifying a machine learning model from variables between cells of the deliverable, detecting cells that pass the machine learning model as a variable to other cells, tracing back the dependency relationships of variables from the detected cells to detect a specific data type,
identifying, as a matching target, a template associated with an input data type that matches the detected specific data type from among program code templates stored in association with the input data type, and searching for a portion in the deliverable that matches the template;
A code creation support program to make things happen.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2022156487A JP7817129B2 (en) | 2022-09-29 | 2022-09-29 | Code creation support system, method, and program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2022156487A JP7817129B2 (en) | 2022-09-29 | 2022-09-29 | Code creation support system, method, and program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2024049954A JP2024049954A (en) | 2024-04-10 |
| JP7817129B2 true JP7817129B2 (en) | 2026-02-18 |
Family
ID=90622265
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2022156487A Active JP7817129B2 (en) | 2022-09-29 | 2022-09-29 | Code creation support system, method, and program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP7817129B2 (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2020068020A (en) | 2018-10-26 | 2020-04-30 | 富士ゼロックス株式会社 | System for calculation notebook pc interface, method, program, and device |
| JP2021140640A (en) | 2020-03-09 | 2021-09-16 | 株式会社日立製作所 | Search system and search method |
| JP2022042496A (en) | 2020-09-02 | 2022-03-14 | 富士通株式会社 | Automatic labeling of function blocks in pipeline of existing machine learning project in corpuses applicable for use in new machine learning project |
| JP2022129380A (en) | 2021-02-24 | 2022-09-05 | 富士通株式会社 | Machine learning pipeline skeleton instantiation |
-
2022
- 2022-09-29 JP JP2022156487A patent/JP7817129B2/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2020068020A (en) | 2018-10-26 | 2020-04-30 | 富士ゼロックス株式会社 | System for calculation notebook pc interface, method, program, and device |
| JP2021140640A (en) | 2020-03-09 | 2021-09-16 | 株式会社日立製作所 | Search system and search method |
| JP2022042496A (en) | 2020-09-02 | 2022-03-14 | 富士通株式会社 | Automatic labeling of function blocks in pipeline of existing machine learning project in corpuses applicable for use in new machine learning project |
| JP2022129380A (en) | 2021-02-24 | 2022-09-05 | 富士通株式会社 | Machine learning pipeline skeleton instantiation |
Non-Patent Citations (1)
| Title |
|---|
| Jiawei Wang et al.,Assessing and restoring reproducibility of Jupyter notebooks,ACM DIGITAL LIBRARY,2021年,[取得日 2025.12.19] 取得元<https://dl.acm.org/doi/10.1145/3324884.3416585> |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2024049954A (en) | 2024-04-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11907107B2 (en) | Auto test generator | |
| US11281708B2 (en) | Utilizing a machine learning model to predict metrics for an application development process | |
| US20190303107A1 (en) | Automated software programming guidance | |
| Li et al. | Understanding quantum software engineering challenges an empirical study on stack exchange forums and github issues | |
| TWI553558B (en) | Virtual machine snapshotting and analysis | |
| EP4024203B1 (en) | System performance optimization | |
| US20240061653A1 (en) | Collaborative industrial integrated development and execution environment | |
| Auffarth | Artificial Intelligence with Python Cookbook: Proven recipes for applying AI algorithms and deep learning techniques using TensorFlow 2. x and PyTorch 1.6 | |
| Shaheen et al. | AI-Driven Augmented Software Engineering: Leveraging Cognitive Models for Enhanced Code Generation | |
| JP7450187B2 (en) | Program, information processing method, and information processing device | |
| Dimov et al. | Weka: Practical machine learning tools and techniques with java implementations | |
| JP7817129B2 (en) | Code creation support system, method, and program | |
| CN119179467B (en) | Artificial intelligence aided programming construction method | |
| CN119883907B (en) | Software automated testing method and device | |
| US20250244958A1 (en) | Generating cross-platform applications | |
| Preeyanon et al. | Reproducible bioinformatics research for biologists | |
| US20250004910A1 (en) | Automated software testing using natural language-based form completion | |
| JP7807658B2 (en) | Rewriting program, rewriting method, and information processing device | |
| Wang et al. | A declarative enhancement of JavaScript programs by leveraging the Java metadata infrastructure | |
| US11966724B1 (en) | Framework and system for building assisted automations from recordings using program synthesis | |
| Husain et al. | Application of data mining techniques for improving software engineering | |
| Eichinski et al. | Datatrack: An R package for managing data in a multi-stage experimental workflow data versioning and provenance considerations in interactive scripting | |
| US20260030361A1 (en) | Auditing and remediating identified security vulnerability in source code using llm | |
| CN113722223B (en) | Automatic test method based on neural network | |
| Martínez-Rojas et al. | Assessing reproducibility in screenshot-based task mining: A decision discovery perspective |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20250221 |
|
| TRDD | Decision of grant or rejection written | ||
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20251226 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20260106 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20260205 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7817129 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |