Data processing method, apparatus and device

CN122927481APending Publication Date: 2026-10-16BEIJING ZITIAO NETWORK TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611123198.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-27
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0005]本文提供一种数据处理方法、装置及设备,以解决相关技术三元组抽取的精度低的问题

Benefits of technology

[0021] This paper presents a data processing method, apparatus, and device. This method achieves accurate data object extraction through a three-stage extraction approach. Specifically, for the first text, candidate relationships are first extracted from the text. Then, entities are extracted from the text using these candidate relationships as constraints. Finally, matching data objects are obtained based on the extracted candidate relationships and entities. By first extracting candidate relationships and then using them to constrain subsequent entity extraction steps, the entity extraction stage has a clear relationship orientation, avoiding the blind extraction of entities unrelated to candidate relationships. This improves the targeting and accuracy of entity extraction. Combining candidate relationships and entities to obtain data objects achieves refined filtering from multiple candidates to high-quality data objects. Compared to end-to-end or two-stage solutions in related technologies where task coupling leads to error accumulation and decreased accuracy, this method improves data extraction accuracy through hierarchical decoupling and step-by-step matching and filtering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122927481A_ABST
    Figure CN122927481A_ABST
Patent Text Reader

Abstract

The present application provides a data processing method, device and equipment, which realizes accurate extraction of data objects through a three-stage extraction method. For the first text, candidate relationships in the text are first extracted, then entities in the text are extracted with the candidate relationships as constraints, and finally matched data objects are obtained based on the extracted candidate relationships and entities. By first extracting candidate relationships and then using the candidate relationships to constrain the subsequent entity extraction step, the entity extraction stage has a clear relationship orientation, avoiding the blind extraction of entities unrelated to the candidate relationships, improving the relevance and accuracy of entity extraction, and obtaining data objects in combination with candidate relationships and entities, realizing fine screening from multiple candidates to high-quality data objects. Compared with the end-to-end or two-stage scheme in related technologies, which causes error accumulation and precision decline due to task coupling, the present application improves the precision of data extraction through hierarchical decoupling and step-by-step matching screening.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This article relates to the field of data processing technology, and in particular to a data processing method, apparatus and equipment. Background Technology

[0002] Triple extraction is a technique for extracting triples from unstructured text, consisting of a subject entity, a relation type, and an object entity. It is a fundamental supporting technology for applications such as knowledge graph construction, intelligent question answering, and information retrieval. Large-scale models such as large language models or diffusion models have high-precision triple extraction capabilities, but this method uses a large number of model parameters, and a single inference takes several seconds or even longer, making it difficult to meet the needs of real-time application scenarios.

[0003] In related technologies, lightweight pre-trained small models are used to improve the efficiency of triple extraction. Specifically, triple extraction is achieved through an end-to-end single-stage approach or a two-stage approach that first extracts entities and then determines relations.

[0004] However, the relevant technology suffers from low accuracy in triplet extraction. Summary of the Invention

[0005] This paper provides a data processing method, apparatus, and device to solve the problem of low accuracy in triple extraction in related technologies.

[0006] Firstly, this paper provides a data processing method, including:

[0007] Get the first text;

[0008] Based on the first text, first extraction information is obtained; wherein, the first extraction information includes at least one candidate relation in the first text;

[0009] Based on the first text and the first extracted information, second extracted information is obtained; wherein the second extracted information includes at least one entity in the first text; wherein the entity includes the first entity and the second entity;

[0010] Based on the first extraction information and the second extraction information, third extraction information is obtained; wherein, the third extraction information includes at least one data object; the data object includes a candidate relation, and a first entity and a second entity corresponding to the candidate relation.

[0011] Secondly, this paper provides a data processing apparatus, including:

[0012] The first acquisition unit is used to acquire the first text;

[0013] A first processing unit is configured to obtain first extraction information based on the first text; wherein the first extraction information includes at least one candidate relationship in the first text;

[0014] The second processing unit is configured to obtain second extraction information based on the first text and the first extraction information; wherein the second extraction information includes at least one entity in the first text; wherein the entity includes a first entity and a second entity;

[0015] The third processing unit is configured to obtain third extraction information based on the first extraction information and the second extraction information; wherein the third extraction information includes at least one data object; the data object includes the candidate relationship, and the first entity and the second entity corresponding to the candidate relationship.

[0016] Thirdly, this article provides an electronic device, including: a processor and a memory;

[0017] The memory stores computer-executed instructions;

[0018] The processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the data processing method described in the first aspect and various possible designs of the first aspect.

[0019] Fourthly, this document provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the data processing method described in the first aspect and various possible designs of the first aspect.

[0020] Fifthly, this document provides a computer program product, including a computer program that, when executed by a processor, implements the data processing method described in the first aspect and various possible designs of the first aspect.

[0021] This paper presents a data processing method, apparatus, and device. This method achieves accurate data object extraction through a three-stage extraction approach. Specifically, for the first text, candidate relationships are first extracted from the text. Then, entities are extracted from the text using these candidate relationships as constraints. Finally, matching data objects are obtained based on the extracted candidate relationships and entities. By first extracting candidate relationships and then using them to constrain subsequent entity extraction steps, the entity extraction stage has a clear relationship orientation, avoiding the blind extraction of entities unrelated to candidate relationships. This improves the targeting and accuracy of entity extraction. Combining candidate relationships and entities to obtain data objects achieves refined filtering from multiple candidates to high-quality data objects. Compared to end-to-end or two-stage solutions in related technologies where task coupling leads to error accumulation and decreased accuracy, this method improves data extraction accuracy through hierarchical decoupling and step-by-step matching and filtering. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in this document or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this document. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This paper provides a schematic diagram of a data processing system architecture.

[0024] Figure 2 This paper presents a schematic diagram of a three-stage cascaded system architecture.

[0025] Figure 3 A flowchart illustrating the data processing method provided in this article;

[0026] Figure 4 This paper presents a structural diagram of a reinforcement learning framework for entity extraction.

[0027] Figure 5 This paper provides a schematic diagram of a data processing reasoning process.

[0028] Figure 6 This paper provides a schematic diagram of a data processing training process.

[0029] Figure 7 A schematic diagram illustrating the processing results of an implicit subject processing mechanism provided in this paper;

[0030] Figure 8 The structural block diagram of the data processing device provided in this paper;

[0031] Figure 9 This is a schematic diagram of the hardware structure of the electronic device provided in this article. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of this document clearer, the technical solutions described below will be clearly and completely described in conjunction with the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments described herein, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments described herein without inventive effort are within the scope of protection of this document.

[0033] It is understood that before using the technical solutions disclosed in the embodiments of this article, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this article in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0034] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as electronic devices, applications, servers, or storage media, that perform the operations described herein, based on the prompt message.

[0035] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0036] It is understood that the above notification and user authorization process is merely illustrative and does not limit the implementation method described in this article. Other methods that comply with relevant laws and regulations may also be applied to the implementation method described in this article.

[0037] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in some situations in this article are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0038] It should be noted that the data processing methods, apparatuses, and devices provided in this article can be used in the field of data processing technology, or in any field other than the field of data processing technology. The application fields of the data processing methods, apparatuses, and devices provided in this article are not limited.

[0039] This paper addresses the need for structured information extraction from unstructured text, and is particularly suitable for scenarios such as social media content analysis, product review mining, and knowledge graph construction. In these scenarios, it is necessary to automatically extract entities and their relationships from massive amounts of text to construct structured data for analysis; this structured data refers to the data objects discussed in this paper. It should be noted that the structured data can be triples or quadruples, or other custom-defined relational data structures. For example, extended quadruples may include a subject entity, relation type, object entity, and relation confidence, or additional quadruples may include a subject entity, object entity, relation type, and text source information. This paper does not impose specific limitations, as long as the semantic relationships between entities are reflected. For ease of explanation, this paper primarily uses triples as an example to describe the technical solution.

