Large model-based knowledge extraction method and device, computer equipment and medium

CN122596047APending Publication Date: 2026-08-18CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610968252.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-30
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

在面对不同长度的语义文本段时,传统方案通常采用固定的模型进行处理,不仅导致了计算资源的浪费,或者因模型能力不足导致复杂任务处理失败

Benefits of technology

[0010] Fourthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the knowledge extraction method based on a large model as described above.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122596047A_ABST
    Figure CN122596047A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of intelligent decision-making, and discloses a knowledge extraction method and device based on a large model, computer equipment and a medium, the method comprising the following steps: performing layout analysis and paragraph boundary identification on an initial structured text to generate a semantic text segment; generating a target prompt word according to the initial structured text; dynamically determining a target large language model according to the semantic complexity level of the semantic text segment by using a classification model, generating an initial knowledge extraction result, correcting the initial knowledge extraction result, and generating a target knowledge extraction result. In the foregoing manner, the application improves the contextual semantic coherence of long text by using a self-adaptive window segmentation algorithm, improves the accuracy of domain terminology recognition by using a three-layer prompt word architecture, dynamically selects a target model to improve reasoning accuracy, and suppresses hallucination output by using a calibration network. The application can be applied to the business fields of financial technology, medical health and the elderly care, and improves the accuracy of the output structured knowledge of a document management system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent decision-making technology, and in particular to a knowledge extraction method, apparatus, computer equipment, and medium based on a large model. Background Technology

[0002] As digital transformation deepens across industries, the amount of unstructured text is constantly increasing, leading to a growing demand from enterprises for extracting structured information from this text to build digital knowledge bases. Currently, knowledge extraction from unstructured text primarily relies on manual labor, resulting in additional learning costs and human resource consumption. Automating knowledge extraction from unstructured text is of great significance in the field of knowledge extraction, which is a data resource upon which various intelligent applications depend.

[0003] In the fintech sector, financial institutions process a large number of unstructured documents daily, such as insurance clauses, financial contracts, regulatory reports, and claims materials. Taking the insurance industry as an example, insurance clauses, as a core component of insurance contracts, are typically in the form of unstructured documents such as PDFs and Word documents, containing complex formatting structures, dense technical terms, complex logical relationships, and unstructured expressions.

[0004] In the healthcare and elderly care sector, medical and elderly care service providers face the need to process massive amounts of unstructured documents. For example, electronic health records contain a large amount of unstructured text such as medical records, examination reports, and doctor's orders. Knowledge extraction from these documents is crucial for intelligent applications such as intelligent diagnosis and treatment assistance, elderly care plan recommendations, elderly care product matching, and chronic disease management consultation.

[0005] Existing large language model applications lack flexibility and adaptability. When faced with semantic text segments of varying lengths, traditional solutions typically employ fixed models, leading to wasted computational resources or failure to handle complex tasks due to insufficient model capabilities. Therefore, in business areas such as fintech and healthcare / elderly care, improving the accuracy of structured knowledge output by document management systems through dynamic fusion of domain knowledge has become a pressing technical challenge. Summary of the Invention

[0006] This application provides a knowledge extraction method, apparatus, computer equipment, and medium based on a large model to improve the accuracy of structured knowledge output by a document management system.

[0007] Firstly, this application provides a knowledge extraction method based on a large model, the method comprising: An adaptive window segmentation algorithm is used to perform layout analysis and paragraph boundary recognition on the initial structured text in the target domain, generating at least one semantic text segment. Target prompt words are generated based on the prompt word architecture, the document type of the initial structured text, and the extraction task type. The prompt word architecture includes a preset basic semantic layer, a preset business rule layer, and a preset conversation instruction layer. The semantic complexity level is determined by the classification model built into the model abstraction layer based on the semantic feature vector and semantic length vector of the semantic text segment. The target large language model is dynamically determined based on the historical extraction accuracy and the semantic complexity level. Initial knowledge extraction results are generated based on the target large language model and the target prompt words. The initial knowledge extraction results are corrected by pre-training a calibration network and the primary structured text to generate target knowledge extraction results.

[0008] Secondly, this application also provides a knowledge extraction device based on a large model, the device comprising: The semantic text segment generation module is used to perform layout analysis and paragraph boundary recognition on the initial structured text of the target domain using an adaptive window segmentation algorithm, and generate at least one semantic text segment. The target prompt word generation module is used to generate target prompt words based on the prompt word architecture, the document type of the initial structured text, and the extraction task type. The prompt word architecture includes a preset basic semantic layer, a preset business rule layer, and a preset conversation instruction layer. The initial knowledge extraction result generation module is used to determine the semantic complexity level based on the semantic feature vector and semantic length vector of the semantic text segment through the classification model built into the model abstraction layer, dynamically determine the target large language model based on the historical extraction accuracy and the semantic complexity level, and generate the initial knowledge extraction result based on the target large language model and the target prompt word. The target knowledge extraction result generation module is used to correct the initial knowledge extraction result by using a pre-trained calibration network and the primary structured text to generate the target knowledge extraction result.

[0009] Thirdly, this application also provides a computer device, the computer device including a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and, when executing the computer program, implement the knowledge extraction method based on the large model as described above.

[0010] Fourthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the knowledge extraction method based on a large model as described above.

[0011] This application discloses a knowledge extraction method, apparatus, computer device, and medium based on a large model. The method includes performing layout analysis and paragraph boundary recognition on initial structured text in the target domain using an adaptive window segmentation algorithm to generate at least one semantic text segment; generating target prompt words based on the prompt word architecture, the document type of the initial structured text, and the extraction task type, wherein the prompt word architecture includes a preset basic semantic layer, a preset business rule layer, and a preset conversation instruction layer; determining the semantic complexity level based on the semantic feature vector and semantic length vector of the semantic text segment using a classification model built into the model abstraction layer; dynamically determining the target large language model based on the historical extraction accuracy and the semantic complexity level; generating an initial knowledge extraction result based on the target large language model and the target prompt words; and correcting the initial knowledge extraction result using a pre-trained learning calibration network and the initial structured text to generate the target knowledge extraction result. Through the above methods, this application improves the semantic coherence of long text context through an adaptive window segmentation algorithm, enhances the accuracy of domain terminology recognition through a three-layer prompt word architecture, dynamically selects the target model based on semantic complexity and historical accuracy to improve reasoning accuracy, and then uses a learning calibration network to suppress illusory output. In business areas such as fintech and healthcare and elderly care, this application improves the accuracy of structured knowledge output by the document management system. Attached Figure Description

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

[0013] Figure 1 This is a schematic diagram illustrating the application environment of a knowledge extraction method based on a large model, as provided in an embodiment of this application. Figure 2 This is a schematic flowchart illustrating a knowledge extraction method based on a large model provided in an embodiment of this application; Figure 3 A schematic block diagram of a knowledge extraction device based on a large model provided for embodiments of this application; Figure 4 A schematic block diagram of the structure of a computer device provided for an embodiment of this application. Detailed Implementation

