Programming Language Corpus Generation for Context-Rich Code Suggestions
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current machine learning models provide inadequate code suggestions for programming languages, lacking context and relevance, particularly affecting users unfamiliar with the language.
Innovation Solution
A method to generate a programming language corpus by extracting functions from software-repository packages, associating them with descriptive curation resources, and training a machine learning model using these resources to provide context-rich code suggestions.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of information
If machine learning models are trained with basic programming language data, then the models can generate code suggestions, but the suggestions lack context and relevance
Solution Approach 1:
The patent applies preliminary action by pre-processing and curating programming language data before training the machine learning model. The system extracts functions from software repositories, identifies relevant curation resources, and generates code descriptions in advance, so that when the model generates code suggestions, it already has access to pre-organized context information, usage instructions, and descriptive content that enhances suggestion quality
Solution Approach 2:
The patent introduces curation resources as an intermediary between the programming language functions and the machine learning model. These curation resources include code descriptions, usage instructions, and contextual information that mediate the training process, allowing the model to learn not just syntax but also the meaning and appropriate usage contexts of code functions
2Productivity
If code suggestions are generated without descriptive information, then the generation process is faster, but the suggestions are less informative for users
Solution Approach 1:
The patent segments the code suggestion system into multiple components: function extraction, curation resource identification, code description generation, and model training. This segmentation allows the system to pre-process descriptive information separately from the actual code generation process, so that context-rich suggestions can be generated efficiently by leveraging pre-computed descriptions rather than generating them in real-time
Data Source
AI summary
A method may include obtaining one or more software-repository packages. A programming-language function may be extracted from the one or more software-repository packages. A curation resource associated with the programming-language function may be identified. The curation resource may include descriptive information related to the programming-language function. The method may include generating a code description corresponding to the programming-language function based on the curation resource. A function-comment pair that includes the programming-language function and the generated code description may be determined. A programming language corpus that includes the one or more software-repository packages may be generated and augmented by the function-comment pair. The method may include training a machine learning model using the programming language corpus.


