Long-Text Entity Relationship Extraction with LLM-Guided Regex Agents

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Traditional natural language processing methods face challenges in efficiently extracting entity relationships from long texts due to insufficient understanding capability and limited reasoning, leading to low accuracy and high computational costs when using large language models.

Innovation Solution

A method involving inputting a target long text into a large language model to generate a keyword list, followed by using multiple relationship agents to derive regular expressions for entity relationships, and processing texts with these expressions to obtain extraction results, enhancing accuracy and efficiency.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If large language models are directly used for relationship extraction, then text understanding capability is improved, but computational resource consumption and costs increase enormously

Engineering Contradiction:
Improvetext understanding capabilityVSAvoidcomputational resource consumption
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The patent segments the relationship extraction task into multiple stages: first using a large language model to extract keywords and identify entities, then using rule-based methods with regular expressions to extract relationships. This divides the computational workload between the powerful LLM for high-level understanding and efficient rule-based methods for structured extraction, reducing overall computational resource consumption while maintaining understanding capability.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent extracts key information (keywords and entities) from the text using large language models, then separates the relationship extraction process from the understanding process. By taking out the essential semantic information early and using it to guide subsequent rule-based extraction, the system maintains LLM understanding capabilities while avoiding the need to process entire long texts through computationally intensive LLM inference for every extraction task.

Inventive Principle:
Principle #2Taking out (Extraction)

2Use of energy by moving object

If traditional NLP methods are used for relationship extraction, then computational costs are reduced, but accuracy and reasoning ability deteriorate due to insufficient understanding capability

Engineering Contradiction:
Improvecomputational costVSAvoidextraction accuracy
Core Design Contradiction:
Use of energy by moving objectVSMeasurement precision

Solution Approach 1:

The patent performs preliminary action by using large language models to extract keywords and identify entities before the actual relationship extraction. This preliminary processing captures the semantic understanding and contextual information needed for accurate relationship identification, while the subsequent rule-based extraction uses this pre-processed information to achieve high accuracy without the computational cost of applying LLMs to every extraction task.

Inventive Principle:
Principle #10Preliminary action

3Measurement precision

If large language models are used for long text processing, then text understanding capability is improved, but time cost and efficiency deteriorate

Engineering Contradiction:
Improvetext understanding capabilityVSAvoidextraction efficiency
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent segments the processing pipeline into an understanding phase (using LLMs to extract keywords and entities from long texts) and an extraction phase (using rule-based methods with regular expressions to identify relationships). This segmentation allows the computationally intensive LLM processing to be done once on the entire long text to capture semantic understanding, while subsequent relationship extraction can be performed efficiently on smaller, pre-processed data segments.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces an intermediary layer of keyword extraction and entity identification that mediates between the long text input and the relationship extraction process. This intermediary layer processes the text once using LLMs to extract semantic information, then this condensed representation guides the efficient rule-based extraction, acting as a bridge that maintains understanding capability while enabling high processing efficiency.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS20250217594A1Method, electronic device and computer-readable storage medium for extracting entity relationships
Publication Date: 2025.07.03 BEIJING BAIDU NETCOM SCI & TECH CO LTD
  • US20250217594A1 patent drawing
  • US20250217594A1 patent drawing
  • US20250217594A1 patent drawing

AI summary

A method, electronic device and computer-readable storage medium for extracting entity relationships, which relates to artificial intelligence technologies such as natural language processing, knowledge graphs, deep learning, and large language models. The method for extracting entity relationships includes: inputting a target long text into a target large language model to obtain a target keyword list based on an output result of the target large language model; inputting the target keyword list into multiple target relationship agents respectively to obtain multiple target regular expressions corresponding to different entity relationships based on output results of the multiple target relationship agents; and processing texts in a preset text set using the multiple target regular expressions to obtain entity relationship extraction results.