[0014] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0015] The knowledge extraction method based on large models provided in this invention can be applied to, for example... Figure 1 In this application environment, the client communicates with the server via a network. The server can use an adaptive window segmentation algorithm to perform layout analysis and paragraph boundary recognition on the initial structured text of the target domain, generating at least one semantic text segment. Based on the prompt word architecture, the document type of the initial structured text, and the extraction task type, target prompt words are generated. The prompt word architecture includes a preset basic semantic layer, a preset business rule layer, and a preset conversation instruction layer. The semantic complexity level is determined by a classification model built into the model abstraction layer based on the semantic feature vector and semantic length vector of the semantic text segment. The target large language model is dynamically determined based on the historical extraction accuracy and the semantic complexity level. Initial knowledge extraction results are generated based on the target large language model and the target prompt words. The initial knowledge extraction results are corrected using a pre-trained learning calibration network and the initial structured text to generate the target knowledge extraction results. This application improves the semantic coherence of long text context through an adaptive window segmentation algorithm, enhances the accuracy of domain terminology recognition through a three-layer prompt word architecture, dynamically selects the target model based on semantic complexity and historical accuracy to improve inference accuracy, and further suppresses illusory output through a learning calibration network. In business fields such as fintech and healthcare / elderly care, this improves the accuracy of structured knowledge output by document management systems. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention is described in detail below through specific embodiments.

[0016] Please see Figure 2 , Figure 2 This is a schematic flowchart illustrating a knowledge extraction method based on a large model, provided in an embodiment of this application. This knowledge extraction method based on a large model can be applied to document management systems to improve the accuracy of the structured knowledge output by the system.

[0017] like Figure 2 As shown, the knowledge extraction method based on the large model specifically includes steps S10 to S40.

[0018] Step S10: Perform layout analysis and paragraph boundary recognition on the initial structured text of the target domain using an adaptive window segmentation algorithm to generate at least one semantic text segment; Specifically, the initial structured text of the target domain is first obtained, which is derived from the original unstructured documents (such as insurance policy documents in PDF format or medical records in Word format) through optical character recognition or text extraction. A sliding window is initialized, setting the initial window size and sliding step size. The initial window size is dynamically adjusted according to the document type characteristics. For example, a larger base window size is used for single-column text layouts, a smaller base window size is used for multi-column text layouts, an even smaller base window size is used for nested table areas, and the window size is dynamically calculated based on the text-image ratio for mixed text and image areas.

[0019] The sliding step size is adjusted based on the text density coefficient, which is positively correlated with text length and negatively correlated with average paragraph length. Multidimensional text layout features are extracted within the sliding window, including font size change rate, line spacing abrupt change value, indentation level difference, and white space density. The font size change rate is obtained by calculating the ratio of font sizes between adjacent text lines; when the ratio exceeds a preset threshold, a transition between heading and body text levels is identified. The line spacing abrupt change value is obtained by calculating the deviation rate between the actual line spacing of adjacent text lines and the document's average line spacing; when the deviation rate exceeds a preset threshold, paragraph spacing is identified. The indentation level difference is obtained by detecting the horizontal offset of the first character of adjacent text lines; when the offset exceeds a preset indentation threshold, list item or sub-paragraph level transition is identified. White space density is obtained by calculating the ratio of the area of ​​white pixels within the window to the total area of ​​the window; when the ratio exceeds a preset white space threshold, paragraph spacing or region separation is identified.

[0020] Based on the aforementioned multi-dimensional text layout features, a weighted fusion function is used to calculate paragraph boundary confidence scores. The weight coefficients of each feature are dynamically adjusted according to document type characteristics. For example, for single-column text layouts, the weight of line spacing and blank areas is increased; for multi-column text layouts, the weight of indentation level differences is increased; for nested table areas, the weight of font size change rate is increased; and for areas with mixed text and images, the weight of line spacing is decreased to avoid interference from image areas. When the confidence score exceeds a preset threshold, the current window position is marked as a candidate paragraph boundary.

[0021] In some embodiments, taking the medical and health care elderly care business as an example, for initial structured texts such as medical records, examination reports, elderly care service agreements, and medical insurance settlement statements, an adaptive window segmentation algorithm is used to identify page features such as report partitions, table test values, diagnosis and treatment segments, and elderly care rights and responsibilities columns. The window size and sliding step are adjusted according to the length of the medical record, and paragraph boundaries are identified according to professional semantic rules such as consultation information (e.g., medication or nursing requirements) and service terms, ensuring the semantic integrity of each segment of diagnosis and treatment information and elderly care agreement, and segmenting to generate semantic text segments in the medical and health care business field.

[0022] In some embodiments, taking the fintech business sector as an example, an adaptive window segmentation algorithm is activated for the initial structured text such as contracts, business terms, and settlement documents in the fintech field. This algorithm identifies layout features such as multi-column formatting, nested rate tables, and clauses, and dynamically adjusts the size and step size of the sliding window based on the overall length of the financial text. Following the inherent chapter, clause, and note paragraph logic of relevant standard documents in the financial field, the algorithm prioritizes ensuring the integrity of business semantics such as rates, responsibilities, and timeliness within a single paragraph, generating several semantic text segments related to fintech business after segmentation.

[0023] Step S20: Generate target prompt words based on the prompt word architecture, the document type of the initial structured text, and the extraction task type, wherein the prompt word architecture includes a preset basic semantic layer, a preset business rule layer, and a preset conversation instruction layer; Specifically, the preset basic semantic layer is obtained by encapsulating a preset global fixed instruction set, which includes output format constraint instructions, anti-illusion prohibition instructions, language specification instructions, and field naming constraint instructions.

[0024] Output format constraint directives enforce that the large language model outputs in a preset format (e.g., JSON format), prohibit the output of natural language interpretation or reasoning processes, and define the key name, data type, value range, and nesting structure of each field; the anti-illusion prohibition directive sets a counterexample constraint, triggering format validation failure when the large language model outputs content containing undefined fields, incorrect field types, or values ​​outside the range; the language specification directive stipulates the output language style and terminology usage standards; the field naming constraint directive unifies field naming rules to ensure consistency of document types.

[0025] The preset business rules layer obtains the preset document type identifier of the preset target domain, and generates the rules by retrieving the specialized terminology dictionary, extracting example templates, regular expression constraints, and logical verification rules from the domain knowledge base based on the preset document type identifier.

[0026] Document type identification is achieved by parsing the layout feature vector and keyword feature vector of the initial structured text. The document type classifier outputs the document type confidence distribution, and the current document type is identified when the maximum confidence value exceeds a preset type threshold. A specialized terminology dictionary maps domain-specific terms in the document to standardized knowledge representations; for example, it maps deductibles in insurance clauses to a unified terminology code.

[0027] The preset session instruction layer obtains a preset extraction task type identifier from a preset target domain. Based on this identifier, it retrieves the task description text, expected output granularity control parameters, and context association indicators from the preset task configuration library. The extraction task type identifier is generated by semantically parsing the user-input extraction task description text through a task intent parsing engine to obtain the extraction target entity, extraction relationship type, expected output granularity, and output priority sequence. The task description text clearly defines the goal and scope of the current extraction task. The expected output granularity control parameters specify the level of detail for the output fields, such as summary, standard, or detailed. The context association indicators define the relationship between the current extraction task and historical tasks, used in multi-task collaborative scenarios.