[0040] Currently, triplet extraction schemes include large-model and small-model approaches. Existing triplet extraction schemes based on large language models or diffusion models, while achieving high accuracy, suffer from a large number of model parameters (typically billions to tens of billions of parameters), requiring several seconds or even longer for a single inference, making them unsuitable for real-time applications. Furthermore, large models require high-performance graphics processing unit (GPU) clusters, resulting in high deployment costs. Small-model schemes based on lightweight pre-trained models, while offering high inference efficiency, suffer from systematic accuracy loss when handling complex entity boundaries (such as long segments containing punctuation marks, nested entities, etc.). Traditional supervised fine-tuning (SFT) training methods tend to predict short, simple entities, exhibiting a "harm avoidance" mentality towards long entities and entities with complex boundaries, leading to reduced recall. Most of the aforementioned schemes employ end-to-end or two-stage architectures. High-recall strategies in the relation classification (RC) stage introduce a large number of noisy candidate relations, which the entity extraction (EE) stage fails to effectively filter out, resulting in a significant drop in precision. From the RC stage to the full triplet stage, the harmonic mean (F1-Score, F1) of precision and recall typically decreases by more than 30%. Therefore, this paper aims to address the performance gap between small and large-scale language models, particularly focusing on improving the accuracy of triplet extraction under the premise of efficient extraction by small models.

[0041] To address the aforementioned issues, this paper employs a three-stage extraction method to achieve accurate data object extraction. Specifically, for the first text, candidate relations are first extracted from the text. Then, entities are extracted from the text using these candidate relations as constraints. Finally, matching data objects are obtained based on the extracted candidate relations and entities. By independently extracting candidate relations and entities and then performing matching, each stage can be optimized independently without interference, avoiding the problem of error accumulation caused by task coupling. Furthermore, the constraints imposed by candidate relations on entity extraction and the secondary filtering in the independent matching stage improve the accuracy of data extraction.

[0042] To enable those skilled in the art to better understand the present invention, the following detailed description is provided in conjunction with the accompanying drawings and specific embodiments.

[0043] This section describes the specific application environment architecture or hardware architecture upon which the data processing method depends. (References) Figure 1 , Figure 1 This paper presents a schematic diagram of a data processing system architecture, which is a computer device. Figure 1 As shown, the above architecture includes at least one of a data acquisition device 101, a processing device 102, and a display device 103.

[0044] It is understood that the structure illustrated in this article does not constitute a specific limitation on the architecture of a data processing system. In other feasible embodiments described herein, the architecture may include more or fewer components than illustrated, or combine some components, or split some components, or arrange different components, as can be determined according to the actual application scenario, and is not limited here. Figure 1 The components shown can be implemented in hardware, software, or a combination of both. In one case, this paper may also employ multiple discrete terminal devices or servers in combination.

[0045] In the specific implementation process, the data acquisition device 101 may include an input / output interface or a communication interface, and the data acquisition device 101 can be connected to the processing device through the input / output interface or the communication interface.

[0046] The processing device 102 can achieve accurate extraction of data objects through a three-stage extraction method. Specifically, for the first text, it first extracts candidate relations from the text, then extracts entities from the text using the candidate relations as constraints, and finally obtains the matching data objects based on the extracted candidate relations and entities.

[0047] The display device 103 can also be a touch screen or the screen of a terminal device, used to receive user commands while displaying the above-mentioned content, so as to realize interaction.

[0048] It should be understood that the aforementioned processing device can be implemented by a processor reading instructions from memory and executing those instructions, or it can be implemented by a chip circuit.

[0049] Furthermore, the network architecture and business scenarios described in this article are intended to more clearly illustrate the technical solutions presented herein and do not constitute a limitation on the technical solutions provided herein. As those skilled in the art will know, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in this article are equally applicable to similar technical problems.

[0050] In some cases, this paper provides a three-stage cascaded system, accordingly, Figure 2 This paper provides a schematic diagram of a three-stage cascaded system architecture, combined with... Figure 2 As shown, the three-stage cascaded system includes a relation classification module, an entity extraction module, and a global pointer alignment (GP) module.

[0051] Optionally, the three-stage cascaded system combines Group Relative Policy Optimization (GRPO) to achieve reinforcement learning optimization, thereby improving the accuracy and recall of triple extraction while maintaining the high efficiency of small models.

[0052] The technical solutions in some scenarios described below are explained in detail. These solutions can be combined with each other. Identical or similar concepts or processes may not be elaborated upon in some of the solutions.

[0053] Figure 3 This is a flowchart illustrating the data processing method provided in this paper. The execution entity of this method can be the aforementioned processing device 102, such as... Figure 3 As shown, the method may include:

[0054] S301: Get the first text.

[0055] The first text serves as the input basis for subsequent information extraction and data object generation. As the input text for the method, the first text carries the relational and entity information to be identified.

[0056] In some cases, obtaining the first text can mean that the server reads the text record to be processed from the database. The text record in the database may come from social media messages, comments, news statements, or business document texts, etc. In other cases, the first text may be text content received from the upstream system via the application interface, or text content submitted by the user through the input interface and written to the processing queue.

[0057] In some cases, after obtaining the first text, the first text is segmented and encoded.

[0058] Optionally, combined Figure 2 As shown, this paper can input the first text into the preprocessing module, first use a word segmenter to perform word segmentation and encoding, and generate the first encoded sequence.

[0059] The word segmenter can be any word segmenter capable of dividing the first text into sub-word units existing in the model vocabulary; this paper does not impose specific restrictions on this.

[0060] Optionally, the first encoding sequence includes a sequence of tokens and a mapping of raw characters.

[0061] In unstructured texts (such as social media and user comments), the subject of many relationships is not explicitly stated. Existing extraction frameworks cannot effectively handle these implicit subject scenarios, resulting in the omission of a large amount of useful information.

[0062] In other cases, after obtaining the first encoded sequence, this paper preprocesses it to obtain a second encoded sequence. The second encoded sequence is used for candidate relation extraction. Enabling the extraction framework to handle text scenarios where the subject is not explicitly stated, transforming the generation task into an extraction task, and improving recall are also important directions for improving data processing accuracy.

[0063] Optionally, obtaining the first extraction information based on the first text includes: obtaining a first encoding sequence based on the first text; obtaining a second encoding sequence based on placeholders and the first encoding sequence; and performing a first extraction process based on the second encoding sequence to obtain the first extraction information.

[0064] In some cases, this paper uses placeholders to handle implicit subjects. Specifically, a special placeholder is appended at the beginning of the text.<IMPLICIT_SUBJECT> This transforms implicit subject scenarios into standard extraction tasks, enabling the model to extract text fragments where the subject is not explicitly stated.

[0065] In the above implementation, by incorporating placeholders into the encoding sequence, the model can perceive the existence of implicit subjects during the relation classification stage, transforming the originally unmanageable subject-missing scenarios into a standard extraction task that the model can handle. This improves the triple recall rate in scenarios with a high incidence of implicit subjects. At the same time, the placeholders participate in the encoding and extraction processing as part of the encoding sequence, without changing the overall structure of the three-stage cascaded architecture. Only simple processing is required in the preprocessing stage, ensuring the efficient inference advantage of the three-stage cascaded architecture.

[0066] In other cases, this paper can also segment the first encoded sequence after implicit subject processing to improve data processing efficiency.

[0067] Optionally, the segmentation method can be at least one of the following: segmentation by sentence boundaries, segmentation by paragraphs, segmentation by fixed length, or segmentation by text structure. This paper does not impose specific restrictions on this.

[0068] Optionally, this paper implements segmentation using a sliding window approach. Specifically, long texts are segmented into multiple segments based on sentence boundaries. For example, the parameters for sliding window segmentation include the maximum number of characters (max_chars) and the minimum number of characters (min_chars), where max_chars = 400 and min_chars = 160. Sliding window segmentation maintains semantic integrity and avoids the problem of diluting long texts.

[0069] S302: Obtain the first extraction information based on the first text.

[0070] The first extracted information includes at least one candidate relation in the first text.

[0071] The first extraction information is the intermediate extraction result obtained from the first text, which includes at least candidate relations, used to constrain subsequent entity extraction and final data object generation. Candidate relations are relational candidates identified from the first text, used to indicate possible entity relations in the text, and serve as conditions for subsequent entity extraction and data object assembly.

[0072] In some cases, at least one candidate relation can be identified based on the first text, thereby forming the first extracted information.

[0073] In other cases, to adapt to complex text scenarios, the first extracted information may include, in addition to the candidate relation itself, the relation number corresponding to each candidate relation, its sequential index in the text segment, and the corresponding segment identifier, so as to support result alignment in the subsequent entity extraction stage.

[0074] In other cases, for multiple text fragments after sentence segmentation, candidate relations can be determined separately, and deduplication and merging can be performed after the fragment-level candidate relations are output.

[0075] Optionally, this paper first identifies candidate relations at the full-text level and establishes a relation constraint space before subsequent entity recognition. This ensures that entity extraction no longer faces all possible relation types, but rather performs role-based extraction under the constraint of at least one candidate relation. Based on the above analysis, this step-by-step processing approach, which prioritizes relation recognition, can reduce noise in subsequent entity candidates and decrease the probability of long entities, nested entities, and irrelevant entities in text with complex boundaries being misassigned to incorrect relations. This provides intermediate constraints for the stable generation of the third extracted information.

