Rule Structure Embedding for Code Reuse
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Converting thousands of natural language rules into computer program code is challenging due to the difficulty in finding structurally similar rules for code reuse, as existing methods struggle to effectively embed the structure of complex rules into machine-readable vectors.
Innovation Solution
A method using machine learning models to preprocess natural language rules by replacing terms with dummy tokens, generating dependency graphs, canonical graphs, and machine-readable vectors that represent the rule structure, allowing for comparison and identification of structurally similar rules for code reuse.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If natural language rules are converted directly into computer program code, then the conversion process is simple, but the ability to find structurally similar rules for code reuse is poor
Solution Approach 1:
The patent introduces an intermediary representation layer (dependency graph with dummy tokens) between natural language rules and machine-readable vectors. This intermediary structure captures semantic relationships and enables structural similarity comparison, allowing code reuse while maintaining conversion simplicity through automated processing pipelines.
Solution Approach 2:
The patent transforms rules through multiple parameter changes: replacing terms with dummy tokens, generating dependency graphs, creating canonical versions, and converting to machine-readable vectors. These parameter transformations enable structural comparison and code reuse while maintaining the original rule semantics.
2Adaptability or versatility
If multiple processing steps are applied to embed rule structure into machine-readable vectors, then the ability to compare and reuse code improves, but the processing complexity increases
Solution Approach 1:
The patent segments the complex processing pipeline into distinct functional modules: pre-processing (term replacement), dependency graph generation, canonicalization, and vector embedding. Each module handles a specific transformation step, making the overall complex process manageable and maintainable while achieving effective structural comparison.
Solution Approach 2:
The patent replaces manual rule comparison mechanisms with automated machine learning models that generate machine-readable vectors. This substitution eliminates the need for complex manual similarity assessment while handling the computational complexity of processing thousands of rules.
3Manufacturing precision
If manual conversion of natural language rules into code is performed, then the quality of code generation is high, but the conversion speed and productivity are low
Solution Approach 1:
The patent implements self-service through automated processing where the system converts natural language rules into code without requiring manual intervention for each conversion. The automated pipeline maintains quality through structured processing while dramatically increasing productivity by handling thousands of rules efficiently.
Solution Approach 2:
The patent enables code reuse by generating machine-readable vectors that capture rule structures, allowing the system to copy and adapt existing code patterns to similar rules. This copying mechanism maintains code generation quality while significantly improving productivity through reuse rather than rewriting.
Data Source
AI summary
A rule having text is pre-processed by replacing terms with dummy tokens. A first machine learning model (MLM) uses the dummy tokens to generate a dependency graph with nodes related by edges tagged with dependency tags. A second MLM uses the dependency graph to generate a canonical version with node labels. The node labels are sorted into a lexicographic order to form a document. A third MLM uses the document to generate a machine readable vector (MRV) that embeds the document as a sequence of numbers representative of a structure of the rule. The MRV is compared to additional MRVs corresponding to additional rules for which computer useable program code blocks have been generated. A set of MRVs is identified that match the MRV within a range. The set of MRVs correspond to a set of rules from the additional rules. The set of rules is displayed to a user.