[0028] When generating target prompt words, the system retrieves basic semantic layer prompt word templates and business rule layer prompt word templates that match the current business scenario from the versioned prompt word library, parses the current extraction task type to generate task instructions for the session instruction layer, injects the initial structured text, historical parsing results and user feedback into the session instruction layer, and then uses the prompt word assembly engine to splice and merge the three layers of prompt words according to preset priorities.

[0029] The default priority is the basic semantic layer, which is the highest, followed by the business rules layer, and then the session instruction layer. When there is a conflict between the three layers, the conflict is resolved according to the priority from high to low. The content of the lower priority layer is automatically adapted to the constraints of the higher priority layer.

[0030] Step S30: Determine the semantic complexity level based on the semantic feature vector and semantic length vector of the semantic text segment using the classification model built into the model abstraction layer; dynamically determine the target large language model based on the historical extraction accuracy and the semantic complexity level; and generate the initial knowledge extraction result based on the target large language model and the target prompt word. Specifically, multi-dimensional semantic features are extracted from semantic text segments, including entity density features, relation complexity features, domain terminology distribution features, and semantic coherence features. Entity density features are the ratio of the number of named entities to the total number of lexical units, reflecting the density of key information in the text; relation complexity features are the number of relation types between entities and the depth of relation nesting levels, reflecting the complexity of the text's logical structure; domain terminology distribution features are the coverage and evenness of domain-specific terms, reflecting the professionalism of the text; and semantic coherence features are the semantic coherence scores between sentences, calculated based on sentence vector similarity from a pre-trained language model, reflecting the smoothness of the text's semantic flow.

[0031] The aforementioned multidimensional semantic features are encoded into semantic feature vectors. Simultaneously, the character length, word length, and number of semantic units in the semantic text segment are calculated, where a semantic unit is an independent semantic expression unit containing a subject-verb-object structure. These three are normalized to form a semantic length index. The semantic feature vectors and semantic length index are fused across modally to generate a fused feature representation. Based on the fused feature representation, a probability distribution of semantic complexity levels is output, including simple semantic level, regular semantic level, complex semantic level, and deep reasoning semantic level. When the maximum probability value in the probability distribution exceeds a preset complexity threshold, the corresponding level is output.

[0032] Historical extraction accuracy records, average response latency, and computational resource consumption of each candidate large language model are retrieved from the historical extraction accuracy database under the same document type, extraction task type, and similar semantic complexity level. Historical extraction accuracy is the ratio of the number of correct extractions within the most recent preset time window to the total number of extraction tasks. Semantic complexity level and historical extraction accuracy are encoded into a state vector. When the historical extraction accuracy is lower than a preset minimum accuracy threshold, the corresponding candidate model is marked as unavailable. Based on the selection probability distribution, the candidate model with the highest probability is selected as the target large language model. When the difference between the highest and second-highest probability is less than a preset confidence threshold, both models are simultaneously selected as target models. Target prompt words are sent to obtain two initial knowledge extraction results, and word consistency and semantic consistency comparisons are performed. When the consistency ratio exceeds a preset threshold, the result with higher confidence is selected.

[0033] The target prompts are converted from a unified standardized protocol to the native input protocol of the target large language model through the model abstraction layer. The converted target prompts are sent to the target large language model, the returned raw response data is received, and the raw response data is converted from the native output protocol to the standardized protocol to generate the initial knowledge extraction results.

[0034] Step S40: Correct the initial knowledge extraction result by using a pre-trained learning calibration network and the primary structured text to generate the target knowledge extraction result.

[0035] Specifically, the initial structured text and the initial knowledge extraction results are aligned in terms of features, extracting original text features from the initial structured text and extracted features from the initial knowledge extraction results. Original text features can include semantic features, structural features, and positional features. Extracted features include field completeness features, field consistency features, and field confidence features. The original text features and extracted features are then input into a pre-trained calibration network. The encoder layer of the pre-trained calibration network independently encodes the original text features and extracted features, generating their respective deep feature representations. A cross-attention layer calculates the attention weight matrix between the original text features and extracted features, identifying regions with low attention weights or anomalous distributions. The decoder layer outputs a deviation type prediction and deviation location label based on the attention weight matrix. According to the deviation type, a corresponding correction strategy is matched from a pre-set correction strategy library. For field omission deviations, a context completion strategy is used to locate context text fragments related to the missing field in the initial structured text. Candidate values ​​for the missing field are generated through semantic reasoning, and the candidate values ​​are semantically consistent with the context text fragments before completion.

[0036] Specifically, the correction process can include: a field value error deviation corresponding to a backtracking verification strategy, locating the original text fragment corresponding to the erroneous field value in the primary structured text, extracting the accurate field value to replace the erroneous field value; a field redundancy deviation corresponding to a field deduplication and simplification strategy, identifying duplicate fields or semantically equivalent fields, retaining the field with the highest confidence and deleting redundant fields; a logical relationship deviation corresponding to a rule reasoning correction strategy, loading the clause association rule library in the business rule layer, and deriving the correct field relationship based on the rule logic for correction; and a format anomaly deviation corresponding to a format normalization strategy, performing field rearrangement, type conversion, and structural reorganization based on the output format constraint template in the basic semantic layer. During the correction process, the primary structured text is used as the verification benchmark. Before the correction operation is executed, the original text evidence related to the field to be corrected is extracted. After the correction operation is executed, the corrected field value is semantically matched and verified with the original text evidence. When the matching degree is lower than a preset threshold, the current correction operation is abandoned and an alternative correction strategy is triggered.

[0037] The corrected knowledge extraction results undergo consistency verification, including semantic consistency verification, structural consistency verification, and logical consistency verification. When the consistency verification passes, the corrected knowledge extraction results are used as the target knowledge extraction results. When the consistency verification fails, iterative correction is triggered.

[0038] This embodiment discloses a knowledge extraction method based on a large model. The method includes performing layout analysis and paragraph boundary recognition on initial structured text in the target domain using an adaptive window segmentation algorithm to generate at least one semantic text segment; generating target prompt words based on the prompt word architecture, the document type of the initial structured text, and the extraction task type, wherein the prompt word architecture includes a preset basic semantic layer, a preset business rule layer, and a preset conversation instruction layer; determining the semantic complexity level based on the semantic feature vector and semantic length vector of the semantic text segment using a classification model built into the model abstraction layer; dynamically determining the target large language model based on the historical extraction accuracy and the semantic complexity level; generating an initial knowledge extraction result based on the target large language model and the target prompt words; and correcting the initial knowledge extraction result using a pre-trained learning calibration network and the initial structured text to generate the target knowledge extraction result. Through the above methods, this application improves the semantic coherence of long text context through an adaptive window segmentation algorithm, enhances the accuracy of domain terminology recognition through a three-layer prompt word architecture, dynamically selects the target model based on semantic complexity and historical accuracy to improve reasoning accuracy, and then uses a learning calibration network to suppress illusory output. In business areas such as fintech and healthcare and elderly care, this application improves the accuracy of structured knowledge output by the document management system.