[0076] Optionally, the implementation of step S302 is based on Figure 2 The relation classification module in the text is designed to identify the types of relations that may be contained in the text, providing a set of candidate relations for subsequent entity extraction.

[0077] Optionally, the relation classification module can be implemented using lightweight model encoding such as Bidirectional Encoder Representations from Transformers (BERT), which uses a linear classifier to predict the probability of existence of each relation type.

[0078] Optionally, the output of the relation classification module can be a high-confidence relation candidate set filtered by the first threshold corresponding to the candidate relations. Optionally, the value range of the first threshold (thres) can be (thres>0.3). It is understood that the first threshold can be determined according to the actual situation, and this paper does not impose specific restrictions on it. The first threshold can be manually set in advance, or it can be dynamically adjusted based on the performance of the validation set. For example, the threshold with the best F1 score on the validation set can be selected through grid search or Bayesian optimization, and it can be flexibly determined according to the needs of the actual application scenario.

[0079] Optionally, the relationship classification module can be implemented based on the RC model.

[0080] In some cases, the training of the RC model involves using relation labels from the labeled data to train a BERT+ classifier for multi-label relation classification, employing the Binary Cross-Entropy Loss (BCE) loss function, and freezing the parameters of the first 5 BERT layers.

[0081] Optionally, the relationship labels in the labeled data are multi-label labels, meaning that each piece of text corresponds to one or more relationship type labels. For example, for the text "Zhang San is in position A at company A, and Li Si is in position B at company B", its relationship labels can include multiple relationship types such as "employed at" and "position A".

[0082] In some cases, the first text or the second encoded sequence corresponding to the first text is input into the RC model. For each text segment, the RC model outputs the probability of each relation type, and after threshold filtering, high-confidence relation candidates are retained.

[0083] S303: Obtain the second extraction information based on the first text and the first extraction information.

[0084] The second extracted information includes at least one entity from the first text.

[0085] The entities include the first entity and the second entity.

[0086] Optionally, the first entity is the subject entity, and the second entity is the object entity. The subject entity is the initiator or active party in the relationship, and the object entity is the receiver or passive party in the relationship. For example, in the triple (Zhang San, employed by, *Company), "Zhang San" is the subject entity, and "*Company" is the object entity.

[0087] Optionally, the first entity and the second entity can also be referred to as the first type entity and the second type entity, or the source entity and the target entity, respectively. This paper does not restrict the specific naming of the first entity and the second entity, as long as it can distinguish the two entities with different roles in the triple.

[0088] Optionally, the second extracted information is an intermediate result obtained under the joint constraints of the first text and the first extracted information, wherein the entity is a text fragment extracted from the first text, which serves as the basic element constituting the data object, and is divided into two types of roles: the first entity and the second entity.

[0089] Optionally, the first entity represents an entity on one side that matches the candidate relationship, and the second entity represents an entity on the other side that matches the candidate relationship.

[0090] In some cases, for each candidate relation obtained in S302, the entity corresponding to the candidate relation can be identified based on the first text and the first extraction information, and the first entity and the second entity can be distinguished. For texts with multiple entity pairs, multiple first entities and multiple second entities can be output under the same candidate relation, and the text content, role category, and candidate relation identifier of each entity can be retained in the second extraction information.

[0091] In some cases, when the first text consists of multiple segmented text fragments, entity recognition can be performed within each fragment first, and then the fragments can be merged based on overlapping areas. For nested entity scenarios, entities with different roles can partially overlap in position, and their affiliation can be distinguished by candidate relationship identifiers.

[0092] Based on the above analysis, it can be seen that S303 does not identify all entities independently of relation information. Instead, it extracts the first and second entities under the candidate relation conditions given by the first extracted information, linking the entity recognition process with the relation type. Thus, in complex sentence structures or information-dense texts, entity recognition focuses on the local semantics and role positions related to the current candidate relation. The second extracted information can therefore reduce the number of irrelevant entities entering the subsequent assembly stage and mitigate the error propagation between relation recognition and entity recognition. Therefore, the second extracted information provides both entity content and the correspondence between entities and candidate relations, triggering the next step of data object generation.

[0093] S304: Obtain the third extraction information based on the first extraction information and the second extraction information.

[0094] The third extracted information includes at least one data object; the data object includes a candidate relation, and a first entity and a second entity corresponding to the candidate relation.

[0095] Optionally, the third extraction information is the final extraction result, which includes at least one data object. The data object consists of a candidate relation and a first entity and a second entity that match the candidate relation. It can be understood as a structured result unit composed of the relation and the entities at both ends.

[0096] In some cases, a data object can be a triple, while in others it can be a quadruple, a quintuple, or other custom-formatted associative data structures.

[0097] In some cases, each candidate relation in the first extraction information can be traversed, the first entity and the second entity corresponding to the candidate relation in the second extraction information can be read, and the candidate relation, the corresponding first entity and the corresponding second entity can be assembled into a data object and written into the third extraction information.

[0098] Optionally, for cases where the same candidate relation corresponds to multiple first entities and multiple second entities, an effective combination can be determined based on the correspondence between entities and candidate relations.

[0099] After the third extracted information is generated, it can be output as a structured record according to a preset format. Each record contains a text identifier, candidate relationship label, first entity content, and second entity content. Alternatively, it can be written to a database, knowledge graph construction module, retrieval index module, or downstream business processing interface.

[0100] This paper achieves the final alignment of relational and entity information. First, the first extracted information defines the relational scope; then, the second extracted information provides entity candidates; finally, a data object is formed. Based on the above analysis, the generation of the third extracted information is not a simple concatenation, but rather utilizes the results of the preceding stages to establish consistency constraints between relations and entities. This ensures that the final output data object simultaneously satisfies the conditions that candidate relations exist, the first entity is valid, the second entity is valid, and the correspondence between the three is clear, thereby improving data extraction accuracy.

[0101] This paper achieves accurate data object extraction through a three-stage extraction method. Specifically, for the first text, candidate relationships are first extracted from the text. Then, entities are extracted from the text using these candidate relationships as constraints. Finally, matching data objects are obtained based on the extracted candidate relationships and entities. By first extracting candidate relationships and then using them to constrain subsequent entity extraction steps, the entity extraction stage has a clear relationship orientation, avoiding the blind extraction of entities unrelated to candidate relationships. This improves the targeting and accuracy of entity extraction. By combining candidate relationships and entities to obtain data objects, a refined screening from multiple candidates to high-quality data objects is achieved. Compared with end-to-end or two-stage solutions in related technologies, which suffer from error accumulation and decreased accuracy due to task coupling, this method improves the accuracy of data extraction through hierarchical decoupling and step-by-step matching and screening.

[0102] The following is a detailed explanation of step S304:

[0103] Optionally, the implementation of step S304 can be based on Figure 2 The global pointer alignment module in the RC phase pairs relation candidates with entity candidates in the EE phase to generate complete triples.

[0104] Optionally, the global pointer alignment module can calculate the matching score between entity pairs through the global pointer (GlobalPointer) network, and output the final triple after threshold filtering.

[0105] Optionally, the key parameters of the global pointer alignment module are: pair score threshold (pair_score_thres=0.2), subject threshold (sub_thres=0.1), and object threshold (obj_thres=0.1). It is understood that these parameters are merely illustrative, and this embodiment does not impose specific limitations on them.

[0106] In some cases, obtaining third extraction information based on first and second extraction information includes: obtaining multiple fourth extraction information based on candidate relationships, first entities, and second entities; obtaining corresponding matching scores based on the fourth extraction information; and obtaining third extraction information from the multiple fourth extraction information based on the matching scores.

[0107] The fourth extracted information consists of multiple candidate structures formed by combining candidate relations, the first entity, and the second entity. Each candidate structure represents a possible data object matching scheme, used to carry different pairing results under the same relation and entity combination. The matching score is used to characterize the degree of semantic consistency between the corresponding fourth extracted information and the input text. The matching score can be output by a global pointer network or generated by a scoring module with vector similarity calculation capabilities. In practical applications, this scoring module can also adopt other model structures, which are not limited in this paper.

