system
A system that analyzes code changes to generate natural language explanations and videos helps users intuitively understand and correct code changes, addressing the challenge of complex code reviews.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2026-03-10
AI Technical Summary
Existing software development methods struggle to quickly and accurately understand code changes, especially in team development where changes span multiple files and functions, making it difficult to intuitively grasp the overall situation.
A system that acquires code change differences, analyzes them to identify changes, generates natural language explanations, creates explanatory videos, and delivers these to the user's device, allowing for intuitive understanding of code changes.
Enables users to quickly and accurately understand code changes, facilitating efficient review and correction by visually and audibly highlighting the changes.
Smart Images

Figure 2026041345000001_ABST
Abstract
Description
[Technical Field]
[0001] The technology of the present disclosure relates to a system. [Background technology]
[0002] Patent document 1 discloses a persona chatbot control method performed by at least one processor, the method including the steps of receiving a user utterance, adding the user utterance to a prompt including an instruction sentence related to a description of the chatbot character, encoding the prompt, and inputting the encoded prompt into a language model to generate a chatbot utterance in response to the user utterance. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Japanese Patent Publication No. 2022-180282 Summary of the Invention [Problem to be solved by the invention]
[0004] In software development, there is a need to quickly and accurately understand code changes, but this can be difficult to understand simply by viewing the changes text-based. In particular, in team development, changes often span multiple files and functions, making understanding difficult. Under these circumstances, there is a need for a method to easily understand changes. [Means for solving the problem]
[0005] This invention provides a system that allows users to intuitively understand code changes. Specifically, the system includes a means for acquiring code change differences, a means for analyzing the acquired differences to identify the changes, a means for generating a natural language explanation based on the analysis results, a means for creating an explanatory video using the generated explanation, and a means for delivering the generated video to the user's device. This allows software developers to quickly understand the changes and efficiently review and correct them.
[0006] "Code change differences" are data that indicate changes to source code made from one point in time to another in a version control system.
[0007] "Means of acquisition" refers to the functions and processes used to incorporate specific data or information into the system.
[0008] "Means of analysis" refers to the processes and tools used to understand and classify the content and meaning of acquired data and information.
[0009] "Changes" are information that indicates how specific pieces of code or data have been modified, added, or deleted.
[0010] A "natural language description" is a textual description written in language that is easy for humans to understand.
[0011] "Means for generating explanatory text" refers to processes and tools for automatically generating natural language text based on the analysis results.
[0012] An "explainer video" is a media format that combines video and audio to visually and audibly explain a specific content or procedure.
[0013] "Means for creating explanatory videos" refers to the processes and tools that generate data in video format based on explanatory text and other information.
[0014] A "user terminal" is an electronic device such as a computer, smartphone, or tablet that can be directly operated by a user.
[0015] "Distribution means" refers to the process or tool used to transmit the generated data or information to the user's terminal. [Brief explanation of the drawings]
[0016] [Figure 1] 1 is a conceptual diagram showing an example of the configuration of a data processing system according to a first embodiment. [Figure 2] 1 is a conceptual diagram showing an example of main functions of a data processing device and a smart device according to a first embodiment. [Figure 3] FIG. 10 is a conceptual diagram showing an example of the configuration of a data processing system according to a second embodiment. [Figure 4] FIG. 10 is a conceptual diagram showing an example of main functions of a data processing device and smart glasses according to a second embodiment. [Figure 5] FIG. 10 is a conceptual diagram showing an example of the configuration of a data processing system according to a third embodiment. [Figure 6] FIG. 11 is a conceptual diagram showing an example of main functions of a data processing device and a headset-type terminal according to a third embodiment. [Figure 7] FIG. 10 is a conceptual diagram showing an example of the configuration of a data processing system according to a fourth embodiment. [Figure 8] FIG. 10 is a conceptual diagram showing an example of main functions of a data processing device and a robot according to a fourth embodiment. [Figure 9] 1 shows an emotion map onto which multiple emotions are mapped. [Figure 10] 1 shows an emotion map onto which multiple emotions are mapped. [Figure 11] FIG. 3 is a sequence diagram showing a processing flow of the data processing system according to the first embodiment. [Figure 12] FIG. 10 is a sequence diagram showing the flow of processing in the data processing system in Application Example 1. [Figure 13]FIG. 10 is a sequence diagram showing the flow of processing in the data processing system according to the second embodiment when an emotion engine is combined. [Figure 14] FIG. 10 is a sequence diagram showing the flow of processing in the data processing system in Application Example 2 when an emotion engine is combined. DETAILED DESCRIPTION OF THE INVENTION
[0017] An example of an embodiment of a system according to the technology of the present disclosure will be described below with reference to the accompanying drawings.
[0018] First, the terms used in the following description will be explained.
[0019] In the following embodiments, a coded processor (hereinafter simply referred to as a "processor") may be a single arithmetic device or a combination of multiple arithmetic devices. Furthermore, a processor may be a single type of arithmetic device or a combination of multiple types of arithmetic devices. Examples of arithmetic devices include a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), a GPGPU (General-Purpose computing on Graphics Processing Units), and an APU (Accelerated Processing Unit).
[0020] In the following embodiments, a coded RAM (Random Access Memory) is a memory in which information is temporarily stored and is used as a working memory by a processor.
[0021] In the following embodiments, the coded storage is one or more non-volatile storage devices that store various programs, various parameters, etc. Examples of non-volatile storage devices include flash memory (SSD (Solid State Drive)), magnetic disks (e.g., hard disks), and magnetic tapes.
[0022] In the following embodiments, a communication I / F (Interface) with a symbol is an interface including a communication processor, an antenna, etc. The communication I / F controls communication between multiple computers. Examples of communication standards applied to the communication I / F include wireless communication standards including 5G (5th Generation Mobile Communication System), Wi-Fi (registered trademark), Bluetooth (registered trademark), etc.
[0023] In the following embodiments, "A and / or B" is synonymous with "at least one of A and B." In other words, "A and / or B" means that it may be only A, only B, or a combination of A and B. Furthermore, in this specification, the same concept as "A and / or B" is also applied when three or more things are expressed connected by "and / or."
[0024] [First embodiment]
[0025] FIG. 1 shows an example of the configuration of a data processing system 10 according to the first embodiment.
[0026] 1, a data processing system 10 includes a data processing device 12 and a smart device 14. An example of the data processing device 12 is a server.
[0027] The data processing device 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" according to the technology of the present disclosure. The computer 22 includes a processor 28, a RAM 30, and a storage 32. The processor 28, the RAM 30, and the storage 32 are connected to a bus 34. The database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).
[0028] The smart device 14 includes a computer 36, a reception device 38, an output device 40, a camera 42, and a communication I / F 44. The computer 36 includes a processor 46, a RAM 48, and a storage 50. The processor 46, the RAM 48, and the storage 50 are connected to a bus 52. The reception device 38, the output device 40, and the camera 42 are also connected to the bus 52.
[0029] The reception device 38 includes a touch panel 38A, a microphone 38B, and the like, and receives user input. The touch panel 38A detects contact with an indicator (for example, a pen or a finger) to receive user input by the touch of the indicator. The microphone 38B detects the user's voice to receive user input by voice. The control unit 46A transmits data indicating the user input received by the touch panel 38A and the microphone 38B to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the data indicating the user input.
[0030] The output device 40 includes a display 40A and a speaker 40B, and presents data to the user 20 by outputting the data in a form of expression that the user 20 can perceive (for example, audio and / or text). The display 40A displays visible information such as text and images in accordance with instructions from the processor 46. The speaker 40B outputs audio in accordance with instructions from the processor 46. The camera 42 is a compact digital camera equipped with an optical system including a lens, aperture, and shutter, and an imaging element such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor.
[0031] The communication I / F 44 is connected to a network 54. The communication I / Fs 44 and 26 control the exchange of various information between the processor 46 and the processor 28 via the network 54.
[0032] FIG. 2 shows an example of the main functions of the data processing device 12 and the smart device 14.
[0033] 2, in the data processing device 12, a specific process is performed by the processor 28. A specific processing program 56 is stored in the storage 32. The specific processing program 56 is an example of a "program" according to the technology of the present disclosure. The processor 28 reads the specific processing program 56 from the storage 32 and executes the read specific processing program 56 on the RAM 30. The specific process is realized by the processor 28 operating as a specific processing unit 290 in accordance with the specific processing program 56 executed on the RAM 30.
[0034] The storage 32 stores a data generation model 58 and an emotion identification model 59. The data generation model 58 and the emotion identification model 59 are used by the identification processing unit 290.
[0035] In the smart device 14, the processor 46 performs the reception output process. The storage 50 stores a reception output program 60. The reception output program 60 is used in conjunction with the specific processing program 56 by the data processing system 10. The processor 46 reads the reception output program 60 from the storage 50 and executes the read reception output program 60 on the RAM 48. The reception output process is realized by the processor 46 operating as the control unit 46A in accordance with the reception output program 60 executed on the RAM 48.
[0036] Next, a description will be given of the specific processing performed by the specific processing unit 290 of the data processing device 12. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."
[0037] The present invention relates to a system that analyzes code change differences and provides the user with explanatory text and video in natural language. An embodiment of the present invention will now be described.
[0038] This system consists of a server and a user's device. The server retrieves code change differences from the version control system, generates explanatory text in natural language based on the analysis results, and creates explanatory videos based on those texts. The generated videos are distributed to the user's device via the Internet.
[0039] Server Processing
[0040] The server first accesses the version control system (for example, a Git repository) and obtains the latest commit and the differences between the specified commits. At this time, it obtains information about the changed files and lines using the git diff command or similar.
[0041] The server then analyzes the difference data and identifies the changes. It classifies the changes as adding functions, changing variables, modifying conditional expressions, etc. The analysis results include detailed information about the changes (for example, the names of new functions and changed variables).
[0042] Based on the analysis results, the server generates a natural language description of the changes. This description is generated by embedding the analysis results in a template, and is then checked for grammar and adjusted to ensure it sounds natural.
[0043] Based on the generated description, the server creates an explanatory video, converting the description into audio using a text-to-speech engine, and using screen capture and animation tools to create a video highlighting the changes. The audio and video are then combined to generate the final video file.
[0044] The generated video file is compressed as needed and delivered to the user's device. Video delivery methods include streaming and providing a download link.
[0045] User terminal processing
[0046] The user's device receives the video streamed from the server and plays it using an appropriate video player. This allows the user to intuitively understand the changes to the code. Specifically, when the video is played, the changed code is highlighted and a natural language explanation is read out, allowing the user to see and hear which parts have been changed and how.
[0047] Specific examples
[0048] For example, if the difference retrieved by the server from the Git repository is the addition of a new function calculateSum, the following process takes place: The server analyzes the difference and identifies that "A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." Next, it generates a natural language explanation of this change: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." An explanatory video is then created based on this explanation. The generated video is then distributed to the user's device, allowing the user to understand the changes through the video.
[0049] In this way, the present invention allows the user to quickly and accurately understand the changes to the code.
[0050] The processing flow will be explained below.
[0051] Step 1:
[0052] The server accesses the version control system and retrieves the differences between the latest commit and the specified commit. This is done by using the git diff command to collect information about changed files and lines. For example, run the command "git diff HEAD^ HEAD --unified=0 --output=difference.patch".
[0053] Step 2:
[0054] The server analyzes the difference data it has acquired. Here, it parses the difference data and extracts information about each change (added, deleted, changed lines). For example, it classifies whether it is an added function or a changed variable name.
[0055] Step 3:
[0056] The server generates a natural language description based on the analysis results. The analysis results are embedded in a template to generate the description. A grammar check is performed and the description is adjusted to ensure natural-sounding sentences. For example, it generates a description such as "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum."
[0057] Step 4:
[0058] The server creates an explanatory video based on the generated text. First, it converts the text into audio using a text-to-speech engine. Then, it uses screen capture and animation tools to generate a video that highlights the changes. Finally, it integrates the audio and video.
[0059] Step 5:
[0060] The server compresses the generated video files and converts them into the appropriate format, for example using ffmpeg commands to combine the audio and video to generate the final video file.
[0061] Step 6:
[0062] The server delivers the generated video to the user's device. The video file is uploaded to cloud storage, for example, and the URL is notified to the user. The user then accesses the video via the provided URL and plays it on their device.
[0063] Step 7:
[0064] Users can play the video in a video player, and the code changes are highlighted and natural language explanations are read out, allowing users to see which parts have been changed and how.
[0065] The above is the specific processing flow of the present invention. This procedure allows the user to intuitively understand the changes and efficiently review and correct them.
[0066] Example 1
[0067] Next, a description will be given of Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."
[0068] Conventional systems for explaining code changes have the drawback of taking a long time to understand the changes and making it difficult to accurately understand them. Especially when large code bases or complex changes are involved, understanding the changes requires specialized knowledge and a lot of time. Furthermore, text-only explanations make it difficult to intuitively grasp the overall situation. To solve these problems, a method that can quickly and accurately understand the changes was needed.
[0069] The specific processing by the specific processing unit 290 of the data processing device 12 in the first embodiment is realized by the following means.
[0070] In this invention, the server includes means for acquiring code change differences, means for analyzing the acquired differences and identifying the changes, means for generating explanatory text in natural language based on the analysis results, means for creating explanatory videos using the generated explanatory text, means for delivering the generated videos to the user's device, means for embedding the analysis results in a specific template to check grammar, and means for generating prompt text to input the explanatory text into the generative AI model, thereby enabling the user to intuitively understand the code changes.
[0071] "Means for obtaining code change differences" refers to a function that extracts changes between different versions from a system that manages code change history.
[0072] The "means of analyzing the acquired differences and identifying the changes" is a function that analyzes the changes in the extracted code in detail and identifies which parts have been changed and how.
[0073] The "means for generating a natural language explanation based on the analysis results" is a function that converts the analyzed changes into a natural language sentence that is easy for humans to understand.
[0074] "Means for creating explanatory videos using generated explanatory text" is a function that converts the generated natural language explanatory text into audio and combines it with video to create explanatory videos.
[0075] "Means for delivering the generated video to the user's terminal" is a function for transmitting the created explanatory video to the user's terminal via the Internet.
[0076] "Means for embedding analysis results in a specific template to check grammar" is a function that incorporates analysis results into a pre-prepared sentence template and checks the grammar to ensure natural grammar.
[0077] "Means for generating prompt sentences to input explanatory text into a generative AI model" is a function that creates instruction sentences (prompt sentences) to provide appropriate input to a generative AI model.
[0078] The present invention relates to a system that analyzes code change differences and provides the user with a natural language explanation and explanatory video. The following describes in detail an embodiment of the present invention.
[0079] This system consists of a server and a user's device. The server retrieves code change differences from the version control system, generates explanatory text in natural language based on the analysis results, and creates explanatory videos based on those texts. The generated videos are distributed to the user's device via the Internet.
[0080] Server Processing
[0081] The server first accesses the version control system (for example, a Git repository) and uses commands such as git diff to obtain the differences between the latest commit and a specified commit. It then analyzes the obtained difference data to identify the changes. During the analysis, it classifies the changes as whether they are the addition of a function, a change to a variable, or a modification to a conditional expression. This allows it to obtain detailed information about the changes (for example, the name of a new function or the name of a changed variable).
[0082] The server then generates a natural language explanation based on the analysis results. During this process, the analysis results are embedded in a specific template, grammar checked, and made natural-sounding. When generating explanations using a generative AI model, a prompt generation function is used.
[0083] Specific examples of prompts are as follows:
[0084] Example prompt sentence:
[0085] "Analyze the following code change diff and explain it in natural language.
[0086] Change Diff:
[0087] diff
[0088] + function calculateSum(a, b) {
[0089] + return a + b;
[0090] +}
[0091] Analysis results:
[0092] A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum.
[0093] The server creates an explanatory video based on the generated description. It uses a text-to-speech engine (e.g., a speech synthesis service) to convert the description into audio, and uses screen capture and animation tools to create a video that highlights the changes. It then combines the audio and video to generate the final video file. The generated video file is compressed as needed and distributed to the user's device via the Internet. Possible methods for distributing the video include streaming or providing a download link.
[0094] User terminal processing
[0095] The user's device receives the video streamed from the server and plays it using an appropriate video player. This allows the user to intuitively understand the changes made to the code. Specifically, when the video is played, the changed code is highlighted and an automatically generated explanation is read aloud, allowing the user to see and hear which parts have been changed and how.
[0096] Specific examples
[0097] For example, if the difference retrieved by the server from the Git repository is the addition of a new function calculateSum, the following process takes place: The server analyzes the difference and identifies that "A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." Next, it generates this content as a natural language description: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum.", and creates an explanatory video based on this description.
[0098] As described above, by using the present invention, the user can quickly and accurately understand the changes to the code.
[0099] The flow of the identification process in the first embodiment will be described with reference to FIG.
[0100] Step 1:
[0101] The server accesses the version control system and retrieves the diffs for the specified commits, using the git diff command to retrieve the latest commit or the diffs between specific commits. For example, run the following command:
[0102] git diff <commit id1> <commit id2>
[0103] Input: Version control system commit ID
[0104] Output: Code diff data
[0105] The server will then capture the resulting changed filename and details of the change.
[0106] Step 2:
[0107] The server analyzes the difference data to identify the changes. The analysis parses the difference data and classifies the changes as follows: adding a function, changing a variable, modifying a conditional expression, etc.
[0108] Input: Code diff data
[0109] Output: Analysis results (detailed information on changes)
[0110] The server obtains information such as new function names and changed variable names as a result of the analysis.
[0111] Step 3:
[0112] The server generates a natural language explanation based on the analysis results. In this process, the analysis results are embedded in a template, grammar checked, and made into natural-sounding sentences. The explanation is generated by inputting the following prompt sentence into the generative AI model:
[0113] Example prompt sentence:
[0114] "Analyze the following code change diff and explain it in natural language.
[0115] Change Diff:
[0116] diff
[0117] + function calculateSum(a, b) {
[0118] + return a + b;
[0119] +}
[0120] Analysis results:
[0121] A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum.
[0122] Input: Analysis results
[0123] Output: Natural language description
[0124] The server uses a generative AI model to create detailed and easy-to-understand descriptions.
[0125] Step 4:
[0126] The server creates an explanatory video based on the generated description. It converts the description into audio using a text-to-speech engine (e.g., a speech synthesis service), and creates a video highlighting the changes using a screen capture tool or animation tool (e.g., FFmpeg, After Effects).
[0127] Input: Natural language description
[0128] Output:Explanatory video
[0129] The server combines the audio and video to generate the final video file.
[0130] Step 5:
[0131] The server compresses the generated video file and delivers it to the user's device, allowing them to watch the video by providing a streaming service or a download link.
[0132] Input: Explainer video
[0133] Output: Compressed video file
[0134] The server converts the video into a compressed format (e.g. MP4, WEBM) and distributes the video through a distribution service.
[0135] Step 6:
[0136] The user's device receives the video delivered from the server and plays it using an appropriate video player.
[0137] Input: Compressed video file
[0138] Output: The video being played
[0139] Users can view and intuitively understand the changes by watching the video: for example, by playing the video using a video player (e.g., VLC Media Player, Windows Media Player), and seeing the highlighted and audio-guided explanations of the code changes.
[0140] (Application example 1)
[0141] Next, a description will be given of Application Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."
[0142] While the control programs of machines and robots in factories are frequently updated, it is difficult for on-site operators and engineers to quickly and accurately understand the changes. In particular, a lack of understanding of complex changes and newly added functions increases the likelihood of reduced work efficiency and serious errors. There is a demand for a system that can solve these problems.
[0143] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 1 is realized by the following means.
[0144] In this invention, the server includes means for acquiring code change differences, means for analyzing the acquired differences and identifying the changes, means for generating a natural language explanation based on the analysis results, means for creating an explanatory video using the generated explanation, means for distributing the generated video to a user's terminal, and means for communicating the changes to the control programs of the machines in the factory to operators. This allows the changes to be intuitively understood and enables operators and engineers in the factory to respond quickly.
[0145] "Code change differences" are data that indicate changes to program code between specific commits in a version control system.
[0146] The "means for identifying the changes" is a function that analyzes the change differences in the acquired code and identifies which parts have been changed and how.
[0147] A "natural language description" is text that describes the code changes in human language so that even those without programming knowledge can understand them.
[0148] An "explanatory video" is content created based on natural language explanations, combining audio and video to convey information visually and audibly.
[0149] A "user's terminal" is a device (e.g., a personal computer, tablet, smartphone, etc.) that receives and plays the explanatory video distributed from the server.
[0150] A "control program for machines in a factory" is a software program used to operate production equipment and robots in a factory.
[0151] An "operator" is an employee in charge of operating machines and robots within a factory.
[0152] A "server" is a computer that transmits, receives, stores, and processes data over a network.
[0153] "Analysis results" refers to the data and information obtained by analyzing the code change differences.
[0154] This invention is a system that analyzes code change differences and provides the content to users as natural language explanations and explanatory videos. This system is mainly composed of a server and a user terminal.
[0155] Server Processing
[0156] The server first accesses the version control system (for example, a Git repository) and obtains the differences between the latest commit and a specified commit. At this time, it uses the git diff command to obtain information about the changed files and lines. The obtained difference data is analyzed by the analysis module to identify the specific changes. The changes are classified into functions, variables, conditional expressions, etc., and detailed information is collected for each.
[0157] Based on the analysis results, the server generates a natural language description of the changes. This description is automatically generated by embedding the analysis results in a template, which then undergoes grammar checks and adjustments to make the text more natural.
[0158] The server then creates an explanatory video based on the generated text. Specifically, it uses a text-to-speech engine (e.g., gTTS) to convert the text into audio, and uses a screen capture tool or animation tool (e.g., MoviePy) to create a video highlighting the changes. The audio and video are then combined to generate the final video file, which is then compressed if necessary.
[0159] The generated video file is then distributed to the user's device via the Internet, either via streaming or by providing a download link.
[0160] User terminal processing
[0161] The user's device receives the video streamed from the server and plays it using an appropriate video player. This allows the user to intuitively understand the changes to the code. Specifically, when the video is played, the changed code is highlighted and a natural language explanation is read out, allowing the user to see and hear which parts have been changed and how.
[0162] Specific examples
[0163] For example, if the difference retrieved by the server from the Git repository is the addition of a new function calculateSum, the following process takes place: The server analyzes the difference and identifies that "A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." Next, it generates a natural language explanation of this change: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." An explanatory video is then created based on this explanation. The generated video is then distributed to the user's device, allowing the user to understand the changes through the video.
[0164] Prompt Sentence Examples
[0165] Prompt: Analyze code change diffs and create a natural language description. Diff information:
[0166] diff --git a / example.py b / example.py
[0167] New file mode 100644
[0168] Index e69de29b..c04204629
[0169] ++ FunctionName calculateSum(a, b) =
[0170] return a + b
[0171] analysis:
[0172] A new function 'calculateSum' has been added, which takes two arguments 'a' and 'b' and returns their sum.
[0173] This allows the user to quickly and intuitively understand the changes.
[0174] The flow of the specific processing in the application example 1 will be described with reference to FIG.
[0175] Step 1:
[0176] The server accesses the version control system and retrieves the latest commit or the differences between the specified commit. Specifically, it executes the git diff command against the Git repository to retrieve information about changed files and lines. The input is the specified commit number, and the output is the change difference data.
[0177] Step 2:
[0178] The server analyzes the acquired differential data and identifies the changes. The analysis module classifies the changes into functions, variable changes, conditional expression modifications, etc. The input is the differential change data, and the output is the analysis results. These analysis results include the names of new functions and changed variables.
[0179] Step 3:
[0180] The server generates a natural language explanation based on the analysis results. It uses a template engine to embed the analysis results into the natural language text. The input is the analysis results, and the output is the natural language explanation.
[0181] Step 4:
[0182] The server uses the generated explanatory text to create an explanatory video. It uses gTTS (Google® Text-to-Speech) to convert the text into audio. It then uses MoviePy to generate a video that combines the text and audio and highlights the changes. The input is the natural language explanatory text, and the output is an explanatory video file.
[0183] Step 5:
[0184] The server compresses the generated video file and delivers it to the user's device. Video delivery is done via streaming or by providing a download link. The input is the explanatory video file, and the output is the video delivered to the user's device.
[0185] Step 6:
[0186] The user's device receives the video streamed from the server and plays it using an appropriate video player, allowing the user to visually and audibly understand the changes in the code. The input is the streamed video file, and the output is the played video.
[0187] For example, if the diff you retrieve from a Git repository looks like this:
[0188] diff --git a / example.py b / example.py
[0189] New file mode 100644
[0190] Index e69de29b..c04204629
[0191] ++ FunctionName calculateSum(a, b) =
[0192] return a + b
[0193] The server analyzes the differences and identifies that "A new function 'calculateSum' has been added. This function takes two arguments 'a' and 'b' and returns their sum." It then generates a natural language explanation for this change: "In this change, a new function 'calculateSum' has been added. This function takes two arguments 'a' and 'b' and returns their sum." It then creates an explanatory video based on this explanation. The generated video is delivered to the user's device, allowing the user to understand the changes through the video.
[0194] Example prompt sentence:
[0195] Prompt: Analyze code change diffs and create a natural language description. Diff information:
[0196] diff --git a / example.py b / example.py
[0197] New file mode 100644
[0198] Index e69de29b..c04204629
[0199] ++ FunctionName calculateSum(a, b) =
[0200] return a + b
[0201] analysis:
[0202] A new function 'calculateSum' has been added, which takes two arguments 'a' and 'b' and returns their sum.
[0203] Furthermore, an emotion engine that estimates the user's emotion may be combined. That is, the identification processing unit 290 may estimate the user's emotion using the emotion identification model 59 and perform identification processing using the user's emotion.
[0204] This invention relates to a system that analyzes code change differences and provides the user with explanatory text and videos in natural language, and further combines it with an emotion engine that recognizes the user's emotions. An embodiment of the invention will be described.
[0205] This system consists of a server, a user's device, and an emotion engine. The server retrieves code change differences from a version control system, generates explanatory text in natural language based on the analysis results, and creates explanatory videos based on those texts. The generated videos are distributed to the user's device via the Internet. The emotion engine also recognizes the user's emotions and adjusts the content of the explanatory text and explanatory videos based on the results.
[0206] Server Processing
[0207] The server first accesses the version control system (for example, a Git repository) and obtains the latest commit and the differences between the specified commit. At this time, it obtains information about the changed files and lines using the git diff command or similar. For example, it executes the command "git diff HEAD^ HEAD --unified=0 --output=difference.patch".
[0208] The server then analyzes the difference data and identifies the changes. The analysis results include detailed information about the changes (for example, the names of new functions or changed variables). Based on this information, the server generates a natural language description of the changes. The generated description is automatically created by embedding the analysis results in a template, and is grammatically checked to ensure it sounds natural.
[0209] Emotion engine processing
[0210] The emotion engine analyzes the user's emotion data sent from the user's device. This emotion data is collected, for example, based on the user's facial expressions and tone of voice while playing a video. The emotion engine analyzes this data and identifies the user's current emotion.
[0211] Based on the identified emotion, the server adjusts the generated explanatory text and explanatory video. For example, if the user is confused, the explanation text will be more detailed and the video will be slower to make it easier to understand. Conversely, if the user is excited, the explanation text will be more concise and the video will be faster to keep the pace up. This allows information to be provided in the most appropriate format for the user's emotion.
[0212] User terminal processing
[0213] The user's device receives the video streamed from the server and plays it using an appropriate video player. During video playback, emotional data such as the user's facial expressions and tone of voice is collected and sent to the emotion engine. This allows the system to monitor the user's emotions in real time and adjust the content of the video as needed.
[0214] Specific examples
[0215] For example, if the difference the server retrieved from the Git repository was a new function calculateSum, the following process would occur: The server would analyze the difference and identify the following: "A new function calculateSum has been added. It takes two arguments, a and b, and returns their sum." It would then generate a natural language description of this change: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." It would then create an explanatory video based on this description. The emotion engine would then analyze the user's emotions, and if it determined that the user was confused, for example, it would deliver a more detailed explanation and a slower-paced video.
[0216] In this way, the present invention allows users to intuitively understand code changes and provides a learning experience that is tailored to their emotions.
[0217] The processing flow will be explained below.
[0218] Step 1:
[0219] The server accesses the version control system and retrieves the difference between the latest commit and the specified commit, for example, by running the command git diff HEAD^ HEAD --unified=0 --output=difference.patch to get information about the changed files and lines.
[0220] Step 2:
[0221] The server analyzes the acquired differential data and identifies which parts have been changed and how. For example, it classifies changes such as the addition of a function, the introduction of a new variable, or the modification of a conditional expression, and identifies the specific details.
[0222] Step 3:
[0223] The server generates a natural language explanation based on the analysis results. Specifically, it embeds the analysis results into a pre-prepared template and generates an explanation such as, "In this change, a new function, calculateSum, has been added. This function takes two arguments, a and b, and returns their sum."
[0224] Step 4:
[0225] The server sends the generated natural language explanation to the emotion engine, which then adjusts the explanation based on the user's emotional data. For example, if the user is confused, the explanation will be made more specific and detailed, making it easier to understand.
[0226] Step 5:
[0227] The server then creates an explainer video based on the adjusted text. First, it uses a text-to-speech engine to convert the text into audio, then it uses screen capture and animation tools to generate a video that highlights the changes. Finally, it combines the audio and video to create the final video file.
[0228] Step 6:
[0229] The server compresses the resulting video files and converts them into the appropriate format, for example using ffmpeg commands to combine audio and video and convert them into the format best suited for streaming or download links.
[0230] Step 7:
[0231] The server delivers the generated video to the user's device. The video file is uploaded to cloud storage and the URL is notified to the user. The user can access the video through the provided URL and play it on their device.
[0232] Step 8:
[0233] The user plays the streamed video on a video player. While the video is playing, the user's device collects emotional data, such as facial expressions and tone of voice, and sends it to the server in real time. The server then adjusts the video content accordingly.
[0234] Step 9:
[0235] The emotion engine analyzes the user's emotions in real time, monitors the user's understanding and reactions while the video is playing, and makes suggestions such as repeat playback or adding detailed explanations as needed.
[0236] In this way, the present invention not only provides intuitive understanding of code changes, but also dynamically adjusts animation content to match the user's emotions.
[0237] Example 2
[0238] Next, a description will be given of Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."
[0239] Effectively identifying and understanding code changes is a time-consuming and labor-intensive task, especially in large-scale projects. Furthermore, there is a need to promote more intuitive understanding by adjusting the explanation content according to the user's emotions. To solve this problem, not only is it necessary to automate the analysis and explanation of code differences, but it is also necessary to provide adaptive information that reflects the user's real-time emotional data.
[0240] The identification process by the identification processing unit 290 of the data processing device 12 in the second embodiment is realized by the following means. In this invention, the server includes means for acquiring code change differences, means for analyzing the acquired differences and identifying the changes, means for generating explanatory text in natural language based on the analysis results, means for creating explanatory videos using the generated explanatory text, means for delivering the generated videos to the user's terminal, means for collecting user emotion data, means for analyzing the collected emotion data, and means for adjusting the explanatory text and video based on the analysis results. This makes it easier for the user to intuitively understand the code changes and enables adaptive information provision according to the user's emotions.
[0241] "Code change differences" is information that indicates parts of source code that have been changed from one point in time to another in a version control system.
[0242] A "version control system" is software that manages the change history of source code and tracks changes when multiple developers work together on the same project.
[0243] "Analysis" is the process of analyzing acquired data and extracting meaningful information from it.
[0244] A "natural language description" is a textual description written in a form that is easy for humans to read, and primarily uses natural language to explain the content.
[0245] An "explainer video" is video content created to convey information through visual and audio means.
[0246] "Emotional data" is data collected based on non-verbal cues such as a user's facial expression and tone of voice, and indicates the user's emotional state.
[0247] "Emotion engine" is a general term for software and hardware that analyzes emotion data and identifies the user's emotional state.
[0248] A "template" is a document template with a predefined format and structure, in which specific data is embedded to generate consistent output.
[0249] A "generative AI model" is a machine learning model that uses artificial intelligence to automatically generate text and content.
[0250] A "prompt" is text input to a generative AI model that is an instruction to obtain a specific output.
[0251] MODE FOR CARRYING OUT THE INVENTION
[0252] This invention relates to a system that analyzes code change differences and provides the user with explanatory text and videos in natural language, and also combines it with an emotion engine that recognizes the user's emotions. Specific embodiments for carrying out the invention are described below.
[0253] Server Processing
[0254] The server first accesses the version control system (e.g., Git repository) and retrieves the latest commit or the diff of the specified commit. The server then executes the git diff command to retrieve information about the changed files and lines. For example, use the command "git diff HEAD^ HEAD --unified=0 --output=difference.patch".
[0255] Next, the server analyzes the acquired differential data and identifies the changes. Specifically, it identifies detailed information such as the addition of new functions or changes to variable names. The results of this analysis are embedded in a template to generate a natural language explanation. The explanation is generated by inputting the following prompt to the generative AI model:
[0256] Please explain the following code changes in natural language.
[0257] ---
[0258] Changes:
[0259] We've added a new function calculateSum that takes two arguments a and b and returns their sum.
[0260] An explanatory video is created based on the generated explanatory text. The video is created by reading the explanatory text as a narration and displaying the code where changes were made. The completed video file is then distributed to the user's device via the Internet.
[0261] Emotion engine processing
[0262] The emotion engine collects and analyzes the user's emotion data sent from the user's device. This emotion data is mainly collected from the user's facial expressions and tone of voice while playing the video. The emotion engine analyzes the collected emotion data to identify the user's emotional state. For example, it determines whether the user is confused or excited.
[0263] The emotion engine sends feedback to the server based on the analysis results. The server receives this feedback and adjusts the content of the explanatory text and explanatory video. If the user is confused, the explanation will be more detailed and the video will play slower. Conversely, if the user is excited, the explanation will be more concise and the video will play faster.
[0264] User terminal processing
[0265] The user's device receives the video streamed from the server and plays it using an appropriate video player. During video playback, emotional data such as the user's facial expressions and tone of voice is collected and sent to the emotion engine. This allows the system to monitor the user's emotions in real time and adjust the content of the video as needed.
[0266] Specific examples
[0267] For example, if the difference the server retrieved from the Git repository was the addition of a new function calculateSum, the server would run the git diff command to determine the following information: "A new function calculateSum has been added. It takes two arguments, a and b, and returns their sum."
[0268] Based on this information, the server generates a prompt and feeds it into the generative AI model:
[0269] Please explain the following code changes in natural language.
[0270] ---
[0271] Changes:
[0272] We've added a new function calculateSum that takes two arguments a and b and returns their sum.
[0273] From the generated natural language description, an explanatory video is created that explains, "In this change, a new function, calculateSum, is added. This function takes two arguments, a and b, and returns their sum." and is delivered to the user's device. If the emotion engine determines that the user is confused during video playback, the server delivers a more detailed explanation and a slower version of the video. This allows the user to intuitively understand the code changes and enjoy a learning experience that suits their emotions.
[0274] The flow of the identification process in the second embodiment will be described with reference to FIG.
[0275] Step 1: Get the code change diff
[0276] The server accesses the version control system and retrieves the latest commit and the diff for the specified commit. Specifically, it executes the command git diff HEAD^ HEAD --unified=0 --output=difference.patch. The input is the ID of the specified commit, and the output is a patch file containing the diff information. The server parses this patch file in the next step.
[0277] Step 2: Analyze differential data
[0278] The server analyzes the differential data it has obtained and identifies the changes. The input is the patch file obtained in step 1, and the output is the details of the analyzed changes. Specifically, the server parses the patch file and extracts the addition of new functions, changes to variable names, etc. It then generates a dataset to embed this information into the template.
[0279] Step 3: Generate natural language descriptions
[0280] The server inputs a prompt into the generative AI model based on the analysis results, and generates a natural language explanation. The input is the detailed data of the changes obtained in step 2, and the output is the generated explanation. The prompt looks like this:
[0281] Please explain the following code changes in natural language.
[0282] ---
[0283] Changes:
[0284] A new function calculateSum has been added, which takes two arguments a and b and returns their sum.
[0285] The server checks the grammar of the output of the generative AI model and adjusts it to make the sentences more natural.
[0286] Step 4: Create an explainer video
[0287] The server uses the generated explanatory text to create an explanatory video. The input is the explanatory text generated in step 3, and the output is an explanatory video file. Specifically, the server converts the explanatory text into audio narration and creates corresponding screen displays. The video is generated in a format that narrates the explanatory content while highlighting the changed code parts.
[0288] Step 5: Publish your video
[0289] The server delivers the generated video file to the user's device. The input is the video file generated in step 4, and the output is the video file delivered to the user's device. The server transfers the video file to the user's device via the Internet.
[0290] Step 6: Collect emotion data
[0291] While the device is playing a video, it collects emotional data such as the user's facial expressions and tone of voice. The input is the user's real-time facial expressions and voice, and the output is the collected emotional data. Specifically, it uses a camera and microphone to collect the user's emotional data.
[0292] Step 7: Analyze the sentiment data
[0293] The emotion engine analyzes the collected emotion data and identifies the user's emotional state. The input is the emotion data collected in step 6, and the output is the analyzed emotion state. The emotion engine performs the analysis using facial recognition and voice analysis technologies.
[0294] Step 8: Adjust the description
[0295] The server adjusts the content of the description and video based on the analysis results of the emotion engine. The input is the user's emotional state obtained in step 7, and the output is the adjusted description and video. Specifically, if the user is confused, the description is made more detailed and the video playback speed is slowed down. Conversely, if the user is excited, the description is made more concise and the video playback speed is increased.
[0296] Step 9: Re-stream the adjusted video
[0297] The server re-broadcasts the adjusted video to the user's device. The input is the video file adjusted in step 8, and the output is the video file re-broadcast to the user's device. The server transfers the video file to the user's device via the Internet.
[0298] (Application example 2)
[0299] Next, a description will be given of Application Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."
[0300] In conventional factory robot maintenance work, engineers have had to spend a great deal of time and effort understanding the changes every time software is updated or modified. Furthermore, work efficiency can decline because it is not possible to provide effective information tailored to the engineer's level of understanding or emotional state. To solve this problem, a system is needed that analyzes code change differences and provides optimal explanations based on the engineer's emotional state.
[0301] The identification process by the identification processing unit 290 of the data processing device 12 in Application Example 2 is realized by the following means. In this invention, the server includes means for acquiring code change differences, means for analyzing the acquired differences and identifying the changes, means for generating a natural language explanatory text based on the analysis results, means for creating an explanatory video using the generated explanatory text, means for delivering the generated video to the user's device, means for analyzing the user's emotions, and means for adjusting the content of the explanatory text and explanatory video based on the analysis results. This allows engineers to quickly and intuitively understand the code changes and perform maintenance work in a manner that is optimal for their emotional state.
[0302] "Code change differences" is information that identifies changes between new and old versions in a software version control system.
[0303] "Analysis" is the process of examining and examining acquired data and information in detail to derive specific meanings and results.
[0304] A "natural language description" is a description written in a language that humans use on a daily basis, and is a document intended to convey technical content in an easy-to-understand manner.
[0305] An "explanatory video" is video content that uses visual and audio techniques to explain specific content.
[0306] The term "user terminal" refers to an information processing device used by a user for operation, and includes, for example, a smartphone or a tablet.
[0307] "Emotion analysis" is a technology that identifies a user's emotional state from their facial expressions, voice, etc.
[0308] "Change classification" is the process of dividing the analyzed changes into specific categories.
[0309] "Adjusting the playback speed" is an operation for changing the playback speed of the explanatory video according to the user's level of understanding and emotions.
[0310] "Speech" is a process of outputting text information as voice.
[0311] "Change highlighting" refers to visually highlighting areas of software code where changes have been made.
[0312] "Robot maintenance work in factories" refers to the work of maintaining and updating the software and hardware of automated equipment in factories.
[0313] The present invention relates to a system for supporting the maintenance of factory robots, which analyzes the difference in changes and provides the user with explanatory text and videos in natural language. The system also incorporates an emotion engine that recognizes the user's emotions.
[0314] System Configuration
[0315] This system consists of a server, a user's terminal, and an emotion engine.
[0316] Server Processing
[0317] The server accesses the version control system to obtain the differences in code changes. For example, it uses the git diff command to obtain the differences between the latest commit or a specified commit in the Git repository, and analyzes the difference data. It then analyzes the obtained difference data and identifies detailed information about the changes. It generates a natural language explanation based on the analysis results, and creates an explanatory video based on this explanation. The generated explanatory video is then distributed to the user's device via the Internet.
[0318] Emotion engine processing
[0319] The emotion engine analyzes the user's emotion data sent from the user's device. This data is collected based on facial expressions, tone of voice, and other factors while the user is playing the video. The emotion engine analyzes this data to identify the user's current emotional state. Based on the identified emotion, the server adjusts the content of the generated explanation text and explanatory video. For example, if the user is confused, the explanation text will be more detailed and the pace of the video will be slower to make it easier to understand. Conversely, if the user is excited, the explanation text will be more concise and the pace of the video will be faster.
[0320] User terminal processing
[0321] The user's device receives the explanatory video delivered from the server and plays it using an appropriate video player. During the video playback, emotional data such as the user's facial expressions and tone of voice is collected and sent to the emotion engine. This allows the system to monitor the user's emotions in real time and adjust the content of the video as needed.
[0322] Techniques used and examples
[0323] The system uses the following technologies:
[0324] Hardware: Servers, user devices (smartphones, tablets, etc.), webcams
[0325] Software: Version control system (Git), natural language generation engine (OpenAI (registered trademark)), emotion analysis engine (emotion_recognition library)
[0326] Specific examples
[0327] For example, if the difference the server retrieved from the Git repository was the addition of a new function calculateSum, the server would analyze the difference and identify it as "A new function calculateSum has been added. It takes two arguments, a and b, and returns their sum." It then generates a natural language explanation for this change: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." It then creates an explanatory video based on this explanation. Next, the emotion engine analyzes the user's emotions, and if it determines that the user is confused, for example, it will deliver a more detailed explanation and a slower-paced video.
[0328] Prompt Sentence Examples
[0329] Latest Git commit log:
[0330] diff --git a / src / main.py b / src / main.py
[0331] index abc123..def456 100644
[0332] --- a / src / main.py
[0333] +++ b / src / main.py
[0334] @@ -2,6 +2,7 @@
[0335] import sys
[0336] +def new_function():
[0337] + print("This is a new function")
[0338] def main():
[0339] print("Hello World")
[0340] Please briefly explain this change.
[0341] In this way, by using this invention, factory engineers can intuitively understand the changes in the code and receive information in a format that is optimal for their emotional state, which is expected to lead to efficient and effective maintenance work.
[0342] The flow of the specific processing in the application example 2 will be described with reference to FIG.
[0343] Step 1:
[0344] The server accesses the version control system and retrieves the difference between the code changes. The server uses the git diff command to retrieve the difference data between the latest commit and the specified commit. This difference data includes information about the changed files and lines. The input is a Git repository, and the output is the difference data.
[0345] Step 2:
[0346] The server analyzes the differential data it has acquired and identifies the changes. During the analysis, detailed information such as the names of new functions and changed variables is extracted. The input is the differential data obtained in step 1, and the output is detailed information about the changes.
[0347] Step 3:
[0348] The server generates a natural language description based on the analysis results. Using a generative AI model (such as OpenAI's GPT-3 (registered trademark)), it converts the identified changes into easy-to-understand text. The input is detailed information about the changes, and the output is a natural language description.
[0349] Step 4:
[0350] An explanatory video is created based on the natural language description generated by the server. To generate the video, a speech synthesis engine and video editing tool are used to convert the description into audio and create a video that highlights the changes. The input is the natural language description, and the output is the explanatory video.
[0351] Step 5:
[0352] The server generates an explanatory video and delivers it to the user's device. The delivery is via the Internet, and the user's device can play the video on an appropriate video player. The input is the explanatory video, and the output is the video delivered to the user's device.
[0353] Step 6:
[0354] Emotion data is collected while the user's device is playing a video. The device's webcam and microphone are used to capture the user's facial expressions and tone of voice, which are then sent to an emotion analysis engine. The input is the user's facial and voice data, and the output is emotion data.
[0355] Step 7:
[0356] The emotion engine analyzes the user's emotion data and identifies their emotional state. For example, it determines whether the user is confused or excited. The input is the emotion data obtained in step 6, and the output is the user's emotional state.
[0357] Step 8:
[0358] The server adjusts the content of the explanatory text and explanatory video based on the analysis results of the emotion engine. If the user is confused, the explanation will be more detailed and the pace of the video will be slower. Conversely, if the user is excited, the explanation will be more concise and the pace of the video will be faster. The input is the user's emotional state, and the output is the adjusted explanation text and video.
[0359] Through these processing steps, factory technicians can perform maintenance work efficiently.
[0360] The specific processing unit 290 transmits the result of the specific processing to the smart device 14. In the smart device 14, the control unit 46A causes the output device 40 to output the result of the specific processing. The microphone 38B acquires audio indicating a user input regarding the result of the specific processing. The control unit 46A transmits audio data indicating the user input acquired by the microphone 38B to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the audio data.
[0361] The data generation model 58 is a so-called generative AI (Artificial Intelligence). An example of the data generation model 58 is ChatGPT (registered trademark) (Internet search engine).<URL: https: / / openai.com / blog / chatgpt> ), Gemini (registered trademark) (Internet search <url: https: gemini.google.com ?hl="ja">) and other generation AIs. The data generation model 58 is obtained by performing deep learning on a neural network. A prompt including an instruction is input to the data generation model 58, and inference data such as voice data indicating voice, text data indicating text, and image data indicating an image is also input. The data generation model 58 performs inference on the input inference data in accordance with the instruction indicated by the prompt, and outputs the inference result in a data format such as voice data and text data. Here, inference refers to, for example, analysis, classification, prediction, and / or summarization.
[0362] In the above embodiment, an example in which the specific process is performed by the data processing device 12 has been given, but the technology of the present disclosure is not limited to this, and the specific process may be performed by the smart device 14.
[0363] [Second embodiment]
[0364] FIG. 3 shows an example of the configuration of a data processing system 210 according to the second embodiment.
[0365] 3, the data processing system 210 includes the data processing device 12 and smart glasses 214. An example of the data processing device 12 is a server.
[0366] The data processing device 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" according to the technology of the present disclosure. The computer 22 includes a processor 28, a RAM 30, and a storage 32. The processor 28, the RAM 30, and the storage 32 are connected to a bus 34. The database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).
[0367] The smart glasses 214 include a computer 36, a microphone 238, a speaker 240, a camera 42, and a communication I / F 44. The computer 36 includes a processor 46, a RAM 48, and a storage 50. The processor 46, the RAM 48, and the storage 50 are connected to a bus 52. The microphone 238, the speaker 240, and the camera 42 are also connected to the bus 52.
[0368] The microphone 238 receives instructions and the like from the user 20 by receiving voice uttered by the user 20. The microphone 238 captures the voice uttered by the user 20, converts the captured voice into audio data, and outputs it to the processor 46. The speaker 240 outputs audio in accordance with instructions from the processor 46.
[0369] Camera 42 is a small digital camera equipped with an optical system including a lens, aperture, and shutter, and an imaging element such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor, and captures images of the surroundings of user 20 (for example, an imaging range defined by an angle of view equivalent to the field of vision of a typical healthy person).
[0370] The communication I / F 44 is connected to a network 54. The communication I / Fs 44 and 26 are responsible for the exchange of various information between the processor 46 and the processor 28 via the network 54. The exchange of various information between the processor 46 and the processor 28 using the communication I / Fs 44 and 26 is carried out in a secure state.
[0371] Fig. 4 shows an example of the main functions of the data processing device 12 and the smart glasses 214. As shown in Fig. 4, in the data processing device 12, a specific process is performed by the processor 28. A specific process program 56 is stored in the storage 32.
[0372] The specific processing program 56 is an example of a "program" according to the technology of the present disclosure. The processor 28 reads the specific processing program 56 from the storage 32 and executes the read specific processing program 56 on the RAM 30. The specific processing is realized by the processor 28 operating as a specific processing unit 290 in accordance with the specific processing program 56 executed on the RAM 30.
[0373] The storage 32 stores a data generation model 58 and an emotion identification model 59. The data generation model 58 and the emotion identification model 59 are used by the identification processing unit 290.
[0374] In the smart glasses 214, the processor 46 performs the reception output process. A reception output program 60 is stored in the storage 50. The processor 46 reads the reception output program 60 from the storage 50 and executes the read reception output program 60 on the RAM 48. The reception output process is realized by the processor 46 operating as the control unit 46A in accordance with the reception output program 60 executed on the RAM 48.
[0375] Next, a description will be given of the identification process performed by the identification processing unit 290 of the data processing device 12. In the following description, the data processing device 12 will be referred to as the "server" and the smart glasses 214 will be referred to as the "terminal."
[0376] The present invention relates to a system that analyzes code change differences and provides the user with explanatory text and video in natural language. An embodiment of the present invention will now be described.
[0377] This system consists of a server and a user's device. The server retrieves code change differences from the version control system, generates explanatory text in natural language based on the analysis results, and creates explanatory videos based on those texts. The generated videos are distributed to the user's device via the Internet.
[0378] Server Processing
[0379] The server first accesses the version control system (for example, a Git repository) and obtains the latest commit and the differences between the specified commits. At this time, it obtains information about the changed files and lines using the git diff command or similar.
[0380] The server then analyzes the difference data and identifies the changes. It classifies the changes as adding functions, changing variables, modifying conditional expressions, etc. The analysis results include detailed information about the changes (for example, the names of new functions and changed variables).
[0381] Based on the analysis results, the server generates a natural language description of the changes. This description is generated by embedding the analysis results in a template, and is then checked for grammar and adjusted to ensure it sounds natural.
[0382] Based on the generated description, the server creates an explanatory video, converting the description into audio using a text-to-speech engine, and using screen capture and animation tools to create a video highlighting the changes. The audio and video are then combined to generate the final video file.
[0383] The generated video file is compressed as needed and delivered to the user's device. Video delivery methods include streaming and providing a download link.
[0384] User terminal processing
[0385] The user's device receives the video streamed from the server and plays it using an appropriate video player. This allows the user to intuitively understand the changes to the code. Specifically, when the video is played, the changed code is highlighted and a natural language explanation is read out, allowing the user to see and hear which parts have been changed and how.
[0386] Specific examples
[0387] For example, if the difference retrieved by the server from the Git repository is the addition of a new function calculateSum, the following process takes place: The server analyzes the difference and identifies that "A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." Next, it generates a natural language explanation of this change: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." An explanatory video is then created based on this explanation. The generated video is then distributed to the user's device, allowing the user to understand the changes through the video.
[0388] In this way, the present invention allows the user to quickly and accurately understand the changes to the code.
[0389] The processing flow will be explained below.
[0390] Step 1:
[0391] The server accesses the version control system and retrieves the differences between the latest commit and the specified commit. This is done by using the git diff command to collect information about changed files and lines. For example, run the command "git diff HEAD^ HEAD --unified=0 --output=difference.patch".
[0392] Step 2:
[0393] The server analyzes the difference data it has acquired. Here, it parses the difference data and extracts information about each change (added, deleted, changed lines). For example, it classifies whether it is an added function or a changed variable name.
[0394] Step 3:
[0395] The server generates a natural language description based on the analysis results. The analysis results are embedded in a template to generate the description. A grammar check is performed and the description is adjusted to ensure natural-sounding sentences. For example, it generates a description such as "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum."
[0396] Step 4:
[0397] The server creates an explanatory video based on the generated text. First, it converts the text into audio using a text-to-speech engine. Then, it uses screen capture and animation tools to generate a video that highlights the changes. Finally, it integrates the audio and video.
[0398] Step 5:
[0399] The server compresses the generated video files and converts them into the appropriate format, for example using ffmpeg commands to combine the audio and video to generate the final video file.
[0400] Step 6:
[0401] The server delivers the generated video to the user's device. The video file is uploaded to cloud storage, for example, and the URL is notified to the user. The user then accesses the video via the provided URL and plays it on their device.
[0402] Step 7:
[0403] Users can play the video in a video player, and the code changes are highlighted and natural language explanations are read out, allowing users to see which parts have been changed and how.
[0404] The above is the specific processing flow of the present invention. This procedure allows the user to intuitively understand the changes and efficiently review and correct them.
[0405] Example 1
[0406] Next, a description will be given of Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the smart glasses 214 will be referred to as a "terminal."
[0407] Conventional systems for explaining code changes have the drawback of taking a long time to understand the changes and making it difficult to accurately understand them. Especially when large code bases or complex changes are involved, understanding the changes requires specialized knowledge and a lot of time. Furthermore, text-only explanations make it difficult to intuitively grasp the overall situation. To solve these problems, a method that can quickly and accurately understand the changes was needed.
[0408] The specific processing by the specific processing unit 290 of the data processing device 12 in the first embodiment is realized by the following means.
[0409] In this invention, the server includes means for acquiring code change differences, means for analyzing the acquired differences and identifying the changes, means for generating explanatory text in natural language based on the analysis results, means for creating explanatory videos using the generated explanatory text, means for delivering the generated videos to the user's device, means for embedding the analysis results in a specific template to check grammar, and means for generating prompt text to input the explanatory text into the generative AI model, thereby enabling the user to intuitively understand the code changes.
[0410] "Means for obtaining code change differences" refers to a function that extracts changes between different versions from a system that manages code change history.
[0411] The "means of analyzing the acquired differences and identifying the changes" is a function that analyzes the changes in the extracted code in detail and identifies which parts have been changed and how.
[0412] The "means for generating a natural language explanation based on the analysis results" is a function that converts the analyzed changes into a natural language sentence that is easy for humans to understand.
[0413] "Means for creating explanatory videos using generated explanatory text" is a function that converts the generated natural language explanatory text into audio and combines it with video to create explanatory videos.
[0414] "Means for delivering the generated video to the user's terminal" is a function for transmitting the created explanatory video to the user's terminal via the Internet.
[0415] "Means for embedding analysis results in a specific template to check grammar" is a function that incorporates analysis results into a pre-prepared sentence template and checks the grammar to ensure natural grammar.
[0416] "Means for generating prompt sentences to input explanatory text into a generative AI model" is a function that creates instruction sentences (prompt sentences) to provide appropriate input to a generative AI model.
[0417] The present invention relates to a system that analyzes code change differences and provides the user with a natural language explanation and explanatory video. The following describes in detail an embodiment of the present invention.
[0418] This system consists of a server and a user's device. The server retrieves code change differences from the version control system, generates explanatory text in natural language based on the analysis results, and creates explanatory videos based on those texts. The generated videos are distributed to the user's device via the Internet.
[0419] Server Processing
[0420] The server first accesses the version control system (for example, a Git repository) and uses commands such as git diff to obtain the differences between the latest commit and a specified commit. It then analyzes the obtained difference data to identify the changes. During the analysis, it classifies the changes as whether they are the addition of a function, a change to a variable, or a modification to a conditional expression. This allows it to obtain detailed information about the changes (for example, the name of a new function or the name of a changed variable).
[0421] The server then generates a natural language explanation based on the analysis results. During this process, the analysis results are embedded in a specific template, grammar checked, and made natural-sounding. When generating explanations using a generative AI model, a prompt generation function is used.
[0422] Specific examples of prompts are as follows:
[0423] Example prompt sentence:
[0424] "Analyze the following code change diff and explain it in natural language.
[0425] Change Diff:
[0426] diff
[0427] + function calculateSum(a, b) {
[0428] + return a + b;
[0429] +}
[0430] Analysis results:
[0431] A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum.
[0432] The server creates an explanatory video based on the generated description. It uses a text-to-speech engine (e.g., a speech synthesis service) to convert the description into audio, and uses screen capture and animation tools to create a video that highlights the changes. It then combines the audio and video to generate the final video file. The generated video file is compressed as needed and distributed to the user's device via the Internet. Possible methods for distributing the video include streaming or providing a download link.
[0433] User terminal processing
[0434] The user's device receives the video streamed from the server and plays it using an appropriate video player. This allows the user to intuitively understand the changes made to the code. Specifically, when the video is played, the changed code is highlighted and an automatically generated explanation is read aloud, allowing the user to see and hear which parts have been changed and how.
[0435] Specific examples
[0436] For example, if the difference retrieved by the server from the Git repository is the addition of a new function calculateSum, the following process takes place: The server analyzes the difference and identifies that "A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." Next, it generates this content as a natural language description: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum.", and creates an explanatory video based on this description.
[0437] As described above, by using the present invention, the user can quickly and accurately understand the changes to the code.
[0438] The flow of the identification process in the first embodiment will be described with reference to FIG.
[0439] Step 1:
[0440] The server accesses the version control system and retrieves the diffs for the specified commits, using the git diff command to retrieve the latest commit or the diffs between specific commits. For example, run the following command:
[0441] git diff <commit id1> <commit id2>
[0442] Input: Version control system commit ID
[0443] Output: Code diff data
[0444] The server will then capture the resulting changed filename and details of the change.
[0445] Step 2:
[0446] The server analyzes the difference data to identify the changes. The analysis parses the difference data and classifies the changes as follows: adding a function, changing a variable, modifying a conditional expression, etc.
[0447] Input: Code diff data
[0448] Output: Analysis results (detailed information on changes)
[0449] The server obtains information such as new function names and changed variable names as a result of the analysis.
[0450] Step 3:
[0451] The server generates a natural language explanation based on the analysis results. In this process, the analysis results are embedded in a template, grammar checked, and made into natural-sounding sentences. The explanation is generated by inputting the following prompt sentence into the generative AI model:
[0452] Example prompt sentence:
[0453] "Analyze the following code change diff and explain it in natural language.
[0454] Change Diff:
[0455] diff
[0456] + function calculateSum(a, b) {
[0457] + return a + b;
[0458] +}
[0459] Analysis results:
[0460] A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum.
[0461] Input: Analysis results
[0462] Output: Natural language description
[0463] The server uses a generative AI model to create detailed and easy-to-understand descriptions.
[0464] Step 4:
[0465] The server creates an explanatory video based on the generated description. It converts the description into audio using a text-to-speech engine (e.g., a speech synthesis service), and creates a video highlighting the changes using a screen capture tool or animation tool (e.g., FFmpeg, After Effects).
[0466] Input: Natural language description
[0467] Output:Explanatory video
[0468] The server combines the audio and video to generate the final video file.
[0469] Step 5:
[0470] The server compresses the generated video file and delivers it to the user's device, allowing them to watch the video by providing a streaming service or a download link.
[0471] Input: Explainer video
[0472] Output: Compressed video file
[0473] The server converts the video into a compressed format (e.g. MP4, WEBM) and distributes the video through a distribution service.
[0474] Step 6:
[0475] The user's device receives the video delivered from the server and plays it using an appropriate video player.
[0476] Input: Compressed video file
[0477] Output: The video being played
[0478] Users can view and intuitively understand the changes by watching the video: for example, by playing the video using a video player (e.g., VLC Media Player, Windows Media Player), and seeing the highlighted and audio-guided explanations of the code changes.
[0479] (Application example 1)
[0480] Next, a description will be given of Application Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the smart glasses 214 will be referred to as a "terminal."
[0481] While the control programs of machines and robots in factories are frequently updated, it is difficult for on-site operators and engineers to quickly and accurately understand the changes. In particular, a lack of understanding of complex changes and newly added functions increases the likelihood of reduced work efficiency and serious errors. There is a demand for a system that can solve these problems.
[0482] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 1 is realized by the following means.
[0483] In this invention, the server includes means for acquiring code change differences, means for analyzing the acquired differences and identifying the changes, means for generating a natural language explanation based on the analysis results, means for creating an explanatory video using the generated explanation, means for distributing the generated video to a user's terminal, and means for communicating the changes to the control programs of the machines in the factory to operators. This allows the changes to be intuitively understood and enables operators and engineers in the factory to respond quickly.
[0484] "Code change differences" are data that indicate changes to program code between specific commits in a version control system.
[0485] The "means for identifying the changes" is a function that analyzes the change differences in the acquired code and identifies which parts have been changed and how.
[0486] A "natural language description" is text that describes the code changes in human language so that even those without programming knowledge can understand them.
[0487] An "explanatory video" is content created based on natural language explanations, combining audio and video to convey information visually and audibly.
[0488] A "user's terminal" is a device (e.g., a personal computer, tablet, smartphone, etc.) that receives and plays the explanatory video distributed from the server.
[0489] A "control program for machines in a factory" is a software program used to operate production equipment and robots in a factory.
[0490] An "operator" is an employee in charge of operating machines and robots within a factory.
[0491] A "server" is a computer that transmits, receives, stores, and processes data over a network.
[0492] "Analysis results" refers to the data and information obtained by analyzing the code change differences.
[0493] This invention is a system that analyzes code change differences and provides the content to users as natural language explanations and explanatory videos. This system is mainly composed of a server and a user terminal.
[0494] Server Processing
[0495] The server first accesses the version control system (for example, a Git repository) and obtains the differences between the latest commit and a specified commit. At this time, it uses the git diff command to obtain information about the changed files and lines. The obtained difference data is analyzed by the analysis module to identify the specific changes. The changes are classified into functions, variables, conditional expressions, etc., and detailed information is collected for each.
[0496] Based on the analysis results, the server generates a natural language description of the changes. This description is automatically generated by embedding the analysis results in a template, which then undergoes grammar checks and adjustments to make the text more natural.
[0497] The server then creates an explanatory video based on the generated text. Specifically, it uses a text-to-speech engine (e.g., gTTS) to convert the text into audio, and uses a screen capture tool or animation tool (e.g., MoviePy) to create a video highlighting the changes. The audio and video are then combined to generate the final video file, which is then compressed if necessary.
[0498] The generated video file is then distributed to the user's device via the Internet, either via streaming or by providing a download link.
[0499] User terminal processing
[0500] The user's device receives the video streamed from the server and plays it using an appropriate video player. This allows the user to intuitively understand the changes to the code. Specifically, when the video is played, the changed code is highlighted and a natural language explanation is read out, allowing the user to see and hear which parts have been changed and how.
[0501] Specific examples
[0502] For example, if the difference retrieved by the server from the Git repository is the addition of a new function calculateSum, the following process takes place: The server analyzes the difference and identifies that "A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." Next, it generates a natural language explanation of this change: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." An explanatory video is then created based on this explanation. The generated video is then distributed to the user's device, allowing the user to understand the changes through the video.
[0503] Prompt Sentence Examples
[0504] Prompt: Analyze code change diffs and create a natural language description. Diff information:
[0505] diff --git a / example.py b / example.py
[0506] New file mode 100644
[0507] Index e69de29b..c04204629
[0508] ++ FunctionName calculateSum(a, b) =
[0509] return a + b
[0510] analysis:
[0511] A new function 'calculateSum' has been added, which takes two arguments 'a' and 'b' and returns their sum.
[0512] This allows the user to quickly and intuitively understand the changes.
[0513] The flow of the specific processing in the application example 1 will be described with reference to FIG.
[0514] Step 1:
[0515] The server accesses the version control system and retrieves the latest commit or the differences between the specified commit. Specifically, it executes the git diff command against the Git repository to retrieve information about changed files and lines. The input is the specified commit number, and the output is the change difference data.
[0516] Step 2:
[0517] The server analyzes the acquired differential data and identifies the changes. The analysis module classifies the changes into functions, variable changes, conditional expression modifications, etc. The input is the differential change data, and the output is the analysis results. These analysis results include the names of new functions and changed variables.
[0518] Step 3:
[0519] The server generates a natural language explanation based on the analysis results. It uses a template engine to embed the analysis results into the natural language text. The input is the analysis results, and the output is the natural language explanation.
[0520] Step 4:
[0521] The server uses the generated text to create an explanatory video. It uses gTTS (Google Text-to-Speech) to convert the text to speech. It then uses MoviePy to generate a video that combines the text and audio and highlights the changes. The input is a natural language explanatory text, and the output is an explanatory video file.
[0522] Step 5:
[0523] The server compresses the generated video file and delivers it to the user's device. Video delivery is done via streaming or by providing a download link. The input is the explanatory video file, and the output is the video delivered to the user's device.
[0524] Step 6:
[0525] The user's device receives the video streamed from the server and plays it using an appropriate video player, allowing the user to visually and audibly understand the changes in the code. The input is the streamed video file, and the output is the played video.
[0526] For example, if the diff you retrieve from a Git repository looks like this:
[0527] diff --git a / example.py b / example.py
[0528] New file mode 100644
[0529] Index e69de29b..c04204629
[0530] ++ FunctionName calculateSum(a, b) =
[0531] return a + b
[0532] The server analyzes the differences and identifies that "A new function 'calculateSum' has been added. This function takes two arguments 'a' and 'b' and returns their sum." It then generates a natural language explanation for this change: "In this change, a new function 'calculateSum' has been added. This function takes two arguments 'a' and 'b' and returns their sum." It then creates an explanatory video based on this explanation. The generated video is delivered to the user's device, allowing the user to understand the changes through the video.
[0533] Example prompt sentence:
[0534] Prompt: Analyze code change diffs and create a natural language description. Diff information:
[0535] diff --git a / example.py b / example.py
[0536] New file mode 100644
[0537] Index e69de29b..c04204629
[0538] ++ FunctionName calculateSum(a, b) =
[0539] return a + b
[0540] analysis:
[0541] A new function 'calculateSum' has been added, which takes two arguments 'a' and 'b' and returns their sum.
[0542] Furthermore, an emotion engine that estimates the user's emotion may be further combined. That is, the identification processing unit 290 may estimate the user's emotion using the emotion identification model 59, and perform identification processing using the user's emotion.
[0543] This invention relates to a system that analyzes code change differences and provides the user with explanatory text and videos in natural language, and further combines it with an emotion engine that recognizes the user's emotions. An embodiment of the invention will be described.
[0544] This system consists of a server, a user's device, and an emotion engine. The server retrieves code change differences from a version control system, generates explanatory text in natural language based on the analysis results, and creates explanatory videos based on those texts. The generated videos are distributed to the user's device via the Internet. The emotion engine also recognizes the user's emotions and adjusts the content of the explanatory text and explanatory videos based on the results.
[0545] Server Processing
[0546] The server first accesses the version control system (for example, a Git repository) and obtains the latest commit and the differences between the specified commit. At this time, it obtains information about the changed files and lines using the git diff command or similar. For example, it executes the command "git diff HEAD^ HEAD --unified=0 --output=difference.patch".
[0547] The server then analyzes the difference data and identifies the changes. The analysis results include detailed information about the changes (for example, the names of new functions or changed variables). Based on this information, the server generates a natural language description of the changes. The generated description is automatically created by embedding the analysis results in a template, and is grammatically checked to ensure it sounds natural.
[0548] Emotion engine processing
[0549] The emotion engine analyzes the user's emotion data sent from the user's device. This emotion data is collected, for example, based on the user's facial expressions and tone of voice while playing a video. The emotion engine analyzes this data and identifies the user's current emotion.
[0550] Based on the identified emotion, the server adjusts the generated explanatory text and explanatory video. For example, if the user is confused, the explanation text will be more detailed and the video will be slower to make it easier to understand. Conversely, if the user is excited, the explanation text will be more concise and the video will be faster to keep the pace up. This allows information to be provided in the most appropriate format for the user's emotion.
[0551] User terminal processing
[0552] The user's device receives the video streamed from the server and plays it using an appropriate video player. During video playback, emotional data such as the user's facial expressions and tone of voice is collected and sent to the emotion engine. This allows the system to monitor the user's emotions in real time and adjust the content of the video as needed.
[0553] Specific examples
[0554] For example, if the difference the server retrieved from the Git repository was a new function calculateSum, the following process would occur: The server would analyze the difference and identify the following: "A new function calculateSum has been added. It takes two arguments, a and b, and returns their sum." It would then generate a natural language description of this change: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." It would then create an explanatory video based on this description. The emotion engine would then analyze the user's emotions, and if it determined that the user was confused, for example, it would deliver a more detailed explanation and a slower-paced video.
[0555] In this way, the present invention allows users to intuitively understand code changes and provides a learning experience that is tailored to their emotions.
[0556] The processing flow will be explained below.
[0557] Step 1:
[0558] The server accesses the version control system and retrieves the difference between the latest commit and the specified commit, for example, by running the command git diff HEAD^ HEAD --unified=0 --output=difference.patch to get information about the changed files and lines.
[0559] Step 2:
[0560] The server analyzes the acquired differential data and identifies which parts have been changed and how. For example, it classifies changes such as the addition of a function, the introduction of a new variable, or the modification of a conditional expression, and identifies the specific details.
[0561] Step 3:
[0562] The server generates a natural language explanation based on the analysis results. Specifically, it embeds the analysis results into a pre-prepared template and generates an explanation such as, "In this change, a new function, calculateSum, has been added. This function takes two arguments, a and b, and returns their sum."
[0563] Step 4:
[0564] The server sends the generated natural language explanation to the emotion engine, which then adjusts the explanation based on the user's emotional data. For example, if the user is confused, the explanation will be made more specific and detailed, making it easier to understand.
[0565] Step 5:
[0566] The server then creates an explainer video based on the adjusted text. First, it uses a text-to-speech engine to convert the text into audio, then it uses screen capture and animation tools to generate a video that highlights the changes. Finally, it combines the audio and video to create the final video file.
[0567] Step 6:
[0568] The server compresses the resulting video files and converts them into the appropriate format, for example using ffmpeg commands to combine audio and video and convert them into the format best suited for streaming or download links.
[0569] Step 7:
[0570] The server delivers the generated video to the user's device. The video file is uploaded to cloud storage and the URL is notified to the user. The user can access the video through the provided URL and play it on their device.
[0571] Step 8:
[0572] The user plays the streamed video on a video player. While the video is playing, the user's device collects emotional data, such as facial expressions and tone of voice, and sends it to the server in real time. The server then adjusts the video content accordingly.
[0573] Step 9:
[0574] The emotion engine analyzes the user's emotions in real time, monitors the user's understanding and reactions while the video is playing, and makes suggestions such as repeat playback or adding detailed explanations as needed.
[0575] In this way, the present invention not only provides intuitive understanding of code changes, but also dynamically adjusts animation content to match the user's emotions.
[0576] Example 2
[0577] Next, a description will be given of Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the smart glasses 214 will be referred to as a "terminal."
[0578] Effectively identifying and understanding code changes is a time-consuming and labor-intensive task, especially in large-scale projects. Furthermore, there is a need to promote more intuitive understanding by adjusting the explanation content according to the user's emotions. To solve this problem, not only is it necessary to automate the analysis and explanation of code differences, but it is also necessary to provide adaptive information that reflects the user's real-time emotional data.
[0579] The identification process by the identification processing unit 290 of the data processing device 12 in the second embodiment is realized by the following means. In this invention, the server includes means for acquiring code change differences, means for analyzing the acquired differences and identifying the changes, means for generating explanatory text in natural language based on the analysis results, means for creating explanatory videos using the generated explanatory text, means for delivering the generated videos to the user's terminal, means for collecting user emotion data, means for analyzing the collected emotion data, and means for adjusting the explanatory text and video based on the analysis results. This makes it easier for the user to intuitively understand the code changes and enables adaptive information provision according to the user's emotions.
[0580] "Code change differences" is information that indicates parts of source code that have been changed from one point in time to another in a version control system.
[0581] A "version control system" is software that manages the change history of source code and tracks changes when multiple developers work together on the same project.
[0582] "Analysis" is the process of analyzing acquired data and extracting meaningful information from it.
[0583] A "natural language description" is a textual description written in a form that is easy for humans to read, and primarily uses natural language to explain the content.
[0584] An "explainer video" is video content created to convey information through visual and audio means.
[0585] "Emotional data" is data collected based on non-verbal cues such as a user's facial expression and tone of voice, and indicates the user's emotional state.
[0586] "Emotion engine" is a general term for software and hardware that analyzes emotion data and identifies the user's emotional state.
[0587] A "template" is a document template with a predefined format and structure, in which specific data is embedded to generate consistent output.
[0588] A "generative AI model" is a machine learning model that uses artificial intelligence to automatically generate text and content.
[0589] A "prompt" is text input to a generative AI model that is an instruction to obtain a specific output.
[0590] MODE FOR CARRYING OUT THE INVENTION
[0591] This invention relates to a system that analyzes code change differences and provides the user with explanatory text and videos in natural language, and also combines it with an emotion engine that recognizes the user's emotions. Specific embodiments for carrying out the invention are described below.
[0592] Server Processing
[0593] The server first accesses the version control system (e.g., Git repository) and retrieves the latest commit or the diff of the specified commit. The server then executes the git diff command to retrieve information about the changed files and lines. For example, use the command "git diff HEAD^ HEAD --unified=0 --output=difference.patch".
[0594] Next, the server analyzes the acquired differential data and identifies the changes. Specifically, it identifies detailed information such as the addition of new functions or changes to variable names. The results of this analysis are embedded in a template to generate a natural language explanation. The explanation is generated by inputting the following prompt to the generative AI model:
[0595] Please explain the following code changes in natural language.
[0596] ---
[0597] Changes:
[0598] We've added a new function calculateSum that takes two arguments a and b and returns their sum.
[0599] An explanatory video is created based on the generated explanatory text. The video is created by reading the explanatory text as a narration and displaying the code where changes were made. The completed video file is then distributed to the user's device via the Internet.
[0600] Emotion engine processing
[0601] The emotion engine collects and analyzes the user's emotion data sent from the user's device. This emotion data is mainly collected from the user's facial expressions and tone of voice while playing the video. The emotion engine analyzes the collected emotion data to identify the user's emotional state. For example, it determines whether the user is confused or excited.
[0602] The emotion engine sends feedback to the server based on the analysis results. The server receives this feedback and adjusts the content of the explanatory text and explanatory video. If the user is confused, the explanation will be more detailed and the video will play slower. Conversely, if the user is excited, the explanation will be more concise and the video will play faster.
[0603] User terminal processing
[0604] The user's device receives the video streamed from the server and plays it using an appropriate video player. During video playback, emotional data such as the user's facial expressions and tone of voice is collected and sent to the emotion engine. This allows the system to monitor the user's emotions in real time and adjust the content of the video as needed.
[0605] Specific examples
[0606] For example, if the difference the server retrieved from the Git repository was the addition of a new function calculateSum, the server would run the git diff command to determine the following information: "A new function calculateSum has been added. It takes two arguments, a and b, and returns their sum."
[0607] Based on this information, the server generates a prompt and feeds it into the generative AI model:
[0608] Please explain the following code changes in natural language.
[0609] ---
[0610] Changes:
[0611] We've added a new function calculateSum that takes two arguments a and b and returns their sum.
[0612] From the generated natural language description, an explanatory video is created that explains, "In this change, a new function, calculateSum, is added. This function takes two arguments, a and b, and returns their sum." and is delivered to the user's device. If the emotion engine determines that the user is confused during video playback, the server delivers a more detailed explanation and a slower version of the video. This allows the user to intuitively understand the code changes and enjoy a learning experience that suits their emotions.
[0613] The flow of the identification process in the second embodiment will be described with reference to FIG.
[0614] Step 1: Get the code change diff
[0615] The server accesses the version control system and retrieves the latest commit and the diff for the specified commit. Specifically, it executes the command git diff HEAD^ HEAD --unified=0 --output=difference.patch. The input is the ID of the specified commit, and the output is a patch file containing the diff information. The server parses this patch file in the next step.
[0616] Step 2: Analyze differential data
[0617] The server analyzes the differential data it has obtained and identifies the changes. The input is the patch file obtained in step 1, and the output is the details of the analyzed changes. Specifically, the server parses the patch file and extracts the addition of new functions, changes to variable names, etc. It then generates a dataset to embed this information into the template.
[0618] Step 3: Generate natural language descriptions
[0619] The server inputs a prompt into the generative AI model based on the analysis results, and generates a natural language explanation. The input is the detailed data of the changes obtained in step 2, and the output is the generated explanation. The prompt looks like this:
[0620] Please explain the following code changes in natural language.
[0621] ---
[0622] Changes:
[0623] A new function calculateSum has been added, which takes two arguments a and b and returns their sum.
[0624] The server checks the grammar of the output of the generative AI model and adjusts it to make the sentences more natural.
[0625] Step 4: Create an explainer video
[0626] The server uses the generated explanatory text to create an explanatory video. The input is the explanatory text generated in step 3, and the output is an explanatory video file. Specifically, the server converts the explanatory text into audio narration and creates corresponding screen displays. The video is generated in a format that narrates the explanatory content while highlighting the changed code parts.
[0627] Step 5: Publish your video
[0628] The server delivers the generated video file to the user's device. The input is the video file generated in step 4, and the output is the video file delivered to the user's device. The server transfers the video file to the user's device via the Internet.
[0629] Step 6: Collect emotion data
[0630] While the device is playing a video, it collects emotional data such as the user's facial expressions and tone of voice. The input is the user's real-time facial expressions and voice, and the output is the collected emotional data. Specifically, it uses a camera and microphone to collect the user's emotional data.
[0631] Step 7: Analyze the sentiment data
[0632] The emotion engine analyzes the collected emotion data and identifies the user's emotional state. The input is the emotion data collected in step 6, and the output is the analyzed emotion state. The emotion engine performs the analysis using facial recognition and voice analysis technologies.
[0633] Step 8: Adjust the description
[0634] The server adjusts the content of the description and video based on the analysis results of the emotion engine. The input is the user's emotional state obtained in step 7, and the output is the adjusted description and video. Specifically, if the user is confused, the description is made more detailed and the video playback speed is slowed down. Conversely, if the user is excited, the description is made more concise and the video playback speed is increased.
[0635] Step 9: Re-stream the adjusted video
[0636] The server re-broadcasts the adjusted video to the user's device. The input is the video file adjusted in step 8, and the output is the video file re-broadcast to the user's device. The server transfers the video file to the user's device via the Internet.
[0637] (Application example 2)
[0638] Next, a description will be given of Application Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the smart glasses 214 will be referred to as a "terminal."
[0639] In conventional factory robot maintenance work, engineers have had to spend a great deal of time and effort understanding the changes every time software is updated or modified. Furthermore, work efficiency can decline because it is not possible to provide effective information tailored to the engineer's level of understanding or emotional state. To solve this problem, a system is needed that analyzes code change differences and provides optimal explanations based on the engineer's emotional state.
[0640] The identification process by the identification processing unit 290 of the data processing device 12 in Application Example 2 is realized by the following means. In this invention, the server includes means for acquiring code change differences, means for analyzing the acquired differences and identifying the changes, means for generating a natural language explanatory text based on the analysis results, means for creating an explanatory video using the generated explanatory text, means for delivering the generated video to the user's device, means for analyzing the user's emotions, and means for adjusting the content of the explanatory text and explanatory video based on the analysis results. This allows engineers to quickly and intuitively understand the code changes and perform maintenance work in a manner that is optimal for their emotional state.
[0641] "Code change differences" is information that identifies changes between new and old versions in a software version control system.
[0642] "Analysis" is the process of examining and examining acquired data and information in detail to derive specific meanings and results.
[0643] A "natural language description" is a description written in a language that humans use on a daily basis, and is a document intended to convey technical content in an easy-to-understand manner.
[0644] An "explanatory video" is video content that uses visual and audio techniques to explain specific content.
[0645] The term "user terminal" refers to an information processing device used by a user for operation, and includes, for example, a smartphone or a tablet.
[0646] "Emotion analysis" is a technology that identifies a user's emotional state from their facial expressions, voice, etc.
[0647] "Change classification" is the process of dividing the analyzed changes into specific categories.
[0648] "Adjusting the playback speed" is an operation for changing the playback speed of the explanatory video according to the user's level of understanding and emotions.
[0649] "Speech" is a process of outputting text information as voice.
[0650] "Change highlighting" refers to visually highlighting areas of software code where changes have been made.
[0651] "Robot maintenance work in factories" refers to the work of maintaining and updating the software and hardware of automated equipment in factories.
[0652] The present invention relates to a system for supporting the maintenance of factory robots, which analyzes the difference in changes and provides the user with explanatory text and videos in natural language. The system also incorporates an emotion engine that recognizes the user's emotions.
[0653] System Configuration
[0654] This system consists of a server, a user's terminal, and an emotion engine.
[0655] Server Processing
[0656] The server accesses the version control system to obtain the differences in code changes. For example, it uses the git diff command to obtain the differences between the latest commit or a specified commit in the Git repository, and analyzes the difference data. It then analyzes the obtained difference data and identifies detailed information about the changes. It generates a natural language explanation based on the analysis results, and creates an explanatory video based on this explanation. The generated explanatory video is then distributed to the user's device via the Internet.
[0657] Emotion engine processing
[0658] The emotion engine analyzes the user's emotion data sent from the user's device. This data is collected based on facial expressions, tone of voice, and other factors while the user is playing the video. The emotion engine analyzes this data to identify the user's current emotional state. Based on the identified emotion, the server adjusts the content of the generated explanation text and explanatory video. For example, if the user is confused, the explanation text will be more detailed and the pace of the video will be slower to make it easier to understand. Conversely, if the user is excited, the explanation text will be more concise and the pace of the video will be faster.
[0659] User terminal processing
[0660] The user's device receives the explanatory video delivered from the server and plays it using an appropriate video player. During the video playback, emotional data such as the user's facial expressions and tone of voice is collected and sent to the emotion engine. This allows the system to monitor the user's emotions in real time and adjust the content of the video as needed.
[0661] Techniques used and examples
[0662] The system uses the following technologies:
[0663] Hardware: Servers, user devices (smartphones, tablets, etc.), webcams
[0664] Software: Version control system (Git), natural language generation engine (OpenAI), emotion analysis engine (emotion_recognition library)
[0665] Specific examples
[0666] For example, if the difference the server retrieved from the Git repository was the addition of a new function calculateSum, the server would analyze the difference and identify it as "A new function calculateSum has been added. It takes two arguments, a and b, and returns their sum." It then generates a natural language explanation for this change: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." It then creates an explanatory video based on this explanation. Next, the emotion engine analyzes the user's emotions, and if it determines that the user is confused, for example, it will deliver a more detailed explanation and a slower-paced video.
[0667] Prompt Sentence Examples
[0668] Latest Git commit log:
[0669] diff --git a / src / main.py b / src / main.py
[0670] index abc123..def456 100644
[0671] --- a / src / main.py
[0672] +++ b / src / main.py
[0673] @@ -2,6 +2,7 @@
[0674] import sys
[0675] +def new_function():
[0676] + print("This is a new function")
[0677] def main():
[0678] print("Hello World")
[0679] Please briefly explain this change.
[0680] In this way, by using this invention, factory engineers can intuitively understand the changes in the code and receive information in a format that is optimal for their emotional state, which is expected to lead to efficient and effective maintenance work.
[0681] The flow of the specific processing in the application example 2 will be described with reference to FIG.
[0682] Step 1:
[0683] The server accesses the version control system and retrieves the difference between the code changes. The server uses the git diff command to retrieve the difference data between the latest commit and the specified commit. This difference data includes information about the changed files and lines. The input is a Git repository, and the output is the difference data.
[0684] Step 2:
[0685] The server analyzes the differential data it has acquired and identifies the changes. During the analysis, detailed information such as the names of new functions and changed variables is extracted. The input is the differential data obtained in step 1, and the output is detailed information about the changes.
[0686] Step 3:
[0687] The server generates a natural language description based on the analysis results. Using a generative AI model (such as OpenAI's GPT-3), it converts the identified changes into easy-to-understand text. The input is detailed information about the changes, and the output is a natural language description.
[0688] Step 4:
[0689] An explanatory video is created based on the natural language description generated by the server. To generate the video, a speech synthesis engine and video editing tool are used to convert the description into audio and create a video that highlights the changes. The input is the natural language description, and the output is the explanatory video.
[0690] Step 5:
[0691] The server generates an explanatory video and delivers it to the user's device. The delivery is via the Internet, and the user's device can play the video on an appropriate video player. The input is the explanatory video, and the output is the video delivered to the user's device.
[0692] Step 6:
[0693] Emotion data is collected while the user's device is playing a video. The device's webcam and microphone are used to capture the user's facial expressions and tone of voice, which are then sent to an emotion analysis engine. The input is the user's facial and voice data, and the output is emotion data.
[0694] Step 7:
[0695] The emotion engine analyzes the user's emotion data and identifies their emotional state. For example, it determines whether the user is confused or excited. The input is the emotion data obtained in step 6, and the output is the user's emotional state.
[0696] Step 8:
[0697] The server adjusts the content of the explanatory text and explanatory video based on the analysis results of the emotion engine. If the user is confused, the explanation will be more detailed and the pace of the video will be slower. Conversely, if the user is excited, the explanation will be more concise and the pace of the video will be faster. The input is the user's emotional state, and the output is the adjusted explanation text and video.
[0698] Through these processing steps, factory technicians can perform maintenance work efficiently.
[0699] The specific processing unit 290 transmits the result of the specific processing to the smart glasses 214. In the smart glasses 214, the control unit 46A causes the speaker 240 to output the result of the specific processing. The microphone 238 acquires audio indicating a user input regarding the result of the specific processing. The control unit 46A transmits audio data indicating the user input acquired by the microphone 238 to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the audio data.
[0700] The data generation model 58 is a so-called generative AI (Artificial Intelligence). An example of the data generation model 58 is ChatGPT (Internet Search<URL: https: / / openai.com / blog / chatgpt> ), Gemini (Internet search <url: https: gemini.google.com ?hl="ja">) and other generation AIs. The data generation model 58 is obtained by performing deep learning on a neural network. A prompt including an instruction is input to the data generation model 58, and inference data such as voice data indicating voice, text data indicating text, and image data indicating an image is also input. The data generation model 58 performs inference on the input inference data in accordance with the instruction indicated by the prompt, and outputs the inference result in a data format such as voice data and text data. Here, inference refers to, for example, analysis, classification, prediction, and / or summarization.
[0701] In the above embodiment, an example in which the specific processing is performed by the data processing device 12 has been given, but the technology of the present disclosure is not limited to this, and the specific processing may be performed by the smart glasses 214.
[0702] [Third embodiment]
[0703] FIG. 5 shows an example of the configuration of a data processing system 310 according to the third embodiment.
[0704] 5, the data processing system 310 includes the data processing device 12 and a headset terminal 314. An example of the data processing device 12 is a server.
[0705] The data processing device 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" according to the technology of the present disclosure. The computer 22 includes a processor 28, a RAM 30, and a storage 32. The processor 28, the RAM 30, and the storage 32 are connected to a bus 34. The database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).
[0706] The headset type terminal 314 includes a computer 36, a microphone 238, a speaker 240, a camera 42, a communication I / F 44, and a display 343. The computer 36 includes a processor 46, a RAM 48, and a storage 50. The processor 46, the RAM 48, and the storage 50 are connected to a bus 52. The microphone 238, the speaker 240, the camera 42, and the display 343 are also connected to the bus 52.
[0707] The microphone 238 receives instructions and the like from the user 20 by receiving voice uttered by the user 20. The microphone 238 captures the voice uttered by the user 20, converts the captured voice into audio data, and outputs it to the processor 46. The speaker 240 outputs audio in accordance with instructions from the processor 46.
[0708] Camera 42 is a small digital camera equipped with an optical system including a lens, aperture, and shutter, and an imaging element such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor, and captures images of the surroundings of user 20 (for example, an imaging range defined by an angle of view equivalent to the field of vision of a typical healthy person).
[0709] The communication I / F 44 is connected to a network 54. The communication I / Fs 44 and 26 are responsible for the exchange of various information between the processor 46 and the processor 28 via the network 54. The exchange of various information between the processor 46 and the processor 28 using the communication I / Fs 44 and 26 is carried out in a secure state.
[0710] Fig. 6 shows an example of the main functions of the data processing device 12 and the headset type terminal 314. As shown in Fig. 6, in the data processing device 12, a specific process is performed by the processor 28. A specific process program 56 is stored in the storage 32.
[0711] The specific processing program 56 is an example of a "program" according to the technology of the present disclosure. The processor 28 reads the specific processing program 56 from the storage 32 and executes the read specific processing program 56 on the RAM 30. The specific processing is realized by the processor 28 operating as a specific processing unit 290 in accordance with the specific processing program 56 executed on the RAM 30.
[0712] The storage 32 stores a data generation model 58 and an emotion identification model 59. The data generation model 58 and the emotion identification model 59 are used by the identification processing unit 290.
[0713] In the headset type terminal 314, a reception output process is performed by the processor 46. A reception output program 60 is stored in the storage 50. The processor 46 reads the reception output program 60 from the storage 50 and executes the read reception output program 60 on the RAM 48. The reception output process is realized by the processor 46 operating as the control unit 46A in accordance with the reception output program 60 executed on the RAM 48.
[0714] Next, a description will be given of the identification process performed by the identification processing unit 290 of the data processing device 12. In the following description, the data processing device 12 will be referred to as the "server" and the headset type terminal 314 will be referred to as the "terminal."
[0715] The present invention relates to a system that analyzes code change differences and provides the user with explanatory text and video in natural language. An embodiment of the present invention will now be described.
[0716] This system consists of a server and a user's device. The server retrieves code change differences from the version control system, generates explanatory text in natural language based on the analysis results, and creates explanatory videos based on those texts. The generated videos are distributed to the user's device via the Internet.
[0717] Server Processing
[0718] The server first accesses the version control system (for example, a Git repository) and obtains the latest commit and the differences between the specified commits. At this time, it obtains information about the changed files and lines using the git diff command or similar.
[0719] The server then analyzes the difference data and identifies the changes. It classifies the changes as adding functions, changing variables, modifying conditional expressions, etc. The analysis results include detailed information about the changes (for example, the names of new functions and changed variables).
[0720] Based on the analysis results, the server generates a natural language description of the changes. This description is generated by embedding the analysis results in a template, and is then checked for grammar and adjusted to ensure it sounds natural.
[0721] Based on the generated description, the server creates an explanatory video, converting the description into audio using a text-to-speech engine, and using screen capture and animation tools to create a video highlighting the changes. The audio and video are then combined to generate the final video file.
[0722] The generated video file is compressed as needed and delivered to the user's device. Video delivery methods include streaming and providing a download link.
[0723] User terminal processing
[0724] The user's device receives the video streamed from the server and plays it using an appropriate video player. This allows the user to intuitively understand the changes to the code. Specifically, when the video is played, the changed code is highlighted and a natural language explanation is read out, allowing the user to see and hear which parts have been changed and how.
[0725] Specific examples
[0726] For example, if the difference retrieved by the server from the Git repository is the addition of a new function calculateSum, the following process takes place: The server analyzes the difference and identifies that "A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." Next, it generates a natural language explanation of this change: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." An explanatory video is then created based on this explanation. The generated video is then distributed to the user's device, allowing the user to understand the changes through the video.
[0727] In this way, the present invention allows the user to quickly and accurately understand the changes to the code.
[0728] The processing flow will be explained below.
[0729] Step 1:
[0730] The server accesses the version control system and retrieves the differences between the latest commit and the specified commit. This is done by using the git diff command to collect information about changed files and lines. For example, run the command "git diff HEAD^ HEAD --unified=0 --output=difference.patch".
[0731] Step 2:
[0732] The server analyzes the difference data it has acquired. Here, it parses the difference data and extracts information about each change (added, deleted, changed lines). For example, it classifies whether it is an added function or a changed variable name.
[0733] Step 3:
[0734] The server generates a natural language description based on the analysis results. The analysis results are embedded in a template to generate the description. A grammar check is performed and the description is adjusted to ensure natural-sounding sentences. For example, it generates a description such as "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum."
[0735] Step 4:
[0736] The server creates an explanatory video based on the generated text. First, it converts the text into audio using a text-to-speech engine. Then, it uses screen capture and animation tools to generate a video that highlights the changes. Finally, it integrates the audio and video.
[0737] Step 5:
[0738] The server compresses the generated video files and converts them into the appropriate format, for example using ffmpeg commands to combine the audio and video to generate the final video file.
[0739] Step 6:
[0740] The server delivers the generated video to the user's device. The video file is uploaded to cloud storage, for example, and the URL is notified to the user. The user then accesses the video via the provided URL and plays it on their device.
[0741] Step 7:
[0742] Users can play the video in a video player, and the code changes are highlighted and natural language explanations are read out, allowing users to see which parts have been changed and how.
[0743] The above is the specific processing flow of the present invention. This procedure allows the user to intuitively understand the changes and efficiently review and correct them.
[0744] Example 1
[0745] Next, a description will be given of Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the headset type terminal 314 will be referred to as a "terminal."
[0746] Conventional systems for explaining code changes have the drawback of taking a long time to understand the changes and making it difficult to accurately understand them. Especially when large code bases or complex changes are involved, understanding the changes requires specialized knowledge and a lot of time. Furthermore, text-only explanations make it difficult to intuitively grasp the overall situation. To solve these problems, a method that can quickly and accurately understand the changes was needed.
[0747] The specific processing by the specific processing unit 290 of the data processing device 12 in the first embodiment is realized by the following means.
[0748] In this invention, the server includes means for acquiring code change differences, means for analyzing the acquired differences and identifying the changes, means for generating explanatory text in natural language based on the analysis results, means for creating explanatory videos using the generated explanatory text, means for delivering the generated videos to the user's device, means for embedding the analysis results in a specific template to check grammar, and means for generating prompt text to input the explanatory text into the generative AI model, thereby enabling the user to intuitively understand the code changes.
[0749] "Means for obtaining code change differences" refers to a function that extracts changes between different versions from a system that manages code change history.
[0750] The "means of analyzing the acquired differences and identifying the changes" is a function that analyzes the changes in the extracted code in detail and identifies which parts have been changed and how.
[0751] The "means for generating a natural language explanation based on the analysis results" is a function that converts the analyzed changes into a natural language sentence that is easy for humans to understand.
[0752] "Means for creating explanatory videos using generated explanatory text" is a function that converts the generated natural language explanatory text into audio and combines it with video to create explanatory videos.
[0753] "Means for delivering the generated video to the user's terminal" is a function for transmitting the created explanatory video to the user's terminal via the Internet.
[0754] "Means for embedding analysis results in a specific template to check grammar" is a function that incorporates analysis results into a pre-prepared sentence template and checks the grammar to ensure natural grammar.
[0755] "Means for generating prompt sentences to input explanatory text into a generative AI model" is a function that creates instruction sentences (prompt sentences) to provide appropriate input to a generative AI model.
[0756] The present invention relates to a system that analyzes code change differences and provides the user with a natural language explanation and explanatory video. The following describes in detail an embodiment of the present invention.
[0757] This system consists of a server and a user's device. The server retrieves code change differences from the version control system, generates explanatory text in natural language based on the analysis results, and creates explanatory videos based on those texts. The generated videos are distributed to the user's device via the Internet.
[0758] Server Processing
[0759] The server first accesses the version control system (for example, a Git repository) and uses commands such as git diff to obtain the differences between the latest commit and a specified commit. It then analyzes the obtained difference data to identify the changes. During the analysis, it classifies the changes as whether they are the addition of a function, a change to a variable, or a modification to a conditional expression. This allows it to obtain detailed information about the changes (for example, the name of a new function or the name of a changed variable).
[0760] The server then generates a natural language explanation based on the analysis results. During this process, the analysis results are embedded in a specific template, grammar checked, and made natural-sounding. When generating explanations using a generative AI model, a prompt generation function is used.
[0761] Specific examples of prompts are as follows:
[0762] Example prompt sentence:
[0763] "Analyze the following code change diff and explain it in natural language.
[0764] Change Diff:
[0765] diff
[0766] + function calculateSum(a, b) {
[0767] + return a + b;
[0768] +}
[0769] Analysis results:
[0770] A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum.
[0771] The server creates an explanatory video based on the generated description. It uses a text-to-speech engine (e.g., a speech synthesis service) to convert the description into audio, and uses screen capture and animation tools to create a video that highlights the changes. It then combines the audio and video to generate the final video file. The generated video file is compressed as needed and distributed to the user's device via the Internet. Possible methods for distributing the video include streaming or providing a download link.
[0772] User terminal processing
[0773] The user's device receives the video streamed from the server and plays it using an appropriate video player. This allows the user to intuitively understand the changes made to the code. Specifically, when the video is played, the changed code is highlighted and an automatically generated explanation is read aloud, allowing the user to see and hear which parts have been changed and how.
[0774] Specific examples
[0775] For example, if the difference retrieved by the server from the Git repository is the addition of a new function calculateSum, the following process takes place: The server analyzes the difference and identifies that "A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." Next, it generates this content as a natural language description: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum.", and creates an explanatory video based on this description.
[0776] As described above, by using the present invention, the user can quickly and accurately understand the changes to the code.
[0777] The flow of the identification process in the first embodiment will be described with reference to FIG.
[0778] Step 1:
[0779] The server accesses the version control system and retrieves the diffs for the specified commits, using the git diff command to retrieve the latest commit or the diffs between specific commits. For example, run the following command:
[0780] git diff <commit id1> <commit id2>
[0781] Input: Version control system commit ID
[0782] Output: Code diff data
[0783] The server will then capture the resulting changed filename and details of the change.
[0784] Step 2:
[0785] The server analyzes the difference data to identify the changes. The analysis parses the difference data and classifies the changes as follows: adding a function, changing a variable, modifying a conditional expression, etc.
[0786] Input: Code diff data
[0787] Output: Analysis results (detailed information on changes)
[0788] The server obtains information such as new function names and changed variable names as a result of the analysis.
[0789] Step 3:
[0790] The server generates a natural language explanation based on the analysis results. In this process, the analysis results are embedded in a template, grammar checked, and made into natural-sounding sentences. The explanation is generated by inputting the following prompt sentence into the generative AI model:
[0791] Example prompt sentence:
[0792] "Analyze the following code change diff and explain it in natural language.
[0793] Change Diff:
[0794] diff
[0795] + function calculateSum(a, b) {
[0796] + return a + b;
[0797] +}
[0798] Analysis results:
[0799] A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum.
[0800] Input: Analysis results
[0801] Output: Natural language description
[0802] The server uses a generative AI model to create detailed and easy-to-understand descriptions.
[0803] Step 4:
[0804] The server creates an explanatory video based on the generated description. It converts the description into audio using a text-to-speech engine (e.g., a speech synthesis service), and creates a video highlighting the changes using a screen capture tool or animation tool (e.g., FFmpeg, After Effects).
[0805] Input: Natural language description
[0806] Output:Explanatory video
[0807] The server combines the audio and video to generate the final video file.
[0808] Step 5:
[0809] The server compresses the generated video file and delivers it to the user's device, allowing them to watch the video by providing a streaming service or a download link.
[0810] Input: Explainer video
[0811] Output: Compressed video file
[0812] The server converts the video into a compressed format (e.g. MP4, WEBM) and distributes the video through a distribution service.
[0813] Step 6:
[0814] The user's device receives the video delivered from the server and plays it using an appropriate video player.
[0815] Input: Compressed video file
[0816] Output: The video being played
[0817] Users can view and intuitively understand the changes by watching the video: for example, by playing the video using a video player (e.g., VLC Media Player, Windows Media Player), and seeing the highlighted and audio-guided explanations of the code changes.
[0818] (Application example 1)
[0819] Next, a description will be given of Application Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the headset type terminal 314 will be referred to as a "terminal."
[0820] While the control programs of machines and robots in factories are frequently updated, it is difficult for on-site operators and engineers to quickly and accurately understand the changes. In particular, a lack of understanding of complex changes and newly added functions increases the likelihood of reduced work efficiency and serious errors. There is a demand for a system that can solve these problems.
[0821] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 1 is realized by the following means.
[0822] In this invention, the server includes means for acquiring code change differences, means for analyzing the acquired differences and identifying the changes, means for generating a natural language explanation based on the analysis results, means for creating an explanatory video using the generated explanation, means for distributing the generated video to a user's terminal, and means for communicating the changes to the control programs of the machines in the factory to operators. This allows the changes to be intuitively understood and enables operators and engineers in the factory to respond quickly.
[0823] "Code change differences" are data that indicate changes to program code between specific commits in a version control system.
[0824] The "means for identifying the changes" is a function that analyzes the change differences in the acquired code and identifies which parts have been changed and how.
[0825] A "natural language description" is text that describes the code changes in human language so that even those without programming knowledge can understand them.
[0826] An "explanatory video" is content created based on natural language explanations, combining audio and video to convey information visually and audibly.
[0827] A "user's terminal" is a device (e.g., a personal computer, tablet, smartphone, etc.) that receives and plays the explanatory video distributed from the server.
[0828] A "control program for machines in a factory" is a software program used to operate production equipment and robots in a factory.
[0829] An "operator" is an employee in charge of operating machines and robots within a factory.
[0830] A "server" is a computer that transmits, receives, stores, and processes data over a network.
[0831] "Analysis results" refers to the data and information obtained by analyzing the code change differences.
[0832] This invention is a system that analyzes code change differences and provides the content to users as natural language explanations and explanatory videos. This system is mainly composed of a server and a user terminal.
[0833] Server Processing
[0834] The server first accesses the version control system (for example, a Git repository) and obtains the differences between the latest commit and a specified commit. At this time, it uses the git diff command to obtain information about the changed files and lines. The obtained difference data is analyzed by the analysis module to identify the specific changes. The changes are classified into functions, variables, conditional expressions, etc., and detailed information is collected for each.
[0835] Based on the analysis results, the server generates a natural language description of the changes. This description is automatically generated by embedding the analysis results in a template, which then undergoes grammar checks and adjustments to make the text more natural.
[0836] The server then creates an explanatory video based on the generated text. Specifically, it uses a text-to-speech engine (e.g., gTTS) to convert the text into audio, and uses a screen capture tool or animation tool (e.g., MoviePy) to create a video highlighting the changes. The audio and video are then combined to generate the final video file, which is then compressed if necessary.
[0837] The generated video file is then distributed to the user's device via the Internet, either via streaming or by providing a download link.
[0838] User terminal processing
[0839] The user's device receives the video streamed from the server and plays it using an appropriate video player. This allows the user to intuitively understand the changes to the code. Specifically, when the video is played, the changed code is highlighted and a natural language explanation is read out, allowing the user to see and hear which parts have been changed and how.
[0840] Specific examples
[0841] For example, if the difference retrieved by the server from the Git repository is the addition of a new function calculateSum, the following process takes place: The server analyzes the difference and identifies that "A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." Next, it generates a natural language explanation of this change: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." An explanatory video is then created based on this explanation. The generated video is then distributed to the user's device, allowing the user to understand the changes through the video.
[0842] Prompt Sentence Examples
[0843] Prompt: Analyze code change diffs and create a natural language description. Diff information:
[0844] diff --git a / example.py b / example.py
[0845] New file mode 100644
[0846] Index e69de29b..c04204629
[0847] ++ FunctionName calculateSum(a, b) =
[0848] return a + b
[0849] analysis:
[0850] A new function 'calculateSum' has been added, which takes two arguments 'a' and 'b' and returns their sum.
[0851] This allows the user to quickly and intuitively understand the changes.
[0852] The flow of the specific processing in the application example 1 will be described with reference to FIG.
[0853] Step 1:
[0854] The server accesses the version control system and retrieves the latest commit or the differences between the specified commit. Specifically, it executes the git diff command against the Git repository to retrieve information about changed files and lines. The input is the specified commit number, and the output is the change difference data.
[0855] Step 2:
[0856] The server analyzes the acquired differential data and identifies the changes. The analysis module classifies the changes into functions, variable changes, conditional expression modifications, etc. The input is the differential change data, and the output is the analysis results. These analysis results include the names of new functions and changed variables.
[0857] Step 3:
[0858] The server generates a natural language explanation based on the analysis results. It uses a template engine to embed the analysis results into the natural language text. The input is the analysis results, and the output is the natural language explanation.
[0859] Step 4:
[0860] The server uses the generated text to create an explanatory video. It uses gTTS (Google Text-to-Speech) to convert the text to speech. It then uses MoviePy to generate a video that combines the text and audio and highlights the changes. The input is a natural language explanatory text, and the output is an explanatory video file.
[0861] Step 5:
[0862] The server compresses the generated video file and delivers it to the user's device. Video delivery is done via streaming or by providing a download link. The input is the explanatory video file, and the output is the video delivered to the user's device.
[0863] Step 6:
[0864] The user's device receives the video streamed from the server and plays it using an appropriate video player, allowing the user to visually and audibly understand the changes in the code. The input is the streamed video file, and the output is the played video.
[0865] For example, if the diff you retrieve from a Git repository looks like this:
[0866] diff --git a / example.py b / example.py
[0867] New file mode 100644
[0868] Index e69de29b..c04204629
[0869] ++ FunctionName calculateSum(a, b) =
[0870] return a + b
[0871] The server analyzes the differences and identifies that "A new function 'calculateSum' has been added. This function takes two arguments 'a' and 'b' and returns their sum." It then generates a natural language explanation for this change: "In this change, a new function 'calculateSum' has been added. This function takes two arguments 'a' and 'b' and returns their sum." It then creates an explanatory video based on this explanation. The generated video is delivered to the user's device, allowing the user to understand the changes through the video.
[0872] Example prompt sentence:
[0873] Prompt: Analyze code change diffs and create a natural language description. Diff information:
[0874] diff --git a / example.py b / example.py
[0875] New file mode 100644
[0876] Index e69de29b..c04204629
[0877] ++ FunctionName calculateSum(a, b) =
[0878] return a + b
[0879] analysis:
[0880] A new function 'calculateSum' has been added, which takes two arguments 'a' and 'b' and returns their sum.
[0881] Furthermore, an emotion engine that estimates the user's emotion may be further combined. That is, the identification processing unit 290 may estimate the user's emotion using the emotion identification model 59, and perform identification processing using the user's emotion.
[0882] This invention relates to a system that analyzes code change differences and provides the user with explanatory text and videos in natural language, and further combines it with an emotion engine that recognizes the user's emotions. An embodiment of the invention will be described.
[0883] This system consists of a server, a user's device, and an emotion engine. The server retrieves code change differences from a version control system, generates explanatory text in natural language based on the analysis results, and creates explanatory videos based on those texts. The generated videos are distributed to the user's device via the Internet. The emotion engine also recognizes the user's emotions and adjusts the content of the explanatory text and explanatory videos based on the results.
[0884] Server Processing
[0885] The server first accesses the version control system (for example, a Git repository) and obtains the latest commit and the differences between the specified commit. At this time, it obtains information about the changed files and lines using the git diff command or similar. For example, it executes the command "git diff HEAD^ HEAD --unified=0 --output=difference.patch".
[0886] The server then analyzes the difference data and identifies the changes. The analysis results include detailed information about the changes (for example, the names of new functions or changed variables). Based on this information, the server generates a natural language description of the changes. The generated description is automatically created by embedding the analysis results in a template, and is grammatically checked to ensure it sounds natural.
[0887] Emotion engine processing
[0888] The emotion engine analyzes the user's emotion data sent from the user's device. This emotion data is collected, for example, based on the user's facial expressions and tone of voice while playing a video. The emotion engine analyzes this data and identifies the user's current emotion.
[0889] Based on the identified emotion, the server adjusts the generated explanatory text and explanatory video. For example, if the user is confused, the explanation text will be more detailed and the video will be slower to make it easier to understand. Conversely, if the user is excited, the explanation text will be more concise and the video will be faster to keep the pace up. This allows information to be provided in the most appropriate format for the user's emotion.
[0890] User terminal processing
[0891] The user's device receives the video streamed from the server and plays it using an appropriate video player. During video playback, emotional data such as the user's facial expressions and tone of voice is collected and sent to the emotion engine. This allows the system to monitor the user's emotions in real time and adjust the content of the video as needed.
[0892] Specific examples
[0893] For example, if the difference the server retrieved from the Git repository was a new function calculateSum, the following process would occur: The server would analyze the difference and identify the following: "A new function calculateSum has been added. It takes two arguments, a and b, and returns their sum." It would then generate a natural language description of this change: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." It would then create an explanatory video based on this description. The emotion engine would then analyze the user's emotions, and if it determined that the user was confused, for example, it would deliver a more detailed explanation and a slower-paced video.
[0894] In this way, the present invention allows users to intuitively understand code changes and provides a learning experience that is tailored to their emotions.
[0895] The processing flow will be explained below.
[0896] Step 1:
[0897] The server accesses the version control system and retrieves the difference between the latest commit and the specified commit, for example, by running the command git diff HEAD^ HEAD --unified=0 --output=difference.patch to get information about the changed files and lines.
[0898] Step 2:
[0899] The server analyzes the acquired differential data and identifies which parts have been changed and how. For example, it classifies changes such as the addition of a function, the introduction of a new variable, or the modification of a conditional expression, and identifies the specific details.
[0900] Step 3:
[0901] The server generates a natural language explanation based on the analysis results. Specifically, it embeds the analysis results into a pre-prepared template and generates an explanation such as, "In this change, a new function, calculateSum, has been added. This function takes two arguments, a and b, and returns their sum."
[0902] Step 4:
[0903] The server sends the generated natural language explanation to the emotion engine, which then adjusts the explanation based on the user's emotional data. For example, if the user is confused, the explanation will be made more specific and detailed, making it easier to understand.
[0904] Step 5:
[0905] The server then creates an explainer video based on the adjusted text. First, it uses a text-to-speech engine to convert the text into audio, then it uses screen capture and animation tools to generate a video that highlights the changes. Finally, it combines the audio and video to create the final video file.
[0906] Step 6:
[0907] The server compresses the resulting video files and converts them into the appropriate format, for example using ffmpeg commands to combine audio and video and convert them into the format best suited for streaming or download links.
[0908] Step 7:
[0909] The server delivers the generated video to the user's device. The video file is uploaded to cloud storage and the URL is notified to the user. The user can access the video through the provided URL and play it on their device.
[0910] Step 8:
[0911] The user plays the streamed video on a video player. While the video is playing, the user's device collects emotional data, such as facial expressions and tone of voice, and sends it to the server in real time. The server then adjusts the video content accordingly.
[0912] Step 9:
[0913] The emotion engine analyzes the user's emotions in real time, monitors the user's understanding and reactions while the video is playing, and makes suggestions such as repeat playback or adding detailed explanations as needed.
[0914] In this way, the present invention not only provides intuitive understanding of code changes, but also dynamically adjusts animation content to match the user's emotions.
[0915] Example 2
[0916] Next, a description will be given of Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the headset type terminal 314 will be referred to as a "terminal."
[0917] Effectively identifying and understanding code changes is a time-consuming and labor-intensive task, especially in large-scale projects. Furthermore, there is a need to promote more intuitive understanding by adjusting the explanation content according to the user's emotions. To solve this problem, not only is it necessary to automate the analysis and explanation of code differences, but it is also necessary to provide adaptive information that reflects the user's real-time emotional data.
[0918] The identification process by the identification processing unit 290 of the data processing device 12 in the second embodiment is realized by the following means. In this invention, the server includes means for acquiring code change differences, means for analyzing the acquired differences and identifying the changes, means for generating explanatory text in natural language based on the analysis results, means for creating explanatory videos using the generated explanatory text, means for delivering the generated videos to the user's terminal, means for collecting user emotion data, means for analyzing the collected emotion data, and means for adjusting the explanatory text and video based on the analysis results. This makes it easier for the user to intuitively understand the code changes and enables adaptive information provision according to the user's emotions.
[0919] "Code change differences" is information that indicates parts of source code that have been changed from one point in time to another in a version control system.
[0920] A "version control system" is software that manages the change history of source code and tracks changes when multiple developers work together on the same project.
[0921] "Analysis" is the process of analyzing acquired data and extracting meaningful information from it.
[0922] A "natural language description" is a textual description written in a form that is easy for humans to read, and primarily uses natural language to explain the content.
[0923] An "explainer video" is video content created to convey information through visual and audio means.
[0924] "Emotional data" is data collected based on non-verbal cues such as a user's facial expression and tone of voice, and indicates the user's emotional state.
[0925] "Emotion engine" is a general term for software and hardware that analyzes emotion data and identifies the user's emotional state.
[0926] A "template" is a document template with a predefined format and structure, in which specific data is embedded to generate consistent output.
[0927] A "generative AI model" is a machine learning model that uses artificial intelligence to automatically generate text and content.
[0928] A "prompt" is text input to a generative AI model that is an instruction to obtain a specific output.
[0929] MODE FOR CARRYING OUT THE INVENTION
[0930] This invention relates to a system that analyzes code change differences and provides the user with explanatory text and videos in natural language, and also combines it with an emotion engine that recognizes the user's emotions. Specific embodiments for carrying out the invention are described below.
[0931] Server Processing
[0932] The server first accesses the version control system (e.g., Git repository) and retrieves the latest commit or the diff of the specified commit. The server then executes the git diff command to retrieve information about the changed files and lines. For example, use the command "git diff HEAD^ HEAD --unified=0 --output=difference.patch".
[0933] Next, the server analyzes the acquired differential data and identifies the changes. Specifically, it identifies detailed information such as the addition of new functions or changes to variable names. The results of this analysis are embedded in a template to generate a natural language explanation. The explanation is generated by inputting the following prompt to the generative AI model:
[0934] Please explain the following code changes in natural language.
[0935] ---
[0936] Changes:
[0937] We've added a new function calculateSum that takes two arguments a and b and returns their sum.
[0938] An explanatory video is created based on the generated explanatory text. The video is created by reading the explanatory text as a narration and displaying the code where changes were made. The completed video file is then distributed to the user's device via the Internet.
[0939] Emotion engine processing
[0940] The emotion engine collects and analyzes the user's emotion data sent from the user's device. This emotion data is mainly collected from the user's facial expressions and tone of voice while playing the video. The emotion engine analyzes the collected emotion data to identify the user's emotional state. For example, it determines whether the user is confused or excited.
[0941] The emotion engine sends feedback to the server based on the analysis results. The server receives this feedback and adjusts the content of the explanatory text and explanatory video. If the user is confused, the explanation will be more detailed and the video will play slower. Conversely, if the user is excited, the explanation will be more concise and the video will play faster.
[0942] User terminal processing
[0943] The user's device receives the video streamed from the server and plays it using an appropriate video player. During video playback, emotional data such as the user's facial expressions and tone of voice is collected and sent to the emotion engine. This allows the system to monitor the user's emotions in real time and adjust the content of the video as needed.
[0944] Specific examples
[0945] For example, if the difference the server retrieved from the Git repository was the addition of a new function calculateSum, the server would run the git diff command to determine the following information: "A new function calculateSum has been added. It takes two arguments, a and b, and returns their sum."
[0946] Based on this information, the server generates a prompt and feeds it into the generative AI model:
[0947] Please explain the following code changes in natural language.
[0948] ---
[0949] Changes:
[0950] We've added a new function calculateSum that takes two arguments a and b and returns their sum.
[0951] From the generated natural language description, an explanatory video is created that explains, "In this change, a new function, calculateSum, is added. This function takes two arguments, a and b, and returns their sum." and is delivered to the user's device. If the emotion engine determines that the user is confused during video playback, the server delivers a more detailed explanation and a slower version of the video. This allows the user to intuitively understand the code changes and enjoy a learning experience that suits their emotions.
[0952] The flow of the identification process in the second embodiment will be described with reference to FIG.
[0953] Step 1: Get the code change diff
[0954] The server accesses the version control system and retrieves the latest commit and the diff for the specified commit. Specifically, it executes the command git diff HEAD^ HEAD --unified=0 --output=difference.patch. The input is the ID of the specified commit, and the output is a patch file containing the diff information. The server parses this patch file in the next step.
[0955] Step 2: Analyze differential data
[0956] The server analyzes the differential data it has obtained and identifies the changes. The input is the patch file obtained in step 1, and the output is the details of the analyzed changes. Specifically, the server parses the patch file and extracts the addition of new functions, changes to variable names, etc. It then generates a dataset to embed this information into the template.
[0957] Step 3: Generate natural language descriptions
[0958] The server inputs a prompt into the generative AI model based on the analysis results, and generates a natural language explanation. The input is the detailed data of the changes obtained in step 2, and the output is the generated explanation. The prompt looks like this:
[0959] Please explain the following code changes in natural language.
[0960] ---
[0961] Changes:
[0962] A new function calculateSum has been added, which takes two arguments a and b and returns their sum.
[0963] The server checks the grammar of the output of the generative AI model and adjusts it to make the sentences more natural.
[0964] Step 4: Create an explainer video
[0965] The server uses the generated explanatory text to create an explanatory video. The input is the explanatory text generated in step 3, and the output is an explanatory video file. Specifically, the server converts the explanatory text into audio narration and creates corresponding screen displays. The video is generated in a format that narrates the explanatory content while highlighting the changed code parts.
[0966] Step 5: Publish your video
[0967] The server delivers the generated video file to the user's device. The input is the video file generated in step 4, and the output is the video file delivered to the user's device. The server transfers the video file to the user's device via the Internet.
[0968] Step 6: Collect emotion data
[0969] While the device is playing a video, it collects emotional data such as the user's facial expressions and tone of voice. The input is the user's real-time facial expressions and voice, and the output is the collected emotional data. Specifically, it uses a camera and microphone to collect the user's emotional data.
[0970] Step 7: Analyze the sentiment data
[0971] The emotion engine analyzes the collected emotion data and identifies the user's emotional state. The input is the emotion data collected in step 6, and the output is the analyzed emotion state. The emotion engine performs the analysis using facial recognition and voice analysis technologies.
[0972] Step 8: Adjust the description
[0973] The server adjusts the content of the description and video based on the analysis results of the emotion engine. The input is the user's emotional state obtained in step 7, and the output is the adjusted description and video. Specifically, if the user is confused, the description is made more detailed and the video playback speed is slowed down. Conversely, if the user is excited, the description is made more concise and the video playback speed is increased.
[0974] Step 9: Re-stream the adjusted video
[0975] The server re-broadcasts the adjusted video to the user's device. The input is the video file adjusted in step 8, and the output is the video file re-broadcast to the user's device. The server transfers the video file to the user's device via the Internet.
[0976] (Application example 2)
[0977] Next, a description will be given of Application Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the headset type terminal 314 will be referred to as a "terminal."
[0978] In conventional factory robot maintenance work, engineers have had to spend a great deal of time and effort understanding the changes every time software is updated or modified. Furthermore, work efficiency can decline because it is not possible to provide effective information tailored to the engineer's level of understanding or emotional state. To solve this problem, a system is needed that analyzes code change differences and provides optimal explanations based on the engineer's emotional state.
[0979] The identification process by the identification processing unit 290 of the data processing device 12 in Application Example 2 is realized by the following means. In this invention, the server includes means for acquiring code change differences, means for analyzing the acquired differences and identifying the changes, means for generating a natural language explanatory text based on the analysis results, means for creating an explanatory video using the generated explanatory text, means for delivering the generated video to the user's device, means for analyzing the user's emotions, and means for adjusting the content of the explanatory text and explanatory video based on the analysis results. This allows engineers to quickly and intuitively understand the code changes and perform maintenance work in a manner that is optimal for their emotional state.
[0980] "Code change differences" is information that identifies changes between new and old versions in a software version control system.
[0981] "Analysis" is the process of examining and examining acquired data and information in detail to derive specific meanings and results.
[0982] A "natural language description" is a description written in a language that humans use on a daily basis, and is a document intended to convey technical content in an easy-to-understand manner.
[0983] An "explanatory video" is video content that uses visual and audio techniques to explain specific content.
[0984] The term "user terminal" refers to an information processing device used by a user for operation, and includes, for example, a smartphone or a tablet.
[0985] "Emotion analysis" is a technology that identifies a user's emotional state from their facial expressions, voice, etc.
[0986] "Change classification" is the process of dividing the analyzed changes into specific categories.
[0987] "Adjusting the playback speed" is an operation for changing the playback speed of the explanatory video according to the user's level of understanding and emotions.
[0988] "Speech" is a process of outputting text information as voice.
[0989] "Change highlighting" refers to visually highlighting areas of software code where changes have been made.
[0990] "Robot maintenance work in factories" refers to the work of maintaining and updating the software and hardware of automated equipment in factories.
[0991] The present invention relates to a system for supporting the maintenance of factory robots, which analyzes the difference in changes and provides the user with explanatory text and videos in natural language. The system also incorporates an emotion engine that recognizes the user's emotions.
[0992] System Configuration
[0993] This system consists of a server, a user's terminal, and an emotion engine.
[0994] Server Processing
[0995] The server accesses the version control system to obtain the differences in code changes. For example, it uses the git diff command to obtain the differences between the latest commit or a specified commit in the Git repository, and analyzes the difference data. It then analyzes the obtained difference data and identifies detailed information about the changes. It generates a natural language explanation based on the analysis results, and creates an explanatory video based on this explanation. The generated explanatory video is then distributed to the user's device via the Internet.
[0996] Emotion engine processing
[0997] The emotion engine analyzes the user's emotion data sent from the user's device. This data is collected based on facial expressions, tone of voice, and other factors while the user is playing the video. The emotion engine analyzes this data to identify the user's current emotional state. Based on the identified emotion, the server adjusts the content of the generated explanation text and explanatory video. For example, if the user is confused, the explanation text will be more detailed and the pace of the video will be slower to make it easier to understand. Conversely, if the user is excited, the explanation text will be more concise and the pace of the video will be faster.
[0998] User terminal processing
[0999] The user's device receives the explanatory video delivered from the server and plays it using an appropriate video player. During the video playback, emotional data such as the user's facial expressions and tone of voice is collected and sent to the emotion engine. This allows the system to monitor the user's emotions in real time and adjust the content of the video as needed.
[1000] Techniques used and examples
[1001] The system uses the following technologies:
[1002] Hardware: Servers, user devices (smartphones, tablets, etc.), webcams
[1003] Software: Version control system (Git), natural language generation engine (OpenAI), emotion analysis engine (emotion_recognition library)
[1004] Specific examples
[1005] For example, if the difference the server retrieved from the Git repository was the addition of a new function calculateSum, the server would analyze the difference and identify it as "A new function calculateSum has been added. It takes two arguments, a and b, and returns their sum." It then generates a natural language explanation for this change: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." It then creates an explanatory video based on this explanation. Next, the emotion engine analyzes the user's emotions, and if it determines that the user is confused, for example, it will deliver a more detailed explanation and a slower-paced video.
[1006] Prompt Sentence Examples
[1007] Latest Git commit log:
[1008] diff --git a / src / main.py b / src / main.py
[1009] index abc123..def456 100644
[1010] --- a / src / main.py
[1011] +++ b / src / main.py
[1012] @@ -2,6 +2,7 @@
[1013] import sys
[1014] +def new_function():
[1015] + print("This is a new function")
[1016] def main():
[1017] print("Hello World")
[1018] Please briefly explain this change.
[1019] In this way, by using this invention, factory engineers can intuitively understand the changes in the code and receive information in a format that is optimal for their emotional state, which is expected to lead to efficient and effective maintenance work.
[1020] The flow of the specific processing in the application example 2 will be described with reference to FIG.
[1021] Step 1:
[1022] The server accesses the version control system and retrieves the difference between the code changes. The server uses the git diff command to retrieve the difference data between the latest commit and the specified commit. This difference data includes information about the changed files and lines. The input is a Git repository, and the output is the difference data.
[1023] Step 2:
[1024] The server analyzes the differential data it has acquired and identifies the changes. During the analysis, detailed information such as the names of new functions and changed variables is extracted. The input is the differential data obtained in step 1, and the output is detailed information about the changes.
[1025] Step 3:
[1026] The server generates a natural language description based on the analysis results. Using a generative AI model (such as OpenAI's GPT-3), it converts the identified changes into easy-to-understand text. The input is detailed information about the changes, and the output is a natural language description.
[1027] Step 4:
[1028] An explanatory video is created based on the natural language description generated by the server. To generate the video, a speech synthesis engine and video editing tool are used to convert the description into audio and create a video that highlights the changes. The input is the natural language description, and the output is the explanatory video.
[1029] Step 5:
[1030] The server generates an explanatory video and delivers it to the user's device. The delivery is via the Internet, and the user's device can play the video on an appropriate video player. The input is the explanatory video, and the output is the video delivered to the user's device.
[1031] Step 6:
[1032] Emotion data is collected while the user's device is playing a video. The device's webcam and microphone are used to capture the user's facial expressions and tone of voice, which are then sent to an emotion analysis engine. The input is the user's facial and voice data, and the output is emotion data.
[1033] Step 7:
[1034] The emotion engine analyzes the user's emotion data and identifies their emotional state. For example, it determines whether the user is confused or excited. The input is the emotion data obtained in step 6, and the output is the user's emotional state.
[1035] Step 8:
[1036] The server adjusts the content of the explanatory text and explanatory video based on the analysis results of the emotion engine. If the user is confused, the explanation will be more detailed and the pace of the video will be slower. Conversely, if the user is excited, the explanation will be more concise and the pace of the video will be faster. The input is the user's emotional state, and the output is the adjusted explanation text and video.
[1037] Through these processing steps, factory technicians can perform maintenance work efficiently.
[1038] The specific processing unit 290 transmits the result of the specific processing to the headset type terminal 314. In the headset type terminal 314, the control unit 46A causes the speaker 240 and the display 343 to output the result of the specific processing. The microphone 238 acquires audio indicating a user input regarding the result of the specific processing. The control unit 46A transmits audio data indicating the user input acquired by the microphone 238 to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the audio data.
[1039] The data generation model 58 is a so-called generative AI (Artificial Intelligence). An example of the data generation model 58 is ChatGPT (Internet Search<URL: https: / / openai.com / blog / chatgpt> ), Gemini (Internet search <url: https: gemini.google.com ?hl="ja">) and other generation AIs. The data generation model 58 is obtained by performing deep learning on a neural network. A prompt including an instruction is input to the data generation model 58, and inference data such as voice data indicating voice, text data indicating text, and image data indicating an image is also input. The data generation model 58 performs inference on the input inference data in accordance with the instruction indicated by the prompt, and outputs the inference result in a data format such as voice data and text data. Here, inference refers to, for example, analysis, classification, prediction, and / or summarization.
[1040] In the above embodiment, an example was given in which the specific processing is performed by the data processing device 12, but the technology of the present disclosure is not limited to this, and the specific processing may be performed by the headset type terminal 314.
[1041] [Fourth embodiment]
[1042] FIG. 7 shows an example of the configuration of a data processing system 410 according to the fourth embodiment.
[1043] 7, a data processing system 410 includes a data processing device 12 and a robot 414. An example of the data processing device 12 is a server.
[1044] The data processing device 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" according to the technology of the present disclosure. The computer 22 includes a processor 28, a RAM 30, and a storage 32. The processor 28, the RAM 30, and the storage 32 are connected to a bus 34. The database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).
[1045] The robot 414 includes a computer 36, a microphone 238, a speaker 240, a camera 42, a communication I / F 44, and a control target 443. The computer 36 includes a processor 46, a RAM 48, and a storage 50. The processor 46, the RAM 48, and the storage 50 are connected to a bus 52. The microphone 238, the speaker 240, the camera 42, and the control target 443 are also connected to the bus 52.
[1046] The microphone 238 receives instructions and the like from the user 20 by receiving voice uttered by the user 20. The microphone 238 captures the voice uttered by the user 20, converts the captured voice into audio data, and outputs it to the processor 46. The speaker 240 outputs audio in accordance with instructions from the processor 46.
[1047] Camera 42 is a small digital camera equipped with an optical system including a lens, aperture, and shutter, and an imaging element such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor, and captures images of the surroundings of user 20 (for example, an imaging range defined by an angle of view equivalent to the field of vision of a typical healthy person).
[1048] The communication I / F 44 is connected to a network 54. The communication I / Fs 44 and 26 are responsible for the exchange of various information between the processor 46 and the processor 28 via the network 54. The exchange of various information between the processor 46 and the processor 28 using the communication I / Fs 44 and 26 is carried out in a secure state.
[1049] The control object 443 includes a display device, LEDs in the eyes, and motors for driving the arms, hands, and feet. The posture and gestures of the robot 414 are controlled by controlling the motors of the arms, hands, and feet. Some of the emotions of the robot 414 can be expressed by controlling these motors. In addition, the facial expressions of the robot 414 can also be expressed by controlling the light emission state of the LEDs in the eyes of the robot 414.
[1050] Fig. 8 shows an example of the main functions of the data processing device 12 and the robot 414. As shown in Fig. 8, in the data processing device 12, a specific process is performed by the processor 28. A specific process program 56 is stored in the storage 32.
[1051] The specific processing program 56 is an example of a "program" according to the technology of the present disclosure. The processor 28 reads the specific processing program 56 from the storage 32 and executes the read specific processing program 56 on the RAM 30. The specific processing is realized by the processor 28 operating as a specific processing unit 290 in accordance with the specific processing program 56 executed on the RAM 30.
[1052] The storage 32 stores a data generation model 58 and an emotion identification model 59. The data generation model 58 and the emotion identification model 59 are used by the identification processing unit 290.
[1053] In the robot 414, the processor 46 performs the reception output process. A reception output program 60 is stored in the storage 50. The processor 46 reads the reception output program 60 from the storage 50 and executes the read reception output program 60 on the RAM 48. The reception output process is realized by the processor 46 operating as the control unit 46A in accordance with the reception output program 60 executed on the RAM 48.
[1054] Next, a description will be given of the specific processing performed by the specific processing unit 290 of the data processing device 12. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."
[1055] The present invention relates to a system that analyzes code change differences and provides the user with explanatory text and video in natural language. An embodiment of the present invention will now be described.
[1056] This system consists of a server and a user's device. The server retrieves code change differences from the version control system, generates explanatory text in natural language based on the analysis results, and creates explanatory videos based on those texts. The generated videos are distributed to the user's device via the Internet.
[1057] Server Processing
[1058] The server first accesses the version control system (for example, a Git repository) and obtains the latest commit and the differences between the specified commits. At this time, it obtains information about the changed files and lines using the git diff command or similar.
[1059] The server then analyzes the difference data and identifies the changes. It classifies the changes as adding functions, changing variables, modifying conditional expressions, etc. The analysis results include detailed information about the changes (for example, the names of new functions and changed variables).
[1060] Based on the analysis results, the server generates a natural language description of the changes. This description is generated by embedding the analysis results in a template, and is then checked for grammar and adjusted to ensure it sounds natural.
[1061] Based on the generated description, the server creates an explanatory video, converting the description into audio using a text-to-speech engine, and using screen capture and animation tools to create a video highlighting the changes. The audio and video are then combined to generate the final video file.
[1062] The generated video file is compressed as needed and delivered to the user's device. Video delivery methods include streaming and providing a download link.
[1063] User terminal processing
[1064] The user's device receives the video streamed from the server and plays it using an appropriate video player. This allows the user to intuitively understand the changes to the code. Specifically, when the video is played, the changed code is highlighted and a natural language explanation is read out, allowing the user to see and hear which parts have been changed and how.
[1065] Specific examples
[1066] For example, if the difference retrieved by the server from the Git repository is the addition of a new function calculateSum, the following process takes place: The server analyzes the difference and identifies that "A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." Next, it generates a natural language explanation of this change: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." An explanatory video is then created based on this explanation. The generated video is then distributed to the user's device, allowing the user to understand the changes through the video.
[1067] In this way, the present invention allows the user to quickly and accurately understand the changes to the code.
[1068] The processing flow will be explained below.
[1069] Step 1:
[1070] The server accesses the version control system and retrieves the differences between the latest commit and the specified commit. This is done by using the git diff command to collect information about changed files and lines. For example, run the command "git diff HEAD^ HEAD --unified=0 --output=difference.patch".
[1071] Step 2:
[1072] The server analyzes the difference data it has acquired. Here, it parses the difference data and extracts information about each change (added, deleted, changed lines). For example, it classifies whether it is an added function or a changed variable name.
[1073] Step 3:
[1074] The server generates a natural language description based on the analysis results. The analysis results are embedded in a template to generate the description. A grammar check is performed and the description is adjusted to ensure natural-sounding sentences. For example, it generates a description such as "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum."
[1075] Step 4:
[1076] The server creates an explanatory video based on the generated text. First, it converts the text into audio using a text-to-speech engine. Then, it uses screen capture and animation tools to generate a video that highlights the changes. Finally, it integrates the audio and video.
[1077] Step 5:
[1078] The server compresses the generated video files and converts them into the appropriate format, for example using ffmpeg commands to combine the audio and video to generate the final video file.
[1079] Step 6:
[1080] The server delivers the generated video to the user's device. The video file is uploaded to cloud storage, for example, and the URL is notified to the user. The user then accesses the video via the provided URL and plays it on their device.
[1081] Step 7:
[1082] Users can play the video in a video player, and the code changes are highlighted and natural language explanations are read out, allowing users to see which parts have been changed and how.
[1083] The above is the specific processing flow of the present invention. This procedure allows the user to intuitively understand the changes and efficiently review and correct them.
[1084] Example 1
[1085] Next, a description will be given of Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."
[1086] Conventional systems for explaining code changes have the drawback of taking a long time to understand the changes and making it difficult to accurately understand them. Especially when large code bases or complex changes are involved, understanding the changes requires specialized knowledge and a lot of time. Furthermore, text-only explanations make it difficult to intuitively grasp the overall situation. To solve these problems, a method that can quickly and accurately understand the changes was needed.
[1087] The specific processing by the specific processing unit 290 of the data processing device 12 in the first embodiment is realized by the following means.
[1088] In this invention, the server includes means for acquiring code change differences, means for analyzing the acquired differences and identifying the changes, means for generating explanatory text in natural language based on the analysis results, means for creating explanatory videos using the generated explanatory text, means for delivering the generated videos to the user's device, means for embedding the analysis results in a specific template to check grammar, and means for generating prompt text to input the explanatory text into the generative AI model, thereby enabling the user to intuitively understand the code changes.
[1089] "Means for obtaining code change differences" refers to a function that extracts changes between different versions from a system that manages code change history.
[1090] The "means of analyzing the acquired differences and identifying the changes" is a function that analyzes the changes in the extracted code in detail and identifies which parts have been changed and how.
[1091] The "means for generating a natural language explanation based on the analysis results" is a function that converts the analyzed changes into a natural language sentence that is easy for humans to understand.
[1092] "Means for creating explanatory videos using generated explanatory text" is a function that converts the generated natural language explanatory text into audio and combines it with video to create explanatory videos.
[1093] "Means for delivering the generated video to the user's terminal" is a function for transmitting the created explanatory video to the user's terminal via the Internet.
[1094] "Means for embedding analysis results in a specific template to check grammar" is a function that incorporates analysis results into a pre-prepared sentence template and checks the grammar to ensure natural grammar.
[1095] "Means for generating prompt sentences to input explanatory text into a generative AI model" is a function that creates instruction sentences (prompt sentences) to provide appropriate input to a generative AI model.
[1096] The present invention relates to a system that analyzes code change differences and provides the user with a natural language explanation and explanatory video. The following describes in detail an embodiment of the present invention.
[1097] This system consists of a server and a user's device. The server retrieves code change differences from the version control system, generates explanatory text in natural language based on the analysis results, and creates explanatory videos based on those texts. The generated videos are distributed to the user's device via the Internet.
[1098] Server Processing
[1099] The server first accesses the version control system (for example, a Git repository) and uses commands such as git diff to obtain the differences between the latest commit and a specified commit. It then analyzes the obtained difference data to identify the changes. During the analysis, it classifies the changes as whether they are the addition of a function, a change to a variable, or a modification to a conditional expression. This allows it to obtain detailed information about the changes (for example, the name of a new function or the name of a changed variable).
[1100] The server then generates a natural language explanation based on the analysis results. During this process, the analysis results are embedded in a specific template, grammar checked, and made natural-sounding. When generating explanations using a generative AI model, a prompt generation function is used.
[1101] Specific examples of prompts are as follows:
[1102] Example prompt sentence:
[1103] "Analyze the following code change diff and explain it in natural language.
[1104] Change Diff:
[1105] diff
[1106] + function calculateSum(a, b) {
[1107] + return a + b;
[1108] +}
[1109] Analysis results:
[1110] A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum.
[1111] The server creates an explanatory video based on the generated description. It uses a text-to-speech engine (e.g., a speech synthesis service) to convert the description into audio, and uses screen capture and animation tools to create a video that highlights the changes. It then combines the audio and video to generate the final video file. The generated video file is compressed as needed and distributed to the user's device via the Internet. Possible methods for distributing the video include streaming or providing a download link.
[1112] User terminal processing
[1113] The user's device receives the video streamed from the server and plays it using an appropriate video player. This allows the user to intuitively understand the changes made to the code. Specifically, when the video is played, the changed code is highlighted and an automatically generated explanation is read aloud, allowing the user to see and hear which parts have been changed and how.
[1114] Specific examples
[1115] For example, if the difference retrieved by the server from the Git repository is the addition of a new function calculateSum, the following process takes place: The server analyzes the difference and identifies that "A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." Next, it generates this content as a natural language description: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum.", and creates an explanatory video based on this description.
[1116] As described above, by using the present invention, the user can quickly and accurately understand the changes to the code.
[1117] The flow of the identification process in the first embodiment will be described with reference to FIG.
[1118] Step 1:
[1119] The server accesses the version control system and retrieves the diffs for the specified commits, using the git diff command to retrieve the latest commit or the diffs between specific commits. For example, run the following command:
[1120] git diff <commit id1> <commit id2>
[1121] Input: Version control system commit ID
[1122] Output: Code diff data
[1123] The server will then capture the resulting changed filename and details of the change.
[1124] Step 2:
[1125] The server analyzes the difference data to identify the changes. The analysis parses the difference data and classifies the changes as follows: adding a function, changing a variable, modifying a conditional expression, etc.
[1126] Input: Code diff data
[1127] Output: Analysis results (detailed information on changes)
[1128] The server obtains information such as new function names and changed variable names as a result of the analysis.
[1129] Step 3:
[1130] The server generates a natural language explanation based on the analysis results. In this process, the analysis results are embedded in a template, grammar checked, and made into natural-sounding sentences. The explanation is generated by inputting the following prompt sentence into the generative AI model:
[1131] Example prompt sentence:
[1132] "Analyze the following code change diff and explain it in natural language.
[1133] Change Diff:
[1134] diff
[1135] + function calculateSum(a, b) {
[1136] + return a + b;
[1137] +}
[1138] Analysis results:
[1139] A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum.
[1140] Input: Analysis results
[1141] Output: Natural language description
[1142] The server uses a generative AI model to create detailed and easy-to-understand descriptions.
[1143] Step 4:
[1144] The server creates an explanatory video based on the generated description. It converts the description into audio using a text-to-speech engine (e.g., a speech synthesis service), and creates a video highlighting the changes using a screen capture tool or animation tool (e.g., FFmpeg, After Effects).
[1145] Input: Natural language description
[1146] Output:Explanatory video
[1147] The server combines the audio and video to generate the final video file.
[1148] Step 5:
[1149] The server compresses the generated video file and delivers it to the user's device, allowing them to watch the video by providing a streaming service or a download link.
[1150] Input: Explainer video
[1151] Output: Compressed video file
[1152] The server converts the video into a compressed format (e.g. MP4, WEBM) and distributes the video through a distribution service.
[1153] Step 6:
[1154] The user's device receives the video delivered from the server and plays it using an appropriate video player.
[1155] Input: Compressed video file
[1156] Output: The video being played
[1157] Users can view and intuitively understand the changes by watching the video: for example, by playing the video using a video player (e.g., VLC Media Player, Windows Media Player), and seeing the highlighted and audio-guided explanations of the code changes.
[1158] (Application example 1)
[1159] Next, a description will be given of Application Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."
[1160] While the control programs of machines and robots in factories are frequently updated, it is difficult for on-site operators and engineers to quickly and accurately understand the changes. In particular, a lack of understanding of complex changes and newly added functions increases the likelihood of reduced work efficiency and serious errors. There is a demand for a system that can solve these problems.
[1161] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 1 is realized by the following means.
[1162] In this invention, the server includes means for acquiring code change differences, means for analyzing the acquired differences and identifying the changes, means for generating a natural language explanation based on the analysis results, means for creating an explanatory video using the generated explanation, means for distributing the generated video to a user's terminal, and means for communicating the changes to the control programs of the machines in the factory to operators. This allows the changes to be intuitively understood and enables operators and engineers in the factory to respond quickly.
[1163] "Code change differences" are data that indicate changes to program code between specific commits in a version control system.
[1164] The "means for identifying the changes" is a function that analyzes the change differences in the acquired code and identifies which parts have been changed and how.
[1165] A "natural language description" is text that describes the code changes in human language so that even those without programming knowledge can understand them.
[1166] An "explanatory video" is content created based on natural language explanations, combining audio and video to convey information visually and audibly.
[1167] A "user's terminal" is a device (e.g., a personal computer, tablet, smartphone, etc.) that receives and plays the explanatory video distributed from the server.
[1168] A "control program for machines in a factory" is a software program used to operate production equipment and robots in a factory.
[1169] An "operator" is an employee in charge of operating machines and robots within a factory.
[1170] A "server" is a computer that transmits, receives, stores, and processes data over a network.
[1171] "Analysis results" refers to the data and information obtained by analyzing the code change differences.
[1172] This invention is a system that analyzes code change differences and provides the content to users as natural language explanations and explanatory videos. This system is mainly composed of a server and a user terminal.
[1173] Server Processing
[1174] The server first accesses the version control system (for example, a Git repository) and obtains the differences between the latest commit and a specified commit. At this time, it uses the git diff command to obtain information about the changed files and lines. The obtained difference data is analyzed by the analysis module to identify the specific changes. The changes are classified into functions, variables, conditional expressions, etc., and detailed information is collected for each.
[1175] Based on the analysis results, the server generates a natural language description of the changes. This description is automatically generated by embedding the analysis results in a template, which then undergoes grammar checks and adjustments to make the text more natural.
[1176] The server then creates an explanatory video based on the generated text. Specifically, it uses a text-to-speech engine (e.g., gTTS) to convert the text into audio, and uses a screen capture tool or animation tool (e.g., MoviePy) to create a video highlighting the changes. The audio and video are then combined to generate the final video file, which is then compressed if necessary.
[1177] The generated video file is then distributed to the user's device via the Internet, either via streaming or by providing a download link.
[1178] User terminal processing
[1179] The user's device receives the video streamed from the server and plays it using an appropriate video player. This allows the user to intuitively understand the changes to the code. Specifically, when the video is played, the changed code is highlighted and a natural language explanation is read out, allowing the user to see and hear which parts have been changed and how.
[1180] Specific examples
[1181] For example, if the difference retrieved by the server from the Git repository is the addition of a new function calculateSum, the following process takes place: The server analyzes the difference and identifies that "A new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." Next, it generates a natural language explanation of this change: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." An explanatory video is then created based on this explanation. The generated video is then distributed to the user's device, allowing the user to understand the changes through the video.
[1182] Prompt Sentence Examples
[1183] Prompt: Analyze code change diffs and create a natural language description. Diff information:
[1184] diff --git a / example.py b / example.py
[1185] New file mode 100644
[1186] Index e69de29b..c04204629
[1187] ++ FunctionName calculateSum(a, b) =
[1188] return a + b
[1189] analysis:
[1190] A new function 'calculateSum' has been added, which takes two arguments 'a' and 'b' and returns their sum.
[1191] This allows the user to quickly and intuitively understand the changes.
[1192] The flow of the specific processing in the application example 1 will be described with reference to FIG.
[1193] Step 1:
[1194] The server accesses the version control system and retrieves the latest commit or the differences between the specified commit. Specifically, it executes the git diff command against the Git repository to retrieve information about changed files and lines. The input is the specified commit number, and the output is the change difference data.
[1195] Step 2:
[1196] The server analyzes the acquired differential data and identifies the changes. The analysis module classifies the changes into functions, variable changes, conditional expression modifications, etc. The input is the differential change data, and the output is the analysis results. These analysis results include the names of new functions and changed variables.
[1197] Step 3:
[1198] The server generates a natural language explanation based on the analysis results. It uses a template engine to embed the analysis results into the natural language text. The input is the analysis results, and the output is the natural language explanation.
[1199] Step 4:
[1200] The server uses the generated text to create an explanatory video. It uses gTTS (Google Text-to-Speech) to convert the text to speech. It then uses MoviePy to generate a video that combines the text and audio and highlights the changes. The input is a natural language explanatory text, and the output is an explanatory video file.
[1201] Step 5:
[1202] The server compresses the generated video file and delivers it to the user's device. Video delivery is done via streaming or by providing a download link. The input is the explanatory video file, and the output is the video delivered to the user's device.
[1203] Step 6:
[1204] The user's device receives the video streamed from the server and plays it using an appropriate video player, allowing the user to visually and audibly understand the changes in the code. The input is the streamed video file, and the output is the played video.
[1205] For example, if the diff you retrieve from a Git repository looks like this:
[1206] diff --git a / example.py b / example.py
[1207] New file mode 100644
[1208] Index e69de29b..c04204629
[1209] ++ FunctionName calculateSum(a, b) =
[1210] return a + b
[1211] The server analyzes the differences and identifies that "A new function 'calculateSum' has been added. This function takes two arguments 'a' and 'b' and returns their sum." It then generates a natural language explanation for this change: "In this change, a new function 'calculateSum' has been added. This function takes two arguments 'a' and 'b' and returns their sum." It then creates an explanatory video based on this explanation. The generated video is delivered to the user's device, allowing the user to understand the changes through the video.
[1212] Example prompt sentence:
[1213] Prompt: Analyze code change diffs and create a natural language description. Diff information:
[1214] diff --git a / example.py b / example.py
[1215] New file mode 100644
[1216] Index e69de29b..c04204629
[1217] ++ FunctionName calculateSum(a, b) =
[1218] return a + b
[1219] analysis:
[1220] A new function 'calculateSum' has been added, which takes two arguments 'a' and 'b' and returns their sum.
[1221] Furthermore, an emotion engine that estimates the user's emotion may be further combined. That is, the identification processing unit 290 may estimate the user's emotion using the emotion identification model 59, and perform identification processing using the user's emotion.
[1222] This invention relates to a system that analyzes code change differences and provides the user with explanatory text and videos in natural language, and further combines it with an emotion engine that recognizes the user's emotions. An embodiment of the invention will be described.
[1223] This system consists of a server, a user's device, and an emotion engine. The server retrieves code change differences from a version control system, generates explanatory text in natural language based on the analysis results, and creates explanatory videos based on those texts. The generated videos are distributed to the user's device via the Internet. The emotion engine also recognizes the user's emotions and adjusts the content of the explanatory text and explanatory videos based on the results.
[1224] Server Processing
[1225] The server first accesses the version control system (for example, a Git repository) and obtains the latest commit and the differences between the specified commit. At this time, it obtains information about the changed files and lines using the git diff command or similar. For example, it executes the command "git diff HEAD^ HEAD --unified=0 --output=difference.patch".
[1226] The server then analyzes the difference data and identifies the changes. The analysis results include detailed information about the changes (for example, the names of new functions or changed variables). Based on this information, the server generates a natural language description of the changes. The generated description is automatically created by embedding the analysis results in a template, and is grammatically checked to ensure it sounds natural.
[1227] Emotion engine processing
[1228] The emotion engine analyzes the user's emotion data sent from the user's device. This emotion data is collected, for example, based on the user's facial expressions and tone of voice while playing a video. The emotion engine analyzes this data and identifies the user's current emotion.
[1229] Based on the identified emotion, the server adjusts the generated explanatory text and explanatory video. For example, if the user is confused, the explanation text will be more detailed and the video will be slower to make it easier to understand. Conversely, if the user is excited, the explanation text will be more concise and the video will be faster to keep the pace up. This allows information to be provided in the most appropriate format for the user's emotion.
[1230] User terminal processing
[1231] The user's device receives the video streamed from the server and plays it using an appropriate video player. During video playback, emotional data such as the user's facial expressions and tone of voice is collected and sent to the emotion engine. This allows the system to monitor the user's emotions in real time and adjust the content of the video as needed.
[1232] Specific examples
[1233] For example, if the difference the server retrieved from the Git repository was a new function calculateSum, the following process would occur: The server would analyze the difference and identify the following: "A new function calculateSum has been added. It takes two arguments, a and b, and returns their sum." It would then generate a natural language description of this change: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." It would then create an explanatory video based on this description. The emotion engine would then analyze the user's emotions, and if it determined that the user was confused, for example, it would deliver a more detailed explanation and a slower-paced video.
[1234] In this way, the present invention allows users to intuitively understand code changes and provides a learning experience that is tailored to their emotions.
[1235] The processing flow will be explained below.
[1236] Step 1:
[1237] The server accesses the version control system and retrieves the difference between the latest commit and the specified commit, for example, by running the command git diff HEAD^ HEAD --unified=0 --output=difference.patch to get information about the changed files and lines.
[1238] Step 2:
[1239] The server analyzes the acquired differential data and identifies which parts have been changed and how. For example, it classifies changes such as the addition of a function, the introduction of a new variable, or the modification of a conditional expression, and identifies the specific details.
[1240] Step 3:
[1241] The server generates a natural language explanation based on the analysis results. Specifically, it embeds the analysis results into a pre-prepared template and generates an explanation such as, "In this change, a new function, calculateSum, has been added. This function takes two arguments, a and b, and returns their sum."
[1242] Step 4:
[1243] The server sends the generated natural language explanation to the emotion engine, which then adjusts the explanation based on the user's emotional data. For example, if the user is confused, the explanation will be made more specific and detailed, making it easier to understand.
[1244] Step 5:
[1245] The server then creates an explainer video based on the adjusted text. First, it uses a text-to-speech engine to convert the text into audio, then it uses screen capture and animation tools to generate a video that highlights the changes. Finally, it combines the audio and video to create the final video file.
[1246] Step 6:
[1247] The server compresses the resulting video files and converts them into the appropriate format, for example using ffmpeg commands to combine audio and video and convert them into the format best suited for streaming or download links.
[1248] Step 7:
[1249] The server delivers the generated video to the user's device. The video file is uploaded to cloud storage and the URL is notified to the user. The user can access the video through the provided URL and play it on their device.
[1250] Step 8:
[1251] The user plays the streamed video on a video player. While the video is playing, the user's device collects emotional data, such as facial expressions and tone of voice, and sends it to the server in real time. The server then adjusts the video content accordingly.
[1252] Step 9:
[1253] The emotion engine analyzes the user's emotions in real time, monitors the user's understanding and reactions while the video is playing, and makes suggestions such as repeat playback or adding detailed explanations as needed.
[1254] In this way, the present invention not only provides intuitive understanding of code changes, but also dynamically adjusts animation content to match the user's emotions.
[1255] Example 2
[1256] Next, a description will be given of Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."
[1257] Effectively identifying and understanding code changes is a time-consuming and labor-intensive task, especially in large-scale projects. Furthermore, there is a need to promote more intuitive understanding by adjusting the explanation content according to the user's emotions. To solve this problem, not only is it necessary to automate the analysis and explanation of code differences, but it is also necessary to provide adaptive information that reflects the user's real-time emotional data.
[1258] The identification process by the identification processing unit 290 of the data processing device 12 in the second embodiment is realized by the following means. In this invention, the server includes means for acquiring code change differences, means for analyzing the acquired differences and identifying the changes, means for generating explanatory text in natural language based on the analysis results, means for creating explanatory videos using the generated explanatory text, means for delivering the generated videos to the user's terminal, means for collecting user emotion data, means for analyzing the collected emotion data, and means for adjusting the explanatory text and video based on the analysis results. This makes it easier for the user to intuitively understand the code changes and enables adaptive information provision according to the user's emotions.
[1259] "Code change differences" is information that indicates parts of source code that have been changed from one point in time to another in a version control system.
[1260] A "version control system" is software that manages the change history of source code and tracks changes when multiple developers work together on the same project.
[1261] "Analysis" is the process of analyzing acquired data and extracting meaningful information from it.
[1262] A "natural language description" is a textual description written in a form that is easy for humans to read, and primarily uses natural language to explain the content.
[1263] An "explainer video" is video content created to convey information through visual and audio means.
[1264] "Emotional data" is data collected based on non-verbal cues such as a user's facial expression and tone of voice, and indicates the user's emotional state.
[1265] "Emotion engine" is a general term for software and hardware that analyzes emotion data and identifies the user's emotional state.
[1266] A "template" is a document template with a predefined format and structure, in which specific data is embedded to generate consistent output.
[1267] A "generative AI model" is a machine learning model that uses artificial intelligence to automatically generate text and content.
[1268] A "prompt" is text input to a generative AI model that is an instruction to obtain a specific output.
[1269] MODE FOR CARRYING OUT THE INVENTION
[1270] This invention relates to a system that analyzes code change differences and provides the user with explanatory text and videos in natural language, and also combines it with an emotion engine that recognizes the user's emotions. Specific embodiments for carrying out the invention are described below.
[1271] Server Processing
[1272] The server first accesses the version control system (e.g., Git repository) and retrieves the latest commit or the diff of the specified commit. The server then executes the git diff command to retrieve information about the changed files and lines. For example, use the command "git diff HEAD^ HEAD --unified=0 --output=difference.patch".
[1273] Next, the server analyzes the acquired differential data and identifies the changes. Specifically, it identifies detailed information such as the addition of new functions or changes to variable names. The results of this analysis are embedded in a template to generate a natural language explanation. The explanation is generated by inputting the following prompt to the generative AI model:
[1274] Please explain the following code changes in natural language.
[1275] ---
[1276] Changes:
[1277] We've added a new function calculateSum that takes two arguments a and b and returns their sum.
[1278] An explanatory video is created based on the generated explanatory text. The video is created by reading the explanatory text as a narration and displaying the code where changes were made. The completed video file is then distributed to the user's device via the Internet.
[1279] Emotion engine processing
[1280] The emotion engine collects and analyzes the user's emotion data sent from the user's device. This emotion data is mainly collected from the user's facial expressions and tone of voice while playing the video. The emotion engine analyzes the collected emotion data to identify the user's emotional state. For example, it determines whether the user is confused or excited.
[1281] The emotion engine sends feedback to the server based on the analysis results. The server receives this feedback and adjusts the content of the explanatory text and explanatory video. If the user is confused, the explanation will be more detailed and the video will play slower. Conversely, if the user is excited, the explanation will be more concise and the video will play faster.
[1282] User terminal processing
[1283] The user's device receives the video streamed from the server and plays it using an appropriate video player. During video playback, emotional data such as the user's facial expressions and tone of voice is collected and sent to the emotion engine. This allows the system to monitor the user's emotions in real time and adjust the content of the video as needed.
[1284] Specific examples
[1285] For example, if the difference the server retrieved from the Git repository was the addition of a new function calculateSum, the server would run the git diff command to determine the following information: "A new function calculateSum has been added. It takes two arguments, a and b, and returns their sum."
[1286] Based on this information, the server generates a prompt and feeds it into the generative AI model:
[1287] Please explain the following code changes in natural language.
[1288] ---
[1289] Changes:
[1290] We've added a new function calculateSum that takes two arguments a and b and returns their sum.
[1291] From the generated natural language description, an explanatory video is created that explains, "In this change, a new function, calculateSum, is added. This function takes two arguments, a and b, and returns their sum." and is delivered to the user's device. If the emotion engine determines that the user is confused during video playback, the server delivers a more detailed explanation and a slower version of the video. This allows the user to intuitively understand the code changes and enjoy a learning experience that suits their emotions.
[1292] The flow of the identification process in the second embodiment will be described with reference to FIG.
[1293] Step 1: Get the code change diff
[1294] The server accesses the version control system and retrieves the latest commit and the diff for the specified commit. Specifically, it executes the command git diff HEAD^ HEAD --unified=0 --output=difference.patch. The input is the ID of the specified commit, and the output is a patch file containing the diff information. The server parses this patch file in the next step.
[1295] Step 2: Analyze differential data
[1296] The server analyzes the differential data it has obtained and identifies the changes. The input is the patch file obtained in step 1, and the output is the details of the analyzed changes. Specifically, the server parses the patch file and extracts the addition of new functions, changes to variable names, etc. It then generates a dataset to embed this information into the template.
[1297] Step 3: Generate natural language descriptions
[1298] The server inputs a prompt into the generative AI model based on the analysis results, and generates a natural language explanation. The input is the detailed data of the changes obtained in step 2, and the output is the generated explanation. The prompt looks like this:
[1299] Please explain the following code changes in natural language.
[1300] ---
[1301] Changes:
[1302] A new function calculateSum has been added, which takes two arguments a and b and returns their sum.
[1303] The server checks the grammar of the output of the generative AI model and adjusts it to make the sentences more natural.
[1304] Step 4: Create an explainer video
[1305] The server uses the generated explanatory text to create an explanatory video. The input is the explanatory text generated in step 3, and the output is an explanatory video file. Specifically, the server converts the explanatory text into audio narration and creates corresponding screen displays. The video is generated in a format that narrates the explanatory content while highlighting the changed code parts.
[1306] Step 5: Publish your video
[1307] The server delivers the generated video file to the user's device. The input is the video file generated in step 4, and the output is the video file delivered to the user's device. The server transfers the video file to the user's device via the Internet.
[1308] Step 6: Collect emotion data
[1309] While the device is playing a video, it collects emotional data such as the user's facial expressions and tone of voice. The input is the user's real-time facial expressions and voice, and the output is the collected emotional data. Specifically, it uses a camera and microphone to collect the user's emotional data.
[1310] Step 7: Analyze the sentiment data
[1311] The emotion engine analyzes the collected emotion data and identifies the user's emotional state. The input is the emotion data collected in step 6, and the output is the analyzed emotion state. The emotion engine performs the analysis using facial recognition and voice analysis technologies.
[1312] Step 8: Adjust the description
[1313] The server adjusts the content of the description and video based on the analysis results of the emotion engine. The input is the user's emotional state obtained in step 7, and the output is the adjusted description and video. Specifically, if the user is confused, the description is made more detailed and the video playback speed is slowed down. Conversely, if the user is excited, the description is made more concise and the video playback speed is increased.
[1314] Step 9: Re-stream the adjusted video
[1315] The server re-broadcasts the adjusted video to the user's device. The input is the video file adjusted in step 8, and the output is the video file re-broadcast to the user's device. The server transfers the video file to the user's device via the Internet.
[1316] (Application example 2)
[1317] Next, a description will be given of Application Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."
[1318] In conventional factory robot maintenance work, engineers have had to spend a great deal of time and effort understanding the changes every time software is updated or modified. Furthermore, work efficiency can decline because it is not possible to provide effective information tailored to the engineer's level of understanding or emotional state. To solve this problem, a system is needed that analyzes code change differences and provides optimal explanations based on the engineer's emotional state.
[1319] The identification process by the identification processing unit 290 of the data processing device 12 in Application Example 2 is realized by the following means. In this invention, the server includes means for acquiring code change differences, means for analyzing the acquired differences and identifying the changes, means for generating a natural language explanatory text based on the analysis results, means for creating an explanatory video using the generated explanatory text, means for delivering the generated video to the user's device, means for analyzing the user's emotions, and means for adjusting the content of the explanatory text and explanatory video based on the analysis results. This allows engineers to quickly and intuitively understand the code changes and perform maintenance work in a manner that is optimal for their emotional state.
[1320] "Code change differences" is information that identifies changes between new and old versions in a software version control system.
[1321] "Analysis" is the process of examining and examining acquired data and information in detail to derive specific meanings and results.
[1322] A "natural language description" is a description written in a language that humans use on a daily basis, and is a document intended to convey technical content in an easy-to-understand manner.
[1323] An "explanatory video" is video content that uses visual and audio techniques to explain specific content.
[1324] The term "user terminal" refers to an information processing device used by a user for operation, and includes, for example, a smartphone or a tablet.
[1325] "Emotion analysis" is a technology that identifies a user's emotional state from their facial expressions, voice, etc.
[1326] "Change classification" is the process of dividing the analyzed changes into specific categories.
[1327] "Adjusting the playback speed" is an operation for changing the playback speed of the explanatory video according to the user's level of understanding and emotions.
[1328] "Speech" is a process of outputting text information as voice.
[1329] "Change highlighting" refers to visually highlighting areas of software code where changes have been made.
[1330] "Robot maintenance work in factories" refers to the work of maintaining and updating the software and hardware of automated equipment in factories.
[1331] The present invention relates to a system for supporting the maintenance of factory robots, which analyzes the difference in changes and provides the user with explanatory text and videos in natural language. The system also incorporates an emotion engine that recognizes the user's emotions.
[1332] System Configuration
[1333] This system consists of a server, a user's terminal, and an emotion engine.
[1334] Server Processing
[1335] The server accesses the version control system to obtain the differences in code changes. For example, it uses the git diff command to obtain the differences between the latest commit or a specified commit in the Git repository, and analyzes the difference data. It then analyzes the obtained difference data and identifies detailed information about the changes. It generates a natural language explanation based on the analysis results, and creates an explanatory video based on this explanation. The generated explanatory video is then distributed to the user's device via the Internet.
[1336] Emotion engine processing
[1337] The emotion engine analyzes the user's emotion data sent from the user's device. This data is collected based on facial expressions, tone of voice, and other factors while the user is playing the video. The emotion engine analyzes this data to identify the user's current emotional state. Based on the identified emotion, the server adjusts the content of the generated explanation text and explanatory video. For example, if the user is confused, the explanation text will be more detailed and the pace of the video will be slower to make it easier to understand. Conversely, if the user is excited, the explanation text will be more concise and the pace of the video will be faster.
[1338] User terminal processing
[1339] The user's device receives the explanatory video delivered from the server and plays it using an appropriate video player. During the video playback, emotional data such as the user's facial expressions and tone of voice is collected and sent to the emotion engine. This allows the system to monitor the user's emotions in real time and adjust the content of the video as needed.
[1340] Techniques used and examples
[1341] The system uses the following technologies:
[1342] Hardware: Servers, user devices (smartphones, tablets, etc.), webcams
[1343] Software: Version control system (Git), natural language generation engine (OpenAI), emotion analysis engine (emotion_recognition library)
[1344] Specific examples
[1345] For example, if the difference the server retrieved from the Git repository was the addition of a new function calculateSum, the server would analyze the difference and identify it as "A new function calculateSum has been added. It takes two arguments, a and b, and returns their sum." It then generates a natural language explanation for this change: "In this change, a new function calculateSum has been added. This function takes two arguments, a and b, and returns their sum." It then creates an explanatory video based on this explanation. Next, the emotion engine analyzes the user's emotions, and if it determines that the user is confused, for example, it will deliver a more detailed explanation and a slower-paced video.
[1346] Prompt Sentence Examples
[1347] Latest Git commit log:
[1348] diff --git a / src / main.py b / src / main.py
[1349] index abc123..def456 100644
[1350] --- a / src / main.py
[1351] +++ b / src / main.py
[1352] @@ -2,6 +2,7 @@
[1353] import sys
[1354] +def new_function():
[1355] + print("This is a new function")
[1356] def main():
[1357] print("Hello World")
[1358] Please briefly explain this change.
[1359] In this way, by using this invention, factory engineers can intuitively understand the changes in the code and receive information in a format that is optimal for their emotional state, which is expected to lead to efficient and effective maintenance work.
[1360] The flow of the specific processing in the application example 2 will be described with reference to FIG.
[1361] Step 1:
[1362] The server accesses the version control system and retrieves the difference between the code changes. The server uses the git diff command to retrieve the difference data between the latest commit and the specified commit. This difference data includes information about the changed files and lines. The input is a Git repository, and the output is the difference data.
[1363] Step 2:
[1364] The server analyzes the differential data it has acquired and identifies the changes. During the analysis, detailed information such as the names of new functions and changed variables is extracted. The input is the differential data obtained in step 1, and the output is detailed information about the changes.
[1365] Step 3:
[1366] The server generates a natural language description based on the analysis results. Using a generative AI model (such as OpenAI's GPT-3), it converts the identified changes into easy-to-understand text. The input is detailed information about the changes, and the output is a natural language description.
[1367] Step 4:
[1368] An explanatory video is created based on the natural language description generated by the server. To generate the video, a speech synthesis engine and video editing tool are used to convert the description into audio and create a video that highlights the changes. The input is the natural language description, and the output is the explanatory video.
[1369] Step 5:
[1370] The server generates an explanatory video and delivers it to the user's device. The delivery is via the Internet, and the user's device can play the video on an appropriate video player. The input is the explanatory video, and the output is the video delivered to the user's device.
[1371] Step 6:
[1372] Emotion data is collected while the user's device is playing a video. The device's webcam and microphone are used to capture the user's facial expressions and tone of voice, which are then sent to an emotion analysis engine. The input is the user's facial and voice data, and the output is emotion data.
[1373] Step 7:
[1374] The emotion engine analyzes the user's emotion data and identifies their emotional state. For example, it determines whether the user is confused or excited. The input is the emotion data obtained in step 6, and the output is the user's emotional state.
[1375] Step 8:
[1376] The server adjusts the content of the explanatory text and explanatory video based on the analysis results of the emotion engine. If the user is confused, the explanation will be more detailed and the pace of the video will be slower. Conversely, if the user is excited, the explanation will be more concise and the pace of the video will be faster. The input is the user's emotional state, and the output is the adjusted explanation text and video.
[1377] Through these processing steps, factory technicians can perform maintenance work efficiently.
[1378] The specific processing unit 290 transmits the result of the specific processing to the robot 414. In the robot 414, the control unit 46A causes the speaker 240 and the control target 443 to output the result of the specific processing. The microphone 238 acquires voice indicating a user input regarding the result of the specific processing. The control unit 46A transmits voice data indicating the user input acquired by the microphone 238 to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the voice data.
[1379] The data generation model 58 is a so-called generative AI (Artificial Intelligence). An example of the data generation model 58 is ChatGPT (Internet Search<URL: https: / / openai.com / blog / chatgpt> ), Gemini (Internet search <url: https: gemini.google.com ?hl="ja">) and other generation AIs. The data generation model 58 is obtained by performing deep learning on a neural network. A prompt including an instruction is input to the data generation model 58, and inference data such as voice data indicating voice, text data indicating text, and image data indicating an image is also input. The data generation model 58 performs inference on the input inference data in accordance with the instruction indicated by the prompt, and outputs the inference result in a data format such as voice data and text data. Here, inference refers to, for example, analysis, classification, prediction, and / or summarization.
[1380] In the above embodiment, an example in which the specific processing is performed by the data processing device 12 has been given, but the technology of the present disclosure is not limited to this, and the specific processing may be performed by the robot 414.
[1381] The emotion identification model 59 as an emotion engine may determine the user's emotion according to a specific mapping. Specifically, the emotion identification model 59 may determine the user's emotion according to an emotion map (see FIG. 9), which is a specific mapping. Similarly, the emotion identification model 59 may determine the robot's emotion, and the identification processing unit 290 may perform identification processing using the robot's emotion.
[1382] FIG. 9 illustrates an emotion map 400 on which multiple emotions are mapped. In the emotion map 400, emotions are arranged in concentric circles radiating from the center. Emotions closer to the center of the concentric circles are more primitive. Emotions representing states and behaviors arising from a state of mind are arranged on the outer edges of the concentric circles. The concept of emotion includes both affect and mental states. Emotions generally generated from reactions occurring in the brain are arranged on the left side of the concentric circles. Emotions generally induced by situational judgment are arranged on the right side of the concentric circles. Emotions generally generated from reactions occurring in the brain and induced by situational judgment are arranged on the upper and lower sides of the concentric circles. Furthermore, the emotion of "pleasure" is arranged on the upper side of the concentric circles, and the emotion of "discomfort" is arranged on the lower side. In this way, in the emotion map 400, multiple emotions are mapped based on the structure by which emotions are generated, and emotions that tend to occur simultaneously are mapped close to each other.
[1383] These emotions are distributed in the 3 o'clock direction on emotion map 400, and typically fluctuate between relief and anxiety. In the right half of emotion map 400, situational awareness dominates over internal sensations, resulting in a sense of calm.
[1384] The inside of emotion map 400 represents what is going on in the mind, and the outside of emotion map 400 represents behavior, so the further you go outside emotion map 400, the more visible the emotions become (the more they are expressed in behavior).
[1385] Human emotions are based on various balances, such as posture and blood sugar levels. When these balances deviate from the ideal, a state of discomfort is indicated, and when they approach the ideal, a state of pleasure is indicated. Emotions can also be created for robots, automobiles, and motorcycles, based on various balances, such as posture and remaining battery life. When these balances deviate from the ideal, a state of discomfort is indicated, and when they approach the ideal, a state of pleasure is indicated. An emotion map can be generated, for example, based on Dr. Mitsuyoshi's emotion map (Research on Voice Emotion Recognition and Emotional Brain Physiological Signal Analysis Systems, Tokushima University, Doctoral Dissertation: https: / / ci.nii.ac.jp / naid / 500000375379). The left half of the emotion map lists emotions belonging to the "reaction" domain, where sensation is dominant. The right half of the emotion map lists emotions belonging to the "situation" domain, where situational awareness is dominant.
[1386] The emotion map defines two emotions that promote learning. One is a negative emotion on the situation side, around the middle of "repentance" or "reflection." In other words, this occurs when the robot experiences negative emotions such as "I never want to feel this way again" or "I don't want to be scolded again." The other is a positive emotion on the response side, around "desire." In other words, this occurs when the robot experiences positive feelings such as "I want more" or "I want to know more."
[1387] The emotion identification model 59 inputs user input into a pre-trained neural network, obtains emotion values indicating each emotion shown in the emotion map 400, and determines the user's emotion. This neural network is pre-trained based on multiple pieces of training data that are combinations of user input and emotion values indicating each emotion shown in the emotion map 400. Furthermore, this neural network is trained so that emotions that are located close to each other have similar values, as in the emotion map 900 shown in FIG. 10. FIG. 10 shows an example in which multiple emotions, "relieved," "calm," and "reassuring," have similar emotion values.
[1388] The system according to the present disclosure has been described above mainly with respect to the functions of the data processing device 12, but the system according to the present disclosure is not necessarily implemented on a server. The system according to the present disclosure may be implemented as a general information processing system. The present disclosure may be implemented, for example, as a software program running on a personal computer or an application running on a smartphone, etc. The method according to the present disclosure may be provided to users in the form of SaaS (Software as a Service).
[1389] In the above embodiment, an example was given in which the specific processing is performed by one computer 22, but the technology of the present disclosure is not limited to this, and the specific processing may be distributed and performed by a plurality of computers including the computer 22. For example, the data generation model 58 may be provided in an external device of the data processing device 12, and data may be generated in the external device in accordance with input data.
[1390] In the above embodiment, an example in which the specific processing program 56 is stored in the storage 32 has been described, but the technology of the present disclosure is not limited to this. For example, the specific processing program 56 may be stored in a portable, computer-readable, non-transitory storage medium such as a USB (Universal Serial Bus) memory. The specific processing program 56 stored in the non-transitory storage medium is installed in the computer 22 of the data processing device 12. The processor 28 executes the specific processing in accordance with the specific processing program 56.
[1391] Alternatively, the specific processing program 56 may be stored in a storage device such as a server connected to the data processing device 12 via the network 54, and the specific processing program 56 may be downloaded and installed on the computer 22 in response to a request from the data processing device 12.
[1392] It is not necessary to store all of the specific processing program 56 in a storage device such as a server connected to the data processing device 12 via the network 54, or to store all of the specific processing program 56 in the storage 32; only a portion of the specific processing program 56 may be stored.
[1393] The hardware resource for executing a specific process can be any of the following processors: An example of a processor is a CPU, which is a general-purpose processor that functions as a hardware resource for executing a specific process by executing software, i.e., a program. Another example of a processor is a dedicated electrical circuit, such as an FPGA (Field-Programmable Gate Array), a PLD (Programmable Logic Device), or an ASIC (Application Specific Integrated Circuit), which is a processor with a circuit configuration designed specifically for executing a specific process. Each processor has built-in or connected memory, and each processor uses the memory to execute the specific process.
[1394] The hardware resource that executes the specific processing may be configured with one of these various processors, or may be configured with a combination of two or more processors of the same or different types (for example, a combination of multiple FPGAs, or a combination of a CPU and an FPGA). Also, the hardware resource that executes the specific processing may be a single processor.
[1395] As an example of a system configured with a single processor, first, one processor is configured by combining one or more CPUs and software, and this processor functions as a hardware resource that executes a specific process. Second, there is a system that uses a processor that realizes the functions of an entire system including multiple hardware resources that execute a specific process on a single IC chip, as typified by SoC (System-on-a-chip). In this way, a specific process is realized using one or more of the above-mentioned various processors as hardware resources.
[1396] Furthermore, the hardware structure of these various processors can be, more specifically, an electric circuit that combines circuit elements such as semiconductor devices. The specific processing described above is merely an example. Therefore, it goes without saying that unnecessary steps may be deleted, new steps may be added, or the processing order may be rearranged, without departing from the spirit of the invention.
[1397] The above-described description and illustrations are a detailed explanation of the parts related to the technology of the present disclosure and are merely an example of the technology of the present disclosure. For example, the above description of the configuration, functions, actions, and effects is an explanation of an example of the configuration, functions, actions, and effects of the parts related to the technology of the present disclosure. Therefore, it goes without saying that unnecessary parts may be deleted, new elements may be added, or replacements may be made to the above-described description and illustrations within the scope of the gist of the technology of the present disclosure. Furthermore, to avoid confusion and facilitate understanding of the parts related to the technology of the present disclosure, the above-described description and illustrations omit explanations of common technical knowledge that do not require particular explanation to enable the implementation of the technology of the present disclosure.
[1398] All publications, patent applications, and technical standards mentioned in this specification are herein incorporated by reference to the same extent as if each individual publication, patent application, or technical standard was specifically and individually indicated to be incorporated by reference.
[1399] The following is further disclosed regarding the above embodiment.
[1400] (Claim 1)
[1401] A way to get code change diffs,
[1402] A means for analyzing the acquired differences and identifying the changes;
[1403] A means for generating a natural language description based on the analysis results;
[1404] A means for creating an explanatory video using the generated explanatory text;
[1405] A means for delivering the generated video to a user's device;
[1406] A system including:
[1407] (Claim 2)
[1408] a means of categorizing the changes;
[1409] A means for adjusting the description based on the classification results;
[1410] The system of claim 1 further comprising:
[1411] (Claim 3)
[1412] a means for converting the description into audio;
[1413] means for generating a video highlighting the changes;
[1414] a means of integrating audio and video;
[1415] The system of claim 1 further comprising:
[1416] "Example 1"
[1417] (Claim 1)
[1418] A way to get code change diffs,
[1419] A means for analyzing the acquired differences and identifying the changes;
[1420] A means for generating a natural language description based on the analysis results;
[1421] A means for creating an explanatory video using the generated explanatory text;
[1422] A means for delivering the generated video to a user's device;
[1423] A means to embed the parsing results into a specific template and check the grammar,
[1424] A means for generating a prompt sentence to be input to the description generation AI model;
[1425] A system including:
[1426] (Claim 2)
[1427] a means of categorizing the changes;
[1428] A means for adjusting the description based on the classification results;
[1429] The system of claim 1 further comprising:
[1430] (Claim 3)
[1431] a means for converting the description into audio;
[1432] means for generating a video highlighting the changes;
[1433] a means of integrating audio and video;
[1434] The system of claim 1 further comprising:
[1435] "Application Example 1"
[1436] (Claim 1)
[1437] A way to get code change diffs,
[1438] A means for analyzing the acquired differences and identifying the changes;
[1439] A means for generating a natural language description based on the analysis results;
[1440] A means for creating an explanatory video using the generated explanatory text;
[1441] A means for delivering the generated video to a user's device;
[1442] means for communicating changes to the control programs of machines in a factory to operators;
[1443] A system including:
[1444] (Claim 2)
[1445] a means of categorizing the changes;
[1446] A means for adjusting the description based on the classification results;
[1447] 10. The system of claim 1.
[1448] (Claim 3)
[1449] a means for converting the description into audio;
[1450] means for generating a video highlighting the changes;
[1451] a means of integrating audio and video;
[1452] 10. The system of claim 1.
[1453] "Example 2: Combining Emotion Engines"
[1454] (Claim 1)
[1455] A way to get code change diffs,
[1456] A means for analyzing the acquired differences and identifying the changes;
[1457] A means for generating a natural language description based on the analysis results;
[1458] A means for creating an explanatory video using the generated explanatory text;
[1459] A means for delivering the generated video to a user's device;
[1460] means for collecting user emotion data;
[1461] a means for analyzing the collected emotion data;
[1462] a means for adjusting the description and video based on the analysis results;
[1463] A system including:
[1464] (Claim 2)
[1465] a means of categorizing the changes;
[1466] A means for adjusting the description based on the classification results;
[1467] The system of claim 1 further comprising:
[1468] (Claim 3)
[1469] a means for converting the description into audio;
[1470] means for generating a video highlighting the changes;
[1471] a means of integrating audio and video;
[1472] The system of claim 1 further comprising:
[1473] "Application example 2 when combining emotion engines"
[1474] (Claim 1)
[1475] A way to get code change diffs,
[1476] A means for analyzing the acquired differences and identifying the changes;
[1477] A means for generating a natural language description based on the analysis results;
[1478] A means for creating an explanatory video using the generated explanatory text;
[1479] A means for delivering the generated video to a user's device;
[1480] means for analyzing user emotions;
[1481] A means for adjusting the content of the description and the explanatory video based on the analysis results;
[1482] A system including:
[1483] (Claim 2)
[1484] a means of categorizing the changes;
[1485] A means for adjusting the description based on the classification results;
[1486] A way to adjust the playback speed of the explainer video,
[1487] The system of claim 1 further comprising:
[1488] (Claim 3)
[1489] a means for converting the description into audio;
[1490] means for generating a video highlighting the changes;
[1491] a means of integrating audio and video;
[1492] A means for supporting robot maintenance work within the factory;
[1493] The system of claim 1 further comprising: [Explanation of symbols]
[1494] 10, 210, 310, 410 Data Processing Systems 12 Data Processing Device 14 Smart Devices 214 Smart Glasses 314 Headset-type terminal 414 Robot< / url:> < / url:> < / url:> < / url:>
Claims
1. A way to get code change diffs, A means for analyzing the acquired differences and identifying the changes; A means for generating a natural language description based on the analysis results; A means for creating an explanatory video using the generated explanatory text; A means for delivering the generated video to a user's device; A system including:
2. a means of categorizing the changes; A means for adjusting the description based on the classification results; The system of claim 1 further comprising:
3. a means for converting the description into audio; means for generating a video highlighting the changes; a means of integrating audio and video; The system of claim 1 further comprising:
Citation Information
Patent Citations
Persona chatbot control method and system
JP2022180282A