[0039] based on Figure 2 In the illustrated embodiment, before step S20, the following steps are included: Obtain a preset global fixed instruction set, a preset document type identifier for a preset target domain, and a preset extraction task type identifier for the preset target domain; The preset global fixed instruction set is encapsulated into the preset basic semantic layer; Specifically, a set of general instructions that does not involve any specific domain is predefined as fixed content of the basic semantic layer. This set can include: output format constraint instructions, anti-illusion prohibition instructions, language standardization instructions, and field naming constraint instructions. The main framework of the basic semantic layer is automatically loaded each time a prompt word is generated, ensuring that all large models are consistent in output format and standardization.

[0040] Based on the preset document type identifier, the preset business rule layer is generated by retrieving a specialized terminology dictionary, extracting example templates, regular expression constraints, and logical verification rules from the domain knowledge base. Specifically, taking insurance clauses as an example, document type identifiers include "critical illness insurance clauses," "medical insurance clauses," and "accident insurance clauses," etc. When a critical illness insurance clause extraction task is received, the type identifier is read, and the corresponding business rule content is retrieved from the knowledge base: a dictionary of specialized terms, extraction example templates, regular expression constraints, and logical verification rules.

[0041] Retrieve task description text, expected output granularity control parameters, and context association indicators that match the preset extraction task type identifier from the preset task configuration library; The preset session instruction layer is generated based on the task description text, the expected output granularity control parameters, and the context association indication; Specifically, dynamic parameters are retrieved from the task configuration library based on the specific task type identifier. For example, for a key field extraction task, the task description text is: "Please extract six key fields from the following clause text: policy number, policyholder, insurer, insured amount, insurance period, and payment method." The expected output granularity control parameter is set to take only the first occurrence of each field, separated by commas if multiple values ​​exist. Contextual association indicators may include "insurer (insurance company), policyholder (individual purchasing insurance)." The content of the session instruction layer is dynamically generated at runtime based on the user-selected extraction task type and inserted into the prompts to provide precise guidance for the current task.

[0042] The preset basic semantic layer, the preset business rule layer, and the preset conversation instruction layer are encapsulated into the prompt word architecture by a preset hierarchical order.

[0043] Specifically, after generating the templates for the three levels mentioned above, they are encapsulated according to a fixed hierarchical order. This order can be predefined: the basic semantic layer is placed at the front to establish global constraints and prevent illusions; the business rules layer follows, used to inject domain knowledge and extract specifications; and the conversation instruction layer is placed at the end to clarify the specific requirements of the current task. During encapsulation, the text of the three levels is concatenated sequentially, with clear markers separating the layers to improve the large model's ability to recognize attention at different levels.

[0044] After the concatenation is complete, the variable placeholders in the entire prompt word structure are scanned and replaced with the actual parameter values ​​of the current task to generate the target prompt word text.

[0045] In a specific embodiment, step S20 includes: Based on the document type identifier corresponding to the document type and the extraction task type identifier corresponding to the extraction task type, determine the target basic semantic layer, the target business rule layer, and the target session instruction layer; Specifically, the process retrieves the document type identifier of the currently pending document and the type identifier of the current extraction task. Based on these two identifiers, it connects to a pre-built time-series database. This database stores all historical versions of the basic semantic layer, business rule layer, and session instruction layer in chronological order. Each record contains template content, version number, effective time interval, hierarchical tag, and associated document type and task type tags. Using the document type identifier and task type identifier as the joint query key, it retrieves the latest version template that perfectly matches this combination and is currently within the effective time interval, thus obtaining the target basic semantic layer, target business rule layer, and target session instruction layer, respectively.

[0046] The target basic semantic layer, the target business rule layer, and the target session instruction layer are concatenated according to the preset hierarchical order to generate initial prompt words; Specifically, after obtaining the three target layer templates, the splicing operation is performed according to a fixed preset hierarchical order. The preset hierarchical order can be defined as follows: first, place the target basic semantic layer to establish global output format constraints and anti-illusion instructions; second, place the target business rule layer to inject domain-specific terminology, extract examples, regular expression constraints, and logical verification rules; and finally, place the target session instruction layer to clarify the description of the current task, output granularity, and contextual association indications.

[0047] During concatenation, hierarchy markers are added to the beginning and end of the text at each level. For example, "Beginning of Basic Semantic Layer" is added before the basic semantic layer, and "End of Basic Semantic Layer" is added after it, separated by line breaks to help the large model distinguish the information sources at different levels. Simultaneously, duplicate content within each level is checked. If conflicts are found, they are merged or overwritten according to a conflict resolution strategy that prioritizes the session instruction layer over the business rule layer, which in turn prioritizes the basic semantic layer. The resulting text after concatenation is the initial prompt word. At this stage, the initial prompt word still contains variable placeholders such as "Document Type Name," "List of Extracted Fields," and "Maximum Output Length," which have not yet been filled with actual values.

[0048] Identify the variable placeholders in the initial prompt word, obtain the current parameter value of the initial structured text, fill the variable placeholders with the current parameter value, and generate the target prompt word.

[0049] Specifically, the initial prompt string is scanned, and regular expressions are used to identify all identifiers, such as "document type name," "extractable field list," "current text segment length," and "maximum output length." For each identified variable placeholder, the current parameter value is retrieved from its corresponding data source. After obtaining the specific value or string, the corresponding variable placeholder in the initial prompt is replaced. If a placeholder cannot find a corresponding parameter value in the data source, it is replaced with a default value according to preset rules, and a warning message is logged. After filling all placeholders, a complete, placeholder-free target prompt is generated.

[0050] based on Figure 2 In the illustrated embodiment, step S30 includes: The entity density feature, relation complexity feature, domain term distribution feature, and semantic coherence feature of the semantic text segment are extracted as multidimensional semantic features, and the multidimensional semantic features are encoded into the semantic feature vector. Specifically, deep language feature analysis is performed on each semantic text segment. For example, entity density is obtained by statistically analyzing the ratio of the number of named entities (such as financial product names, medical diagnostic terms, monetary values, dates, etc.) in the text segment to the total number of words in the text; higher density indicates denser information carrying. Relationship complexity is quantified by parsing the frequency of subject-verb-object structures, nested clause levels, and logical connectors in the text, reflecting the dependency and constraint relationships between clauses. Domain terminology distribution features are calculated based on a pre-built terminology database for the financial technology or healthcare and elderly care fields, calculating the frequency and evenness of domain-specific words in the text segment. Semantic coherence is evaluated by calculating the average semantic embedding similarity between adjacent sentences; low coherence often indicates table line breaks, paragraph jumps, or layout breaks. After extracting the above four types of features, they are converted into fixed-dimensional numerical vectors and concatenated along the feature dimensions to form a comprehensive semantic feature vector.

[0051] Calculate the character length, word length, and number of semantic units of the semantic text segment, and normalize the character length, word length, and number of semantic units to generate the semantic length vector; Specifically, besides semantic features, the physical length of the text is also a key factor affecting the processing capacity of large models. For each semantic text segment, three length metrics are calculated simultaneously: character length, word length, and number of semantic units. Since these three metrics have different dimensions (character length can reach thousands, while semantic units typically do not exceed tens), they are normalized to map all values ​​to the [0,1] interval. The three normalized scalar values ​​are arranged in a fixed order (character length, word length, number of semantic units) to form a semantic length vector.

