Rich text content conversion method and device, processor and storage medium
By training a model to extract knowledge triples from rich text and fusing them with a knowledge graph, structured content is generated and verified. This solves the problems of poor accuracy and consistency in rich text conversion in existing technologies and achieves high-quality structured data output.
Patent Information
- Application Number
- CN202511672255.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2026-02-10
AI Technical Summary
In existing technologies, the accuracy and consistency of converting rich text into structured data are poor, resulting in low conversion quality.
The trained model extracts knowledge triples from rich text content and merges them with the knowledge graph to generate structured content. After consistency verification and optimization, the model identifies entities, relationships and feature information through long short-term memory networks and deep learning models, and uses the knowledge graph for verification and reconstruction.
It improves the accuracy and reliability of rich text conversion, ensures high-quality output data, and achieves efficient format conversion to knowledge conversion through a self-correction mechanism.
Smart Images

Figure CN121503477A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a rich text content conversion method, a rich text content conversion device, a processor, a machine-readable storage medium, and a computer program product. Background Technology
[0002] In the information society, a large amount of knowledge and data exists in unstructured documents, such as various reports, technical documents, and research papers. This content is mostly in rich text formats (such as Microsoft Word, PDF, and HTML). In application scenarios such as data exchange, system integration, knowledge base construction, and intelligent analysis, the use of machine-readable and processable structured data formats (such as XML, JSON, or specific knowledge graph patterns) is generally required.
[0003] In existing technologies, rich text is typically parsed into an intermediate structure, information is extracted through iteration, and finally, structured data is regenerated according to the target format. This method results in poor accuracy and consistency after conversion to structured content, leading to low conversion quality. Summary of the Invention
[0004] The purpose of this application is to provide a rich text content conversion method, apparatus, processor, storage medium, and machine-readable storage medium.
[0005] To achieve the above objectives, the first aspect of this application provides a rich text content conversion method, which includes: extracting rich text content using a trained model to obtain knowledge triples to be converted; fusing and updating the knowledge triples to be converted with historical knowledge in a knowledge graph to obtain an updated knowledge graph; simultaneously generating structured content from the knowledge triples to be converted according to a preset logical structure; verifying the structured content to obtain a verification result; wherein the verification process includes at least performing a consistency verification on the structured content using the updated knowledge graph; and if the verification result does not meet preset requirements, reconstructing the structured content into verification text content and optimizing the structured content using the verification text content.
[0006] In this embodiment of the application, the knowledge triple includes entity information, relation information, and feature information.
[0007] In this embodiment of the application, the extraction of rich text content using a trained model includes: extracting entity information and relational information from the rich text content using a long short-term memory network model; and extracting feature information from the rich text content using a hybrid model that integrates a rule engine and a deep learning model.
[0008] In this embodiment of the application, the step of fusing and updating the knowledge triples to be converted with historical knowledge in the knowledge graph to obtain an updated knowledge graph includes: constructing an association model using the knowledge graph, and determining the potential association between the knowledge triples to be converted and historical triples based on the association model; wherein, the historical knowledge includes historical triples; and fusing and updating the knowledge graph based on the potential association.
[0009] In this embodiment of the application, the verification process further includes at least one of the following: determining the confidence score when extracting the knowledge triples to be converted from the rich text content; determining the information density of the structured content; wherein the information density is determined based on the ratio of the length of the rich text content to the number of knowledge triples extracted from it; and determining the source reliability of the rich text content.
[0010] In this embodiment of the application, the step of using the updated knowledge graph to perform consistency verification on the structured content includes: parsing structured knowledge triples with timestamp information from the structured content; querying the historical evolution pattern of entities related to the structured knowledge triples in the updated knowledge graph; calculating the consistency confidence of the structured knowledge triples in the time dimension based on the historical evolution pattern; and using the consistency confidence as the consistency verification result.
[0011] In this embodiment of the application, determining whether the verification result meets the preset requirements includes: performing a weighted calculation on the confidence score, information density, consistency verification result and source reliability information to obtain a quality score; when the quality score is lower than a preset threshold, it is determined that the structured content does not meet the preset requirements.
[0012] A second aspect of this application provides a rich text content conversion device, comprising: an extraction module for extracting rich text content using a trained model to obtain knowledge triples to be converted; an update module for fusing and updating the knowledge triples to be converted with historical knowledge in a knowledge graph to obtain an updated knowledge graph; a structured generation module for simultaneously generating structured content from the knowledge triples to be converted according to a preset logical structure; a verification module for verifying the structured content to obtain a verification result; wherein the verification process includes at least a consistency verification of the structured content using the updated knowledge graph; and an optimization module for reconstructing the structured content into verification text content and optimizing the structured content using the verification text content if the verification result does not meet preset requirements.
[0013] In this embodiment of the application, the knowledge triple includes entity information, relation information, and feature information.
[0014] In this embodiment of the application, the extraction of rich text content using a trained model includes: extracting entity information and relational information from the rich text content using a long short-term memory network model; and extracting feature information from the rich text content using a hybrid model that integrates a rule engine and a deep learning model.
[0015] In this embodiment of the application, the step of fusing and updating the knowledge triples to be converted with historical knowledge in the knowledge graph to obtain an updated knowledge graph includes: constructing an association model using the knowledge graph, and determining the potential association between the knowledge triples to be converted and historical triples based on the association model; wherein, the historical knowledge includes historical triples; and fusing and updating the knowledge graph based on the potential association.
[0016] In this embodiment of the application, the verification process further includes at least one of the following: determining the confidence score when extracting the knowledge triples to be converted from the rich text content; determining the information density of the structured content; wherein the information density is determined based on the ratio of the length of the rich text content to the number of knowledge triples extracted from it; and determining the source reliability of the rich text content.
[0017] In this embodiment of the application, the step of using the updated knowledge graph to perform consistency verification on the structured content includes: parsing structured knowledge triples with timestamp information from the structured content; querying the historical evolution pattern of entities related to the structured knowledge triples in the updated knowledge graph; calculating the consistency confidence of the structured knowledge triples in the time dimension based on the historical evolution pattern; and using the consistency confidence as the consistency verification result.
[0018] In this embodiment of the application, determining whether the verification result meets the preset requirements includes: performing a weighted calculation on the confidence score, information density, consistency verification result and source reliability information to obtain a quality score; when the quality score is lower than a preset threshold, it is determined that the structured content does not meet the preset requirements.
[0019] A third aspect of this application provides a processor configured to perform the rich text content conversion method described above.
[0020] A fourth aspect of this application provides a machine-readable storage medium storing instructions that, when executed by a processor, configure the processor to perform the rich text content conversion method described above.
[0021] The fifth aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the rich text content conversion method described above.
[0022] The technical solution provided in this application has at least the following technical effects: The rich text content conversion method of this application pre-trains an extraction model and uses this trained model to extract rich text content, obtaining knowledge triples to be converted, achieving both format recognition and semantic understanding. Next, the knowledge triples to be converted are fused and updated with historical knowledge in a knowledge graph to obtain an updated knowledge graph, constructing a dynamic knowledge center to provide the latest basis for subsequent verification. Simultaneously, the knowledge triples to be converted are used to generate structured content according to a preset logical structure and then verified. The use of the updated knowledge graph for consistency verification automatically identifies and corrects factual and logical errors, ensuring the accuracy of the output data. Finally, if the verification results do not meet the preset requirements, the structured content is reconstructed into verification text content, which is then used to optimize the structured content. This forms a feedback loop, enabling self-correction and ensuring high-quality final output. Therefore, the rich text content conversion method provided in this application can improve the accuracy and reliability of rich text content conversion and enhance conversion quality.
[0023] Other features and advantages of the embodiments of this application will be described in detail in the following detailed description section. Attached Figure Description
[0024] The accompanying drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the following detailed description to explain the embodiments of this application, but do not constitute a limitation on the embodiments of this application. In the drawings: Figure 1 A flowchart illustrating a rich text content conversion method according to an embodiment of this application is shown schematically. Figure 2 A schematic diagram of a rich text content conversion apparatus according to an embodiment of this application is shown. Figure 3 The diagram illustrates the internal structure of a computer device according to an embodiment of this application.
[0025] Explanation of reference numerals in the attached figures 200-Rich text content conversion device; 201-Extraction module; 202-Update module; 203-Structured generation module; 204-Verification module; 205-Optimization module; A01-Processor; A02-Network interface; A03-Internal memory; A04-Non-volatile storage medium; B01-Operating system; B02-Computer program. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for illustration and explanation of the embodiments of this application and are not intended to limit the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0027] It should be noted that if the embodiments of this application involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.
[0028] Furthermore, if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0029] The acquisition, transmission, storage, use, and processing of data in this application comply with relevant national laws and regulations. Furthermore, it should be noted that existing industry solutions such as software, components, and models may be mentioned in the embodiments of this application. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solution of this application, and do not imply that the applicant has already used or necessarily used such solutions.
[0030] Figure 1 The illustration shows a flowchart of a rich text content conversion method according to an embodiment of this application. Figure 1As shown, in one embodiment of this application, a rich text content conversion method is provided. The rich text content conversion method includes: S101: extracting rich text content using a trained model to obtain knowledge triples to be converted; S102: fusing and updating the knowledge triples to be converted with historical knowledge in a knowledge graph to obtain an updated knowledge graph; S103: simultaneously generating structured content from the knowledge triples to be converted according to a preset logical structure; S104: verifying the structured content to obtain a verification result; wherein, the verification process includes at least using the updated knowledge graph to perform consistency verification on the structured content; S105: if it is determined that the verification result does not meet the preset requirements, reconstructing the structured content into verification text content, and optimizing the structured content using the verification text content.
[0031] Specifically, in this embodiment, rich text content is collected from multiple sources, such as project proposals, requirements analysis specifications, and detailed design specifications. By collecting data from various data sources and file types, the comprehensiveness, timeliness, and accuracy of the collected data are ensured. Then, data cleaning is performed to remove irrelevant information from the text, such as watermarks and annotations. Preprocessing operations such as word segmentation, stop word removal, and part-of-speech tagging are also performed, while spelling and grammatical errors are addressed. Natural language processing technology is used to identify entities (such as organizations and products) from the text, classify and label them, identify relationships between entities (such as ownership and association relationships), and extract entity feature information (such as organization information and product attributes). Finally, a high-quality labeled corpus is constructed, and a deep learning model for knowledge extraction is trained.
[0032] Once the rich text content is input, a trained model extracts it. First, key entities are identified, such as "Borrowing Company A," "Guarantor B," and "Collateral C." Next, relationships between entities are extracted, such as (Borrowing Company A, applying for a loan of 50 million) and (Guarantor B, providing a guarantee for Borrowing Company A). Simultaneously, feature information is identified, such as event information like "data exchange" and "risk assessment," or attribute information like "registered capital" and "establishment date," resulting in knowledge triples to be converted. These triples constitute the core knowledge framework of the rich text content.
[0033] This application pre-constructs a preliminary knowledge graph based on preset knowledge and historical knowledge triples. The knowledge graph can be specific to a particular field (such as finance) or applicable to all fields. It contains massive amounts of historical enterprise information, relationships, product attributes, and preset knowledge, as well as information such as charts, logos, and signatures from documents. The knowledge triples extracted in the previous step are then integrated with this knowledge graph: first, entity alignment is performed to determine if "Borrowing Company A" already exists in the graph; if so, it is associated. Then, relationship supplementation is performed, adding a new relationship (Borrowing Company A, Loan Application, 50 million) to the entity node. If conflicting information is found (such as the discrepancy between the registered capital of "Borrowing Company A" and the report in the graph), it is marked. The knowledge graph can be updated in real time, forming an updated knowledge graph containing the latest information, providing an authoritative benchmark for subsequent verification.
[0034] Based on a pre-defined logical structure template (such as JSON or XML format specifications), the triples of knowledge to be transformed are populated and rendered, generating a preliminary structured content. Subsequently, post-processing is performed on the preliminary structured content, such as removing duplicate information and merging similar entities, to improve data quality. The generated structured content undergoes multi-dimensional validation. First, data format validation is performed to ensure the basic standardization of the structured content, including: Structure validation: such as JSON / XML format validation, ensuring the generated structured content conforms to correct key-value pairs, array representations, or closing tags; Field validation: checking for missing required fields and whether the length of fields such as strings is within the allowed range; Data type validation: verifying that the data type of each field meets expectations, such as integers, floating-point numbers, strings, or dates; Encoding validation: uniformly using UTF-8 character encoding to avoid garbled characters.
[0035] Secondly, data consistency verification is performed. This is a core step to ensure the logical correctness of the content and its consistency with business facts. It is divided into two levels: internal and external. Internal consistency verification checks the logical self-consistency of the structured content itself. For example, it checks whether the relationships between entities described in the content (such as parent-child relationships) are contradictory, or whether the order of multiple timestamps is reasonable. External consistency verification compares the structured content with the updated knowledge graph. For example, querying the updated knowledge graph reveals that "Guarantor B" has a credit rating of "C-", while "Borrower A" in the report has a credit rating of "AA+", and the two are recorded as parent-subsidiary relationships in the graph. According to the preset financial business rules, this constitutes a significant risk, and the system will determine that this external consistency verification fails. All verification results (including errors, warnings, and pass information) are recorded in detail, and a comprehensive verification report is generated, providing a clear basis for subsequent optimization and adjustments.
[0036] When the validation report shows errors that do not meet preset requirements, the initially generated structured content is reconstructed into a more easily understandable validation text. This text is then used to optimize the structured content through preset rules or by re-invoking the model. Keyword matching or semantic analysis is used to align relevant information fragments in the validation text with the various fields of the structured content. When inconsistencies are found between the validation text and the structured content, newer and more reliable information is prioritized to correct the structured content based on preset strategies such as timestamps and source credibility. Additional information in the validation text is used to complete missing fields in the structured content or add contextual data, thereby comprehensively enhancing the accuracy, completeness, and timeliness of the structured content. The optimized structured content is validated again until it meets the requirements, ultimately outputting high-quality, highly reliable structured data.
[0037] The rich text content conversion method provided in this application achieves knowledge conversion from format conversion through knowledge extraction and knowledge graph verification mechanisms. It not only understands the deep semantics of the text but also automatically identifies and corrects factual errors and logical contradictions in the content by comparing it with authoritative knowledge bases, thereby eliminating the generation of junk data at the source and improving the accuracy and reliability of the conversion. An intelligent feedback closed loop of verification-reconstruction-optimization is constructed. When the conversion result is unsatisfactory, it can simulate the review and correction process of human experts, performing self-correction and iteration to ensure the high quality of the final output, achieving adaptive optimization and quality closed-loop control of the conversion process.
[0038] In one embodiment, the knowledge triple includes entity information, relation information, and feature information.
[0039] In one embodiment, the extraction of rich text content using a trained model includes: extracting entity information and relational information from the rich text content using a long short-term memory network model; and extracting feature information from the rich text content using a hybrid model that integrates a rule engine and a deep learning model.
[0040] Specifically, in this embodiment, differentiated models are used for extraction based on the characteristics of different knowledge elements. For identifying and extracting the core entities and their interrelationships in the text, a sequence labeling model based on Long Short-Term Memory (LSTM) is configured. After rich text content is input, the LSTM model can effectively capture the contextual dependencies in the text, thereby accurately identifying key entity information, such as "borrowing company A" and "guarantor B," and simultaneously extracting the relationship information between them, such as (borrowing company A, applying for a loan, 50 million) and (guarantor B, providing a guarantee, borrowing company A). Meanwhile, to handle more complex and semantically deeper information, a hybrid model integrating a rule engine and a deep learning model is adopted. This model first uses predefined business rules (such as regular expressions or keyword triggers) to quickly locate fragments in the text that may contain feature information, such as locating statements like "registered capital: 100 million yuan" or "data exchange completed in 2023." Subsequently, the deep learning model performs refined semantic analysis on these located fragments, accurately extracting the knowledge triples to be transformed, namely (borrowing company A, registered capital, 100 million yuan) and (borrowing company A, trigger, risk assessment).
[0041] The rich text content conversion method provided in this application can efficiently and comprehensively extract multi-dimensional knowledge such as entities, relationships, and attributes from rich text, ensuring the breadth and depth of knowledge extraction.
[0042] In one embodiment, the step of fusing and updating the knowledge triples to be converted with historical knowledge in the knowledge graph to obtain an updated knowledge graph includes: constructing an association model using the knowledge graph, and determining the potential associations between the knowledge triples to be converted and historical triples based on the association model; wherein the historical knowledge includes historical triples; and fusing and updating the knowledge graph based on the potential associations.
[0043] Specifically, in this embodiment, an existing knowledge graph containing a large number of historical triples is used to train an association model capable of calculating the strength of associations between entities, quantifying the semantic or topological similarity between any two entities in the graph. The model can be built based on graph embedding algorithms (such as TransE, RotatE) or graph neural networks (GNNs), capable of mapping entities and relationships in the graph to a low-dimensional vector space and quantifying their semantic similarity or topological association through vector operations. When extracting the knowledge triples to be converted from new rich text content (e.g., (Borrowing Company A, Loan Application, 50 million)), the entity "Borrowing Company A" in the triple is input into the trained association model. The association model quickly retrieves and calculates all potential associations between historical entities and "Borrowing Company A" in the knowledge graph, outputting a list of candidate entities and their association scores. For example, the association model might determine that the association score between the entity "XX Technology Co., Ltd." and "Borrowing Company A" in the graph is 0.95, thus indicating that they may refer to the same real-world object. Based on the potential associations determined by the association model, the knowledge graph is fused and updated: if the association degree exceeds the preset threshold, entity alignment is performed, the triple to be transformed is associated with the "XX Technology Co., Ltd." node in the knowledge graph, and the new relationship "apply for a loan of 50 million" is added to the node, thereby updating the knowledge graph; if the association degree is lower than the threshold, the triple is added to the graph as new knowledge, expanding the coverage of the graph.
[0044] The rich text content conversion method provided in this application, through an association model, does not rely on simple string matching for entity alignment. Instead, it deeply understands the semantic and contextual relationships between entities, effectively solving the problem of entity recognition errors caused by aliases, abbreviations, or description differences. This improves the quality of knowledge graph updates and enhances the accuracy and intelligence of knowledge fusion. When new rich text content is processed, the knowledge graph can automatically and accurately absorb new knowledge, correcting or supplementing existing knowledge, maintaining timeliness and completeness, avoiding knowledge base obsolescence, and realizing dynamic and adaptive growth of the knowledge graph, providing a reliable data foundation for subsequent verification steps.
[0045] In one embodiment, the step of fusing and updating the knowledge triples to be transformed with historical knowledge in the knowledge graph to obtain an updated knowledge graph includes: performing counterfactual reasoning on the knowledge triples to be transformed based on preset knowledge in the knowledge graph to simulate the causal impact of changes in specific entity information or relationship information on the knowledge graph; and updating the knowledge graph based on the causal impact.
[0046] Specifically, in this implementation, after obtaining the knowledge triple to be transformed, such as (Xiaoming, application, credit card), the knowledge triple is integrated into a knowledge graph. Pre-defined knowledge within the knowledge graph is invoked, including numerous causal rules extracted from historical data and expert experience. For example, "If a person applies for a credit card for the first time, their willingness to spend in the short term may increase, while the risk of future overdue payments will also increase." Based on this pre-defined knowledge, counterfactual reasoning is performed on the knowledge triple to be transformed, simulating a scenario contrary to the facts, such as: "What would happen if Xiaoming hadn't applied for this credit card?" By comparing the differences in the knowledge graph states between the facts and the counterfactual, the causal impact of this application event is determined. For example, Xiaoming's "spending capacity" attribute value may increase, the "credit risk level" attribute value may change from "low" to "low-medium," and Xiaoming's "consumption frequency" relationship with the "e-commerce platform" may increase. Finally, the new knowledge or risk labels derived from the causal impact are updated in the knowledge graph. This not only records the fact that "Xiaoming applied for a credit card," but also deeply understands and integrates the complex causal logic behind this fact, making the knowledge graph update forward-looking and insightful.
[0047] In one embodiment, the verification process further includes at least one of the following: determining a confidence score when extracting the knowledge triples to be converted from the rich text content; determining the information density of the structured content; wherein the information density is determined based on the ratio of the length of the rich text content to the number of knowledge triples extracted from it; and determining the source reliability of the rich text content.
[0048] Specifically, in the embodiments of this application, a more comprehensive and in-depth quality assessment of structured content can be performed. Besides consistency verification, the quality assessment includes at least the following three aspects: First, determining the confidence score of knowledge extraction and evaluating the quality of structured content based on the confidence score. When the deep learning model extracts each knowledge triple to be transformed from rich text content, the model simultaneously outputs a confidence score, which quantifies the model's certainty regarding the extraction result. For example, for the triple (borrowing company A, applying for a loan, 50 million), the model might give a score of 0.98, while for a vaguely defined relation, it might only give a score of 0.65. Second, determining the information density of the structured content and evaluating the quality of structured content based on the information density. Information density is quantified by calculating the ratio of the total length of the rich text content to the number of knowledge triples successfully extracted from it. For example, a 10,000-word report with only ten triples extracted has a much lower information density than a 1,000-word report with fifty triples. Low density may indicate redundant source text or poor extraction model performance. Third, determine the reliability of the rich text content's source and assess the quality of structured content based on this reliability. Pre-determine a reliability rating for different information sources, such as official documents > academic papers > news reports > social media. During comprehensive verification, these assessment results will be integrated into the final verification report. For example, structured content generated from a highly reliable source with high confidence scores for all triples will have a higher overall quality rating; conversely, if the content source has low reliability and insufficient information density, even if the format verification passes, it will be marked as requiring manual review.
[0049] The rich text content conversion method provided in this application can intuitively identify uncertainties in the conversion process through confidence scores, providing precise guidance for subsequent manual review or model optimization. Information density effectively assesses the value of the source text and the efficiency of the extraction model, helping users quickly determine the core value of the converted content and avoiding wasting processing resources on information-sparse content, thereby optimizing the overall data processing workflow. Source reliability enables the verification process to be traceable and trackable, allowing for control of data quality from the source, which is crucial for fields such as finance and law where data source requirements are extremely stringent. Combining these dimensions enables comprehensive quality assessment, ensuring that the output structured content is not only formatted correctly but also guarantees content quality, information value, and source credibility, thus improving the reliability and usability of the final data.
[0050] In one embodiment, the consistency verification of the structured content using the updated knowledge graph includes: parsing structured knowledge triples with timestamp information from the structured content; querying the historical evolution patterns of entities related to the structured knowledge triples in the updated knowledge graph; calculating the consistency confidence of the structured knowledge triples in the time dimension based on the historical evolution patterns; and using the consistency confidence as the consistency verification result.
[0051] Specifically, in this embodiment, structural knowledge triples with explicit timestamp information can be parsed from rich text content, such as (Borrowing Company A, Credit Rating, AA+, Timestamp: December 2023). Then, in updating the knowledge graph, using "Borrowing Company A" as the core entity, all historical triples related to "Credit Rating" are queried, thereby constructing a historical evolution pattern of the entity's credit rating, such as (Borrowing Company A, Credit Rating, A, Timestamp: December 2021) --- (Borrowing Company A, Credit Rating, AA-, Timestamp: December 2022). Based on this continuous, upward-trending historical evolution pattern, the consistency confidence of the new structural knowledge triples in the time dimension is calculated. Since the improvement from AA- to AA+ conforms to its steady improvement trend, the triple will obtain a high consistency confidence. Conversely, if the new triple shows that the rating of "Borrowing Company A" suddenly drops to C, it does not conform to the historical evolution pattern, thus obtaining a low consistency confidence. Finally, the consistency confidence score is used as the result of consistency verification, reflecting the credibility of the structured content in terms of time logic. Furthermore, historical evolution patterns can be used to predict the changing trends of feature and relational information, and the prediction results can be stored as forward-looking knowledge in a knowledge graph or used for risk warning.
[0052] The rich text content conversion method provided in this application can not only verify whether a fact exists in the graph, but also determine whether the fact is reasonable at a specific point in time, and identify potentially abnormal data that is formatted correctly but contradicts historical development patterns. It automatically captures subtle early risk signals, enhancing risk warning capabilities. It identifies logical contradictions behind the data, thus ensuring that structured content is not only grammatically and factually correct, but also logically and temporally reliable, providing a reliable data foundation for subsequent processing.
[0053] In one embodiment, determining whether the verification result meets the preset requirements includes: performing a weighted calculation on the confidence score, information density, consistency verification result, and source reliability information to obtain a quality score; when the quality score is lower than a preset threshold, it is determined that the structured content does not meet the preset requirements.
[0054] Specifically, in this embodiment, the confidence score, information density, consistency verification result, and source reliability generated from the aforementioned multiple verification dimensions are obtained. Based on the needs of different application scenarios, a preset weight coefficient is assigned to each of these four indicators. For example, in a financial risk control scenario, the weights of consistency verification result and source reliability information are set higher, while the weight of information density is relatively lower. Next, the value of each indicator is multiplied by its corresponding weight and then summed to calculate the final quality score of the structured content. The quality score is compared with a preset quality threshold, for example, a threshold of 85 points. If the quality score is greater than or equal to 85 points, the structured content is determined to meet the preset requirements; if the quality score is lower than 85 points, the structured content is automatically determined to not meet the preset requirements and is marked as requiring manual review or re-conversion, thereby ensuring that only high-quality, highly reliable content can proceed to the next processing stage.
[0055] The rich text content conversion method provided in this application can convert the verification results of multiple dimensions into quantitative scores, making the evaluation more objective and improving the accuracy and consistency of the assessment. It can also adjust the weight of different indicators to adapt to the specific needs of different business scenarios.
[0056] Please refer to Figure 2 In one embodiment of this application, a rich text content conversion device 200 is provided. The rich text content conversion device 200 includes: an extraction module 201, used to extract rich text content using a trained model to obtain knowledge triples to be converted; an update module 202, used to fuse and update the knowledge triples to be converted with historical knowledge in a knowledge graph to obtain an updated knowledge graph; a structured generation module 203, used to simultaneously generate structured content from the knowledge triples to be converted according to a preset logical structure; a verification module 204, used to verify the structured content and obtain a verification result; wherein the verification process includes at least using the updated knowledge graph to perform consistency verification on the structured content; and an optimization module 205, used to reconstruct the structured content into verification text content and optimize the structured content using the verification text content if the verification result does not meet the preset requirements.
[0057] In one embodiment, the knowledge triple includes entity information, relation information, and feature information.
[0058] In one embodiment, the extraction of rich text content using a trained model includes: extracting entity information and relational information from the rich text content using a long short-term memory network model; and extracting feature information from the rich text content using a hybrid model that integrates a rule engine and a deep learning model.
[0059] In one embodiment, the step of fusing and updating the knowledge triples to be converted with historical knowledge in the knowledge graph to obtain an updated knowledge graph includes: constructing an association model using the knowledge graph, and determining the potential associations between the knowledge triples to be converted and historical triples based on the association model; wherein the historical knowledge includes historical triples; and fusing and updating the knowledge graph based on the potential associations.
[0060] In one embodiment, the verification process further includes at least one of the following: determining a confidence score when extracting the knowledge triples to be converted from the rich text content; determining the information density of the structured content; wherein the information density is determined based on the ratio of the length of the rich text content to the number of knowledge triples extracted from it; and determining the source reliability of the rich text content.
[0061] In one embodiment, the consistency verification of the structured content using the updated knowledge graph includes: parsing structured knowledge triples with timestamp information from the structured content; querying the historical evolution patterns of entities related to the structured knowledge triples in the updated knowledge graph; calculating the consistency confidence of the structured knowledge triples in the time dimension based on the historical evolution patterns; and using the consistency confidence as the consistency verification result.
[0062] In one embodiment, determining whether the verification result meets the preset requirements includes: performing a weighted calculation on the confidence score, information density, consistency verification result, and source reliability information to obtain a quality score; when the quality score is lower than a preset threshold, it is determined that the structured content does not meet the preset requirements.
[0063] The rich text content conversion device includes a processor and a memory. The extraction module, voiceprint feature information processing module, fusion module and image generation module are all stored in the memory as program units. The processor executes the program modules stored in the memory to implement the corresponding functions.
[0064] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and rich text conversion methods can be implemented by adjusting kernel parameters.
[0065] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0066] This application provides a processor configured to perform the rich text content conversion method described above.
[0067] This application provides a machine-readable storage medium storing instructions that, when executed by a processor, configure the processor to perform the rich text content conversion method described above.
[0068] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 3 As shown. Figure 3 This schematic diagram illustrates the internal structure of a computer device according to an embodiment of the present application. The computer device includes a processor A01, a network interface A02, a memory (not shown), and a database (not shown) connected via a system bus. The processor A01 provides computing and control capabilities. The memory includes internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02, and a database (not shown). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 stored in the non-volatile storage medium A04. The network interface A02 is used for communication with external terminals via a network connection. When the computer program B02 is executed by the processor A01, it implements a rich text content conversion method.
[0069] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0070] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program with the following steps: extracting rich text content using a trained model to obtain knowledge triples to be converted; fusing and updating the knowledge triples to be converted with historical knowledge in a knowledge graph to obtain an updated knowledge graph; simultaneously generating structured content from the knowledge triples to be converted according to a preset logical structure; verifying the structured content to obtain a verification result; wherein the verification process includes at least performing a consistency verification on the structured content using the updated knowledge graph; if it is determined that the verification result does not meet preset requirements, reconstructing the structured content into verification text content, and optimizing the structured content using the verification text content.
[0071] In one embodiment, the knowledge triple includes entity information, relation information, and feature information.
[0072] In one embodiment, the extraction of rich text content using a trained model includes: extracting entity information and relational information from the rich text content using a long short-term memory network model; and extracting feature information from the rich text content using a hybrid model that integrates a rule engine and a deep learning model.
[0073] In one embodiment, the step of fusing and updating the knowledge triples to be converted with historical knowledge in the knowledge graph to obtain an updated knowledge graph includes: constructing an association model using the knowledge graph, and determining the potential associations between the knowledge triples to be converted and historical triples based on the association model; wherein the historical knowledge includes historical triples; and fusing and updating the knowledge graph based on the potential associations.
[0074] In one embodiment, the verification process further includes at least one of the following: determining a confidence score when extracting the knowledge triples to be converted from the rich text content; determining the information density of the structured content; wherein the information density is determined based on the ratio of the length of the rich text content to the number of knowledge triples extracted from it; and determining the source reliability of the rich text content.
[0075] In one embodiment, the consistency verification of the structured content using the updated knowledge graph includes: parsing structured knowledge triples with timestamp information from the structured content; querying the historical evolution patterns of entities related to the structured knowledge triples in the updated knowledge graph; calculating the consistency confidence of the structured knowledge triples in the time dimension based on the historical evolution patterns; and using the consistency confidence as the consistency verification result.
[0076] In one embodiment, determining whether the verification result meets the preset requirements includes: performing a weighted calculation on the confidence score, information density, consistency verification result, and source reliability information to obtain a quality score; when the quality score is lower than a preset threshold, it is determined that the structured content does not meet the preset requirements.
[0077] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0078] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0079] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0080] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0081] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0082] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0083] Computer-readable media include both permanent and non-permanent, removable and non-removable media, which can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0084] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0085] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for rich text content conversion, characterized in that, The rich text content conversion method includes: The trained model is used to extract rich text content to obtain knowledge triples to be converted; The knowledge triples to be converted are merged and updated with historical knowledge in the knowledge graph to obtain an updated knowledge graph; At the same time, the knowledge triples to be transformed will be used to generate structured content according to the preset logical structure; The structured content is validated to obtain a validation result; wherein, the validation process includes at least using the updated knowledge graph to perform a consistency check on the structured content; If the verification result does not meet the preset requirements, the structured content is reconstructed into verification text content, and the structured content is optimized using the verification text content.
2. The rich text content conversion method according to claim 1, characterized in that, The knowledge triple includes entity information, relation information, and feature information.
3. The rich text content conversion method according to claim 2, characterized in that, The extraction of rich text content using a trained model includes: Entity and relation information are extracted from the rich text content using a long short-term memory network model; Feature information is extracted from the rich text content using a hybrid model that integrates a rule engine and a deep learning model.
4. The rich text content conversion method according to claim 1, characterized in that, The process of fusing and updating the knowledge triples to be converted with historical knowledge in the knowledge graph to obtain an updated knowledge graph includes: A correlation model is constructed using the knowledge graph, and the potential correlation between the knowledge triples to be transformed and historical triples is determined based on the correlation model; wherein, the historical knowledge includes historical triples; the correlation model is configured to calculate the correlation strength between different entities; The knowledge graph is fused and updated based on the potential associations.
5. The rich text content conversion method according to claim 1, characterized in that, The verification process also includes at least one of the following: Determine the confidence score when extracting the knowledge triples to be transformed from the rich text content; The information density of the structured content is determined; wherein the information density is determined based on the ratio of the length of the rich text content to the number of knowledge triples extracted from it; Determine the reliability of the source of the rich text content.
6. The rich text content conversion method according to claim 5, characterized in that, The step of using the updated knowledge graph to perform consistency verification on the structured content includes: Parse the structured knowledge triples with timestamp information from the structured content; In the updated knowledge graph, query the historical evolution patterns of entities related to the structural knowledge triples; Based on the historical evolution pattern, the consistency confidence of the structural knowledge triples in the time dimension is calculated; The consistency confidence level is used as the consistency verification result.
7. The rich text content conversion method according to claim 6, characterized in that, Determining whether the verification result meets the preset requirements includes: A quality score is obtained by weighting the confidence score, information density, consistency check result, and source reliability information. When the quality score is lower than a preset threshold, it is determined that the structured content does not meet the preset requirements.
8. A rich text content conversion device, characterized in that, The rich text content conversion device includes: The extraction module is used to extract rich text content using the trained model to obtain knowledge triples to be converted. The update module is used to merge and update the knowledge triples to be converted with historical knowledge in the knowledge graph to obtain an updated knowledge graph; The structured generation module is used to simultaneously generate structured content from the knowledge triples to be transformed according to a preset logical structure. The verification module is used to verify the structured content and obtain a verification result; wherein, the verification process includes at least using the updated knowledge graph to perform consistency verification on the structured content; An optimization module is used to reconstruct the structured content into verification text content when the verification result does not meet the preset requirements, and to optimize the structured content using the verification text content.
9. The apparatus according to claim 8, characterized in that, The knowledge triple includes entity information, relation information, and feature information.
10. The rich text content conversion device according to claim 8, characterized in that, The extraction of rich text content using a trained model includes: Entity and relation information are extracted from the rich text content using a long short-term memory network model; Feature information is extracted from the rich text content using a hybrid model that integrates a rule engine and a deep learning model.
11. The rich text content conversion device according to claim 8, characterized in that, The process of fusing and updating the knowledge triples to be converted with historical knowledge in the knowledge graph to obtain an updated knowledge graph includes: A correlation model is constructed using the knowledge graph, and the potential correlation between the knowledge triples to be transformed and historical triples is determined based on the correlation model; wherein, the historical knowledge includes historical triples; The knowledge graph is fused and updated based on the potential associations.
12. The rich text content conversion device according to claim 8, characterized in that, The verification process also includes at least one of the following: Determine the confidence score when extracting the knowledge triples to be transformed from the rich text content; The information density of the structured content is determined; wherein the information density is determined based on the ratio of the length of the rich text content to the number of knowledge triples extracted from it; Determine the reliability of the source of the rich text content.
13. The rich text content conversion device according to claim 12, characterized in that, The step of using the updated knowledge graph to perform consistency verification on the structured content includes: Parse the structured knowledge triples with timestamp information from the structured content; In the updated knowledge graph, query the historical evolution patterns of entities related to the structural knowledge triples; Based on the historical evolution pattern, the consistency confidence of the structural knowledge triples in the time dimension is calculated; The consistency confidence level is used as the consistency verification result.
14. The rich text content conversion device according to claim 13, characterized in that, Determining whether the verification result meets the preset requirements includes: A quality score is obtained by weighting the confidence score, information density, consistency check result, and source reliability information. When the quality score is lower than a preset threshold, it is determined that the structured content does not meet the preset requirements.
15. A processor, characterized in that, It is configured to perform the rich text content conversion method according to any one of claims 1 to 7.
16. A machine-readable storage medium storing instructions thereon, characterized in that, When executed by a processor, the instruction causes the processor to be configured to perform the rich text content conversion method as described in any one of claims 1 to 7.
17. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the rich text content conversion method according to any one of claims 1 to 7.