Method, electronic device and computer-readable storage medium for extracting entity relationships

US2025217594A1 · US · A1

Patent metadata
FieldValue
Publication numberUS-2025217594-A1
Application numberUS-202519080056-A
CountryUS
Kind codeA1
Filing dateMar 14, 2025
Priority dateDec 3, 2024
Publication dateJul 3, 2025
Grant date

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

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.

First claim

Opening claim text (preview).

What is claimed is: 1 . A method for extracting entity relationships, comprising: 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. 2 . The method according to claim 1 , wherein obtaining the multiple target regular expressions corresponding to different entity relationships based on the output results of the multiple target relationship agents comprises: obtaining multiple candidate regular expressions corresponding to different entity relationships based on the output results of the multiple target relationship agents; and obtaining the multiple target regular expressions corresponding to different entity relationships based on the multiple candidate regular expressions corresponding to different entity relationships. 3 . The method according to claim 2 , wherein obtaining the multiple target regular expressions corresponding to different entity relationships based on the multiple candidate regular expressions corresponding to different entity relationships comprises: for each target relationship agent, inputting a candidate regular expression corresponding to a current target relationship agent into the other target relationship agents respectively for the other target relationship agents to evaluate the candidate regular expression; and in response to determining that evaluation results output by the other target relationship agents are all passed, using the candidate regular expression as a target regular expression. 4 . The method according to claim 1 , wherein processing the text in the preset text set using the multiple target regular expressions to obtain the entity relationship extraction results comprises: matching the multiple target regular expressions with the texts in the preset text set to obtain multiple matching texts; constructing a training dataset based on the multiple matching texts, entities in each matching text and entity relationships among the entities; training an initial entity relationship extraction model using the training dataset to obtain a target entity relationship extraction model; and inputting each text in the preset text set into the target entity relationship extraction model to obtain the entity relationship extraction result based on output results of the target entity relationship extraction model. 5 . The method according to claim 1 , wherein obtaining the target large language model comprises: obtaining an initial large language model; repeatedly inputting an initial long text into the initial large language model to obtain multiple initial keyword lists output by the initial large language model; inputting the multiple initial keyword lists into a preset relationship agent respectively to obtain multiple initial regular expressions output by the preset relationship agent; selecting an optimal keyword list and a worst keyword list from the multiple initial keyword lists based on the multiple initial keyword lists and the multiple initial regular expressions; and training the initial large language model based on a positive and negative preference sample pair constituted by the optimal keyword list and the worst keyword list to obtain the target large language model. 6 . The method according to claim 5 , wherein selecting the optimal keyword list and the worst keyword list from the multiple initial keyword lists based on the multiple initial keyword lists and the multiple initial regular expressions comprises: using a keyword ranking agent to rank the multiple initial keyword lists to obtain a first ranking result of the multiple initial keyword lists; using a regular expression ranking agent to rank the multiple initial regular expressions to obtain a second ranking result of the multiple initial keyword lists based on ranking results of the multiple initial regular expressions; and selecting the optimal keyword list and the worst keyword list from the multiple initial keyword lists based on the first ranking result and the second ranking result of the initial keyword lists. 7 . The method according to claim 1 , wherein inputting the target long text into the target large language model comprises: obtaining a first prompt text; and inputting the first prompt text and the target long text into the target large language model. 8 . The method according to claim 1 , wherein inputting the target keyword list into the multiple target relationship agents respectively comprises: obtaining a second prompt text; and inputting the second prompt text and the target keyword list into the multiple target relationship agents respectively. 9 . The method according to claim 3 , wherein inputting the candidate regular expression corresponding to the current target relationship agent into the other target relationship agents respectively comprises: obtaining a third prompt text; and inputting the third prompt text and the candidate regular expression corresponding to the current target relationship agent into the other target relationship agents respectively. 10 . An electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform a method for extracting entity relationships, comprising: 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. 11 . The electronic device according to claim 10 , wherein obtaining the multiple target regular expressions corresponding to different entity relationships based on the output results of the multiple target relationship agents comprises: obtaining multiple candidate regular expressions corresponding to different entity relationships based on the output results of the multiple target relationship agents; and obtaining the multiple target regular expressions corresponding to different entity relationships based on the multiple candidate regular expressions corresponding to different entity relationships. 12 . The electronic device according to claim 11 , wherein obtaining the multiple target regular expressions corresponding to different entity relationships based on the multiple candidate regular expressions corresponding to different entity relationships comprises: for each target relationship agent, inputting a candidate regular expression corresponding to a current target relationship agent into the other target relationship agents respectively for the other target relationship agents to evaluate the candidate regular expression; and in response to determining that evaluation results output by the other target relationship agents are all passed, using the candidate regular expression as a

Assignees

Inventors

Classifications

  • Semantic analysis · CPC title

  • G06F40/295Primary

    Named entity recognition · CPC title

  • Selection or weighting of terms from queries, including natural language queries · CPC title

  • Selection or weighting of terms for indexing · CPC title

  • G06N5/025Primary

    Extracting rules from data · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US2025217594A1 cover?
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 keyw…
Who is the assignee on this patent?
Beijing Baidu Netcom Sci & Tech Co Ltd
What technology area does this patent fall under?
Primary CPC classification G06F40/295. Mapped technology areas include Physics.
When was this patent published?
Publication date Thu Jul 03 2025 00:00:00 GMT+0000 (Coordinated Universal Time) (A1). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 8 related publications on this page (citations in our corpus or others sharing the same primary CPC).