Autocomplete device, autocomplete method, and program
The autocomplete device uses machine learning to suggest low-level language code based on high-level language input, enhancing code conversion efficiency and quality by learning from programmer feedback.
Patent Information
- Application Number
- JP2023527154
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-06-07
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2041-06-07
AI Technical Summary
Converting high-level language code to low-level language code is time-consuming and prone to syntax errors, with existing AI tools providing limited productivity improvements.
An autocomplete device that uses machine learning to infer a programmer's intent and suggest low-level language code, learning from the programmer's feedback on suggestions to improve accuracy and efficiency.
Enhances the productivity of code conversion by learning the programmer's coding style and providing tailored suggestions, thereby improving the speed and quality of code creation.
Smart Images

Figure 0007732504000001 
Figure 0007732504000002 
Figure 0007732504000003
Abstract
Description
[Technical Field]
[0001] The present invention relates to an auto-complete technology that automatically completes character strings to be entered in software development. [Background technology]
[0002] Software development, especially coding in low-level languages that are similar to machine language, is extremely difficult and requires a great deal of effort and mastery of the language.
[0003] Therefore, a software development technique called mix-and-match is used, in which code is written in a high-level language and then converted into code in a low-level language, which may also be called production code.
[0004] In the mix-and-match approach, the entire code can be executed, which has parts of high-level language code and parts of low-level language code. Therefore, the entire code can be executed, and development can be done efficiently. [Prior art documents] [Non-patent literature]
[0005] [Non-Patent Document 1] "Codota picks up $12M for an AI platform that auto-completes developers'code" https: / / techcrunch.com / 2020 / 04 / 27 / codota-picks-up-12m-for-an-ai-platform-that-auto-completes-developers-code / Summary of the Invention [Problem to be solved by the invention]
[0006] As mentioned above, the mix-and-match approach involves developing high-level language code and then converting it into low-level language code. However, achieving proper code conversion requires a considerable amount of time and may contain many code syntax bugs. For example, if array elements in Matlab start at index 1, they must start at index 0 when converted to .NET / C, and this conversion may contain errors.
[0007] In some cases, code in a high-level language already exists and only the syntax conversion to a low-level language is outsourced. However, even if an AI tool that is compatible with the syntax is used to auto-complete strings in the code being created, productivity improvement is said to be limited to around 25% (Non-Patent Document 1).
[0008] The present invention has been made in view of the above points, and an object of the present invention is to provide a technique for improving the productivity of the work of converting code in a high-level language into code in a low-level language. [Means for solving the problem]
[0009] According to the disclosed technology, a display unit that displays the high-level language code to be converted; The programmer The aforementioned an auto-complete unit that, when converting a high-level language code into a low-level language code, outputs a suggestion of a low-level language code corresponding to the high-level language code; a learning unit that causes the autocomplete unit to learn based on whether the programmer has adopted the suggestion. An autocomplete device, comprising: The auto-complete unit identifies, based on the beginning of a line of the low-level language code entered by the programmer, which line of the high-level language code to be converted corresponds to, and displays, on the display unit, the line of the low-level language code that corresponds to the identified line as the suggestion. An autocomplete device is provided. [Effects of the Invention]
[0010] According to the disclosed technology, it is possible to improve the productivity of the work of converting high-level language code into low-level language code. [Brief explanation of the drawings]
[0011] [Figure 1] 1 is a configuration diagram of an autocomplete device according to an embodiment of the present invention; [Figure 2] FIG. 10 is a diagram illustrating a processing procedure executed by an autocomplete device. [Figure 3] Here is an example of what will be displayed when autocomplete is performed: [Figure 4] FIG. 2 illustrates an example of the hardware configuration of an autocomplete device. DETAILED DESCRIPTION OF THE INVENTION
[0012] Hereinafter, an embodiment of the present invention (the present embodiment) will be described with reference to the drawings. The embodiment described below is merely an example, and the embodiment to which the present invention is applied is not limited to the following embodiment. Furthermore, in the following description, unless otherwise specified, "code" and "program" are used synonymously. In other words, "code" that appears in the following description may be replaced with "program."
[0013] (Outline of the embodiment) In this embodiment, in code development using the mix-and-match method, an autocomplete device (described later) infers the programmer's "intention" when converting high-level language code into low-level language code, and suggests low-level language code that corresponds to the high-level language code. This inference process can improve the speed and quality of code creation.
[0014] More specifically, the autocomplete device learns the specifications of a high-level language by using the syntax of the high-level language code and also learns the low-level language coding by a programmer. When a programmer performs a new conversion task, the autocomplete device generates and displays suggestions for code in the low-level language based on the high-level language code. The programmer decides whether or not to use the suggestions, and the decision is fed back into the learning process. The unit of the suggestions is not limited to a specific one, and may be a suggestion for a part of a string on a line or a suggestion for converting an entire code snippet.
[0015] (Device configuration example) 1 shows an example of the configuration of an autocomplete device 100 according to this embodiment. As shown in FIG. 1, the autocomplete device 100 includes an autocomplete unit 110, a display unit 120, an input unit 130, a learning unit 140, and a storage unit 150.
[0016] The autocomplete unit 110 uses a machine learning technique to propose low-level language codes corresponding to the high-level language codes to be converted. The machine learning technique is not limited to a specific method, and for example, a neural network such as a DNN may be used. Furthermore, an entity that is learned by the machine learning technique and outputs the proposed low-level language codes may be called a "model." In other words, the autocomplete unit 110 may be called a model.
[0017] The display unit 120 displays a screen that serves as an interface with the user. The screen includes suggestions from the autocomplete unit 110. The input 130 accepts input from the user. The input is, for example, an input indicating whether or not to adopt the suggestions from the autocomplete unit 110.
[0018] The learning unit 140 causes the autocomplete unit 110 to perform learning. For example, when the autocomplete unit 110 has a neural network model, the learning unit 140 performs learning of the model (adjustment of parameters, etc.) using a method such as backpropagation.
[0019] The memory unit 150 stores, for example, parameters of the auto-complete unit 110 (model), codes of a high-level language to be converted, acceptance / rejection results of proposals input from the input unit 130, and the like.
[0020] The auto-complete device 100 may be physically composed of one device (computer), or may be composed of a plurality of network-connected devices. For example, the auto-complete device 100 may be composed of a terminal having an input unit 130 and a display unit 120, and a server having an auto-complete unit 110, a learning unit 140, and a memory unit 150. The server may be a virtual machine on the cloud.
[0021] (Operation example of the auto-complete device 100) Next, an operation example of the auto-complete device 100 will be described according to the procedure of the flowchart shown in FIG. 2.
[0022] <S101: Learning> In S101, as a preliminary preparation, the learning unit 140 causes the auto-complete unit 110 to learn high-level language codes and low-level language codes. For example, the specifications of the high-level language syntax and the low-level language syntax are input from the input unit 130, and the learning unit determines the syntax of the high-level language and the low-level language. Learning is performed so that the auto-complete unit 110 understands the syntax.
[0023] The learning method is not limited to a specific method. For example, a high-level language code and a corresponding low-level language code may be input, and the auto-complete unit 110 may be learned to output a correct low-level language code for the input high-level language code.
[0024] Also, the auto-complete device 100 may learn about the coding in a low-level language performed by a specific programmer. For example, by repeatedly displaying the code in a high-level language from the display unit 120 and having the programmer input the code in the low-level language corresponding to the high-level language code from the input unit 130, the auto-complete unit 110 may learn to output the code in the low-level language according to the coding of the programmer corresponding to the high-level language code.
[0025] The above repeating unit is not limited to a specific unit. For example, learning may be performed by repeatedly displaying a module consisting of multiple lines of code in a high-level language, creating and inputting the module in the low-level language corresponding to the module, or by repeatedly displaying a single line of code in a high-level language and creating and inputting the code in the low-level language corresponding to the code.
[0026] The above learning can be realized, for example, by the learning unit 140 adjusting the parameters of the auto-complete unit 110 (model) so that the auto-complete unit 110 (model) outputs the correct code in the low-level language.
[0027] Also, the above learning may be performed in multiple types of low-level languages for one high-level language. The auto-complete unit 110 learned in multiple types of low-level languages for one high-level language can identify the type of low-level language from a part of the low-level language code input from the programmer in the actual conversion operation and propose the code in the correct type of low-level language.
[0028] <S1: Code Proposal> Start the operation of converting the code of a high-level language into the code of a low-level language. For example, assume that the code of the high-level language to be converted is stored in the storage unit 150. The auto-complete unit 110 reads the code of the high-level language to be converted from the storage unit 150 and displays the code of the high-level language to be converted via the display unit 120. The unit for display is not limited to a specific unit. As an example, a module consisting of multiple lines is displayed.
[0029] The programmer who performs the operation starts to input the code of the low-level language corresponding to the code of the high-level language displayed on the display unit 120. The code of the low-level language input by the programmer is displayed on the display unit 120 and input to the auto-complete unit 110.
[0030] For example, based on the start part of the line of the code input by the programmer, the auto-complete unit 110 identifies which line of the high-level language that the line corresponds to among the lines to be converted, and outputs (proposes) the line of the low-level language corresponding to the identified line via the display unit 120. That is, in this case, the auto-complete unit 110 outputs a proposal at the timing when the input of the line of the low-level language code is started by the programmer.
[0031] In the above example, an example of making a proposal in line units is shown, but the unit for making a proposal is not limited to lines. The unit for making a proposal may be a partial character string in a line (e.g., a function, an argument of a function, etc.), or may be a set of codes of multiple lines (which may also be called a module). FIG. 3 shows an example of display. The upper side of FIG. 3 is the high-level language code to be converted, and the lower side is the code of the low-level language after conversion.
[0032] Also, when the code that has not been learned in the high-level language is the object to be converted, the auto-complete unit 110 may not make a proposal.
[0033] <S103: Input for Proposal> The programmer, upon seeing the suggestions made by the autocomplete unit 110, decides whether to accept the suggestions and inputs the decision through the input unit 130. The decision is passed from the input unit 130 to the learning unit 140 and the autocomplete unit 110.
[0034] For example, if the determined result is "adopt proposal," the autocomplete unit 110 confirms the proposal as the low-level language code corresponding to the high-level language code. If the determined result is "reject proposal," the autocomplete unit 110 displays another proposal. Alternatively, if there is no other proposal, the autocomplete unit 110 displays a message urging the programmer to create code without any proposals.
[0035] The result of the proposal adoption / rejection determined by the programmer is also input to the learning unit 140. The learning unit 140 learns the autocomplete unit 110 based on the result of the proposal adoption / rejection. Specifically, for example, if a proposal for a certain high-level language code is rejected, the parameters of the autocomplete unit 110 are adjusted to lower the probability and priority of making the proposal for that high-level language code. Also, for example, if a proposal for a certain high-level language code is adopted, the parameters of the autocomplete unit 110 are adjusted to make the proposal for that high-level language code with a higher probability.
[0036] (Example of device hardware configuration) The autocomplete device 100 can be realized by, for example, causing a computer to execute a program. This computer may be a physical computer or a virtual machine on the cloud.
[0037] That is, the autocomplete device 100 can be realized by using hardware resources such as a CPU and memory built into a computer to execute a program corresponding to the processing performed by the autocomplete device 100. The program can be recorded on a computer-readable recording medium (such as a portable memory) and can be saved or distributed. The program can also be provided via a network such as the Internet or email.
[0038] Fig. 4 is a diagram showing an example of the hardware configuration of the computer. The computer in Fig. 4 includes a drive device 1000, an auxiliary storage device 1002, a memory device 1003, a CPU 1004, an interface device 1005, a display device 1006, an input device 1007, an output device 1008, and the like, all of which are interconnected by a bus BS.
[0039] A program for realizing processing on the computer is provided by a recording medium 1001 such as a CD-ROM or a memory card. When the recording medium 1001 storing the program is set in the drive device 1000, the program is installed from the recording medium 1001 to the auxiliary storage device 1002 via the drive device 1000. However, the program does not necessarily have to be installed from the recording medium 1001, but may be downloaded from another computer via a network. The auxiliary storage device 1002 stores the installed program as well as necessary files, data, etc.
[0040] The memory device 1003 reads and stores the program from the auxiliary storage device 1002 when an instruction to start the program is received. The CPU 1004 realizes functions related to the autocomplete device 100 in accordance with the program stored in the memory device 1003. The interface device 1005 is used as an interface for connecting to a network or various external devices. The display device 1006 displays a GUI (Graphical User Interface) or the like according to the program. The input device 1007 is composed of a keyboard, mouse, buttons, a touch panel, or the like, and is used to input various operation instructions. The output device 1008 outputs the results of calculations.
[0041] (Effects of the embodiment) As described above, the technology according to this embodiment learns high-level language code and the corresponding converted low-level language code, and when a programmer converts from a high-level language to a low-level language, suggests low-level language code based on the learning, and whether the programmer adopts or rejects the suggested results is reflected in the learning, thereby making it possible to further improve productivity through auto-complete.
[0042] It is also possible to learn the coding style of a particular programmer and therefore tailor code suggestions to that particular programmer.
[0043] (Summary of the embodiment) This specification discloses at least the autocomplete device, autocomplete method, and program described in the following sections. (Section 1) an auto-complete unit that, when a programmer converts a high-level language code into a low-level language code, outputs a suggestion of a low-level language code corresponding to the high-level language code; a learning unit that trains the autocomplete unit based on whether the programmer has adopted the proposal; An autocomplete device comprising: (Section 2) As a preliminary preparation, the learning unit causes the autocomplete unit to learn high-level language codes and corresponding low-level language codes. 2. The autocomplete device according to claim 1. (Section 3) The learning unit causes the autocomplete unit to learn low-level language codes created by a specific programmer for high-level language codes. 3. The autocomplete device according to claim 2. (Section 4) The autocomplete unit outputs the suggestions when the programmer starts inputting a line of low-level language code. 1. An autocomplete device according to claim 1, 2 or 3. (Section 5) An autocomplete method executed by a device having an autocomplete unit, outputting, by the auto-complete unit, suggestions of low-level language codes corresponding to the high-level language codes when a programmer converts the high-level language codes into low-level language codes; training the autocomplete unit based on whether the programmer accepts or rejects the suggestions; An autocomplete method comprising: (Section 6) A program for causing a computer to function as each part of the autocomplete device described in any one of paragraphs 1 to 4.
[0044] Although the present embodiment has been described above, the present invention is not limited to such a specific embodiment, and various modifications and changes are possible within the scope of the gist of the present invention described in the claims. [Explanation of symbols]
[0045] 100 Autocomplete Device 110 Autocomplete section 120 Display section 130 Input section 140 Learning Department 150 Storage section 1000 Drive Device 1001 Recording media 1002 Auxiliary storage device 1003 Memory device 1004 CPU 1005 Interface device 1006 Display device 1007 Input Device 1008 Output Device
Claims
1. A display unit that displays the high-level language code to be converted; an auto-complete unit that, when a programmer converts the high-level language code into a low-level language code, outputs a suggestion of a low-level language code corresponding to the high-level language code; a learning unit that causes the autocomplete unit to learn based on whether the programmer has adopted the suggestion, The auto-complete unit identifies, based on the beginning of a line of the low-level language code entered by the programmer, which line of the high-level language code to be converted corresponds to, and displays, on the display unit, the line of the low-level language code that corresponds to the identified line as the suggestion. Autocomplete device.
2. When the suggestion for the high-level language code is not adopted, the learning unit adjusts parameters of the autocomplete unit so as to reduce the probability of making the suggestion for the high-level language code. The autocomplete device according to claim 1 .
3. As a preliminary preparation, the learning unit causes the autocomplete unit to learn high-level language codes and corresponding low-level language codes.
3. The autocomplete device according to claim 1 or 2.
4. The learning unit causes the autocomplete unit to learn low-level language codes created by a specific programmer for high-level language codes.
4. The autocomplete device according to claim 3.
5. The autocomplete unit outputs the suggestions when the programmer starts inputting a line of low-level language code.
5. The autocomplete device according to claim 1, wherein the autocomplete device is a device for automatically completing a selection of characters.
6. An auto-complete method executed by a device having a display unit that displays a high-level language code to be converted and an auto-complete unit, outputting, by the auto-complete unit, a suggestion of a low-level language code corresponding to the high-level language code when the programmer converts the high-level language code into a low-level language code; and causing the autocomplete unit to learn based on whether the programmer has adopted the suggestion, The auto-complete unit identifies, based on the beginning of a line of the low-level language code entered by the programmer, which line of the high-level language code to be converted corresponds to, and displays, on the display unit, the line of the low-level language code that corresponds to the identified line as the suggestion. Autocomplete method.
7. When the suggestion for the high-level language code is not adopted, the device adjusts parameters of the autocomplete unit so as to reduce the probability of making the suggestion for the high-level language code. The auto-complete method of claim 6.
8. A program for causing a computer to function as each unit of the autocomplete device according to any one of claims 1 to 5.
Citation Information
Patent Citations
Machine translation method, machine translation system and program
JP2016218995A