Context-Free Grammar Corpus Generation for NLP Training

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Training machine learning models for natural language processing requires large, diverse, and uniformly distributed corpora, which is resource-intensive and challenging to collect, especially for application-specific tasks.

Innovation Solution

A system and method using context-free grammars to generate labeled corpora by recursively rewriting text strings, applying production rules to replace nonterminal symbols with terminal symbols, and assigning ground-truth labels, thereby creating a diverse and uniformly distributed dataset with minimal resources.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If large, diverse corpora are collected for training machine learning models, then model performance is improved, but resource requirements and collection difficulty increase

Engineering Contradiction:
Improvemodel performanceVSAvoidresource requirements
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent uses context-free grammar rules to generate synthetic text samples that copy the structural patterns of natural language. Instead of collecting large amounts of real-world data, the system creates artificial corpora by recursively applying production rules to nonterminal symbols, thereby copying linguistic structures without requiring extensive resource investment for data collection and annotation

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The grammar-based corpus generation system is self-sufficient, using only the defined production rules and nonterminal symbols to generate unlimited diverse samples. The system serves itself by automatically creating labeled training data without external human annotation, eliminating the need for expensive manual data preparation while maintaining consistent structural quality

Inventive Principle:
Principle #25Self-service

2Productivity

If application-specific corpora are created, then training efficiency is improved, but corpus generation complexity increases

Engineering Contradiction:
Improvetraining efficiencyVSAvoidcorpus generation complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent segments the corpus generation process into distinct grammatical components: production rules, nonterminal symbols, and terminal symbols. Each segment serves a specific function in generating application-specific training data, allowing the system to efficiently create targeted corpora by combining these modular elements without overwhelming complexity

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system changes parameters by modifying the production rules and nonterminal symbols to generate different application-specific corpora. By adjusting the grammar definitions rather than restructuring the entire generation system, the patent enables efficient adaptation to different applications while maintaining manageable complexity through parameter modification rather than system redesign

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS11520982B2Generating corpus for training and validating machine learning model for natural language processing
Publication Date: 2022.12.06 SAP SE
  • US11520982B2 patent drawing
  • US11520982B2 patent drawing
  • US11520982B2 patent drawing

AI summary

A method may include generating, based a context-free grammar, a sample forming a corpus. The context-free grammar may include production rules for replacing a first nonterminal symbol with a second nonterminal symbol and/or a terminal symbol. The sample may be generated by rewriting recursively a first text string to form a second text string associated with the sample. The first text string may be rewritten by applying the production rules to replace nonterminal symbols included in the first text string until no nonterminal symbols remain in the first text string. A machine learning model may be trained, based on the corpus, to process a natural language. Related methods and articles of manufacture are also disclosed.