[0108] In some cases, candidate relations, first entities, and second entities are first mapped to a unified semantic representation, and multiple fourth-order extraction information are generated based on this representation. These fourth-order extraction information can be obtained by combining entity boundaries, relation directions, or entity pairing methods in different ways. Subsequently, each fourth-order extraction information is input into a scoring model to obtain a corresponding matching score, and the candidate structures are sorted or filtered according to the score. Based on a preset threshold, maximum score, or Top-k retention strategy, third-order extraction information is determined from the multiple fourth-order extraction information, such that the third-order extraction information corresponds to a set of data objects with a higher degree of matching with the current text.

[0109] Here, this paper obtains multiple fourth extraction information based on candidate relations, the first entity, and the second entity. Then, a matching score is calculated for each fourth extraction information. Finally, third extraction information is selected from multiple candidates based on the matching scores, achieving a refined screening process from candidate pairing to high-quality output. Through quantitative evaluation of the matching scores, each candidate triplet can obtain an independent confidence measure, effectively ensuring the quality of the final output triplet.

[0110] Optionally, the above solution can be configured with a score threshold filtering mechanism to flexibly adjust the balance between the output precision and recall, thereby improving the adaptability of the solution in different application scenarios.

[0111] In some cases, candidate relations, first entities, and second entities can be partially combined based on confidence ranking. Only candidate relations and entities with predicted matching scores exceeding a preset threshold can be combined to reduce the number of candidates and improve processing efficiency.

[0112] Optionally, the fourth extracted information is generated through explicit concatenation or feature fusion. In the explicit concatenation method, the type identifier of the candidate relation, the text fragment of the first entity, and the text fragment of the second entity are concatenated into a unified sequence input. In the feature fusion method, the relation vector representation corresponding to the candidate relation, the boundary vector representation of the first entity, and the boundary vector representation of the second entity are fused to obtain a joint semantic representation. Those skilled in the art can choose any of the above methods according to actual needs; this document does not impose any limitation on this.

[0113] Optionally, the number of candidate relations is M, the number of first entities is N, the number of second entities is P, and the number of fourth extracted information obtained through full combination is M×N×P.

[0114] In some cases, a corresponding matching score is obtained based on the fourth extraction information, including: inputting the fourth extraction information into the first extraction model to score the fourth extraction information and output the corresponding matching score.

[0115] The first extraction model is a global pointer network. The first extraction model is trained by data object samples and the first annotation information corresponding to the data object samples. The first annotation information includes candidate relations, first entity and second entity corresponding to the data object.

[0116] Optionally, the data object sample and the first annotation information are obtained through the following methods: obtaining the original text sample and its corresponding structured annotation information, wherein the structured annotation information includes at least one labeled data object, and each labeled data object contains a subject entity, a relation type, and an object entity; constructing positive samples and negative samples based on the original text sample and the structured annotation information, wherein the positive sample is the labeled data object, and the negative sample is an erroneous data object generated by replacing the subject entity, object entity, or relation type in the positive sample; and using the positive sample and the negative sample together as the data object sample. Optionally, the generation method of the negative sample includes, but is not limited to, at least one of the following: replacing the subject entity in the positive sample with other non-subject entities in the text, replacing the object entity in the positive sample with other non-object entities in the text, replacing the relation type in the positive sample with other relation types that do not exist in the text, and randomly shuffling the pairing relationship between the subject entity and the object entity in the positive sample.

[0117] In some cases, the first text can be encoded to obtain a contextual representation. Then, the combined information of the candidate relation, the first entity, and the second entity can be used to construct the fourth extraction information, which is then input into the first extraction model. The global pointer network, based on the parameters learned during training, jointly discriminates the relational semantics, entity boundaries, and their correspondences in this combination, and outputs a matching score. This matching score represents the likelihood that the current fourth extraction information is a valid data object; the higher the score, the higher the degree of matching between the candidate relation and the corresponding first and second entities.

[0118] The first extraction model, employing a global pointer network, can directly score the overall combination of relations and entities, rather than relying solely on local fragment judgments. During training, supervised samples are constructed based on data object samples and their initial annotation information, enabling the model to gradually learn the discriminative features of entity pairings under different candidate relations and provide stable matching scores for unseen combinations during inference. In practical applications, the global pointer network can also employ different hidden dimensions and encoding layers; this paper does not impose limitations on these.

[0119] Optionally, GlobalPointer is trained using complete triplet annotations for entity alignment, employing an improved multi-label classification cross-entropy loss (mcce3).

[0120] This paper inputs the fourth extracted information into a global pointer network for scoring, outputting the corresponding matching score. The global pointer network's global discriminative ability is then used to evaluate the quality of candidate triples. The global pointer network models pairing scoring as a multi-label classification problem, enabling parallel scoring of all candidate pairs with high computational efficiency. Furthermore, the global pointer network is independently trained using data object samples and their corresponding triple annotations, allowing the network to fully learn the matching patterns between entity pairs and relation types, effectively improving the accuracy and reliability of the matching score.

[0121] Alternatively, the matching score can also be obtained in a variety of ways, including but not limited to the following:

[0122] The fully connected discrimination method based on a global pointer network models the overall matching relationship between candidate relations and entity pairs, directly outputting a matching score. This method is suitable for scenarios with many candidate relation types and complex entity boundaries, and can fully utilize the semantic understanding capabilities of pre-trained models.

[0123] The vector similarity-based scoring method calculates the similarity (e.g., cosine similarity, dot product similarity, or Euclidean distance) between the vector representation of the candidate relation and the vector representations of the first and second entities, and determines the matching score based on the similarity value. This method is suitable for scenarios where both the relation type and entity representation have been vectorized, and it has high computational efficiency.

[0124] The attention-based matching method calculates the interaction weights between candidate relations and the first and second entities using an attention mechanism, and determines the matching score based on these weights. This method is suitable for scenarios that require consideration of fine-grained interactions between relations and entities.

[0125] Optionally, the scoring module can be a global pointer network, or a scoring network based on a multilayer perceptron, a scoring network based on bilinear transformation, or a scoring network based on an attention mechanism. When using a global pointer network, the GlobalPointer architecture can be directly reused for training and inference; when using other scoring networks, it is only necessary to ensure that the network input is a semantic representation of the fourth extracted information and the output is a scalar matching score. Those skilled in the art can flexibly choose according to the actual application scenario, and this document does not impose any restrictions on this.

[0126] In some cases, third extraction information is obtained from multiple fourth extraction information based on the matching score, including: filtering multiple fourth extraction information based on a first entity threshold, a second entity threshold, and a matching score threshold to obtain third extraction information.

[0127] Compared to filtering the overall matching score using a single threshold, the triple threshold independently judges the subject entity, object entity, and relationship matching dimensions. Only candidate triples that meet all three threshold conditions can be output, effectively filtering out low-quality candidates with unreliable subjects, unreliable objects, or low relationship matching, thus improving the accuracy and overall quality of the final output triples.

[0128] Optionally, the three thresholds can be configured and adjusted independently, providing a flexible means of balancing precision and recall for different application scenarios.

[0129] Optionally, the first entity threshold is 0.1, used to filter the confidence score of the first entity (subject). That is, when the confidence score of the first entity is lower than 0.1, the entity is judged as unreliable and the corresponding fourth extraction information is filtered out. The second entity threshold is 0.1, used to filter the confidence score of the second entity (object). That is, when the confidence score of the second entity is lower than 0.1, the entity is judged as unreliable and the corresponding fourth extraction information is filtered out. The matching score threshold is 0.2, used to filter the matching degree between the candidate relationship and the entity pair. That is, when the matching score is lower than 0.2, the candidate pair is judged as unreliable and the corresponding fourth extraction information is filtered out.

[0130] Optionally, the three thresholds mentioned above can be adjusted independently according to specific application scenarios. For example, in knowledge graph construction scenarios requiring high accuracy, the matching score threshold can be increased (e.g., from 0.2 to 0.4) to improve output quality; in recommendation system scenarios requiring high recall, the matching score threshold can be decreased (e.g., from 0.2 to 0.1) to retain more candidate results. Similarly, the first entity threshold and the second entity threshold can also be set differently based on the respective recognition difficulty of the subject entity and the object entity. The independent adjustability of the three thresholds allows this solution to flexibly adapt to different application requirements.

[0131] Optionally, any one or more of the first entity threshold, the second entity threshold, and the matching score threshold can be determined using at least one of the following methods: manual setting, validation set optimization (e.g., iterating through different threshold combinations on the validation set to select the threshold combination that optimizes the F1 score), statistical distribution-based methods (e.g., dynamically determined based on the percentiles of the matching score distribution), or confidence-adaptive adjustment (e.g., using a lower threshold for relation types with generally lower confidence and a higher threshold for relation types with generally higher confidence). These methods can be used individually or in combination, and this document does not impose any limitations on their use.