[0052] The semantic feature vector and the semantic length vector are fused across modalities using the feature fusion network to generate semantic fusion features, and the semantic complexity level is determined by the level determination network based on the semantic fusion features.

[0053] Specifically, after obtaining the semantic feature vector and semantic length vector, the model abstraction layer is responsible for fusing them and mapping them to discrete complexity levels. First, the semantic feature vector and semantic length vector are concatenated into a joint feature vector. A lightweight classifier outputs the probability value for each complexity level, and the level with the highest probability is selected as the final semantic complexity level of the current semantic text segment. The specific determination logic is as follows: when the text segment has sparse entities, simple relationships, very few domain terms, and a short length, it is classified as low complexity; when the number of entities and relationships is moderate, medium-frequency professional terms appear, and the length is close to half of the model context window, it is classified as medium complexity; when the entities are dense, there are multiple layers of nested logic, a large number of domain terms, and the length is close to or exceeds the context window, it is classified as high complexity.

[0054] In a specific embodiment, step S20 further includes: Obtain a pool of candidate large language models, and calculate the historical extraction accuracy of each candidate large language model for the target domain based on the historical call logs of each candidate large language model in the pool of candidate large language models. Specifically, the initialization process includes a pool of candidate large language models, encompassing various versions with different capabilities, such as a general-purpose large language model, an insurance-domain fine-tuned large language model, a medical-domain fine-tuned large language model, an inference-enhanced large language model, and a lightweight large language model. Each candidate large language model is configured with metadata such as model identifier, model version number, context window capacity, maximum supported input length, inference capability level, domain adaptation label, and resource consumption baseline.

[0055] For each candidate large language model, its historical call records in the target domain are retrieved from the historical call log database. The historical call log includes fields such as input text summary, output result, extraction correctness marker, response latency, computational resource consumption, and call timestamp for each call. Calculating the historical extraction accuracy for the target domain may include: filtering all call records of the candidate large language model within the most recent preset time window in the target domain, and counting the total number of extraction tasks, the number of correct extractions, and the number of extraction errors. The number of extraction errors includes types such as field omissions, incorrect field values, logical relationship deviations, and format anomalies.

[0056] The semantic complexity level is mapped and matched with the historical extraction accuracy of each candidate large language model, the comprehensive adaptation score of each candidate large language model is calculated, and the candidate large language model with the highest comprehensive adaptation score is determined as the target large language model. Specifically, after obtaining the historical extraction accuracy of each candidate model and the semantic complexity level (low, medium, high) of the current semantic text segment, a comprehensive fit score is calculated for each model. The comprehensive fit score is obtained by a weighted sum of two parts: the first part is based on the historical extraction accuracy, i.e., the accuracy score is directly used as the base score; the second part is based on the matching degree between the model and the semantic complexity level. For example, for low-complexity text segments, the matching degree of the lightweight model is set to 1.0, and the matching degree of the large-parameter model is set to 0.6, because large models waste resources and are slow when processing simple text; for high-complexity text segments, the matching degree of the large-parameter model is set to 1.0, and the matching degree of the lightweight model is set to 0.3 to ensure extraction quality. The two scores are added according to preset weights (e.g., historical accuracy weight 0.6, complexity matching degree weight 0.4) to obtain the comprehensive fit score of each candidate model. All models in the candidate model pool are traversed, and the model with the highest comprehensive fit score is selected as the target large language model.

[0057] The target prompt words are converted into a request message that matches the format of the target large language model. The target large language model then performs a reasoning task based on the request message to generate the initial knowledge extraction result.

[0058] Specifically, after determining the target large language model, the system calls the adapter component in the model abstraction layer to convert the target prompt words into the request message format required by the model. Different large models have different interfaces, input formats, and parameter naming conventions. Based on pre-configured mapping rules, the target prompt words are encapsulated into a request message conforming to the target model's specifications, while simultaneously reading the corresponding inference parameters from the configuration file. The request message is sent to the target model's inference endpoint. After receiving the request, the target model executes the inference task, generates a raw response containing the extracted results, parses the raw response, extracts the core text content, and converts it into a unified internal data format, i.e., the initial knowledge extraction result.

[0059] based on Figure 2 In the illustrated embodiment, step S40 includes: The initial structured text is used as the reference anchor point, and the original semantic feature vector of the initial structured text and the initial extracted semantic feature vector of the initial knowledge extraction result are extracted respectively through a preset text embedding model. Specifically, the original text segment that strictly corresponds to the current semantic text segment in the initial structured text is extracted and used as the reference anchor. A preset text embedding model is then called to vectorize each field value in the reference anchor text and the initial knowledge extraction result.

[0060] For the baseline anchor, the embedding model converts it into a high-dimensional semantic feature vector, denoted as the original semantic feature vector. The original semantic feature vector captures the true meaning of each sentence in the original text. For the initial knowledge extraction results, the embedding model converts them into a set of vectors, with each field corresponding to an initial extracted semantic feature vector. For example, the value "90%" in the "compensation ratio" field is encoded as one feature vector, and the value "1000 yuan" in the "deductible" field is encoded as another vector.

[0061] The logical consistency score between the original semantic feature vector and the initially extracted semantic feature vector is calculated through the attention mechanism of the pre-trained learning calibration network. Specifically, the pre-trained learning calibration network contains an alignment module based on cross-attention. The alignment module uses the original semantic feature vector as the query and the initially extracted semantic feature vector as the key and value, and calculates the semantic alignment between the two through a multi-head attention mechanism.

[0062] The alignment scores from all attention heads are weighted and summed, then mapped to a logical consistency score between 0 and 1. A score closer to 1 indicates greater semantic consistency between the extracted result and the original text; a lower score indicates semantic bias, missing fields, or incorrect extraction. For example, if the original text contains "waiting period is 90 days," but the extracted result is "waiting period: 30 days," the semantic difference will lead to a significant decrease in the consistency score.

[0063] When the logical consistency score is lower than the preset security confidence threshold, the error correction subnetwork of the pre-trained learning calibration network corrects the abnormal fields in the initial knowledge extraction result according to the benchmark anchor point, and generates the target knowledge extraction result.

[0064] Specifically, the error-correction subnetwork of the pre-trained calibration network is a sequence-to-sequence model based on a pointer generation network. It uses a baseline anchor (i.e., the original semantic text segment) as context and the initial knowledge extraction results as the input sequence to be corrected. It locates the correct field values ​​from the original text through a copying mechanism and standardizes the format through a generation mechanism. Specifically, the error-correction subnetwork first identifies anomalous fields (i.e., fields inconsistent with or missing from the original text) in the initial extraction results. Then, it locates the corresponding original text segments from the baseline anchor and copies them into the output to replace the erroneous values. For missing fields, the error-correction subnetwork automatically supplements them based on the content of the baseline anchor.

