A method and system for generating interactive AI reports based on intelligent semantics
By using an intelligent semantic-driven interactive AI report generation method, the problems of insufficient semantic understanding, access control, and adaptability in business intelligence systems are solved, enabling efficient and secure data analysis and report generation, which is applicable to industries such as finance and retail.
Patent Information
- Application Number
- CN202511036969.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-28
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-07-28
AI Technical Summary
Existing business intelligence systems suffer from insufficient semantic understanding capabilities, weak access control, and inadequate adaptive capabilities, resulting in poor user interactivity, low query accuracy, and high data security risks.
We employ an interactive AI report generation method driven by intelligent semantics. This method utilizes a large language model for semantic analysis, domain knowledge base transformation, database metadata understanding, and access control. It also incorporates user feedback for continuous optimization, thereby achieving both accuracy and security in natural language queries.
It lowers the technical barrier, enabling non-technical users to directly generate accurate reports, improving query accuracy and data security, meeting GDPR compliance requirements, and continuously optimizing system performance through incremental learning.
Smart Images

Figure CN120541091B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of interdisciplinary technology of business intelligence and natural language processing, and in particular to an interactive AI report generation method and system based on intelligent semantics. Background Technology
[0002] A Business Intelligence System (BIS) is a computer system that integrates internal and external enterprise data and uses technologies such as data warehousing, online analytical processing (OLAP), data mining, and visualization to transform massive amounts of data into actionable business insights. Its core functions include data collection and cleaning, multidimensional data analysis, report generation, and interactive visualization. It can provide decision-makers with real-time and accurate monitoring of business metrics (such as sales, user retention rate, and inventory turnover rate), supporting decision-making at all levels from strategic planning to operational optimization. It is widely used in industries such as finance, retail, and manufacturing, aiming to improve enterprise competitiveness and operational efficiency through data-driven approaches.
[0003] Existing business intelligence systems are mainly divided into two categories: one is traditional BI tools based on predefined reports, such as Tableau and Power BI; the other is emerging natural language query (NLQ) systems. The former requires technical personnel to pre-design reports, and business users can only view fixed reports, resulting in poor flexibility; the latter, while supporting natural language input, suffers from the following technical limitations:
[0004] 1. Insufficient semantic understanding: The existing system cannot accurately determine the relevance between user questions and data topics, resulting in a large number of irrelevant queries or erroneous responses. For example, when a user inquires about "sales performance," the system cannot accurately link it to specific metrics and dimensions in the database.
[0005] 2. Lack of problem-solving mechanism: The system lacks the ability to automatically resolve ambiguous natural language issues. For example, if a user asks "last month's performance," the system cannot determine whether "performance" specifically refers to sales revenue, profit, or other metrics.
[0006] 3. Weak access control: Most existing solutions use simple table-level or column-level access control, which cannot achieve semantic-based fine-grained data access control, thus posing data security risks.
[0007] 4. Insufficient Adaptability: The system cannot learn and optimize from user interactions, resulting in a sluggish long-term user experience. For example, it cannot identify which query patterns are more popular with users and adjust the system behavior accordingly.
[0008] In summary, existing business intelligence systems have three major shortcomings: First, traditional BI systems require users to have professional technical knowledge such as SQL, creating a barrier to entry and making it difficult for business personnel to operate independently; second, existing natural language interfaces lack the accuracy to understand the semantics of user questions, especially in handling ambiguous or vague questions; and third, they lack a dynamic learning mechanism, making it impossible to continuously optimize system performance based on user feedback.
[0009] Therefore, a new technical solution is urgently needed to solve the above-mentioned technical problems. Summary of the Invention
[0010] The purpose of this invention is to overcome the problems of the prior art and provide an interactive AI report generation method and system based on intelligent semantics to solve the technical problems of low accuracy of natural language queries, weak access control, and lack of adaptive capabilities in existing business intelligence systems.
[0011] The above objectives are achieved through the following technical solutions:
[0012] An interactive AI report generation method and system based on intelligent semantics, comprising:
[0013] Step (1) Perform semantic analysis on the user's questions using the large language model, calculate the matching score between the questions and the topics of each report, and dynamically select the question correction or report generation process based on the score results.
[0014] Step (2) converts fuzzy queries into deterministic report requests based on the domain knowledge base, eliminating ambiguity in natural language;
[0015] Step (3) Combine database metadata to understand field semantics and relationships, and convert deterministic queries into executable SQL;
[0016] Step (4) Dynamically rewrite the SQL based on user roles to add permission filtering conditions, execute the query and process sensitive data;
[0017] Step (5) Analyze the characteristics of the query results data, automatically select the optimal visualization format and generate a natural language explanation;
[0018] Step (6) Collect user feedback data and continuously optimize the semantic scoring model and query generation strategy.
[0019] Preferably, step (1) in this method specifically includes:
[0020] Vectorized storage and retrieval of historical questions: Each processed question text is converted into a vector through an embedding model to build a vector database; for new questions, the cosine similarity between them and historical questions is first calculated, and if it exceeds the threshold (default 0.85), the historical processing results are directly reused;
[0021] Multi-dimensional semantic scoring: For questions with no similar history, a scoring suggestion is constructed using suggestion engineering to guide the large language model to score from dimensions such as topic relevance and query feasibility, and output a standardized score between 0 and 1;
[0022] Dynamically Adjusted Scoring: The basic semantic score is dynamically adjusted by combining topic weight and keyword weight, as shown in the following formula:
[0023] final_score=base_score*topic_weight*(1+keyword_factor)
[0024] Where: base_score represents the basic semantic score given by the large language model, with a score of 0-1; topic_weight represents the preset importance weight of each topic; keyword_factor represents the weight of keywords in the question, calculated as sum(matching keyword weight) / number of keywords;
[0025] Dynamic process selection: Set a scoring threshold, default 0.6; if the score is higher than the threshold, proceed to the report generation process; if the score is lower than the threshold, proceed to the problem correction process; this threshold is dynamically adjusted based on user feedback data.
[0026] Preferably, step (2) in this method specifically includes:
[0027] Domain knowledge modeling: Build a concept-field mapping table for each report topic;
[0028] Question rewriting mechanism: Using a large language model, fuzzy questions are transformed into explicit queries based on a knowledge base.
[0029] Preferably, step (3) in this method specifically includes:
[0030] Metadata enhancement hints: Inject database table structure, field types, primary and foreign key relationship metadata into the large language model hints to enhance its understanding of the data model;
[0031] Templated SQL generation: Creates parameterized SQL templates for common query patterns, prioritizing template matching;
[0032] Dynamic FunctionCalling: Leveraging the function calling capabilities of a large language model, the generated SQL is converted into safe function call execution.
[0033] Preferably, step (4) in this method specifically includes:
[0034] Semantic-level permission filtering: Automatically attaches data permission tags based on the semantics of the problem;
[0035] SQL rewriting engine: Dynamically modifies SQL based on user roles and automatically injects permission conditions;
[0036] Results desensitization: Sensitive fields that are not accessible to authorized users are automatically desensitized.
[0037] Preferably, step (5) in this method specifically includes:
[0038] Natural Language Summarization: By injecting user questions, data summaries, and sample data from datasets into large language model prompts, it generates text summaries containing key metrics and insights, highlighting outliers and important trends;
[0039] Data Feature Analysis: Automatically analyzes the characteristics of the result dataset and selects the most appropriate chart type or table.
[0040] Preferably, step (6) in this method specifically involves: forming triplet optimization base data by recording user questions, system response results and user satisfaction scores; periodically analyzing feedback data and adjusting the threshold, keyword weight and topic weight of the semantic scoring model.
[0041] An interactive AI report generation system based on intelligent semantics, comprising:
[0042] Semantic scoring and dynamic flow control module: Based on a large language model, the semantic scoring and dynamic flow control module performs semantic analysis on user questions, calculates the matching degree score between the questions and the topics of each report, and dynamically selects the question correction or report generation process based on the scoring results.
[0043] Problem Repair and Deterministic Conversion Module: Based on the domain knowledge base, the problem repair and deterministic conversion module converts fuzzy queries into deterministic report requests, eliminating natural language ambiguity;
[0044] Metadata-aware SQL generation module: By combining database metadata with the understanding of field semantics and relationships, the metadata-aware SQL generation module converts deterministic queries into executable SQL.
[0045] Access Control and Query Execution Module: This module dynamically rewrites SQL based on user roles, adds permission filtering conditions, executes queries, and processes sensitive data.
[0046] Multimodal result generation module: The multimodal result generation module analyzes the characteristics of the query result data, automatically selects the optimal visualization form, and generates a natural language explanation;
[0047] Incremental learning optimization module: This module collects user feedback data and continuously optimizes the semantic scoring model and query generation strategy.
[0048] Preferably, the semantic scoring and dynamic flow control module in this system includes:
[0049] Vector database: Used to store historical question vectors, supporting cosine similarity retrieval;
[0050] Multi-dimensional scoring engine: Integrates large language model prompting engineering to output standardized scores.
[0051] Preferably, the access control and query execution module in this system includes:
[0052] Semantic-level permission tagging engine: used to automatically analyze the semantics of issues and attach permission data.
[0053] SQL rewrite engine: Used to dynamically inject permission filtering conditions into the WHERE clause.
[0054] Preferably, the incremental learning optimization module in this system includes:
[0055] Feedback data collector: used to record user questions, system response results, and satisfaction ratings;
[0056] Parameter optimizer: Adjusts model parameters such as scoring thresholds and keyword weights based on feedback data.
[0057] This invention provides an interactive AI report generation method and system based on intelligent semantics. It is user-friendly for non-technical users, requiring no SQL knowledge and generating reports directly from natural language, effectively lowering the technical barrier. Semantic understanding is accurate, with a composite semantic mechanism (vector retrieval + large language model) significantly improving query accuracy. Data security is controllable, with semantic-based dynamic access control achieving field-level data anonymization, meeting compliance requirements such as GDPR. It has strong continuous optimization capabilities; the incremental learning mechanism makes the system increasingly intelligent with use, significantly improving user satisfaction. This solution, through a multi-module collaborative architecture, effectively solves the interaction barriers, semantic biases, and insufficient adaptability issues of traditional business intelligence systems, providing an efficient and secure intelligent solution for enterprise data analysis. Attached Figure Description
[0058] Figure 1 This is a flowchart illustrating an interactive AI report generation method based on intelligent semantics as described in this invention.
[0059] Figure 2 This is a flowchart illustrating the interactive AI report generation method based on intelligent semantics as described in this invention. Detailed Implementation
[0060] Convert qualitative queries into executable SQL;
[0061] Step (4) Dynamically rewrite the SQL based on user roles to add permission filtering conditions, execute the query and process sensitive data;
[0062] Step (5) Analyze the characteristics of the query results data, automatically select the optimal visualization format and generate a natural language explanation;
[0063] Step (6) Collect user feedback data and continuously optimize the semantic scoring model and query generation strategy.
[0064] Step (1) in this embodiment includes:
[0065] Step (101) Calculate the vector similarity between the problem and the historical problem;
[0066] Step (102) uses a large language model to analyze the semantic relevance between the question and the topic;
[0067] Step (103) Calculate the comprehensive score by combining keyword weight and topic weight;
[0068] Step (104) generates an interactive clarification question when the confidence level is insufficient.
[0069] Step (1) specifically includes:
[0070] Vectorized storage and retrieval of historical questions: Each processed question text is converted into a vector through an embedding model to build a vector database; for new questions, the cosine similarity between them and historical questions is first calculated, and if it exceeds the threshold (default 0.85), the historical processing results are directly reused;
[0071] Multi-dimensional semantic scoring: For questions with no similar history, a scoring suggestion is constructed using suggestion engineering to guide the large language model to score from dimensions such as topic relevance and query feasibility, and output a standardized score between 0 and 1;
[0072] Dynamically Adjusted Scoring: The basic semantic score is dynamically adjusted by combining topic weight and keyword weight, as shown in the following formula:
[0073] final_score=base_score*topic_weight*(1+keyword_factor)
[0074] Where: base_score represents the basic semantic score given by the large language model, with a score of 0-1; topic_weight represents the preset importance weight of each topic; keyword_factor represents the weight of keywords in the question, calculated as sum(matching keyword weight) / number of keywords;
[0075] Dynamic process selection: Set a scoring threshold, default 0.6; if the score is higher than the threshold, proceed to the report generation process; if the score is lower than the threshold, proceed to the problem correction process; this threshold is dynamically adjusted based on user feedback data.
[0076] Step (2) in this embodiment includes:
[0077] Step (201) Establish a concept-field mapping knowledge base;
[0078] Step (202) Rewrite the problem using a large language model.
[0079] Step (2) specifically includes:
[0080] Domain knowledge modeling: Create a concept-field mapping table for each report topic, such as mapping "sales revenue" to the "amount" field in the database, and mapping "product" to "product_name", etc.
[0081] Question rewriting mechanism: Using a large language model and a knowledge base, fuzzy questions are transformed into explicit queries. For example, "How are sales?" can be rewritten as "Please display the total sales revenue of each product in the most recent month".
[0082] Step (3) in this embodiment includes:
[0083] Step (301) Inject database metadata enhancement hints;
[0084] Step (302) prioritizes matching parameterized SQL templates;
[0085] Step (303) securely executes the generated SQL via function call.
[0086] Step (3) specifically includes:
[0087] Metadata enhancement hints: Inject metadata such as database table structure, field types, primary and foreign key relationships into the large language model hints to enhance its understanding of the data model;
[0088] Templated SQL generation: Parameterized SQL templates are created for common query patterns (such as trend analysis, comparative analysis, etc.), and template matching is attempted first.
[0089] Dynamic FunctionCalling: Leveraging the function calling capabilities of a large language model, the generated SQL is converted into safe function call execution.
[0090] Step (4) in this embodiment includes:
[0091] Step (401) Analyze the semantics of the problem and attach data permission tags;
[0092] Step (402) Dynamically modify SQL injection permission conditions;
[0093] Step (403) desensitizes the results of sensitive fields.
[0094] Step (4) specifically includes:
[0095] Semantic-level permission filtering: Automatically attach data permission tags based on the semantics of the analysis question, such as "East China Sales Manager" can only view data from East China.
[0096] SQL rewriting engine: Dynamically modifies SQL based on user roles and automatically injects permission conditions; for example, adding "region='East China'" to the WHERE clause;
[0097] The result of the desensitization process is as follows: Sensitive fields that are not accessible to authorized users (such as customer names) are automatically desensitized and replaced with "***".
[0098] In this embodiment, step (5) specifically includes:
[0099] Natural Language Summarization: By injecting user questions, data summaries, and sample data from datasets into large language model prompts, it generates text summaries containing key metrics and insights, highlighting outliers and important trends;
[0100] Data feature analysis: Automatically analyzes the characteristics of the result dataset (such as the number of dimensions, data distribution, time series characteristics, etc.) and selects the most appropriate chart type or table. For example, line charts are used by default for time series data, and bar charts are used for classification comparisons.
[0101] In this embodiment, step (6) specifically involves: forming triplet optimization base data by recording user questions, system response results (correction of questions, rating results, and topics) and user satisfaction ratings; thereby, periodically analyzing feedback data and adjusting the threshold, keyword weight, and topic weight of the semantic scoring model.
[0102] like Figure 2 As shown, as a specific embodiment of this method, it includes:
[0103] S101: Receive user natural language query
[0104] The system receives natural language report queries input by the user through an interactive terminal, which supports text input, voice input, and retrieval of historical query records.
[0105] S102: Semantic Scoring and Topic Matching
[0106] Semantic analysis of the natural language query includes:
[0107] Vector similarity retrieval: Calculate the cosine similarity between the query and historical question vectors using a vector database. If the similarity is ≥ the first preset threshold (default 0.85), the corresponding historical processing result is directly reused.
[0108] Large Language Model Score: If the similarity is less than the first preset threshold, a basic score is generated from the dimensions of topic relevance and query feasibility through the large language model, and a comprehensive semantic score is calculated by combining topic weight and keyword weight;
[0109] S103: Semantic scoring threshold determination
[0110] Determine whether the comprehensive semantic score is ≥ a second preset threshold (default 0.6):
[0111] If not, proceed to step S104;
[0112] If so, proceed to step S105.
[0113] S104: Generate a problem clarification response
[0114] Based on the high-frequency ambiguities (such as indicator definitions, time ranges, and data dimensions) statistically analyzed in the domain knowledge base (industry terminology library, indicator definition library, and time semantic library), candidate clarification questions in the form of multiple choice questions (containing 2 to 5 candidate answers) are generated and pushed to users.
[0115] S105: Problem Fixing and Deterministic Transformation
[0116] By combining the concept-field mapping table of the domain knowledge base and the few-shot rewriting capability of the large language model, the clarified or initially explicit natural language query is transformed into a deterministic report request that includes data dimensions, indicator types, time ranges, and analysis methods.
[0117] S106: Metadata-Aware SQL Generation
[0118] Automatically collect metadata (table names, field types, primary and foreign key relationships) from the target database and inject it into the large language model along with the deterministic report request;
[0119] Prioritize matching against a predefined SQL template library to generate executable structured query statements;
[0120] When the database table structure changes, the SQL template library is dynamically updated.
[0121] S107: Access Control and Query Execution
[0122] Based on the RBAC permission model corresponding to the user role, field-level data access conditions (such as region, department, and data level restrictions) are dynamically inserted into the WHERE clause of the SQL statement.
[0123] Sensitive fields are de-identified using character replacement, hash mapping, or masking, and the de-identification rules are stored in the permission configuration center.
[0124] Execute SQL using a database connection pool to obtain the query result set;
[0125] S108: Multimodal Result Generation and Output
[0126] Multimodal processing of the query result set includes:
[0127] Visualization rendering: Time series data generates line charts, categorical data generates bar charts, and multidimensional data generates pivot tables. It supports interactive operations such as zooming, drill-down, and dimension switching (new SQL is automatically generated and the report is updated when triggered).
[0128] Natural Language Summary: Generates text summaries containing key indicators, trend changes, and outliers by calling large language models;
[0129] Multi-platform adaptation: Adapts to web, mobile, and large-screen displays through responsive layout and cross-platform rendering engine;
[0130] S109: Record user feedback data
[0131] Collect user feedback triplet data on reports and store it in a time-series database;
[0132] S1010: Incremental learning to optimize parameters
[0133] Regularly extract feedback data and optimize through reinforcement learning, including:
[0134] The semantic scoring model includes a first preset threshold, a second preset threshold, topic weight, and keyword weight.
[0135] The concept of a domain knowledge base - field mapping rules and matching strategies for the SQL template library;
[0136] The reward function for reinforcement learning is designed based on the improvement rate of user satisfaction.
[0137] Furthermore, this solution also provides an interactive AI report generation system based on intelligent semantics, used to implement the aforementioned interactive AI report generation method based on intelligent semantics. This system adopts a layered architecture design and supports cloud, hybrid, and edge deployments, including:
[0138] Semantic scoring and dynamic flow control module: Based on a large language model, the semantic scoring and dynamic flow control module performs semantic analysis on user questions, calculates the matching degree score between the questions and the topics of each report, and dynamically selects the question correction or report generation process based on the scoring results.
[0139] Problem Repair and Deterministic Conversion Module: Based on the domain knowledge base, the problem repair and deterministic conversion module converts fuzzy queries into deterministic report requests, eliminating natural language ambiguity;
[0140] Metadata-aware SQL generation module: By combining database metadata with the understanding of field semantics and relationships, the metadata-aware SQL generation module converts deterministic queries into executable SQL.
[0141] Access Control and Query Execution Module: This module dynamically rewrites SQL based on user roles, adds permission filtering conditions, executes queries, and processes sensitive data.
[0142] Multimodal result generation module: The multimodal result generation module analyzes the characteristics of the query result data, automatically selects the optimal visualization form, and generates a natural language explanation;
[0143] Incremental learning optimization module: This module collects user feedback data and continuously optimizes the semantic scoring model and query generation strategy.
[0144] The semantic scoring and dynamic flow control module described in this embodiment includes:
[0145] Vector database: Used to store historical question vectors, supporting cosine similarity retrieval;
[0146] Multi-dimensional scoring engine: Integrates large language model prompting engineering to output standardized scores.
[0147] The problem repair and deterministic conversion module described in this embodiment includes a domain knowledge base and a large language model rewriting engine, which are used to eliminate natural language ambiguity and convert vague requirements into explicit queries that can be executed by the database.
[0148] The permission control and query execution module described in this embodiment includes:
[0149] Semantic-level permission tagging engine: used to automatically analyze the semantics of issues and attach data permissions (such as data access permissions for "East China Region");
[0150] SQL rewrite engine: Used to dynamically inject permission filtering conditions into the WHERE clause.
[0151] The incremental learning optimization module described in this embodiment includes:
[0152] Feedback data collector: used to record user questions, system response results, and satisfaction ratings;
[0153] Parameter optimizer: Adjusts model parameters such as scoring thresholds and keyword weights based on feedback data.
[0154] The above description is merely illustrative of the embodiments of the present invention and is not intended to limit the present invention. For those skilled in the art, any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for generating interactive AI reports based on intelligent semantics, characterized in that, include: Step (1) Receive natural language report queries input by the user through an interactive terminal, wherein the interactive terminal supports text input, voice input and historical query record retrieval functions; The system performs semantic analysis on user questions using a large language model, calculates their matching score with the topics of various reports, and dynamically selects between question correction and report generation processes based on the score results; specifically including: Vectorized storage and retrieval of historical questions: Each processed question text is converted into a vector through an embedding model to build a vector database; for new questions, the cosine similarity between the new question and the historical questions is first calculated. If the similarity exceeds the threshold (default 0.85), the historical processing results are directly reused. Multi-dimensional semantic scoring: For questions with no similar history, a scoring suggestion is constructed using suggestion engineering to guide the large language model to score from the dimensions of topic relevance and query feasibility, and output a standardized score between 0 and 1; Dynamically Adjusted Scoring: The basic semantic score is dynamically adjusted by combining topic weight and keyword weight, as shown in the following formula: final_score=base_score*topic_weight*(1+keyword_factor) Where: base_score represents the basic semantic score given by the large language model, with a score of 0-1; topic_weight represents the preset importance weight of each topic; keyword_factor represents the weight of keywords in the question, calculated as sum(matching keyword weight) / number of keywords; Dynamic process selection: Set a scoring threshold, default 0.6; if the score is higher than the threshold, proceed to the report generation process; if the score is lower than the threshold, proceed to the problem correction process; this threshold is dynamically adjusted based on user feedback data. Step (2) converts fuzzy queries into deterministic report requests based on the domain knowledge base, eliminating natural language ambiguity; specifically including: Domain knowledge modeling: Build a concept-field mapping table for each report topic; Question rewriting mechanism: Using a large language model and a knowledge base, fuzzy questions are transformed into explicit queries; Step (3) combines database metadata to understand field semantics and relationships. When the database table structure changes, it triggers a dynamic update of the SQL template library, converting deterministic queries into executable SQL; specifically including: Metadata enhancement hints: Inject database table structure, field types, primary and foreign key relationship metadata into the large language model hints to enhance its understanding of the data model; Templated SQL generation: Creates parameterized SQL templates for common query patterns, prioritizing template matching; Dynamic FunctionCalling: Leveraging the function calling capabilities of a large language model, the generated SQL is converted into safe function call execution; Step (4) Dynamically rewrite the SQL based on user roles to add permission filtering conditions, execute the query and process sensitive data; Step (5) Analyze the data characteristics of the query results, automatically select the optimal visualization form and generate natural language explanations; support zoom, drill-down, and dimension switching interactive operations, and automatically generate new SQL and update the report when triggered; Step (6) Collect user feedback data and continuously optimize the semantic scoring model and query generation strategy.
2. The interactive AI report generation method based on intelligent semantics as described in claim 1, characterized in that, Step (4) specifically includes: Semantic-level permission filtering: Automatically attaches data permission tags based on the semantics of the problem; SQL rewriting engine: Dynamically modifies SQL based on user roles and automatically injects permission conditions; Results desensitization: Sensitive fields that are not accessible to authorized users are automatically desensitized.
3. The interactive AI report generation method based on intelligent semantics as described in claim 1, characterized in that, Step (5) specifically includes: Natural Language Summarization: By injecting user questions, data summaries, and sample data from datasets into large language model prompts, it generates text summaries containing key metrics and insights, highlighting outliers and important trends; Data Feature Analysis: Automatically analyzes the characteristics of the result dataset and selects the most appropriate chart type or table.
4. The interactive AI report generation method based on intelligent semantics as described in claim 1, characterized in that, The specific steps (6) are as follows: by recording user questions, system response results and user satisfaction scores, a triplet optimization base data is formed; feedback data is analyzed regularly, and the threshold, keyword weight and topic weight of the semantic scoring model are adjusted.
5. An interactive AI report generation system based on intelligent semantics, characterized in that, include: Semantic scoring and dynamic flow control module: Receives natural language report queries from users via an interactive terminal, which supports text input, voice input, and retrieval of historical query records; performs semantic analysis on user questions using a large language model, calculates a matching score between the question and the topic of each report, and dynamically selects either question correction or report generation based on the score results; specifically including: Vectorized storage and retrieval of historical questions: Each processed question text is converted into a vector through an embedding model to build a vector database; for new questions, the cosine similarity between the new question and the historical questions is first calculated. If the similarity exceeds the threshold (default 0.85), the historical processing results are directly reused. Multi-dimensional semantic scoring: For questions with no similar history, a scoring suggestion is constructed using suggestion engineering to guide the large language model to score from the dimensions of topic relevance and query feasibility, and output a standardized score between 0 and 1; Dynamically Adjusted Scoring: The basic semantic score is dynamically adjusted by combining topic weight and keyword weight, as shown in the following formula: final_score=base_score*topic_weight*(1+keyword_factor) Where: base_score represents the basic semantic score given by the large language model, with a score of 0-1; topic_weight represents the preset importance weight of each topic; keyword_factor represents the weight of keywords in the question, calculated as sum(matching keyword weight) / number of keywords; Dynamic process selection: Set a scoring threshold, default 0.6; if the score is higher than the threshold, proceed to the report generation process; if the score is lower than the threshold, proceed to the problem correction process; this threshold is dynamically adjusted based on user feedback data. The issue fixing and deterministic conversion module: Based on the domain knowledge base, it converts fuzzy queries into deterministic report requests, eliminating natural language ambiguity; specifically including: Domain knowledge modeling: Build a concept-field mapping table for each report topic; Question rewriting mechanism: Using a large language model and a knowledge base, fuzzy questions are transformed into explicit queries; Metadata-aware SQL generation module: This module combines database metadata to understand field semantics and relationships. When the database table structure changes, it triggers dynamic updates to the SQL template library, converting deterministic queries into executable SQL. Specifically, it includes: Metadata enhancement hints: Inject database table structure, field types, primary and foreign key relationship metadata into the large language model hints to enhance its understanding of the data model; Templated SQL generation: Creates parameterized SQL templates for common query patterns, prioritizing template matching; Dynamic FunctionCalling: Leveraging the function calling capabilities of a large language model, the generated SQL is converted into safe function call execution; Access control and query execution module: Dynamically rewrites SQL based on user roles to add permission filtering conditions, executes queries, and processes sensitive data; Multimodal results generation module: Analyzes query result data characteristics, automatically selects the optimal visualization format and generates natural language explanations; supports zoom, drill-down, and dimension switching interactive operations, and automatically generates new SQL and updates reports when triggered; Incremental learning optimization module: Collects user feedback data and continuously optimizes the semantic scoring model and query generation strategy.
6. The interactive AI report generation system based on intelligent semantics as described in claim 5, characterized in that, The semantic scoring and dynamic flow control module includes: Vector database: Used to store historical question vectors, supporting cosine similarity retrieval; Multi-dimensional scoring engine: Integrates large language model prompting engineering to output standardized scores.
7. The interactive AI report generation system based on intelligent semantics as described in claim 5, characterized in that, The access control and query execution module includes: Semantic-level permission tagging engine: used to automatically analyze the semantics of issues and attach permission data. SQL rewrite engine: Used to dynamically inject permission filtering conditions into the WHERE clause.
Citation Information
Patent Citations
Interactive number asking agent system based on large language model
CN120216656A