[0132] The following is a detailed explanation of step S303:

[0133] Optionally, the implementation of step S303 can be based on Figure 2 The entity extraction module in the document extracts entity fragments (first entity em1Text and second entity em2Text) from the text under candidate relation constraints.

[0134] Optionally, the entity extraction module (which can be implemented as a second extraction model) is based on the BERT+GlobalPointer architecture, which predicts the start and end positions of the entity span through a global pointer network.

[0135] Alternatively, one possible way to train the entity extraction module using SFT is to use entity boundary information from the labeled data to train BERT+GlobalPointer for entity extraction, employ GlobalPointer cross-entropy loss, and freeze the parameters of the first two BERT layers.

[0136] Optionally, the GlobalPointer network's role in the entity extraction stage is to score each candidate text span (i.e., a continuous segment from position i to position j) in the first text, determining whether the span constitutes a valid entity segment. Specifically, the GlobalPointer network models entity extraction as a multi-label classification problem, classifying all possible n(n+1) / 2 candidate spans (n ​​being the text length) and predicting whether each candidate span is an entity boundary. Compared to traditional sequence labeling methods, the GlobalPointer network can simultaneously handle the recognition of both non-nested and nested entities, and its decoding process is simple and efficient.

[0137] Optionally, the GlobalPointer network in the entity extraction module and the GlobalPointer network in the subsequent pointer alignment module are two independent networks with different model parameters, different training data, and different optimization objectives. The GlobalPointer network in the entity extraction module focuses on entity boundary recognition and is trained using entity boundary annotation information; the GlobalPointer network in the GP module focuses on the pairing scoring between candidate relations and entities and is trained using complete triplet annotations. The two GlobalPointer networks are independent of each other and do not interfere with each other, reflecting the core idea of ​​independent training and optimization at each stage in the three-stage cascaded architecture.

[0138] In some cases, obtaining second extraction information based on first text and first extraction information includes: inputting the first text and first extraction information into a second extraction model to extract the first text under the constraints of the first extraction information and output the second extraction information.

[0139] The second extraction model is trained using data object samples and the second annotation information corresponding to the data object samples. The second annotation information includes entity boundary annotation information corresponding to the data objects.

[0140] This paper inputs the first text and the first extraction information into the second extraction model, allowing the entity extraction process to proceed under the constraint of candidate relations. That is, entity extraction has a clear relational orientation; the model only needs to extract entities within the semantic range indicated by the candidate relation type, without blindly searching all possible entity spans in the text. This reduces the search space for entity extraction and avoids extracting redundant entities unrelated to candidate relations. Simultaneously, the second extraction model is trained independently using entity boundary annotation information, enabling the model to focus on learning the discrimination of entity start and end positions without simultaneously handling relation classification tasks. This reduces the learning difficulty of the model, improves the accuracy of entity boundary recognition, and provides a high-quality entity candidate set for the subsequent pointer alignment stage.

[0141] In some cases, the second extraction model employs an entity-level negative sampling strategy (my_collate_fn_GP_entlev) to negatively sample non-entity pairs during training, thereby improving entity alignment accuracy.

[0142] In some cases, before inputting the first text and the first extraction information into the second extraction model to extract the first text under the constraints of the first extraction information and output the second extraction information, the method further includes: obtaining an initial second extraction model; obtaining data object samples and second annotation information; performing a first training on the initial second extraction model based on the data object samples and the second annotation information to obtain a trained second extraction model; and performing a second training on the trained second extraction model based on the data object samples and the second annotation information to obtain a second extraction model.

[0143] The second training is reinforcement learning training, which includes a reward signal that represents the degree of matching between the predicted entity boundary and the labeled entity boundary.

[0144] Optionally, entity boundary annotation information includes the start position, end position, and entity type label of each entity in the text. For example, for the text "Zhang San is position A in company A", the entity boundary annotation information may include: the start position[0], end position[1], and type "person name" of entity "Zhang San"; the start position[3], end position[4], and type "organization name" of entity "Company A"; and the start position[6], end position[6], and type "position name" of entity "position A". When the same text contains multiple entities, the annotation information includes the start position, end position, and type label of all entities. During training, the GlobalPointer network classifies all candidate spans. If the start position and end position of a candidate span are consistent with an entity in the annotation information, it is marked as a positive sample; otherwise, it is marked as a negative sample.

[0145] This paper employs reinforcement learning to develop an entity extraction model. First, an initial second extraction model undergoes a first training phase, enabling it to recognize entities based on entity boundary annotations. Then, the trained model undergoes a second training phase, using the matching degree between predicted entity boundaries and labeled entity boundaries as a reward signal to guide the model in further optimizing the prediction quality. The first training phase ensures the model possesses basic entity recognition capabilities, while the second training phase overcomes the bottleneck of supervised learning being limited by the distribution of labeled data, enabling the model to predict long entities and entities with complex boundaries. Through these two stages of training, the second extraction model improves entity recognition accuracy while maintaining basic recognition capabilities.

[0146] In some cases, the initial second extraction model is first trained based on data object samples and second annotation information to obtain a trained second extraction model, including: obtaining a training sample set based on data object samples and second annotation information; and performing the first training on the initial second extraction model based on the training sample set to obtain a trained second extraction model.

[0147] The training sample set includes positive samples and negative samples. Positive samples include the entity span corresponding to the second annotation information, and negative samples include the non-entity span corresponding to the second annotation information.

[0148] Optionally, the entity-level negative sampling strategy is executed during the training data loading phase. The number of real entity spans (positive samples) is typically much smaller than the total number of candidate spans. The negative sampling strategy strategically selects a portion of non-entity spans as negative samples from all candidate spans, after excluding real entity spans, and these negative samples, together with the real entity spans, constitute the training sample set for that sample. Optionally, the negative sample selection strategy may include random sampling, hard negative sample mining (selecting non-entity spans that are adjacent to the real entity in text position, have similar boundaries, or are of similar type), or a hybrid strategy of both. By controlling the ratio of positive to negative samples, the problem of imbalanced positive and negative samples is effectively alleviated, improving the accuracy of the second extraction model.

[0149] This paper constructs a training sample set containing positive and negative samples. Positive samples represent entity spans corresponding to the second annotation information, while negative samples represent non-entity spans corresponding to the second annotation information. This allows the second extraction model to simultaneously learn what constitutes an entity and what does not during the first training phase. Positive samples help the model learn positive features of entities, while negative samples help the model establish discrimination boundaries and reject non-entity segments. This comparative learning mechanism, working together to train the model to establish accurate entity boundary discrimination capabilities, effectively alleviates the problem of extreme imbalance between positive and negative samples during training, reduces training noise caused by unlabeled entities being misclassified as negative samples, improves entity recognition accuracy, and further enhances data extraction accuracy.

[0150] In another scenario, the second extraction model in this paper integrates the GRPO reinforcement learning optimization module for reinforcement learning, thereby optimizing the entity boundary recognition capability of the EE module through reinforcement learning.

[0151] Specifically, the reinforcement learning optimization module improves the entity boundary recognition capability of the EE module through reinforcement learning.

[0152] GRPO (Group Relative Policy Optimization) is a reinforcement learning algorithm based on policy gradients. Its core idea is to calculate the advantage by comparing within groups, without having to train a separate value network (Critic), thus reducing training complexity and resource consumption.

[0153] Specifically, the reinforcement learning optimization module improves the entity boundary recognition capability of the EE module through reinforcement learning.

[0154] Optionally, the reinforcement learning optimization module may include at least one of the following training mechanisms:

[0155] Rollout sampling mechanism: K rounds of sampling are performed on the same input text (K can be 8 to 10), generating multiple candidate entity sets. Through multiple samplings, the model can explore different entity boundary prediction schemes, increase the diversity of output, and provide a sufficient sample basis for subsequent reward evaluation and policy updates.

[0156] Reward Calculation Mechanism: Token-level Micro-F1 is used as the reward signal. This means that the matching degree between the predicted entity boundary and the labeled entity boundary is calculated for each token position, and the harmonic mean of precision and recall is used as the reward value. Token-level F1 rewards enable the model to obtain fine-grained feedback signals during reinforcement learning—even if the model fails to completely predict a long entity, it can still receive a corresponding positive reward as long as it predicts some of the tokens. This guides the model from a risk-averse behavior mode to one that dares to predict long entities and entities with complex boundaries.