[0065] Based on any of the above embodiments, in this embodiment, step S10 includes: The initial structured text of the target domain is obtained, and a sliding window is initialized through the adaptive window segmentation algorithm. The initial window size and initial sliding step size are determined, and the initial window size and initial sliding step size are dynamically adjusted based on the document type and text length of the initial structured text. The target window size and target sliding step size are determined respectively. Specifically, the original document in the target domain is obtained, converted into initial structured text using OCR, and then, based on an adaptive window segmentation algorithm, a default initial window size and initial sliding step are set. The document type identifier and total text length of the document are then read. For example, based on a pre-trained tuning model, for densely packed multi-column layouts of initial structured text, the model recommends reducing the window size to 256 characters to avoid cross-column segmentation; for long documents with a total length exceeding 5000 characters, the sliding step is adjusted to 64 characters to increase sampling density. The final target window size is determined to be 256 characters, and the target sliding step is 64 characters to accommodate the complex layout requirements of insurance terms.

[0066] It should be noted that the above values ​​are for illustrative purposes only and are not intended to impose any restrictions.

[0067] The initial structured text is parsed to determine its layout structure features, and at least one granular text block is generated based on preset semantic boundary rules and the layout structure features. Specifically, the initial structured text is parsed to extract layout features such as the coordinate position, font size, bold status, and indentation of each character or text line. A clustering algorithm is used to identify spatially adjacent text regions with consistent layout styles as independent layout elements, such as heading blocks, body paragraphs, table cells, headers, and footers. Pre-defined semantic boundary rules can be used to treat the area before and after heading lines as paragraph boundaries, group all text within the coordinate range of table borders into a single text block, and segment header and footer areas separately.

[0068] Extract the visual and text features of the initial structured text, and calculate the semantic coherence score of each granular text block based on the visual and text features. Specifically, for each text block at each granularity, both visual and textual features are extracted. Visual features are derived from the layout information of the original document, reflecting the impact of typography on semantic continuity. Textual features may include the average word vector similarity between sentences within the block, punctuation density, and the frequency of logical connectors.

[0069] The similarity between visual features and text features is used as a semantic coherence score. A higher semantic coherence score indicates that the internal semantics are compact and closely related to the preceding and following blocks, and should be kept in the same semantic text segment as much as possible. A lower coherence score indicates that the semantics of the block jumps a lot or that there is a clear separation from the context, and it is suitable as a segmentation point.

[0070] The semantic text segment is generated based on the semantic coherence score, the target window size, the target sliding step size, and the initial structured text.

[0071] Specifically, a dynamic sliding window algorithm is used for final segmentation. Starting from the beginning of the text, the window is moved according to the target sliding step size, and each time several granular text blocks in the window are aggregated into a semantic text segment.

[0072] Please see Figure 3 , Figure 3 This application provides a schematic block diagram of a large-model-based knowledge extraction device, which is used to execute the aforementioned large-model-based knowledge extraction method. The large-model-based knowledge extraction device can be configured on a server.

[0073] like Figure 3 As shown, the knowledge extraction device 400 based on a large model includes: The semantic text segment generation module 410 is used to perform layout analysis and paragraph boundary recognition on the initial structured text of the target domain using an adaptive window segmentation algorithm to generate at least one semantic text segment. The target prompt word generation module 420 is used to generate target prompt words based on the prompt word architecture, the document type of the initial structured text, and the extraction task type. The prompt word architecture includes a preset basic semantic layer, a preset business rule layer, and a preset conversation instruction layer. The initial knowledge extraction result generation module 430 is used to determine the semantic complexity level based on the semantic feature vector and semantic length vector of the semantic text segment through the classification model built into the model abstraction layer, dynamically determine the target large language model based on the historical extraction accuracy and the semantic complexity level, and generate the initial knowledge extraction result based on the target large language model and the target prompt word. The target knowledge extraction result generation module 440 is used to correct the initial knowledge extraction result by pre-training a calibration network and the primary structured text, and generate the target knowledge extraction result.

[0074] Furthermore, the knowledge extraction device 400 based on the large model also includes: The parameter acquisition module is used to acquire a preset global fixed instruction set, a preset document type identifier of a preset target domain, and a preset extraction task type identifier of the preset target domain; A preset basic semantic layer encapsulation module is used to encapsulate the preset global fixed instruction set into the preset basic semantic layer; The preset business rule layer generation module is used to retrieve a specialized terminology dictionary, extract example templates, regular expression constraints, and logical verification rules from the domain knowledge base according to a preset document type identifier, and generate the preset business rule layer. The task configuration matching module is used to obtain task description text, expected output granularity control parameters and context association indicators that match the preset extracted task type identifier from the preset task configuration library; A preset session instruction layer generation module is used to generate the preset session instruction layer based on the task description text, the expected output granularity control parameters, and the context association indication. The prompt word architecture encapsulation module is used to encapsulate the preset basic semantic layer, the preset business rule layer, and the preset session instruction layer into the prompt word architecture according to a preset hierarchical order.

[0075] Furthermore, the target prompt word generation module 420 includes: The matching unit is used to determine the target basic semantic layer, the target business rule layer, and the target session instruction layer based on the document type identifier corresponding to the document type and the extraction task type identifier corresponding to the extraction task type. The initial prompt word generation unit is used to concatenate the target basic semantic layer, the target business rule layer, and the target session instruction layer according to the preset hierarchical order to generate an initial prompt word; The target prompt word generation unit is used to identify variable placeholders in the initial prompt word, obtain the current parameter value of the initial structured text, fill the variable placeholders with the current parameter value, and generate the target prompt word.

[0076] Furthermore, the initial knowledge extraction result generation module 430 includes: The semantic feature vector encoding unit is used to extract entity density features, relation complexity features, domain term distribution features and semantic coherence features of the semantic text segment as multidimensional semantic features, and encode the multidimensional semantic features into the semantic feature vector; A semantic length vector generation unit is used to calculate the character length, word length, and number of semantic units of the semantic text segment, and to normalize the character length, word length, and number of semantic units to generate the semantic length vector. The semantic complexity level determination unit is used to generate semantic fusion features by performing cross-modal vector fusion processing on the semantic feature vector and the semantic length vector through the feature fusion network, and to determine the semantic complexity level based on the semantic fusion features through the level determination network.

[0077] Furthermore, the initial knowledge extraction result generation module 430 also includes: The historical extraction accuracy calculation unit is used to obtain a pool of candidate large language models and calculate the historical extraction accuracy of each candidate large language model for the target domain based on the historical call logs of each candidate large language model in the pool of candidate large language models. The target large language model determination unit is used to map and match the semantic complexity level with the historical extraction accuracy of each candidate large language model, calculate the comprehensive adaptation score of each candidate large language model, and determine the candidate large language model with the highest comprehensive adaptation score as the target large language model. The knowledge extraction result generation unit is used to convert the target prompt words into a request message that matches the format of the target large language model, and then use the target large language model to perform a reasoning task based on the request message to generate the initial knowledge extraction result.

[0078] Furthermore, the target knowledge extraction result generation module 440 includes: The initial vector extraction unit is used to take the initial structured text as a reference anchor point and extract the original semantic feature vector of the initial structured text and the initial extracted semantic feature vector of the initial knowledge extraction result through a preset text embedding model. The logical consistency score calculation unit is used to calculate the logical consistency score between the original semantic feature vector and the initially extracted semantic feature vector through the attention mechanism of the pre-trained learning calibration network. The target knowledge extraction result generation unit is used to generate the target knowledge extraction result by correcting the abnormal fields in the initial knowledge extraction result according to the benchmark anchor point through the error correction subnetwork of the pre-trained learning calibration network when the logical consistency score is lower than the preset security confidence threshold.

