Programming Language Corpus Generation for Context-Rich Code Suggestions

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvecontext informationVSAvoidcode suggestion quality
Core Design Contradiction:
Loss of informationVSReliability

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

Inventive Principle:
Principle #10Preliminary action

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

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If code suggestions are generated without descriptive information, then the generation process is faster, but the suggestions are less informative for users

Engineering Contradiction:
Improvecode suggestion generation speedVSAvoidusage context
Core Design Contradiction:
ProductivityVSLoss of information

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

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS11327722B1Programming language corpus generation
Publication Date: 2022.05.10 FUJITSU LTD
  • US11327722B1 patent drawing
  • US11327722B1 patent drawing
  • US11327722B1 patent drawing

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.