[0157] The KL divergence constraint mechanism limits the policy update magnitude using KL divergence (KL) constraints, specifically with parameters clip_eps = 0.08 and kl_beta = 0.005. Here, clip_eps is the clipping coefficient, used to limit the range of variation in the policy ratio (i.e., the ratio of the probabilities of the new and old policies), preventing excessively large updates in a single time; kl_beta is the KL divergence penalty coefficient, used to control the intensity of the penalty for the policy deviating from the reference model. These constraints effectively prevent policy collapse or performance degradation during reinforcement learning training.

[0158] Auxiliary BCE Loss Mechanism: This paper proposes a joint training mechanism using auxiliary BCE loss, with an auxiliary loss coefficient aux_bce_coef = 0.2. During reinforcement learning training, the auxiliary BCE loss provides additional supervision signals to the model, enabling it to maintain its ability to fit the labeled data while optimizing the policy. This stabilizes the training process and prevents the model from forgetting learned knowledge due to the exploratory nature of reinforcement learning.

[0159] It is understood that the specific values ​​of K (8~10), clip_eps (0.08), kl_beta (0.005) and aux_bce_coef (0.2) mentioned above are only illustrative examples. Those skilled in the art can make adaptive adjustments to the above parameters according to the actual training situation (such as model size, amount of training data, convergence speed, etc.), and this article does not make specific limitations on this.

[0160] Optionally, Figure 4 This paper provides a structural diagram of an entity extraction reinforcement learning framework, such as... Figure 4As shown, this paper presents a closed-loop iterative entity extraction training process, which sequentially executes the steps of sample sampling, reward evaluation, sample quality quantification, and policy update:

[0161] In the sampling phase, multiple sets of entity candidate samples are output in batches using a fixed old strategy. In the reward calculation phase, sample rewards are generated using entity extraction standard evaluation metrics, abandoning the value network required by traditional reinforcement learning. The average reward of the same batch is used as a benchmark to measure the extraction effect of each set of candidate samples. The policy update module uses both pruning constraints and distribution divergence to stabilize the policy update amplitude, and adds entity classification auxiliary loss to achieve joint multi-task optimization. At fixed training steps every interval, the updated policy is synchronized to the old policy, and the entity extraction model is optimized through iterative iteration.

[0162] Optionally, during the sampling phase, multiple sets of entity candidate samples are output in batches using a fixed old strategy; during the reward calculation phase, sample rewards are generated using entity extraction standard evaluation metrics (e.g., TokenMicroF1). Unlike traditional reinforcement learning, which relies on a value network to evaluate absolute quality, this paper abandons the value network and uses the average reward of the same batch as a baseline. The relative advantage value is obtained by calculating the difference between the individual reward and the mean, which measures the extraction performance of each set of candidate samples in the same round. The policy update module uses both pruning constraints and distribution divergence to stabilize the policy update magnitude. For example, the pruning constraint (ε=0.08) limits the extreme values ​​of single-step policy changes, and the KL divergence constraint (β=0.005) prevents drastic deviations in the distribution of the old and new policies. The two together ensure training stability. In addition, an entity classification auxiliary BCE loss (weight λ=0.2) is superimposed during the policy update process. By sharing the underlying feature extractor with the policy network, joint multi-task optimization is achieved, improving the entity representation capability. At fixed intervals of training steps (e.g., 150 steps), the updated policy parameters are synchronized to the old policy, so that the old policy can be stably used for sample sampling in the next cycle. This iterative process completes the optimization of the entity extraction model.

[0163] Optionally, the reinforcement learning process is as follows: sample the same input text from the old policy model for K rounds (K=8~10) to generate multiple candidate entity sets; calculate the token-level Micro-F1 reward for each candidate entity set; calculate the relative advantage of each candidate reward value relative to the average reward value within the group; based on this relative advantage, update the policy model parameters using a proximal policy optimization with clipped surrogate objective (PPO-clip) style objective function; at fixed training steps (e.g., 150 steps), synchronize the updated policy parameters to the old policy model, and iterate until the model converges. Among these features, the token-level Micro-F1 reward enables the model to obtain fine-grained feedback signals, guiding it from a risk-averse behavior pattern to one that dares to predict long entities and complex boundary entities. The PPO-clip objective function, combined with KL divergence constraints (kl_beta=0.005) and clipping constraints (clip_eps=0.08), stabilizes the policy update magnitude, and the auxiliary binary cross-entropy loss (aux_bce_coef=0.2) stabilizes the training process, effectively preventing policy collapse or performance degradation during reinforcement learning training. The parameter values ​​mentioned above are merely examples; those skilled in the art can make adaptive adjustments according to actual circumstances, and this paper does not impose specific limitations.

[0164] Understandable, Figure 4 The specific reward calculation method, policy update implementation, and loss function form can be adjusted according to actual training needs, and this paper does not impose specific restrictions on them.

[0165] In some cases, Figure 5 This paper provides a schematic diagram of a data processing reasoning flow. In some cases, Figure 6 This paper presents a schematic diagram of a data processing training workflow. Combined with... Figure 5 and Figure 6 The data processing method presented in this paper can be implemented through the following steps to achieve training and inference, thereby enabling the extraction of structured data such as triples:

[0166] In this paper, the text preprocessing process is as follows: the input text is segmented into words, and implicit subject placeholders are added (e.g., ...).<IMPLICIT_SUBJECT> The function then segments the long text according to the sliding window parameters. For example, the sliding window parameters have a maximum character count of 400, a minimum character count of 160, and a trigger threshold of 600.

[0167] The Relation Classification (RC) inference process is as follows: For each text segment, the RC model outputs the probability of each relation type, and after filtering by a first threshold, retains high-confidence relation candidates. The RC model is implemented based on the BERT classifier architecture, using relation labels from the labeled data for multi-label relation classification training, employing a binary cross-entropy loss function, and freezing the parameters of the first 5 layers of BERT. Exemplarily, the RC learning rate is 1e-4, the number of training epochs is 2 to 5, and the batch size is 16 to 24. The first threshold (i.e., the RC threshold) typically ranges from 0.2 to 0.3 (in other cases, it can also be a value greater than 0.3).

[0168] The Entity Extraction (EE) inference process is as follows: Under candidate relation constraints, the EE model outputs the start and end position scores of entity spans through the GlobalPointer network. These scores are then decoded into an entity candidate list by an entity span decoding algorithm. The EE model is implemented based on the BERT and GlobalPointer architecture, trained using entity boundary information from labeled data, employing the GlobalPointer cross-entropy loss function, and freezing the parameters of the first two layers of BERT. Exemplarily, the EE learning rate is 5e-6 to 8e-6, the number of training epochs is 2 to 5, and the batch size is 16 to 24.

[0169] In some cases, the EE model employs an entity-level negative sampling strategy during training. During the training data loading phase, a portion of non-entity spans are strategically selected from all candidate spans as negative samples, which together with the real entity spans constitute the training sample set.

[0170] In other cases, after supervised fine-tuning training, the EE model is further optimized using GRPO reinforcement learning. The GRPO reinforcement learning process is as follows: K rounds of sampling are performed on the same input text from the old policy model to generate multiple candidate entity sets; the token-level Micro-F1 reward for each candidate entity set is calculated; the relative advantage of each candidate reward value relative to the group's average reward value is calculated; based on this relative advantage, the policy model parameters are updated using a PPO-clip style objective function; at fixed training steps, the updated policy parameters are synchronized to the old policy model, and this process is iterated until the model converges. Exemplarily, in the GRPO parameters, K is 8 to 10, the clipping coefficient (Clip epsilon) is 0.08, KL beta is 0.005, the synchronization frequency is 150 steps, the reward scaling is 2.0 to 2.2, and the auxiliary BCE coefficient is 0.2.

[0171] The Global Pointer Alignment (GP) inference process is as follows: Entity candidates are paired, a matching score is calculated for each pair, and the final triples are output after threshold filtering. The GP module is implemented based on the GlobalPointer network, trained using complete triple annotations, and employs an improved multi-label classification cross-entropy loss. Exemplarily, GP training consists of 3 to 6 epochs with batch sizes of 16 to 24. In the decoding thresholds, the subject threshold is 0.1, the object threshold is 0.1, and the pairing threshold is 0.2.

[0172] As an example, the basic model of the data processing system used in this paper is a small model, which can have a 12-layer Transformer structure, 768-dimensional hidden layers, and a total number of parameters of approximately 110 million.

[0173] This article can achieve the following technical effects:

[0174] A three-stage cascaded triplet extraction architecture is provided: RC (Relation Classification) → EE (Entity Extraction) → GP (Global Pointer). Each stage is optimized independently yet works collaboratively, effectively controlling error accumulation through threshold filtering and joint decoding. See the specific implementation details. Figure 2 The three-stage cascaded system architecture shown and Figure 5 The process is illustrated below.

[0175] We provide a GRPO-based entity boundary optimization method: applying GRPO reinforcement learning to entity extraction tasks of small models, using token-level Micro-F1 as the reward signal, and solving the risk-seeking problem in SFT training through Rollout sampling and relative advantage estimation, so that the model can confidently predict long entities and complex boundary entities.

[0176] A training strategy at the entity level is provided: Entity-level negative sampling (my_collate_fn_GP_entlev) is used in GlobalPointer training to negatively sample non-entity pairs, improving entity alignment accuracy. This strategy improves the alignment success rate of em2Text.

[0177] Provides an implicit subject placeholder mechanism: concatenates at the beginning of the text.<IMPLICIT_SUBJECT> Special placeholders transform implicit subject scenarios into standard extraction tasks, enabling the extraction framework to process text where the subject is not explicitly stated, thus improving recall in complex scenarios.

[0178] An adaptive threshold decoding strategy is provided: adaptive thresholds are designed for the three stages of RC, EE, and GP, and the recall and precision are balanced by joint threshold tuning to achieve optimal F1 performance.

[0179] Provides a sliding window and implicit subject collaboration mechanism: combining the sliding window segmentation mechanism with implicit subject processing, because...<IMPLICIT_SUBJECT> Located at the beginning of a sentence, regardless of how the text is segmented, the model always has the opportunity to extract this universal implicit subject, ensuring the ability to extract implicit subjects from any position in long texts.

[0180] In some cases, Figure 7 This paper provides a schematic diagram illustrating the processing results of an implicit subject processing mechanism, as shown below. Figure 7 As shown, this paper can achieve accurate extraction of implicit subjects across sentences in long texts by combining the sliding window segmentation mechanism with implicit subject processing.

[0181] Understandable, Figures 4 to 7 This is merely an explanation of the results and some data processing methods used in this paper. Figures 4 to 7 This does not constitute a limitation on the specific implementation method or the scope of protection of this article.

[0182] In practice, a common anchor word (i.e., ...) is first inserted at the beginning of the sentence in the original text.<IMPLICIT_SUBJECT> Implicit subject placeholders are used to reconstruct the text into a processing sequence with explicit subject indicators. Then, a sliding window segmentation strategy is initiated to cut the reconstructed long text into multiple window segments with overlapping areas. Because anchor words are located at the beginning of the global sentence, and sliding windows typically use a top-to-bottom sliding motion, therefore...<IMPLICIT_SUBJECT> The placeholder will be fully preserved and will reappear at the beginning of each sliding window segment.

[0183] During the inference phase, the model extracts data independently for each window segment. When the window contains a real subject (such as "this milk powder"), the model extracts the complete triple; when the window contains implicit subjects across sentences or attributes that cannot locate specific entities, the model directly uses the initial value of the segment.<IMPLICIT_SUBJECT> Triples are constructed using the universal subject. Finally, the triples obtained from each sliding window segment are aligned and merged to ensure that implicit subjects at any position and span in the long text can be effectively identified and structurally extracted.

[0184] Understandable, Figure 7 middle<IMPLICIT_SUBJECT> The specific placeholder format, sliding window size, and overlap step size can be flexibly adjusted according to the actual text length and training requirements. This paper does not impose specific restrictions on these parameters.

[0185] Combining the above solutions, this paper improves data processing efficiency and accuracy without requiring high-performance GPU clusters, reducing deployment costs and making it suitable for small and medium-sized enterprises and edge computing scenarios.

[0186] Corresponding to the data processing method in the above embodiments, Figure 8 A block diagram of the data processing apparatus provided for this document. For ease of illustration, only the parts relevant to this document are shown. (Refer to...) Figure 8 The data processing device includes: a first acquisition unit 801, a first processing unit 802, a second processing unit 803, and a third processing unit 804.

[0187] The first acquisition unit is used to acquire the first text;

[0188] A first processing unit is configured to obtain first extraction information based on a first text; wherein the first extraction information includes at least one candidate relation in the first text;

[0189] The second processing unit is configured to obtain second extraction information based on the first text and the first extraction information; wherein the second extraction information includes at least one entity in the first text; wherein the entity includes a first entity and a second entity;

[0190] The third processing unit is configured to obtain third extraction information based on the first extraction information and the second extraction information; wherein the third extraction information includes at least one data object; the data object includes a candidate relationship, and a first entity and a second entity corresponding to the candidate relationship.

[0191] This paper achieves an end-to-end automated data extraction process through the collaborative work of a first acquisition unit, a first processing unit, a second processing unit, and a third processing unit. First, candidate relationships are output; then, bidirectional entities are extracted based on relationship constraints; finally, precise alignment and matching of relationships and entities are performed, thereby effectively improving the completeness and structure of the extraction results and enhancing data processing accuracy.

[0192] In some cases, the third processing unit is specifically used for:

[0193] Based on the candidate relationship, the first entity, and the second entity, multiple fourth extraction information are obtained;

[0194] Based on the information from the fourth extraction, the corresponding matching score is obtained;

[0195] Based on the matching score, the third extraction information is obtained from multiple fourth extraction information.

[0196] Here, by introducing a scoring and matching mechanism, the matching scores can be used to quantitatively evaluate each candidate data object, and filtering can be performed based on the score threshold. This can filter out unreasonable combinations caused by entity or relationship identification errors, significantly eliminate low-confidence noise data, and thus improve the accuracy and reliability of the final output third-party extracted information.

[0197] In some cases, the third processing unit is also specifically used for:

[0198] The fourth extraction information is input into the first extraction model to score the fourth extraction information and output the corresponding matching score; wherein, the first extraction model is a global pointer network, which is trained by data object samples and the first annotation information corresponding to the data object samples. The first annotation information includes the candidate relationship, the first entity and the second entity corresponding to the data object.

[0199] Because the first extraction model employs a global pointer network and is trained under supervision using first-label information containing candidate relations and dual entities, it can globally perceive the inherent connections between different combinations of entities and relations in a sentence. During scoring, it can effectively capture semantic-level matching, outputting more objective and accurate matching scores, thereby improving the overall accuracy of joint extraction and reasoning.

[0200] In some cases, the third processing unit is also specifically used for:

[0201] Based on the first entity threshold, the second entity threshold, and the matching score threshold, multiple fourth extraction information are filtered to obtain third extraction information.

[0202] By setting independent first entity threshold, second entity threshold, and matching score threshold, the overall semantic matching degree between subject entities, object entities, and relational entity pairs is assessed from three dimensions. Compared to filtering methods using a single total score, this multi-dimensional constraint can capture the prediction confidence at different stages, and only candidate data objects that pass the verification of all three thresholds are output. This mechanism can effectively filter out noisy candidates with fuzzy single-sided entity recognition or low confidence in relation pairing, improving the accuracy of the final output third extracted information.

[0203] In some cases, the second processing unit is specifically used for:

[0204] The first text and the first extraction information are input into the second extraction model to extract the first text under the constraint of the first extraction information and output the second extraction information. The second extraction model is trained by data object samples and the second annotation information corresponding to the data object samples. The second annotation information includes the entity boundary annotation information corresponding to the data object.

[0205] This paper uses the acquired candidate relations as prior constraints to input into the second extraction model. This strategy of using relations to guide entities can effectively reduce the entity search space of the model, avoid the problem of spatial mismatch between relations and entities, and further improve the accuracy of entity boundary prediction.

[0206] In some cases, before the second processing unit is specifically used to input the first text and the first extraction information into the second extraction model to extract the first text under the constraint of the first extraction information and output the second extraction information, the above-mentioned apparatus further includes a training unit for:

[0207] Obtain the initial second extraction model;

[0208] Obtain data object samples and second annotation information;

[0209] Based on the data object samples and the second annotation information, the initial second extraction model is trained to obtain the trained second extraction model.

[0210] Based on the data object samples and the second annotation information, the trained second extraction model is trained a second time to obtain the second extraction model; wherein, the second training is reinforcement learning training, which includes a reward signal, and the reward signal represents the degree of matching between the predicted entity boundary and the labeled entity boundary.