[0079] Furthermore, the semantic text segment generation module 410 includes: A window segmentation unit is used to acquire the initial structured text of the target domain, initialize a sliding window through the adaptive window segmentation algorithm, determine the initial window size and the initial sliding step size, and dynamically adjust the initial window size and the initial sliding step size based on the document type and text length of the initial structured text, and determine the target window size and the target sliding step size respectively. A granular text block generation unit is used to perform layout structure parsing on the initial structured text, determine the layout structure features of the initial structured text, and generate at least one granular text block according to preset semantic boundary rules and the layout structure features. The semantic coherence scoring unit is used to extract the visual features and text features of the initial structured text, and calculate the semantic coherence score of each granular text block based on the visual features and text features. The semantic text segment generation unit is used to generate the semantic text segment based on the semantic coherence score, the target window size, the target sliding step size, and the initial structured text.

[0080] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the above-described apparatus and modules can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0081] The aforementioned device can be implemented as a computer program, which can be used in, for example... Figure 4 It runs on the computer device shown.

[0082] Please see Figure 4 , Figure 4 This is a schematic block diagram illustrating the structure of a computer device according to an embodiment of this application. The computer device may be a server.

[0083] See Figure 4 The computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.

[0084] Non-volatile storage media can store operating systems and computer programs. These computer programs include program instructions that, when executed, cause the processor to perform any knowledge extraction method based on a large model.

[0085] The processor provides computing and control capabilities, supporting the operation of the entire computer device.

[0086] Internal memory provides an environment for the execution of computer programs stored in non-volatile storage media. When these computer programs are executed by a processor, the processor can perform any knowledge extraction method based on a large model.

[0087] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 4The 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.

[0088] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.

[0089] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps: An adaptive window segmentation algorithm is used to perform layout analysis and paragraph boundary recognition on the initial structured text in the target domain, generating at least one semantic text segment. Target prompt words are generated based on the prompt word architecture, the document type of the initial structured text, and the extraction task type. The prompt word architecture includes a preset basic semantic layer, a preset business rule layer, and a preset conversation instruction layer. The semantic complexity level is determined by the classification model built into the model abstraction layer based on the semantic feature vector and semantic length vector of the semantic text segment. The target large language model is dynamically determined based on the historical extraction accuracy and the semantic complexity level. Initial knowledge extraction results are generated based on the target large language model and the target prompt words. The initial knowledge extraction results are corrected by pre-training a calibration network and the primary structured text to generate target knowledge extraction results.

[0090] In one embodiment, target prompt words are generated based on the prompt word architecture, the document type of the initial structured text, and the extraction task type. The prompt word architecture includes a preset basic semantic layer, a preset business rule layer, and a preset session instruction layer, and is used to implement: Obtain a preset global fixed instruction set, a preset document type identifier for a preset target domain, and a preset extraction task type identifier for the preset target domain; The preset global fixed instruction set is encapsulated into the preset basic semantic layer; Based on the preset document type identifier, the preset business rule layer is generated by retrieving a specialized terminology dictionary, extracting example templates, regular expression constraints, and logical verification rules from the domain knowledge base. Retrieve task description text, expected output granularity control parameters, and context association indicators that match the preset extraction task type identifier from the preset task configuration library; The preset session instruction layer is generated based on the task description text, the expected output granularity control parameters, and the context association indication; The preset basic semantic layer, the preset business rule layer, and the preset conversation instruction layer are encapsulated into the prompt word architecture by a preset hierarchical order.

[0091] In one embodiment, target prompt words are generated based on the prompt word architecture, the document type of the initial structured text, and the extraction task type. The prompt word architecture includes a preset basic semantic layer, a preset business rule layer, and a preset session instruction layer, used to achieve: Based on the document type identifier corresponding to the document type and the extraction task type identifier corresponding to the extraction task type, determine the target basic semantic layer, the target business rule layer, and the target session instruction layer; The target basic semantic layer, the target business rule layer, and the target session instruction layer are concatenated according to the preset hierarchical order to generate initial prompt words; Identify the variable placeholders in the initial prompt word, obtain the current parameter value of the initial structured text, fill the variable placeholders with the current parameter value, and generate the target prompt word.

[0092] In one embodiment, the semantic complexity level is determined by a classification model built into the model abstraction layer based on the semantic feature vector and semantic length vector of the semantic text segment, for the purpose of: The entity density feature, relation complexity feature, domain term distribution feature, and semantic coherence feature of the semantic text segment are extracted as multidimensional semantic features, and the multidimensional semantic features are encoded into the semantic feature vector. Calculate the character length, word length, and number of semantic units of the semantic text segment, and normalize the character length, word length, and number of semantic units to generate the semantic length vector; The semantic feature vector and the semantic length vector are fused across modalities using the feature fusion network to generate semantic fusion features, and the semantic complexity level is determined by the level determination network based on the semantic fusion features.

[0093] In one embodiment, a target large language model is dynamically determined based on historical extraction accuracy and the semantic complexity level, and an initial knowledge extraction result is generated based on the target large language model and the target prompt words, for the purpose of: Obtain a pool of candidate large language models, and calculate the historical extraction accuracy of each candidate large language model for the target domain based on the historical call logs of each candidate large language model in the pool of candidate large language models. The semantic complexity level is mapped and matched with the historical extraction accuracy of each candidate large language model, the comprehensive adaptation score of each candidate large language model is calculated, and the candidate large language model with the highest comprehensive adaptation score is determined as the target large language model. The target prompt words are converted into a request message that matches the format of the target large language model. The target large language model then performs a reasoning task based on the request message to generate the initial knowledge extraction result.

[0094] In one embodiment, the initial knowledge extraction result is corrected by a pre-trained calibration network and the primary structured text to generate a target knowledge extraction result, which is used to achieve: The initial structured text is used as the reference anchor point, and the original semantic feature vector of the initial structured text and the initial extracted semantic feature vector of the initial knowledge extraction result are extracted respectively through a preset text embedding model. The logical consistency score between the original semantic feature vector and the initially extracted semantic feature vector is calculated through the attention mechanism of the pre-trained learning calibration network. When the logical consistency score is lower than the preset security confidence threshold, the error correction subnetwork of the pre-trained learning calibration network corrects the abnormal fields in the initial knowledge extraction result according to the benchmark anchor point, and generates the target knowledge extraction result.

[0095] In one embodiment, an adaptive window segmentation algorithm is used to perform layout analysis and paragraph boundary recognition on the initial structured text in the target domain, generating at least one semantic text segment for the purpose of: The initial structured text of the target domain is obtained, and a sliding window is initialized through the adaptive window segmentation algorithm. The initial window size and initial sliding step size are determined, and the initial window size and initial sliding step size are dynamically adjusted based on the document type and text length of the initial structured text. The target window size and target sliding step size are determined respectively. The initial structured text is parsed to determine its layout structure features, and at least one granular text block is generated based on preset semantic boundary rules and the layout structure features. Extract the visual and text features of the initial structured text, and calculate the semantic coherence score of each granular text block based on the visual and text features. The semantic text segment is generated based on the semantic coherence score, the target window size, the target sliding step size, and the initial structured text.

