Method, device and medium for intelligent generation of structured document based on inclination instruction
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- OXFORD INTELLIGENT (HANGZHOU) TECHNOLOGY CO LTD
- Filing Date
- 2026-03-23
- Publication Date
- 2026-06-12
Smart Images

Figure CN122196135A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence, natural language processing and information generation technology, and in particular to a method, device and medium for intelligent generation of structured documents based on preference instructions. Background Technology
[0002] In the generation of structured documents in specialized fields (such as technical due diligence reports, market access analysis reports, and project feasibility study reports), users typically provide biased instructions containing implicit preferences and directional requirements (such as emphasizing technical risks or analyzing commercial prospects), rather than precise, structured document specifications. Existing technologies face the following technical problems when handling such biased input: 1. Interactive Question-Answer System These systems employ pre-defined question-and-answer logic, guiding users to answer specific questions to gradually determine document content. Their technical characteristic lies in their reliance on structured input formats, requiring users to transform abstract needs into explicit question-and-answer statements. However, when users input indicative commands, the system struggles to directly map them to the pre-defined question-and-answer path, necessitating multiple rounds of interaction to refine the requirements, thus limiting document generation efficiency.
[0003] 2. General Large Language Model Generation Method Language models pre-trained on large-scale corpora can generate coherent text based on topic descriptions. Their technical principle relies on statistical language models to reproduce patterns from training data, and the generated content is limited by the coverage and timeliness of the training data. In professional applications, the following technical limitations exist: the generated content may deviate from the knowledge system and logical structure of a specific domain; the source of cited data is untraceable, and its authority is difficult to verify; the output format lacks a mechanism for consistent adaptation with professional document standards.
[0004] 3. Static Template Fill Tool These tools provide predefined document templates, allowing users to populate data within the template framework. Their technical implementation includes predefined template structures and manual / semi-automatic data import. The main technical challenges are: the template's suitability for user needs requires manual judgment; the retrieval, filtering, and integration of multi-source data rely on manual operation; and information conflicts between different data sources lack automatic verification mechanisms, requiring manual arbitration.
[0005] In summary, existing technologies face technical challenges in the automatic conversion from indicative instructions to structured documents, including insufficient precision in intent parsing, low automation of data fusion, and limited ability to dynamically adapt document structures. Summary of the Invention
[0006] To address the aforementioned technical problems, the technical solution adopted by this invention is as follows: According to a first aspect of the present invention, a method for intelligently generating structured documents based on preference instructions is provided, the method comprising the following steps: The system receives topic information and preference instructions input by the user, identifies semantic preference features in the preference instructions through natural language processing technology, and parses and maps the semantic preference features into at least one content unit identifier and a preference weight corresponding to the content unit identifier.
[0007] Based on the content unit identifier and the preference weight, the original data is retrieved from the heterogeneous data source, and the original data is subjected to data consistency detection and credibility weighting processing to generate a structured data tuple corresponding to the content unit identifier.
[0008] Based on the content unit identifiers and the logical relationships between them, and combined with the preference weights, a basic document framework is matched or combined from the template library, and the structured data tuples are mapped to the corresponding chapters of the basic document framework according to preset mapping rules to generate a document structure tree.
[0009] The document rendering engine is invoked to synthesize and output a document based on the document structure tree.
[0010] According to a second aspect of the present invention, an electronic device is provided, including a processor and a memory; the processor executes the steps of the method described in the first aspect of the present invention by invoking a program or instructions stored in the memory.
[0011] According to a third aspect of the present invention, a computer-readable storage medium is provided that stores a program or instructions that cause a computer to perform the steps of the method described in the first aspect of the present invention.
[0012] The present invention has at least the following beneficial effects: This invention parses user-input preference commands and maps them to content unit identifiers and corresponding preference weights. Based on these content unit identifiers and preference weights, it retrieves raw data from heterogeneous data sources and performs data consistency checks and credibility weighting on the raw data to generate structured data tuples. According to the logical relationships between content unit identifiers, and combined with preference weights to match or combine a basic document framework, it maps the structured data tuples to corresponding chapters to generate a document structure tree. Finally, it calls a document rendering engine to synthesize and output the document. This method achieves automatic conversion from preference commands to structured documents, generating professional documents with structured features and data consistency processing.
[0013] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 A flowchart of a structured document intelligent generation method based on preference instructions provided in an embodiment of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0018] It should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processes, many of these steps can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the steps can be rearranged. A process can be terminated when its operation is complete, but it may also have additional steps not included in the figures. A process can correspond to a method, function, procedure, subroutine, subroutine, etc.
[0019] This invention provides a method for intelligently generating structured documents based on preference instructions, such as... Figure 1 As shown, the method includes the following steps: S100: Receive topic information and preference instructions input by the user, identify semantic preference features in the preference instructions through natural language processing technology, and parse and map the semantic preference features into at least one content unit identifier and a preference weight corresponding to the content unit identifier.
[0020] In this invention, preference instructions refer to unstructured natural language descriptions input by users that contain subjective preferences for the focus, depth, or angle of the report content. These preference instructions are usually input together with the report topic information and are used to express the user's implicit requirements for specific analysis dimensions, module weights, or presentation methods, rather than precise, structured document specifications.
[0021] Specifically, biased instructions have the following technical characteristics: Unstructured form: It exists in the form of natural language statements or phrases, such as "emphasis on technical risks", "brief mention of commercialization prospects", "focus on analysis of market competition landscape", etc., rather than predefined options or structured query statements; Preference intensity indicators: These include quantifiable preference intensity indicators such as "emphasis", "key point", "detailed", "brief", "briefly mentioned", "highlighted", etc. These words can be mapped to preset intensity levels through natural language processing technology. Module-oriented: Implies a focus on specific content modules. For example, "technical risks" refers to the technical risk analysis module, and "commercial prospects" refers to the market assessment module. This can be mapped to predefined content unit identifiers through semantic parsing. Implicit weights: Implicit requirements for the relative importance of different modules, which need to be converted into quantifiable preference weights through weight calculation methods to guide subsequent data filtering, template matching and content arrangement.
[0022] In this invention, a module refers to the basic functional unit that constitutes a structured document, serving as the core carrier for content organization and data association. Each module corresponds to an independent analysis dimension or report section, possessing clear thematic semantics and a predefined data structure. Modules have the following technical attributes: Topic semantics: Each module corresponds to a specific analysis topic, such as "technology maturity analysis" or "market size assessment," which can be semantically represented through the module description text; Unique Identifier: Each module is assigned a unique content unit identifier (Module ID) to uniquely identify the module throughout the entire processing flow; Data Structure: Each module predefines the expected data formats to be received, including lists of key metrics, text summary paragraphs, data table structures, chart types, etc. Logical relationships: Modules can have predefined logical relationships, such as causal relationships, parallel relationships, etc. Reusability: The module is independent of specific document templates and can be repeatedly called in different reports; Scalability: The module set can be dynamically expanded according to the application domain.
[0023] Unlike traditional technologies where users need to explicitly answer specific questions or select fixed options, the present invention’s preference instructions allow users to express their needs in a high-level, directional manner. Natural language understanding technology automatically parses their semantic preference features and transforms them into executable modular requirements and quantitative weights, thereby achieving intelligent conversion from vague intentions to structured documents.
[0024] This invention predefines a fine-grained set of content units. Based on domain knowledge, this set breaks down professional reports into reusable modular components, such as a technology risk analysis module, a market size assessment module, a competitive landscape module, and a policy and regulation module. Each module corresponds to a unique content unit identifier. This set of content units can be dynamically expanded according to application scenarios; when adding a new module, only its identifier, descriptive text, and logical relationships with other modules need to be defined.
[0025] Determining the content unit identifier and its corresponding preference weight further includes: S101, the preference intensity indicator words in the preference instruction are identified by a natural language processing model, and the preference intensity indicator words are matched with a preset intensity level library to determine the corresponding intensity level.
[0026] (I) Definition and characteristics of preference intensity indicators In this invention, preference intensity indicators refer to subjective modifiers in natural language used to express a user's level of attention to the report content, the depth of analysis, or the required length. These include, but are not limited to, words such as "emphasis," "key point," "detailed," "in-depth," "brief," "briefly mentioned," "simple introduction," "highlight," and "emphasis." These words quantify user preferences in preference instructions and can be mapped to preset intensity levels through natural language processing technology, providing a basis for subsequent weight calculations.
[0027] Preference intensity indicators have the following technical characteristics: Differences in intensity: Different indicator words express different levels of intensity, such as "important" being stronger than "general," and "brief" being weaker than "routine." Targeting modifiers: These usually modify the theme or analytical dimension of the following modules, such as "focusing on technical risks" modifying "technical risks" in "focusing on technical risks"; Quantifiability: It can be converted into specific intensity levels or numerical weights through predefined mapping rules.
[0028] (ii) Identification of preference intensity indicators In this invention, the natural language processing model can be obtained by fine-tuning a pre-trained language model (such as BERT, RoBERTa, etc.) on labeled corpora, or it can be obtained by other deep learning-based sequence labeling or text classification models. The specific implementation is as follows: First, an annotated corpus of preference intensity indicators is constructed. Words in preference instructions are sequentially labeled, marking whether each word belongs to a preference intensity indicator and its category (e.g., "emphasis category," "key category," "brief category," etc.). The annotated corpus is then input into a pre-trained language model for fine-tuning, enabling the model to learn to recognize preference intensity indicators and their boundaries in instructions.
[0029] During the recognition process, the user's input preference instructions are fed into a fine-tuned natural language processing model. The model outputs a label for each word, thereby extracting all preference intensity indicators and their positions in the instructions.
[0030] (III) Mapping of Intensity Levels In this invention, the intensity level mapping rule base predefines the correspondence between each preference intensity indicator and the intensity level. In this embodiment, the intensity level is divided into three levels: L1 (highlighting key points): corresponding to indicators such as "emphasis," "key point," "detailed," and "in-depth"; L2 (Routine Analysis): Corresponds to neutral indicator words such as "analysis," "evaluation," and "discussion," or situations where there are no obvious strong modifiers in the instruction; L3 (brief mention): corresponds to indicator words such as "brief," "briefly mentioned," or "simple introduction."
[0031] Each intensity level has a preset basic weight range: L1 is 0.8~1.0, L2 is 0.5~0.7, and L3 is 0.1~0.4.
[0032] (iv) Processing of multiple preference intensity indicators When a preference instruction contains multiple preference strength indicators, the module to which each indicator points must be determined through contextual semantics, and each must be assigned a corresponding strength level. The specific implementation steps are as follows: S101-1, Syntactic Analysis and Dependency Relation Parsing Natural language processing is performed on preference instructions, including word segmentation, part-of-speech tagging, and dependency parsing, to generate a syntactic dependency tree. Dependency parsing is used to identify the modification relationships between words, especially the modification relationship between preference intensity indicators and the core nouns (module topics) they modify (such as "advmod" adverbial-head relationship, "amod" attributive-head relationship, etc.).
[0033] For example, for the instruction "focus on analyzing technical risks and briefly mention commercialization prospects," dependency analysis can identify: The word “key point” modifies “analysis”, and the object of “analysis” is “technical risk”, forming a modification chain of “key point → analysis → technical risk”. "Briefly" modifies "mention", and the object of "mention" is "commercial prospects", forming a modification chain of "briefly → mention → commercial prospects".
[0034] S101-2, Module Topic Recognition Using domain-specific dictionaries or named entity recognition technology, keywords or phrases that may correspond to predefined content units are identified from the instructions, such as "technological risks," "commercial prospects," and "market competition." The mapping relationship between the keywords and content unit identifiers has been established in step S100.
[0035] S101-3, Strength Indicator - Module Binding Based on dependency relationships, each preference intensity indicator is bound to the topic of the module it modifies: If the indicator word directly modifies a module's subject term (e.g., "key" in "key technical risks" modifies "technical risks"), then it is directly bound; If an indicator modifies a verb, and the object of the verb is a module subject term (such as "focus on analyzing technical risks"), then the verb indirectly binds the subject. If an indicator does not explicitly modify any object (such as "analyze in detail" appearing alone at the beginning of an instruction), it is considered an overall tendency modifier.
[0036] S101-4, Determination of Intensity Level Each preference intensity indicator is mapped to its corresponding intensity level (L1, L2, or L3) according to a preset intensity level mapping rule library. If the same module is modified by multiple indicators, the highest intensity level is taken as the final intensity level of the module.
[0037] S101-5, Integration of Overall Tendency and Module-Specific Tendency Based on the binding result, three cases are handled: Scenario 1: There are overall tendency modifiers, but no module-specific words. The strength level of the overall tendency modifier is used as the overall tendency level of the entire instruction, and applied to all subsequent content units parsed from the topic information. For example, if the instruction "Please analyze in detail" has an overall tendency level of L1, then all related modules will default to the L1 level.
[0038] Scenario 2: There are module-specific terms, but no overall tendency modifiers. Only bound modules are assigned the corresponding strength level; unbound modules are assigned the default level L2 (normal analysis). For example, the instruction "Focus on analyzing technical risks and briefly mention commercial prospects" assigns the technical risk module L1, the commercial prospects module L3, and the remaining modules L2 by default.
[0039] Scenario 3: The coexistence of overall tendency modifiers and module-specific terms Module-specific terms override the influence of overall trend terms on the module. That is, bound modules are determined by the strength level of the module-specific term; unbound modules inherit the overall trend level. For example, in the instruction "Analyze in detail, especially focusing on technical risks," the overall trend "detailed" is L1, and the module-specific term "focus" bound to "technical risks" is also L1, so they are consistent. If the overall trend is L1 but a module-specific term is L3, then the module is processed as L3.
[0040] S101-6, Handling Special Cases When multiple overall tendency modifiers with different intensities appear in an instruction, the highest intensity level is taken as the overall tendency. For example, in "brief but focused analysis", the intensity of "focused" is higher than that of "brief", so L1 is taken.
[0041] When multiple module-specific terms in an instruction point to the same module, the highest level is used; when they point to different modules, they are processed separately.
[0042] By using the above rules, complex instructions containing one or more preference intensity indicators can be accurately parsed into intensity levels of each module, providing precise input for subsequent weight calculations.
[0043] S102, based on the intensity level, obtain the semantic relevance coefficient between the content unit corresponding to the content unit identifier and the topic information through a semantic similarity calculation model.
[0044] After obtaining the intensity level, the semantic relevance of each content unit to the topic information is further calculated. The specific steps are as follows: First, the topic information and the descriptive text for each content unit are vectorized to obtain the corresponding text feature vectors. Vectorization can be performed using the sentence vector output of a pre-trained language model (such as BERT).
[0045] Then, the similarity between the feature vector of the topic information and the feature vector of each content unit is calculated using the cosine similarity algorithm. The calculation result is used as the semantic relevance coefficient between the content unit and the topic information. The semantic relevance coefficient ranges from [0, 1], and the larger the coefficient value, the higher the semantic matching degree between the content unit and the topic information.
[0046] S103, based on the intensity level and the semantic relevance coefficient, calculate the preference weight of each content unit through a weighting function.
[0047] The weighting function is: W i =α(L i )×Wbase(L i )+(1-α(L i ))×R i .
[0048] Among them, W i Let α(L) be the preference weight for the i-th content unit, where i ranges from 1 to n, and n is the total number of content units; i ) is based on intensity level L i The dynamic adjustment coefficient is used to adjust the influence ratio between the hierarchical base weights and the semantic relevance coefficients; Wbase(L i R represents the base weight of the intensity level corresponding to the i-th content unit, selected from a preset range (e.g., 0.9 for L1, 0.6 for L2, and 0.2 for L3); i is the semantic relevance coefficient between the i-th content unit and the topic information.
[0049] In one illustrative embodiment, α(L i The following conditions must be met: α(L i )=α min +(L max -L i )×(α max -α min ) / (L max -L min ).
[0050] Where, α min and α max These are the minimum and maximum values of the dynamic adjustment coefficient, respectively. In this embodiment, α is taken as... min =0.6 (corresponding to L3), α max =0.8 (corresponding to L1); L max and L min These represent the highest and lowest intensity levels, respectively. In this embodiment, L1=1, L2=2, and L3=3. This formula achieves the effect that the higher the intensity level (L1), the larger the dynamic adjustment coefficient, thereby strengthening the influence of the high-propensity level on the final weight.
[0051] Through the above calculations, each content unit obtains a quantified preference weight, which reflects the user's implicit preference for the module. After normalization, it can be directly used for priority ranking and filtering in subsequent steps.
[0052] In step S100, while parsing and mapping the semantic preference features, the overall tone and key analysis dimensions of the document are also determined, as specifically implemented as follows: Overall Tone Identification: A natural language processing model is used to identify the semantic sentiment and analytical guidance of pertinental instructions to determine the overall tone of the document. This overall tone includes, but is not limited to, conservative, optimistic, neutral, and cautionary categories. For example, instructions containing words such as "risk," "challenge," or "barrier" tend to have a conservative or cautionary tone; instructions containing words such as "opportunity," "prospect," or "growth" tend to have an optimistic or positive tone.
[0053] Key analytical dimensions extraction: Combining the domain attributes of the topic information (such as technical analysis, market research, policy evaluation, etc.) with the core demands of the intended instructions (such as risk analysis, prospect assessment, barrier research, etc.), the key analytical dimensions of the document are extracted and determined. These key analytical dimensions include, but are not limited to, technical dimensions, market dimensions, policy dimensions, and commercialization dimensions.
[0054] Dimension and Module Association Mapping: Establish a corresponding association between the identified key analysis dimensions and the content unit identifiers obtained from the parsing and mapping in S101-S103. Content unit identifiers under the same analysis dimension are grouped into the same module cluster. This module cluster is used in the subsequent S300 step to guide the chapter structure planning during template matching, ensuring that modules of the same dimension maintain logical consistency in the document.
[0055] The S100 step transforms user-inputted, unstructured preference instructions and topic information into a set of explicit content unit identifiers and their quantified preference weights, while simultaneously determining the overall tone and key analytical dimensions of the document. This process is entirely based on natural language processing and statistical computation, without human intervention, ensuring the objectivity and repeatability of intent recognition and providing accurate input for subsequent steps.
[0056] S200: Based on the content unit identifier and the preference weight, retrieve the original data from the heterogeneous data source, and perform data consistency detection and credibility weighting processing on the original data to generate a structured data tuple corresponding to the content unit identifier.
[0057] S200 takes the content unit identifier and its preference weight output by S100 as input, starts a parallel data processing flow for each content unit, retrieves relevant raw data from multi-source heterogeneous data sources, and generates high-quality structured data tuples through data consistency detection and credibility weighting processing, providing data support for subsequent document arrangement.
[0058] Based on the content unit identifiers determined in S100, raw data is retrieved in parallel from preset heterogeneous data sources. These heterogeneous data sources include, but are not limited to: External publicly available data sources: patent databases, academic literature databases, industry research report databases, news and information databases, government open data, etc.; Internal private data sources: enterprise knowledge base, historical report library, internal experimental data, customer feedback data, etc.; Real-time data sources: real-time data from API interfaces, data crawled by web crawlers, etc.
[0059] The search strategy is optimized for the semantics of each content unit. For example, for the "Clinical Accuracy Verification Module", professional data sources such as medical literature databases, clinical trial registration platforms, and drug regulatory approval information are prioritized for retrieval; for the "Market Size Assessment Module", data sources such as industry white papers, market research reports, and statistical yearbooks are prioritized for retrieval.
[0060] If the amount of raw data retrieved for a certain content unit is lower than a preset threshold (less than 3 valid data entries in this embodiment), a large language model is invoked to generate supplementary data. Based on its pre-trained knowledge base, the large language model combines the topic description of the content unit with existing data to generate reasonable inferences as supplementary information. The generated supplementary data will be marked as a low-confidence data source and assigned a lower confidence weight in subsequent data consistency checks and confidence weighting processes. In the authority scoring model, the data source type corresponding to the generated data is assigned the lowest type weight, so that its authority score is significantly lower than that of other data sources; In the calculation of the credibility score, the generated data is multiplied by a preset attenuation coefficient to further reduce its credibility score; The weighted arbitration rule stipulates that generated data will only be considered for inclusion in consensus extraction if a point of inconsistency has no non-generated data source information.
[0061] Through the above multi-layered mechanism, the generated data is given a low priority in data consistency detection and credibility weighting, so as not to excessively affect the objectivity of the final result.
[0062] The data consistency detection and credibility weighting process includes: S201, perform semantic comparison on the original data to identify data inconsistencies between different data sources describing the same entity or event.
[0063] First, key entities are extracted from the raw data using named entity recognition technology. These key entities include, but are not limited to: Product name (e.g., "Artificial Intelligence CT-Assisted Diagnostic System"); Technical metrics (such as "sensitivity", "specificity", "accuracy"); Organization name (e.g., "National Medical Products Administration" or "FDA"); The name of the policy or regulation (e.g., "Regulations on the Administration of Medical Devices"); Names of people, geographical locations, time periods, etc.
[0064] Entity recognition can be achieved using pre-trained named entity recognition models (such as BERT-NER) or rule-based methods.
[0065] After entities are identified, data describing the same entity or event are grouped into the same entity group. Entity alignment is based on the following criteria: The exact matching entity name; Entity links based on knowledge base (e.g., mapping "FDA" and "U.S. Food and Drug Administration" to the same entity); Similarity calculation based on contextual semantics.
[0066] Semantic comparison is performed on data within the same entity group to identify data inconsistencies. These inconsistencies include the following types: The data inconsistency information includes, but is not limited to, the following types: Numerical inconsistency refers to discrepancies in the numerical descriptions of the same indicator. For example, paper A reports a specificity of 95% for a certain system, while news article B reports a specificity of 92% for the same system.
[0067] Factual inconsistency refers to contradictions in the description of the same fact. For example, report C states that a certain technology has been approved for market launch, while report D states that the technology is still under review.
[0068] Temporal inconsistency refers to discrepancies in the time descriptions of the same event. For example, document E records an event as occurring in May 2023, while document F records it as occurring in June 2023.
[0069] Semantic inconsistency refers to disagreements in the qualitative description of the same concept. For example, one report may characterize a technology as "mature," while another report may characterize it as "still in the experimental stage."
[0070] Identification methods include: For numerical inconsistencies, extract the values and perform difference calculations; For factual inconsistencies, semantic implication can be used to determine whether a contradiction exists. For time-related inconsistencies, parse the time expressions and perform time-series comparisons; For semantic inconsistencies, qualitative differences can be identified through sentiment analysis or polarity judgment.
[0071] The data consistency check will generate a set of inconsistency information, and each inconsistency record will contain the following fields: Entity identifier: The core entity or event described; Inconsistency types: numerical / factual / temporal / semantic; Specific details: Inconsistent descriptions; Data sources involved: inconsistent identifiers of various data sources; Original statements: Original text fragments from various data sources; Credibility-related information: Authority scores and timeliness parameters for each data source.
[0072] S202 calculates the authority score of each data source based on the preset authority scoring model, and combines the timeliness parameters of the data source information to perform weighted arbitration on inconsistent data information, extracting consensus information or marking divergent information.
[0073] Regarding the data inconsistencies identified in step S201, this step performs weighted arbitration based on the authority and timeliness of the data source information to determine the disagreements that cannot be resolved by consensus information or annotations. The specific implementation is as follows: (I) Calculation of Data Source Authority Score This invention pre-defines an authority scoring model for different data sources. Each data source (such as a specific academic journal, government website, industry report database, news media, etc.) is assigned an authority score, ranging from [0, 1]. The authority score is calculated based on the following dimensions: Data source type weight: A basic weight is assigned according to the type of data source. In this embodiment, the weights of various data sources are set as follows: academic journals > government announcements > industry reports > news media > social media > generated data. The specific values can be adjusted according to the actual application. Publishing institution reputation: scored based on factors such as journal impact factor, publisher reputation, and institutional authority, with a value range of [0, 1]. Citation frequency: For academic literature, a normalized score is calculated based on the number of times it has been cited; Peer review status: Whether it has undergone peer review; if so, a higher score will be assigned.
[0074] The authority score for each data source is obtained by weighted summation of the scores for each dimension. The authority scoring model can be dynamically updated according to the application scenario.
[0075] (II) Calculation of Timeliness Parameters for Data Source Information For each piece of data from a data source (i.e., each specific piece of data retrieved from various data sources), record the publication time or update time of that data source information and calculate the timeliness parameter. The formula for calculating the timeliness parameter is: Tjk =max(0, 1-(t) now -t jk publish ) / t half-life ).
[0076] Among them, T jk Let t be the timeliness parameter for the k-th message in the j-th data source, where j ranges from 1 to m, m is the number of data sources, and k ranges from 1 to f(j), where f(j) is the number of messages in the j-th data source. now t represents the current time. jk publish Let t be the data publication time of the k-th data source. half-life The preset half-life is set according to the data source type, for example, 5 years for academic literature, 1 year for news, and 3 years for industry reports. The timeliness parameter ranges from [0, 1], and the closer the publication time is to the current time, the higher the timeliness parameter.
[0077] (III) Calculation of data source information credibility score For each data source, a credibility score is calculated by combining the authority score of the data source and the timeliness parameter of the information itself: C jk =w A ×A j +w T ×T ik .
[0078] Among them, C jk A represents the credibility score of the k-th data source information. j w represents the authority score of the i-th data source. A and w T The weighting coefficients for authority and timeliness are respectively, satisfying w A +w T =1. In this embodiment, w is taken as 1. A =0.7, w T =0.3, meaning that authority is weighted higher than timeliness. The weighting coefficient can be adjusted according to the application scenario.
[0079] (iv) Weighted Arbitration For each data inconsistency message generated by S201, involving multiple data sources from different sources, a weighted arbitration is performed based on the credibility scores of each data source. The specific rules are as follows: A difference threshold is set: a preset difference threshold Δ based on the credibility scores is used. th In this embodiment, Δ is taken th =0.2.
[0080] Judgment rules: If the credibility score of a certain data source is higher than all other related information, and the difference between it and the second highest score is greater than Δ... th If the information is deemed to have a significant advantage, its content will be prioritized as the consensus information for that point of inconsistency.
[0081] If the difference between the highest score and the second highest score is less than or equal to Δ th If multiple data sources are considered to have similar credibility, then the semantic intersection of these sources is extracted as consensus information. Semantic intersection extraction can be achieved through methods such as text similarity calculation and key information overlap identification.
[0082] If a consensus cannot be reached through the above rules (e.g., the information content is mutually exclusive and has no overlap), all information will be retained and marked as divergent information. This divergent information will be presented as "Data from different sources shows divergence" in subsequent report generation for user reference.
[0083] Special handling: For information marked as low-confidence data sources (such as supplementary data generated by large language models), its impact can be reduced in weighted arbitration by setting participation thresholds or additional attenuation, for example, only considering adoption when there is no other non-generated data source information.
[0084] Through the aforementioned weighted arbitration process, high-quality and highly credible consensus information can be extracted from multi-source data, while irreconcilable differences are preserved, ensuring the accuracy and objectivity of the reported data.
[0085] S203, based on the preference weight corresponding to the content unit identifier, filter the data segments associated with the content units whose preference weight is greater than a preset threshold.
[0086] This step is the final stage of the data processing flow in S200. Its purpose is to perform preference adaptation filtering on the data after consistency checks and credibility weighting, based on the content unit preference weights calculated in S100, and to organize it into structured data tuples, forming an optimized modular data pool. The specific implementation is as follows: Set preference weight threshold W th (In this embodiment, the value is 0.6). For each content unit, according to its preference weight W... i The relationship with the threshold is used to employ a differentiated screening strategy: High-weight content units (W) i ≥W th Prioritize filtering data segments that are highly relevant to the topic, retaining as much rich and detailed information as possible to meet the requirement of highlighting key points; Low-weight content units (W) i <W th): Only the minimum data fragments required to meet the basic description of the module are selected to satisfy the requirement of brief mention, and redundant details are filtered out.
[0087] Relevance screening combines keyword matching and semantic similarity calculation to ensure that the selected data fragments are highly relevant to the content unit's theme.
[0088] (1) Keyword matching A predefined set of core keywords is defined for each content unit, constructed based on the module's theme and domain knowledge. For example, for the "Clinical Accuracy Validation Module," core keywords include "sensitivity," "specificity," "accuracy," "false positive," and "true positive." Data fragments containing these keywords are prioritized for retention; the higher the keyword matching degree, the higher the priority of the data fragment.
[0089] (2) Semantic similarity calculation For data fragments that do not contain core keywords but may be related to the topic, semantic similarity calculation is used for supplementary filtering. The content of the data fragment is vectorized, and cosine similarity is calculated between it and the topic description vector of the content unit to obtain the semantic matching degree S. If S is greater than a preset similarity threshold (e.g., 0.7), the data fragment is retained; otherwise, it is filtered.
[0090] (3) Screening priority In the screening of high-weight content units, data segments that meet either keyword matching or semantic similarity requirements can be retained, with priority given to data segments that meet both requirements. In the screening of low-weight content units, only a few data segments with the highest keyword matching or semantic similarity are retained.
[0091] (iv) Generation of structured data tuples The filtered data is organized according to the predefined data structures of each module, generating structured data tuples corresponding to the content unit identifiers. Predefined data structure types include, but are not limited to: Key Point List: Suitable for enumerating content such as risk points, advantages, and challenges, such as ["Risk Point 1: Insufficient consistency of data annotation", "Risk Point 2: Weak generalization ability with small samples"]. Data pairs: Applicable to indicator-numerical data, such as ["Sensitivity: 95%", "Specificity: 92%"]; Abstract paragraphs: Suitable for content that requires textual description, which has been compressed and reorganized into coherent paragraphs; Table structure: Two-dimensional table data containing row headers, list headers, and corresponding values; Chart data: Numerical sequences and labels suitable for line charts, bar charts, pie charts, etc.
[0092] Each structured data tuple also contains the following metadata information for reference in subsequent steps: Data source: The original source identifier of each data segment; Credibility score: The highest or average credibility score corresponding to this data segment; Consensus status: Whether it is consensus information or divergent information; Timestamp: Data release time or update time.
[0093] Through the above processing, step S200 generates a corresponding structured data tuple for each content unit, forming an optimized modular data pool. This data pool has the following characteristics: Organized by module: Each structured data tuple is associated with a unique content unit identifier, facilitating retrieval by module; High data quality: It has undergone multiple optimizations including data retrieval, data supplementation, consistency detection, credibility weighting, and preference filtering; Uniform format: conforms to the predefined data structure of each module and can be directly used for subsequent template filling; Complete metadata: It includes information such as data source, credibility, and consensus status, and supports traceability.
[0094] This optimized modular data pool, as the output of step S200, provides high-quality data input for template matching and content orchestration in step S300.
[0095] S300: Based on the content unit identifier and the logical relationship between the content unit identifiers, and combined with the preference weight, a basic document framework is matched or combined from the template library, and the structured data tuples are mapped to the corresponding chapters of the basic document framework according to the preset mapping rules to generate a document structure tree.
[0096] This step, based on the content unit identifier set output from step S100, the logical relationships between the identifiers, and the corresponding preference weights, combined with the structured data tuples associated with each content unit identifier generated in step S200, dynamically constructs the document framework and arranges the content, ultimately generating a renderable document structure tree. The specific implementation is as follows: (a) Template library predefined This invention provides a pre-built template library containing multiple basic document frameworks. Each basic document framework consists of several chapter nodes arranged hierarchically, with a mapping relationship between chapter nodes and content unit identifiers (i.e., a certain chapter is expected to be filled with the content of a certain type of module). Furthermore, each basic document framework defines the following attributes: Chapter structure: the hierarchical relationship and order of chapters, sections, and subsections; Default layout style: Default font, font size, line spacing, page margins, etc. for each chapter; Chart placeholder: Reserved chart space and default chart type; Applicable scenario tags: such as "technology risk analysis", "comprehensive market assessment", "policy interpretation", etc., for quick search and matching.
[0097] The template library can be dynamically expanded according to the application field. When adding a new template, its chapter structure and applicable scenarios need to be defined.
[0098] (ii) Matching and dynamic combination of basic document framework Based on the set of content unit identifiers and the logical relationships between the identifiers determined in step S100, retrieve or generate an adapted basic document framework from the template library.
[0099] (1) Template matching degree calculation For each candidate template, calculate its matching degree with the current set of content unit identifiers. The matching degree is calculated based on the following dimensions: Chapter Coverage: The percentage of overlap between chapter nodes and content unit identifiers within the template. It is calculated as: the number of chapters in the template that can match content units, divided by the total number of content units. For example, if there are 5 content units, and 4 chapters in the template can match all 4, then the chapter coverage is 80%.
[0100] Conformity: This measures the degree to which the chapter order of the template conforms to the logical relationships between the content unit identifiers. First, based on the logical relationships between content units (such as causality, sequence, and parallelism), it is determined which modules should appear before other modules. Then, the chapter order of the template is checked to ensure it meets these sequential requirements. Conformity is calculated as the number of satisfied logical relationships divided by the total number of logical relationships. For example, if there are three logical relationships (e.g., A should precede B, B should precede C), and the template order satisfies two of them, the conformity is 66.7%.
[0101] SceneSim: Measures the degree of match between the applicable scene tags of the template and the implicit report topic in the user's preference instructions. It is obtained by calculating the semantic similarity between the template tag set and the user topic tag set, which can be achieved using Jaccard similarity (intersection size divided by union size) or cosine similarity (calculated after mapping the tags to vectors). For example, if the template tag is "Technology Risk Analysis" and the user topic tags are "Technology Risk Analysis" and "Commercial Prospects", then there is 1 intersection and 2 unions, and the Jaccard similarity is 50%.
[0102] After calculating the chapter coverage, structural compliance, and scene adaptability of each candidate template, a weighted summation is used to calculate the overall matching score MatchScore(T) of the template. The specific calculation formula is as follows: MatchScore(T) = w cov ×Coverage+w conf ×Conformance+w scene ×SceneSim.
[0103] Among them, w cov w conf w scene These are the weighting coefficients for chapter coverage, structural conformity, and scene adaptability, respectively, satisfying w cov +w conf +w scene =1. The weighting coefficients can be dynamically adjusted according to the report type and application scenario. For example, for reports that emphasize the rigor of logical structure (such as technical demonstration reports), the weight of structural conformity can be appropriately increased; for reports that emphasize the comprehensiveness of content (such as overview reports), the weight of chapter coverage can be increased; for reports that emphasize the relevance of the topic (such as special analysis reports), the weight of scenario adaptability can be increased.
[0104] In one illustrative embodiment, the weights for chapter coverage, structure conformity, and scenario fit are set to 0.4, 0.3, and 0.3 respectively. This weighting configuration is suitable for most common reporting scenarios, balancing the requirements of content coverage, logical structure, and topic matching.
[0105] For each candidate template, after calculating the matching score according to the above formula, the template with the highest matching score is selected as the candidate basic document framework.
[0106] (2) Dynamically combine to generate an adaptive framework. If the highest matching degree is lower than the preset threshold (0.6 in this embodiment), a single template cannot be used directly, and the dynamic combination mechanism is activated: Iterate through all content unit identifiers and extract the corresponding chapter structure fragments from multiple templates based on the thematic semantics of each identifier (such as the "Technical Risk Analysis" chapter of one template and the "Market Size Assessment" chapter of another template). Based on the logical relationships (such as cause and effect, comparison, and time sequence) between content unit identifiers, the extracted chapter fragments are sorted and spliced to generate a new adaptive document framework; The adaptive document framework will be used as the basic document framework for this report and stored in a temporary cache for future reuse.
[0107] (III) Page and position allocation based on preference weights Based on the preference weights W of each content unit i Within the basic document framework, allocate appropriate layout space and core chapter positions. The specific rules are as follows: Core chapter position allocation: The top K content units with the highest preference weight (the top 3 in this example) are assigned to the core chapters of the report (such as the abstract, conclusion, and first chapter), and the remaining modules are arranged in subsequent chapters according to their logical relationship; Typesetting space allocation: Within the chapters allocated to each module, the level of detail is determined based on their preferred weights. High-weight modules (W) i (≥0.6) Allocate more space, which can include multiple subsections, multiple charts, and detailed data lists; Low-weight module (W) i <0.6) Allocate a concise length, including only core conclusions or key data summaries, and limit the number of charts and graphs.
[0108] Style Emphasis: For modules with the highest weight, visual emphasis can be placed on the style of the title font, color, icons, etc., to highlight their importance.
[0109] (iv) Content Mapping Planning The structured data tuples generated in step S200 are then populated into the corresponding chapters of the basic document framework according to preset mapping rules. The mapping rules are defined based on the data format type: Key points list: Convert to a bulleted list or numbered list and embed it into the text area of the corresponding chapter; Data pairs: Convert them into declarative sentences in the text (such as "sensitivity is 95%), or organize them into simple tables; Summary paragraph: Insert directly as paragraph text; Table structure: Rendered as a standard table, preserving the correspondence between table headers and rows / columns; Chart Data: Automatically selects the chart type (line chart, bar chart, pie chart, etc.) based on data characteristics, and generates chart descriptions and data series.
[0110] Each mapped content is accompanied by metadata tags (such as data source and credibility score), which are used to determine whether to annotate the reference during rendering.
[0111] (v) Adjustment of logical flow and chapter connection After completing the initial content filling, fine-tune the module order and chapter connections based on the inherent logical relationships between the data: Causal relationship: If there is a causal relationship between two modules (such as "technical risk" leading to "regulatory restrictions"), place the cause module before the result module and add a transitional statement; Comparison and Relationship: If modules need to be compared and analyzed (such as "Competitive Landscape" and "Market Share"), arrange them in the same chapter or adjacent chapters and plan the comparison charts; Temporal association: Modules involving the evolution of time are arranged in chronological order (e.g., "Technological Development History" precedes "Future Trends").
[0112] Adjustments can be made by modifying the node order in the document structure tree or adding connecting text to ensure that the report is fluent and logically clear.
[0113] (vi) Style adaptation Based on the overall tone (e.g., conservative, optimistic, cautionary) and subject area of the report identified in the S100 steps, the global style of the document is automatically adapted. Color scheme: Risk reports use warning colors (red, orange); market reports use business colors (blue, green); policy reports use conservative colors (gray, navy blue). Font selection: Choose a serif or sans-serif font according to industry conventions; Chart style: The line thickness, color gradient, and label style should be consistent with the overall style.
[0114] (vii) Output document structure tree All the planning results described above are encapsulated into a document structure tree, whose node hierarchy is consistent with the chapter structure of the basic document framework. Each node contains the following information: Node types: chapter, section, subsection, paragraph, table, chart, etc.; Content data: populated text, tabular data, and chart data series; Style directives: font, color, alignment, chart type, etc.; Metadata: corresponding content unit identifier, data source, credibility information, etc.
[0115] This document structure tree, as the output of step S300, is directly parsed by the document rendering engine in step S400 to generate the final document.
[0116] S400: Call the document rendering engine to synthesize and output a document based on the document structure tree.
[0117] This step takes the document structure tree generated in step S300 as input, calls the document rendering engine to synthesize it into a formatted, directly readable final document, and provides optional summary generation, highlighting, and user interaction feedback functions. The specific implementation is as follows: (a) Document rendering engine The document rendering engine is invoked, which supports converting structured document tree structures into common document formats (such as PDF, DOCX, HTML, etc.). The rendering engine traverses each node of the document tree structure in a depth-first manner, and performs content composition based on the node type and accompanying style instructions. Text node: Renders text content as paragraphs or headings according to specified style attributes such as font, font size, color, and line spacing; List Nodes: Render the list of key points as labeled list items based on bullet points or numbering styles; Table node: Parses the table structure (rows, columns, headers, cell content), generates a standardized table, and applies styles such as borders and alignment; Chart Node: Based on the chart type (line chart, bar chart, pie chart, etc.) and data series, call the graphics drawing module to generate the corresponding vector or bitmap image and embed it in the specified location of the document; Formula node: If the content contains mathematical formulas or technical symbols, call the formula rendering module (such as MathJax) to convert them.
[0118] During the rendering process, the document rendering engine also determines whether to add footnotes, endnotes, or data source annotations to the document based on the metadata (such as data source and credibility score) attached to the document structure tree, in order to enhance the traceability of the report.
[0119] (II) Abstract generation and highlighting After rendering is complete, the following steps may be performed: Summary generation: Based on the content of core chapters (such as the introduction, conclusion, and chapters with high weighting) in the document structure tree, a text summarization algorithm is used to automatically generate a report summary, which is placed at the beginning of the document. The summary length can be automatically adjusted according to user presets or document length.
[0120] Highlighting: Based on the preference weight of each content unit, visually emphasize the key content of high-weight modules in the document, including using highlighted backgrounds, bold fonts, sidebar annotations, etc.
[0121] (III) Output and Interactive Feedback After the rendering engine completes the document compositing, it outputs the final document (such as a PDF file) for users to download or preview online. Simultaneously, the system provides an interactive editing interface, allowing users to modify the generated document, including but not limited to: Adding or deleting module content; Adjust the module order; Modify the data presentation format (e.g., change the chart type); Add custom comments or descriptions.
[0122] The system captures user modification actions in real time, records the modification type and magnitude of each content unit, and feeds this behavioral data back to the intent parsing model and data processing module to optimize the quality of subsequent report generation, forming a closed-loop iterative mechanism. For details on the implementation of this user behavior feedback, please refer to the subsequent user behavior feedback and model iteration steps.
[0123] (iv) Output Results Through the above processing, the S400 steps output a professionally customized report that is clearly structured, contains reliable data, and adheres to standardized formatting. The report includes the following elements: Cover and table of contents; Automatically generated summary; The content of each chapter is arranged according to the document structure tree, including various forms such as text, tables, and charts; Data source labeling and credibility indicators; Visual annotations for key content.
[0124] The format and style of the final document are consistent with the style instructions of the S300 step plan to ensure the uniformity and professionalism of the output results.
[0125] Furthermore, the method provided by the present invention further includes: S500, User Behavior Feedback and Model Iteration Steps.
[0126] This step is a closed-loop iterative process, executed after the document is output in step S400. By capturing user modifications to the generated document, it reverse-calibrates preference weights and optimizes the natural language processing model to continuously improve the quality of subsequent report generation. The specific implementation is as follows: S510, User Modification Behavior Capture The system monitors user modifications to the generated document in real time within the document editing interface, recording the additions, deletions, and modifications to each content unit. These modifications include, but are not limited to: Add new content snippets; Delete existing content; Modify text descriptions or data; Adjust the module order; Change the chart type or data presentation format.
[0127] Record the initial content percentage for each content unit (Cinitial). i (i.e., the proportion of this module in the initial report) and the proportion of content modified by the user (Cmodified) i .
[0128] S520, Modify magnitude calculation and preference weight calculation The modification magnitude of each content unit is calculated based on the modification operation, and the preference weight of the content unit is adjusted through a feedback correction function.
[0129] The modification percentage is the ratio of the absolute value of the difference between the modified content unit's content percentage and the initial content percentage to the initial content percentage. The calculation formula is: △C i =|Cmodified i -Cinitial i | / Cinitial i .
[0130] Among them, △C i Let represent the modification magnitude of the i-th content unit. This is a non-negative real number. A larger value indicates a greater degree of adjustment by the user to this module, meaning that the user's preferences may not align with the module's initial weights.
[0131] This invention calculates the feedback correction coefficient H of the i-th content unit based on the modification magnitude. i And adjust the preference weight of that content unit. The formula for calculating the feedback correction coefficient is: H i =1+β×ΔC i .
[0132] Where β is a preset correction intensity coefficient, ranging from [0.3, 0.5], used to adjust the degree of influence of the modification magnitude on the weights. The adjusted preference weights WC i We obtain the following through normalization: WC i =(W i ×H i ) / ∑ r=1 n (W) r ×H r ).
[0133] In the formula, W i W represents the initial preference weight for the i-th content unit. r H is the initial preference weight for the r-th content unit. r Let r be the feedback correction coefficient for the r-th content unit, where r ranges from 1 to n.
[0134] Through the above normalization process, the sum of all content unit preference weights after calibration is 1, ensuring the rationality of the weight distribution. The calibrated weights are closer to the user's true preferences and can be used for subsequent report generation. S530, Model Update and Iterative Optimization The adjusted preference weights and modified operation data are used as training samples and fed back into the natural language processing model used in step S100. Specifically: Use the user's original predispositional instructions as input features; The calibrated preference weights of each module are used as supervision labels; By using incremental learning or fine-tuning to update model parameters, the natural language processing model can more accurately identify the user's semantic preference features in subsequent parsing.
[0135] Through the aforementioned closed-loop iteration, the system can continuously learn users' personalized preferences, thereby improving the accuracy of fuzzy intent parsing and the customization level of reports. The natural language processing model is then updated to optimize the accuracy of semantic preference feature recognition.
[0136] S540, Parsing Accuracy Assessment and Rule Base Optimization Based on model updates and iterative optimizations, the parsing accuracy is further quantitatively evaluated, and the bias parsing rule base is optimized based on the evaluation results to continuously improve the accuracy of semantic preference feature recognition. The specific implementation is as follows: Regularly collect actual sample data of user input. This sample data includes the user's original input preference commands, content unit identifiers and preference weights obtained from system parsing, and the actual needs reflected in the user's subsequent modification operations. For each sample, determine whether the system's parsing result matches the user's actual needs, and count the number N samples where the parsing result matches the user's actual needs. correct The total number of samples N participating in the statistics total The propensity score accuracy (Acc) is calculated using the following formula: Acc=N correct / N total ×100%.
[0137] The parsing accuracy is used to evaluate the performance of the current natural language processing model and the biased parsing rule base. When the parsing accuracy falls below a preset threshold (e.g., 85%), a rule base optimization mechanism is triggered. This optimization mechanism includes: Adjust the mapping relationship between preference intensity indicators and intensity levels, such as correcting mismatched indicators or adding new indicators; Update the domain feature vocabulary, for example, by adding newly emerging domain terms or adjusting the feature word weights; Optimize the basic weight range of the intensity level to better match the actual user preference distribution.
[0138] By continuously collecting samples and calculating parsing accuracy, a closed-loop feedback loop for rule base optimization is formed, gradually improving parsing accuracy and enabling the natural language processing model to more accurately identify users' semantic preference features in subsequent parsing.
[0139] Furthermore, the method provided by the present invention further includes: S600, cross-domain parsing steps.
[0140] This step is an extension of the method, designed to adapt the parsing of the biased instructions to different application domains, thereby improving the method's versatility and portability. Specifically, it includes the following sub-steps: S610, build a cross-application domain bias parsing rule base.
[0141] A pre-constructed cross-application domain bias parsing rule base is established, which contains mapping relationships between domain feature words and intensity levels corresponding to multiple application domains. Each application domain (such as patent analysis, market research, technology assessment, policy interpretation, etc.) predefines a set of domain feature words, which include common module topic words in the domain (such as "infringement risk", "market size", "technology maturity", "policy barriers", etc.) and domain-specific preference intensity indicators (such as "priority examination" and "preliminary documents" in the patent field).
[0142] For each domain feature word, the rule base records its correspondence with the intensity level (L1, L2, L3), which can be obtained through expert annotation or statistical learning from historical data. The rule base adopts a structured storage method and supports fast retrieval by domain identifier.
[0143] S620, application domain identification and rule adaptation.
[0144] After receiving the user's input of topic information and preference instructions, the system first identifies the application domain to which the user's input belongs through a text classification model. This text classification model can be obtained by fine-tuning a pre-trained language model (such as BERT) on a domain-annotated corpus. Its input is the entire text input by the user (topic information + preference instructions), and its output is the probability distribution of the domain. The domain with the highest probability is selected as the recognition result.
[0145] Application domain identification calculates domain fit using the following formula: S d =∑ g=1 z (γ) g ×I g ).
[0146] Among them, S d γ represents the fit between the user input and the domain d, where z is the number of feature words in domain d. g Let I be the weight of the g-th feature word. g This is an indicator function (1 if the user input contains the feature word, 0 otherwise). When S d If the value is greater than a preset threshold (e.g., 0.6), the user input is determined to belong to that domain.
[0147] After identifying the application domain, the mapping relationship corresponding to that domain is retrieved from the rule base built in S610, and semantic preference features are identified in conjunction with the natural language processing model used in step S100. Specifically, the mapping relationship between domain feature words and intensity levels is injected as external knowledge into the parsing process, for example: In the preference intensity indicator recognition stage, domain-specific intensity indicators are expanded into the recognition dictionary; In the module topic identification stage, priority is given to matching the content unit identifiers corresponding to domain feature words; During the weight calculation phase, the range of basic weights can be fine-tuned according to domain rules.
[0148] Through the aforementioned cross-domain parsing mechanism, the method of this invention does not require training a complete parsing model separately for each domain. It only needs to build a domain rule base to achieve rapid adaptation to new domains, which significantly improves the versatility and scalability of the method.
[0149] The method of the present invention will be described in detail below through a specific embodiment.
[0150] User input: Main body of the report: "Application of Artificial Intelligence in CT Medical Image-Assisted Diagnosis" A biased instruction: "Help me analyze the technological risks and commercial prospects." Step S100 is implemented as follows: It receives topic information and preference instructions from the user and parses them using a natural language processing model.
[0151] First, the system identifies the intensity indicators of preference in the biased instructions. In this example, "analysis" is a neutral term with no explicit intensity modifier, but the instruction as a whole implicitly focuses on the two dimensions of "technological risk" and "commercial prospects." Through semantic parsing, the system maps "technological risk" to relevant modules in a predefined set of content units, including: [Technology Maturity Module], [Clinical Accuracy Verification Module], [Algorithm Reliability Module], and [Regulations and Ethics Module]; and maps "commercial prospects" to [Market Size Module], [Competitive Landscape Module], [Business Model Module], and [Payer Analysis Module].
[0152] Meanwhile, it was identified that the two dimensions of "technological risk" and "commercial prospects" appeared side by side in the instructions without a clear distinction of strength. Therefore, the same initial preference weight was assigned to the above eight modules (equal distribution). If the instructions contain intensity indicators such as "emphasis" or "brief", the differentiated weights will be calculated according to steps S101 to S103.
[0153] Step S200 implementation (taking the [Clinical Accuracy Validation Module] as an example): Based on the module requirements parsed from S100, the system initiates a multi-source data retrieval and processing flow.
[0154] Data Retrieval: For the [Clinical Accuracy Validation Module], automatically retrieve academic paper databases (to obtain data on indicators such as sensitivity and specificity), drug regulatory authority approval information (to obtain clinical trial results), and relevant clinical trial news reports.
[0155] Data Supplementation: After retrieval, the module has 5 valid data entries, which is higher than the preset threshold (3 entries). Therefore, there is no need to call the large language model to generate supplementary data.
[0156] Data consistency detection (S201): Semantic comparison is performed on the retrieved data to identify data inconsistencies: Paper A reports that the specificity of a certain system is 95%, while news B reports that the specificity of the same system is 92%, which is a numerical inconsistency.
[0157] Credibility-weighted arbitration (S202): Based on the pre-defined authority scoring model, academic papers have a higher authority score than news media; their timeliness is similar. After calculating the credibility scores of information from each data source, paper A's score is significantly higher than news B's (difference greater than 0.2). Therefore, 95% of paper A's score is adopted as consensus information, and news B's data is labeled as low-credibility divergent information.
[0158] Preference Adaptation Screening and Structure Generation (S203): Based on the preference weight of the [Clinical Accuracy Validation Module] (0.125 under equal weights), screen data fragments highly relevant to this module (sensitivity, specificity, false positive rate, multicenter trial results, etc.). Organize the screened data into structured data tuples, including a list of key performance indicators (average sensitivity XX%, average specificity YY%, etc.) and a description of the main challenges (data annotation consistency, insufficient sample size for minor diseases, etc.), along with metadata (data source, credibility score, consensus status).
[0159] Step S300 is implemented as follows: Based on the eight content unit identifiers and their logical relationships determined in S100, and combined with the structured data tuples generated in S200, template matching and document structure planning are performed.
[0160] Template Matching: The matching degree of each candidate template was calculated. Among them, the "Technology-Market Comprehensive Analysis" template had the highest comprehensive score in terms of chapter coverage (covering all 8 modules), structural conformity (technical analysis first, market analysis second, which is logical), and scenario adaptability (the tags include "technical risk analysis" and "market assessment"), with a matching degree of 0.85, which is higher than the preset threshold of 0.6. Therefore, this template was directly adopted as the basic document framework.
[0161] Page layout and placement: Since each module has equal weighting, the system, by default, groups the [Technology Maturity], [Clinical Accuracy Validation], [Algorithm Reliability], and [Regulations and Ethics] modules into the "Technology Analysis" section, and the [Market Size], [Competitive Landscape], [Business Model], and [Payer Analysis] modules into the "Market Analysis" section. Each module is allocated a balanced amount of layout space.
[0162] Content mapping plan: Map the structured data tuples generated by S200 to the corresponding chapters according to preset rules. For example, in the [Technology Maturity Module], a technology maturity curve is planned to be used to display the stages of technology development; in the [Competitive Landscape Module], a competitive landscape matrix table is planned to be used to display the main competitors and their market share.
[0163] Logical flow adjustment: Based on data characteristics, it was found that the information "strict ethical review" appears in the [Regulations and Ethics Module] and has a strong correlation with the [Payer Analysis Module] in [Commercial Prospects] (ethical review affects medical insurance payment decisions). Therefore, the logical connection between the two modules will be strengthened in the planning, and a transitional explanation will be added before the [Payer Analysis Module].
[0164] Step S400 is implemented as follows: The document rendering engine is invoked to synthesize the final report based on the document structure tree generated by S300.
[0165] Rendering output: Traverse the document structure tree and render text, lists, tables, charts, and other nodes into PDF format. Technology maturity curves, competitive landscape matrices, and other charts are automatically generated and embedded by the graphics drawing module.
[0166] Abstract generation and highlighting: Optionally, the system automatically generates a report summary based on the core chapter content and places it at the beginning of the document; since each module has equal weight, there is no special highlighting.
[0167] Output: Generate a complete professional report, including an abstract, a technical risk section (containing 4 sub-modules), a commercialization prospect section (containing 4 sub-modules), and a conclusion. All data and charts are from the optimized S200 results, with consistent formatting and layout.
[0168] Step S500 is implemented as follows: The user reviews the generated report, moves the content of the "Regulations and Ethics Module" to a higher order in the editing interface, and adds a detailed explanation of "strict ethical review." This modification is captured in real time, and the modification magnitude ΔC=0.3 of the "Regulations and Ethics Module" is calculated. The preference weight is adjusted through feedback correction coefficients, and this modification behavior is used as a training sample to feed back into the natural language processing model to optimize the parsing accuracy of similar biased instructions in subsequent iterations.
[0169] As can be seen from the above embodiments, the method of the present invention can automatically complete intent parsing, multi-source data processing, template matching and content arrangement from the user's ambiguous intention commands, and finally generate a professional customized report with clear structure and reliable data.
[0170] This invention parses user-input preference commands and maps them to content unit identifiers and corresponding preference weights. Based on these content unit identifiers and preference weights, it retrieves and processes raw data from multiple sources to generate structured data tuples. According to the content unit identifiers and their logical relationships, and combined with preference weights to match or combine the basic document framework, it maps the structured data tuples to corresponding chapters to generate a document structure tree. Finally, it calls a document rendering engine to synthesize and output the document. This method achieves automatic conversion from preference commands to structured documents, and has the following technical effects: 1. Transform the vague, subjective instructions input by users into quantifiable module requirements and preference weights, enabling subsequent processing based on quantitative indicators; 2. By performing consistency checks and credibility weighting on multi-source data, structured data tuples with high relevance and credibility are obtained; 3. Dynamically match or combine templates based on the logical relationships and preference weights of content units to adapt the generated document structure to the user's intent; 4. Adjust preference weights and update the parsing model based on user behavior feedback to make subsequently generated documents more closely match user preferences; 5. By constructing a cross-domain parsing rule base, the method can be applied to different application domains without the need to train a separate parsing model for each domain.
[0171] This invention also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being configured to perform the method described in this invention.
[0172] This invention also provides a computer-readable storage medium storing computer-executable instructions for performing the methods described in this invention.
[0173] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this invention can be achieved, and this is not limited herein.
[0174] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for intelligently generating structured documents based on preference-based instructions, characterized in that, The method includes the following steps: The system receives topic information and preference instructions input by the user, identifies semantic preference features in the preference instructions through natural language processing technology, and parses and maps the semantic preference features into at least one content unit identifier and a preference weight corresponding to the content unit identifier. Based on the content unit identifier and the preference weight, retrieve the original data from the heterogeneous data source, and perform data consistency detection and credibility weighting on the original data to generate a structured data tuple corresponding to the content unit identifier; Based on the content unit identifier and the logical relationship between the content unit identifiers, combined with the preference weight, a basic document framework is matched or combined from the template library, and the structured data tuples are mapped to the corresponding chapters of the basic document framework according to the preset mapping rules to generate a document structure tree. The document rendering engine is invoked to synthesize and output a document based on the document structure tree.
2. The method according to claim 1, characterized in that, The data consistency detection and credibility weighting process includes: Semantic comparison is performed on the raw data to identify data inconsistencies between different data sources describing the same entity or event; The authority score of each data source is calculated based on the preset authority scoring model. Combined with the timeliness parameter of the data source information, the inconsistent information is weighted and arbitrated to extract consensus information or mark the disagreement information. Based on the preference weight corresponding to the content unit identifier, data segments associated with content units whose preference weight is greater than a preset threshold are selected.
3. The method according to claim 1, characterized in that, Determining the content unit identifier and its corresponding preference weight further includes: The preference intensity indicator words in the preference instructions are identified by a natural language processing model, and the preference intensity indicator words are matched with a preset intensity level library to determine the corresponding intensity level. Based on the intensity level, the semantic relevance coefficient between the content unit corresponding to the content unit identifier and the topic information is obtained through a semantic similarity calculation model; Based on the intensity level and the semantic relevance coefficient, the preference weight of each content unit is calculated using a weighting function.
4. The method according to claim 3, characterized in that, The weighting function is: W i =α(L i )×Wbase(L i )+(1-α(L i ))×R i ; Among them, W i Let α(L) be the preference weight for the i-th content unit, where i ranges from 1 to n, and n is the total number of content units; i ) is based on intensity level L i The dynamic adjustment coefficient, Wbase(L) i R represents the base weight of the intensity level corresponding to the i-th content unit. i is the semantic relevance coefficient between the i-th content unit and the topic information.
5. The method according to claim 1, characterized in that, The matching or combination of the underlying document framework further includes: Based on the content unit identifier and the logical relationship between the content unit identifiers, retrieve the basic document framework with the highest matching degree from the template library; If the highest matching degree is lower than the preset threshold, the chapter structure corresponding to the content unit identifier is extracted from multiple templates, dynamically spliced according to the logical relationship, and an adaptive document framework is generated, and the adaptive document framework is used as the basic document framework.
6. The method according to claim 3, characterized in that, It also includes user behavior feedback and model iteration steps: Real-time monitoring of user modifications to the generated document in the document editing interface, recording the addition, deletion, and modification data of each content unit; The modification magnitude of each content unit is calculated based on the modification operation, and the preference weight of the content unit is adjusted through a feedback correction function. The adjusted preference weights and modified operation data are used as training samples to update the natural language processing model and optimize the semantic preference feature recognition accuracy.
7. The method according to claim 6, characterized in that, The modification range is the ratio of the absolute value of the difference between the modified content unit content ratio and the initial content ratio to the initial content ratio.
8. The method according to claim 3, characterized in that, It also includes cross-domain parsing steps: Construct a cross-application domain tendency parsing rule base, which contains the mapping relationship between domain feature words and intensity levels; The text classification model identifies the application domain to which the user input belongs, retrieves the mapping relationship corresponding to the application domain from the preference parsing rule base, and combines it with a natural language processing model to identify the semantic preference features.
9. An electronic device, characterized in that, Including processor and memory; The processor executes the steps of the method as described in any one of claims 1 to 8 by invoking programs or instructions stored in the memory.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a program or instructions that cause a computer to perform the steps of the method as described in any one of claims 1 to 8.