[0211] This paper proposes a two-stage training strategy: first, training the second extraction model with labeled data to develop its basic capabilities; then, fine-tuning it using reinforcement learning signals. This combines traditional cross-entropy loss with the reward feedback mechanism of reinforcement learning. This two-stage training strategy not only ensures that the model can quickly converge and learn the basic distribution of entity boundaries in the early stages, but also further narrows the consistency between the predicted and true boundaries in the later stages through reward signals. This overcomes the limitations of conventional single-training modes in finely adjusting boundary accuracy.

[0212] In some cases, the training unit is specifically used for:

[0213] A training sample set is obtained based on data object samples and second annotation information; wherein, the training sample set includes positive samples and negative samples, positive samples include entity spans corresponding to the second annotation information, and negative samples include non-entity spans corresponding to the second annotation information;

[0214] Based on the training sample set, the initial second extraction model is trained first to obtain the trained second extraction model.

[0215] Here, this paper constructs a training sample set containing positive samples (entity span) and negative samples (non-entity span), which effectively solves the problem of severe imbalance between positive and negative samples in entity extraction tasks. The introduction of negative samples forces the model to learn the boundary features that distinguish between non-entity and entity, enhances the model's robustness to interference terms, and reduces the false positive rate of entity extraction.

[0216] In some cases, the first processing unit is specifically used for:

[0217] Based on the first text, obtain the first encoded sequence;

[0218] Based on the placeholders and the first encoding sequence, obtain the second encoding sequence;

[0219] Based on the second encoded sequence, a first extraction process is performed to obtain the first extraction information.

[0220] By introducing placeholders and fusing them with the first encoding sequence to generate the second encoding sequence, the model is essentially given specific task instructions during the text semantic encoding stage. This pre-processing approach enables the underlying encoder to extract features more effectively and better capture the contextual semantic features required for implicit relationships, thus providing a better input representation for subsequent candidate relationship extraction.

[0221] To implement the above embodiments, this document also provides an electronic device.

[0222] refer to Figure 9 The diagram illustrates the structure of an electronic device 900 suitable for implementing this document, which can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, personal digital assistants (PDAs), tablet computers, portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 9 The electronic device shown is merely an example and should not impose any limitations on the functionality and scope of this article.

[0223] like Figure 9 As shown, the electronic device 900 may include a processing unit 901 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory 902 (ROM) or a program loaded from a storage device 908 into a random access memory 903 (RAM). The random access memory 903 also stores various programs and data required for the operation of the electronic device 900. The processing unit 901, the read-only memory 902, and the random access memory 903 are interconnected via a bus 904. An input / output interface 905 is also connected to the bus 904.

[0224] Typically, the following devices can be connected to the input / output interface 905: input devices 906 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 907 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 908 including, for example, magnetic tape, hard disk, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 9 An electronic device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0225] In particular, according to embodiments herein, the processes described in the above-referenced flowcharts can be implemented as computer software programs. For example, embodiments herein include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 909, or installed from storage device 908, or installed from read-only memory 902. When the computer program is executed by processing device 901, it performs the functions defined in the methods herein.

[0226] It should be noted that the computer-readable storage medium described herein can be a computer-readable signal medium, a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this document, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable storage medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0227] The aforementioned computer-readable storage medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0228] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the method shown in the above embodiments.

[0229] Computer program code for performing the operations described herein can be written in one or more programming languages ​​or a combination thereof. These programming languages ​​include object-oriented programming languages—such as Java, Smalltalk, and C++—as well as conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0230] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments herein. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0231] The units described herein can be implemented in software or hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".

[0232] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.

[0233] This paper presents an electronic device, computer-readable storage medium, and computer program product that achieves accurate data object extraction through a three-stage extraction method. Specifically, for the first text, candidate relationships are first extracted from the text. Then, entities are extracted from the text using the candidate relationships as constraints. Finally, matching data objects are obtained based on the extracted candidate relationships and entities. By first extracting candidate relationships and then using them to constrain subsequent entity extraction steps, the entity extraction stage has a clear relationship orientation, avoiding the blind extraction of entities unrelated to candidate relationships. This improves the targeting and accuracy of entity extraction. By combining candidate relationships and entities to obtain data objects, a refined screening from multiple candidates to high-quality data objects is achieved. Compared with end-to-end or two-stage solutions in related technologies, which suffer from error accumulation and decreased accuracy due to task coupling, this method improves the accuracy of data extraction through hierarchical decoupling and step-by-step matching and screening.

[0234] The above description is merely a preferred embodiment and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure herein is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed herein that have similar functions.

[0235] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in sequential order. Multitasking and parallel processing may be advantageous in certain environments. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this document. Certain features described in the context of a single embodiment may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0236] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A data processing method, comprising: Get the first text; Based on the first text, first extraction information is obtained; wherein, the first extraction information includes at least one candidate relationship in the first text; Based on the first text and the first extraction information, second extraction information is obtained; wherein the second extraction information includes at least one entity in the first text; wherein the entity includes a first entity and a second entity; Based on the first extraction information and the second extraction information, third extraction information is obtained; wherein, the third extraction information includes at least one data object; the data object includes the candidate relationship, and the first entity and the second entity corresponding to the candidate relationship.

2. The method according to claim 1, wherein obtaining the third extraction information based on the first extraction information and the second extraction information comprises: Based on the candidate relationship, the first entity, and the second entity, multiple fourth extraction information are obtained; Based on the fourth extraction information, the corresponding matching score is obtained; The third extraction information is obtained from the plurality of fourth extraction information based on the matching score.

3. The method according to claim 2, wherein obtaining the corresponding matching score based on the fourth extraction information includes: The fourth extraction information is input into the first extraction model to score the fourth extraction information and output the corresponding matching score; wherein, the first extraction model is a global pointer network, and the first extraction model is trained by data object samples and the first annotation information corresponding to the data object samples. The first annotation information includes the candidate relationship, the first entity and the second entity corresponding to the data object.

4. The method according to claim 3, wherein obtaining the third extraction information from the plurality of fourth extraction information based on the matching score includes: The plurality of fourth extraction information is filtered based on the first entity threshold, the second entity threshold, and the matching score threshold to obtain the third extraction information.

5. The method according to any one of claims 1 to 4, wherein obtaining the second extraction information based on the first text and the first extraction information comprises: The first text and the first extraction information are input into the second extraction model to extract the first text under the constraint of the first extraction information and output the second extraction information; wherein, the second extraction model is trained by data object samples and the second annotation information corresponding to the data object samples, and the second annotation information includes the entity boundary annotation information corresponding to the data object.

6. The method according to claim 5, further comprising, before inputting the first text and the first extraction information into the second extraction model to extract the first text under the constraint of the first extraction information and outputting the second extraction information: Obtain the initial second extraction model; Obtain the data object sample and the second annotation information; Based on the data object sample and the second annotation information, the initial second extraction model is first trained to obtain the trained second extraction model; Based on the data object sample and the second annotation information, the trained second extraction model is subjected to a second training to obtain the second extraction model; wherein, the second training is reinforcement learning training, and the reinforcement learning training includes a reward signal, which represents the degree of matching between the predicted entity boundary and the labeled entity boundary.

7. The method according to claim 6, wherein the step of performing a first training on the initial second extraction model based on the data object sample and the second annotation information to obtain a trained second extraction model includes: A training sample set is obtained based on the data object sample and the second annotation information; wherein, the training sample set includes positive samples and negative samples, the positive samples include the entity span corresponding to the second annotation information, and the negative samples include the non-entity span corresponding to the second annotation information; Based on the training sample set, the initial second extraction model is trained to obtain the trained second extraction model.

8. The method according to any one of claims 1 to 4, wherein obtaining the first extraction information based on the first text comprises: Based on the first text, obtain the first encoded sequence; Based on the placeholders and the first encoding sequence, the second encoding sequence is obtained; Based on the second encoded sequence, a first extraction process is performed to obtain the first extracted information.

9. A data processing apparatus, comprising: The first acquisition unit is used to acquire the first text; A first processing unit is configured to obtain first extraction information based on the first text; wherein the first extraction information includes at least one candidate relationship in the first text; The second processing unit is configured to obtain second extraction information based on the first text and the first extraction information; wherein the second extraction information includes at least one entity in the first text; wherein the entity includes a first entity and a second entity; The third processing unit is configured to obtain third extraction information based on the first extraction information and the second extraction information; wherein the third extraction information includes at least one data object; the data object includes the candidate relationship, and the first entity and the second entity corresponding to the candidate relationship.

10. An electronic device, comprising: Processor and memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1 to 8.