[0096] The embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, and the processor executing the program instructions to implement any of the knowledge extraction methods based on large models provided in the embodiments of this application.

[0097] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.

[0098] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.

[0099] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A knowledge extraction method based on a large model, characterized in that, include: An adaptive window segmentation algorithm is used to perform layout analysis and paragraph boundary recognition on the initial structured text in the target domain, generating at least one semantic text segment. Target prompt words are generated based on the prompt word architecture, the document type of the initial structured text, and the extraction task type. The prompt word architecture includes a preset basic semantic layer, a preset business rule layer, and a preset conversation instruction layer. The semantic complexity level is determined by the classification model built into the model abstraction layer based on the semantic feature vector and semantic length vector of the semantic text segment. The target large language model is dynamically determined based on the historical extraction accuracy and the semantic complexity level. Initial knowledge extraction results are generated based on the target large language model and the target prompt words. The initial knowledge extraction results are corrected by pre-training a calibration network and the primary structured text to generate target knowledge extraction results.

2. The knowledge extraction method based on a large model according to claim 1, characterized in that, Before generating target prompt words based on the prompt word structure, the document type of the initial structured text, and the extraction task type, the process includes: Obtain a preset global fixed instruction set, a preset document type identifier for a preset target domain, and a preset extraction task type identifier for the preset target domain; The preset global fixed instruction set is encapsulated into the preset basic semantic layer; Based on the preset document type identifier, the preset business rule layer is generated by retrieving a specialized terminology dictionary, extracting example templates, regular expression constraints, and logical verification rules from the domain knowledge base. Retrieve task description text, expected output granularity control parameters, and context association indicators that match the preset extraction task type identifier from the preset task configuration library; The preset session instruction layer is generated based on the task description text, the expected output granularity control parameters, and the context association indication. The preset basic semantic layer, the preset business rule layer, and the preset conversation instruction layer are encapsulated into the prompt word architecture by a preset hierarchical order.

3. The knowledge extraction method based on a large model according to claim 2, characterized in that, The step of generating target prompt words based on the prompt word structure, the document type of the initial structured text, and the extraction task type includes: Based on the document type identifier corresponding to the document type and the extraction task type identifier corresponding to the extraction task type, determine the target basic semantic layer, the target business rule layer, and the target session instruction layer; The target basic semantic layer, the target business rule layer, and the target session instruction layer are concatenated according to the preset hierarchical order to generate initial prompt words; Identify the variable placeholders in the initial prompt word, obtain the current parameter value of the initial structured text, fill the variable placeholders with the current parameter value, and generate the target prompt word.

4. The knowledge extraction method based on a large model according to claim 1, characterized in that, The classification model includes a feature fusion network and a ranking network. The classification model built into the model abstraction layer determines the semantic complexity level based on the semantic feature vector and semantic length vector of the semantic text segment, including: The entity density feature, relation complexity feature, domain term distribution feature, and semantic coherence feature of the semantic text segment are extracted as multidimensional semantic features, and the multidimensional semantic features are encoded into the semantic feature vector. Calculate the character length, word length, and number of semantic units of the semantic text segment, and normalize the character length, word length, and number of semantic units to generate the semantic length vector; The semantic feature vector and the semantic length vector are fused across modalities using the feature fusion network to generate semantic fusion features, and the semantic complexity level is determined by the level determination network based on the semantic fusion features.

5. The knowledge extraction method based on a large model according to claim 4, characterized in that, The process of dynamically determining the target large language model based on historical extraction accuracy and semantic complexity level, and generating initial knowledge extraction results based on the target large language model and the target prompt words, includes: Obtain a pool of candidate large language models, and calculate the historical extraction accuracy of each candidate large language model for the target domain based on the historical call logs of each candidate large language model in the pool of candidate large language models. The semantic complexity level is mapped and matched with the historical extraction accuracy of each candidate large language model, the comprehensive adaptation score of each candidate large language model is calculated, and the candidate large language model with the highest comprehensive adaptation score is determined as the target large language model. The target prompt words are converted into a request message that matches the format of the target large language model. The target large language model then performs a reasoning task based on the request message to generate the initial knowledge extraction result.

6. The knowledge extraction method based on a large model according to claim 1, characterized in that, The step of correcting the initial knowledge extraction result by pre-training a calibration network and the primary structured text to generate the target knowledge extraction result includes: The initial structured text is used as the reference anchor point, and the original semantic feature vector of the initial structured text and the initial extracted semantic feature vector of the initial knowledge extraction result are extracted respectively through a preset text embedding model. The logical consistency score between the original semantic feature vector and the initially extracted semantic feature vector is calculated through the attention mechanism of the pre-trained learning calibration network. When the logical consistency score is lower than the preset security confidence threshold, the error correction subnetwork of the pre-trained learning calibration network corrects the abnormal fields in the initial knowledge extraction result according to the benchmark anchor point, and generates the target knowledge extraction result.

7. The knowledge extraction method based on a large model according to any one of claims 1 to 6, characterized in that, The step involves performing layout analysis and paragraph boundary recognition on the initial structured text in the target domain using an adaptive window segmentation algorithm to generate at least one semantic text segment, including: The initial structured text of the target domain is obtained, and a sliding window is initialized through the adaptive window segmentation algorithm. The initial window size and initial sliding step size are determined, and the initial window size and initial sliding step size are dynamically adjusted based on the document type and text length of the initial structured text. The target window size and target sliding step size are determined respectively. The initial structured text is parsed to determine its layout structure features, and at least one granular text block is generated based on preset semantic boundary rules and the layout structure features. Extract the visual and text features of the initial structured text, and calculate the semantic coherence score of each granular text block based on the visual and text features. The semantic text segment is generated based on the semantic coherence score, the target window size, the target sliding step size, and the initial structured text.

8. A knowledge extraction device based on a large model, characterized in that, include: The semantic text segment generation module is used to perform layout analysis and paragraph boundary recognition on the initial structured text of the target domain using an adaptive window segmentation algorithm, and generate at least one semantic text segment. The target prompt word generation module is used to generate target prompt words based on the prompt word architecture, the document type of the initial structured text, and the extraction task type. The prompt word architecture includes a preset basic semantic layer, a preset business rule layer, and a preset conversation instruction layer. The initial knowledge extraction result generation module is used to determine the semantic complexity level based on the semantic feature vector and semantic length vector of the semantic text segment through the classification model built into the model abstraction layer, dynamically determine the target large language model based on the historical extraction accuracy and the semantic complexity level, and generate the initial knowledge extraction result based on the target large language model and the target prompt word. The target knowledge extraction result generation module is used to correct the initial knowledge extraction result by using a pre-trained calibration network and the primary structured text to generate the target knowledge extraction result.

9. A computer device, characterized in that, The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and, in executing the computer program, implement the knowledge extraction method based on a large model as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the knowledge extraction method based on a large model as described in any one of claims 1 to 7.