Intelligent interaction method and interactive system

Through intelligent interaction methods and translation model technology, the problem that traditional intelligent assistants cannot effectively display complex data and analysis results is solved, efficient and personalized data display and analysis are achieved, and user experience and system application capabilities are improved.

CN119271721BActive Publication Date: 2025-05-20GUANGDONG SHUGUO TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411796476.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-05-20
Estimated Expiration
2044-12-09

AI Technical Summary

Technical Problem

When traditional intelligent assistants process advanced user needs involving specific data, multi-dimensional analysis or visual charts, they are unable to directly display the dynamic trends of data, conduct in-depth dimensional analysis or generate intuitive visual charts, resulting in the limitation of the efficiency and quality of users' access to information.

Method used

An intelligent interaction method is adopted to match the relevant indicator text from the indicator text database using the distance measurement algorithm and the approximate nearest neighbor search algorithm, obtain visual chart option information, and convert the question content into an executable data format through the SQL pseudo-code translation model and the JSON data format translation model to generate the corresponding visual chart.

Benefits of technology

It has achieved more accurate and personalized data display for users, improved user experience and satisfaction, and improved the application and development of intelligent assistants in the fields of data analysis and decision support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271721B_ABST
    Figure CN119271721B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention relates to the field of artificial intelligence technology, and discloses an intelligent interaction method and an interaction system, the method comprising: using a distance measurement algorithm and an approximate nearest neighbor search algorithm respectively, matching an indicator text with a correlation with a question content greater than a first specified threshold from an indicator text database as a current indicator option; after taking the indicator with the highest correlation in the current indicator option as a target indicator, obtaining visualization chart option information corresponding to the target indicator; using an SQL pseudocode translation model to convert the question content into SQL pseudocode; using a JSON data format translation model to convert the SQL pseudocode into a JSON data format array; after determining the dimension information, data screening information, and sorting information in the visualization chart option information according to the JSON data format array, outputting a visualization chart. The implementation of the embodiment of the present invention can provide users with more accurate and personalized data display to improve user experience and satisfaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular, to an intelligent interaction method and an interaction system. Background Art

[0002] With the rapid development of artificial intelligence technology, intelligent assistants, as powerful assistants in human daily life and work, have become increasingly important. These intelligent assistants not only rely on advanced natural language processing technology (NLP) to accurately understand users' questions, but also use user intention recognition technology to insight into users' real needs, so as to generate corresponding responses and solutions.

[0003] However, it is found in practice that when users put forward advanced requirements such as specific data, multi-dimensional analysis or visual charts during the query process, most traditional intelligent assistants can only provide simple text responses, and cannot directly display the dynamic trends of data, conduct in-depth dimensional analysis or generate intuitive visual charts. And this limitation not only restricts the efficiency and quality of users' access to information, but also affects the further application and development of intelligent assistants in the fields of data analysis, decision-making support, etc. Summary of the Invention

[0004] Embodiments of the present invention disclose an intelligent interaction method and an interaction system, which can provide more accurate and personalized data display for users to improve user experience and satisfaction.

[0005] In a first aspect, an embodiment of the present invention discloses an intelligent interaction method, and the method includes:

[0006] Respectively use a distance metric algorithm and an approximate nearest neighbor search algorithm to match the metric texts in the metric text database whose relevance to the question content is greater than a first specified threshold as the current metric options;

[0007] After taking the metric with the highest relevance in the current metric options as the target metric, obtain the visualization chart option information corresponding to the target metric; wherein, the chart option information at least includes dimension information, data screening information, and sorting information;

[0008] Use an SQL pseudo-code translation model to convert the question content into SQL pseudo-code;

[0009] Use a JSON data format translation model to convert the SQL pseudo-code into an array in JSON data format;

[0010] After determining the dimension information, data screening information, and sorting information in the visualization chart option information according to the JSON data format array, output a visualization chart.

[0011] As another alternative implementation, in the first aspect of the embodiments of the present invention, the step of respectively using a distance metric algorithm and an approximate nearest neighbor search algorithm to match metric texts in the metric text database whose relevance to the question content is greater than a first specified threshold as the current metric options includes:

[0012] After preprocessing the question content using natural language processing techniques, use a Word Embedding model to convert the question content into a fixed-length vector representation;

[0013] Respectively use the cosine similarity formula and the approximate nearest neighbor search algorithm to calculate the cosine similarity between the metric text vectors in the metric text database and the question content vectors;

[0014] Select from the metric text database the metric texts whose cosine similarity is greater than the first specified threshold as the current metric options.

[0015] As another alternative implementation, in the first aspect of the embodiments of the present invention, the step of using an SQL pseudocode translation model to convert the question content into SQL pseudocode includes:

[0016] After training the SQL pseudocode translation model using question training data and the DSPy framework, input the question content into the SQL pseudocode translation model to obtain the SQL pseudocode; wherein, the SQL pseudocode translation model is a translator based on the chain of thought.

[0017] As another alternative implementation, in the first aspect of the embodiments of the present invention, the step of using a JSON data format translation model to convert the SQL pseudocode into an array in JSON data format includes:

[0018] After training the JSON data format translation model using SQL training data and the DSPy framework, input the GroupBy part, WHERE part, and ORDER BY part in the SQL pseudocode into the JSON data format translation model respectively to obtain the array in JSON data format; wherein, the JSON data format translation model is a translator based on the chain of thought.

[0019] As another alternative implementation, in the first aspect of the embodiments of the present invention, after taking the metric with the highest relevance in the current metric options as the target metric and before obtaining the visualization chart option information corresponding to the target metric, the method further includes:

[0020] If the user re - selects another target metric from the current metric options, use the other target metric as the target metric;

[0021] Perform the operation of obtaining the visualization chart option information corresponding to the target metric.

[0022] As another alternative implementation manner, in the first aspect of the embodiments of the present invention, after converting the SQL pseudo - code into a JSON data - format array by using the JSON data - format translation model, and before determining the dimension information, data filtering information, and sorting information in the visualization chart option information according to the JSON data - format array, the method further includes:

[0023] Use behavior buried - point technology to obtain user interaction behavior records;

[0024] And, after determining the dimension information, data filtering information, and sorting information in the visualization chart option information according to the JSON data - format array, and before outputting the visualization chart, the method further includes:

[0025] Combine the user interaction behavior records with the dimension information, data filtering information, and sorting information in the visualization chart option information to determine the visualization chart, and perform the operation of outputting the visualization chart;

[0026] Store the visualization chart and the question content; where the question content is the index of the visualization chart.

[0027] As another alternative implementation manner, in the first aspect of the embodiments of the present invention, before respectively using the distance - metric algorithm and the approximate nearest - neighbor search algorithm to match the metric text with a relevance greater than the first specified threshold to the question content from the metric text database as the current metric options, the method further includes:

[0028] Detect whether there is an index with a similarity to the question content reaching the second specified threshold; if so, output the corresponding visualization chart;

[0029] If not, perform the operation of respectively using the distance - metric algorithm and the approximate nearest - neighbor search algorithm to match the metric text with a relevance greater than the first specified threshold to the question content from the metric text database as the current metric options.

[0030] The second aspect of the embodiments of the present invention discloses an interactive system, and the interactive system includes:

[0031] A matching unit, which is used to respectively use a distance metric algorithm and an approximate nearest neighbor search algorithm to match, from an index text database, index texts whose relevance to the question content is greater than a first specified threshold as the current index options;

[0032] A first obtaining unit, which is used to, after taking the index with the highest relevance in the current index options as the target index, obtain the visualization chart option information corresponding to the target index; wherein, at least dimension information, data filtering information, and sorting information are included in the chart option information;

[0033] A first conversion unit, which is used to convert the question content into SQL pseudocode by using an SQL pseudocode translation model;

[0034] A second conversion unit, which is used to convert the SQL pseudocode into a JSON data format array by using a JSON data format translation model;

[0035] An output unit, which is used to output a visualization chart after determining the dimension information, data filtering information, and sorting information in the visualization chart option information according to the JSON data format array.

[0036] As another optional implementation manner, in the second aspect of the embodiments of the present invention, the matching unit includes:

[0037] A conversion subunit, which is used to, after preprocessing the question content by using natural language processing technology, convert the question content into a fixed-length vector representation by using a Word Embedding model;

[0038] A calculation subunit, which is used to respectively use a cosine similarity formula and the approximate nearest neighbor search algorithm to calculate the cosine similarity between the index text vector in the index text database and the question content vector;

[0039] A selection subunit, which is used to select, from the index text database, index texts whose cosine similarity is greater than the first specified threshold as the current index options.

[0040] As another optional implementation manner, in the second aspect of the embodiments of the present invention, the first conversion unit includes:

[0041] A first input subunit, which is used to, after training the SQL pseudocode translation model by using question training data and a DSPy framework, input the question content into the SQL pseudocode translation model to obtain the SQL pseudocode; wherein, the SQL pseudocode translation model is a translator based on a chain of thought.

[0042] In a third aspect of the embodiments of the present invention, an interaction system is disclosed, and the interaction system includes:

[0043] A memory storing executable program code;

[0044] A processor coupled to the memory;

[0045] The processor calls the executable program code stored in the memory and executes an intelligent interaction method disclosed in the first aspect of the embodiments of the present invention.

[0046] In a fourth aspect of the embodiments of the present invention, a computer-readable storage medium is disclosed, which stores a computer program, and wherein the computer program causes a computer to execute an intelligent interaction method disclosed in the first aspect of the embodiments of the present invention.

[0047] In a fifth aspect of the embodiments of the present invention, a computer program product is disclosed. When the computer program product runs on a computer, it causes the computer to execute some or all of the steps of any one of the intelligent interaction methods in the first aspect.

[0048] In a sixth aspect of the embodiments of the present invention, an application publishing platform is disclosed. The application publishing platform is used to publish a computer program product, and when the computer program product runs on a computer, it causes the computer to execute some or all of the steps of any one of the intelligent interaction methods in the first aspect.

[0049] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0050] In the embodiments of the present invention, a distance metric algorithm and an approximate nearest neighbor search algorithm are respectively used to match, from an index text database, index texts whose relevance to the question content is greater than a first specified threshold as current index options; after taking the index with the highest relevance in the current index options as the target index, visualization chart option information corresponding to the target index is obtained; wherein, the chart option information at least includes dimension information, data filtering information, and sorting information; a SQL pseudocode translation model is used to convert the question content into SQL pseudocode; a JSON data format translation model is used to convert the SQL pseudocode into a JSON data format array; after determining the dimension information, data filtering information, and sorting information in the visualization chart option information according to the JSON data format array, a visualization chart is output. It can be seen that the embodiments of the present invention can provide more accurate and personalized data display for users, so as to improve the user experience and satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings required in the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.

[0052] Figure 1 is a schematic flowchart of an intelligent interaction method disclosed in an embodiment of the present invention;

[0053] Figure 2 is a schematic flowchart of another intelligent interaction method disclosed in an embodiment of the present invention;

[0054] Figure 3 is a schematic structural diagram of an interaction system disclosed in an embodiment of the present invention;

[0055] Figure 4 is a schematic structural diagram of another interaction system disclosed in an embodiment of the present invention;

[0056] Figure 5 is a schematic structural diagram of another interaction system disclosed in an embodiment of the present invention. Detailed Embodiments

[0057] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0058] It should be noted that the terms "first", "second", "third", "fourth", etc. in the specification and claims of the present invention are used to distinguish different objects, rather than to describe a specific order. The terms "including" and "having" in the embodiments of the present invention and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0059] The embodiments of the present invention disclose an intelligent interaction method and an interaction system, which can provide more accurate and personalized data display for users to improve user experience and satisfaction.

[0060] The following will be described in detail with reference to the accompanying drawings. Embodiment 1

[0061] Please refer toFigure 1 , Figure 1 is a schematic flowchart of an intelligent interaction method disclosed in an embodiment of the present invention. As Figure 1 shown, the intelligent interaction method may include the following steps.

[0062] 101. The interaction system respectively uses a distance metric algorithm and an approximate nearest neighbor search algorithm to match, from the index text database, index texts whose relevance to the question content is greater than a first specified threshold as the current index options.

[0063] As an optional implementation manner, in the embodiment of the present invention, the present application may first use a distance metric algorithm (such as cosine similarity, Euclidean distance, etc.) to calculate the similarity or distance between the user's question and each index text in the database. Then, an approximate nearest neighbor search algorithm (such as KD - tree, ball - tree, LSH, etc.) may be used to accelerate the search process and quickly find the index text most similar to the user's question from a large number of texts. The relevance of these texts needs to be greater than a preset threshold to ensure that only the index texts highly relevant to the user's question are selected as the current index options.

[0064] As an optional implementation manner, in the embodiment of the present invention, through the approximate nearest neighbor search algorithm, the present application can quickly find index texts similar to the question content in a large - scale index text database, significantly improving the efficiency compared to full - scale search. At the same time, combined with the distance metric algorithm, it can quantify the similarity between the question content and the index text, ensuring that only index texts with a relevance greater than the specified threshold are selected, improving the accuracy of matching. Users can quickly obtain index options closely related to the question, reducing the interference of invalid information and enhancing the fluency and satisfaction of the interaction.

[0065] As an optional implementation manner, in the embodiment of the present invention, the present application can quickly and accurately screen out the index most relevant to the user's question from a large amount of index texts, providing high - quality input for subsequent data analysis and visualization.

[0066] 102. After the interaction system takes the index with the highest relevance in the current index options as the target index, it obtains the visualization chart option information corresponding to the target index; wherein, the chart option information at least includes dimension information, data screening information, and sorting information.

[0067] As an alternative implementation, in the embodiments of the present invention, the present application can select the metric with the highest relevance to the user's question from the current metric options as the target metric. Then, the system queries and obtains the visualization chart option information corresponding to this target metric. This information is crucial for generating the chart required by the user because it defines the presentation manner of the chart. The dimension information included at least (such as the data fields on the X-axis and Y-axis), the data filtering information (used to limit the data range displayed in the chart), and the sorting information (specifying the sorting manner of the data in the chart) jointly determine the appearance and content of the chart.

[0068] As an alternative implementation, in the embodiments of the present invention, the present application can automatically extract and display the corresponding visualization chart option information according to the characteristics of the target metric, enabling the user to quickly customize the chart according to their own needs. At the same time, with clear dimension, data filtering, and sorting information, the user can more intuitively understand the data and make decisions quickly. Moreover, providing rich chart option information increases the interaction between the user and the system and improves the flexibility and usability of the system.

[0069] As an alternative implementation, in the embodiments of the present invention, the present application can provide the user with an intuitive and efficient data visualization tool, which helps the user better understand and analyze the data by automatically obtaining and displaying the chart option information related to the target metric.

[0070] 103. The interaction system uses an SQL pseudo-code translation model to convert the question content into SQL pseudo-code.

[0071] In this embodiment, the system can extract the latest intention related to the query from the question content, then perform word segmentation on the intention, and then group the word segmentation results according to SQL verbs, such as putting metrics in select and dimensions in groupBy, etc.

[0072] As an alternative implementation, in the embodiments of the present invention, the present application can convert the user's natural language question into a form of SQL pseudo-code. And SQL pseudo-code is not a real SQL query statement, but an intermediate representation form that is closer to natural language but retains the SQL query structure. This conversion is achieved through a trained translation model, which can understand the user's question intention and map it to the corresponding SQL query logic to convert the user's unstructured query request into a structured query that the system can understand and execute.

[0073] As an alternative implementation, in the embodiments of the present invention, through model translation, the system can support more diverse query requirements, improve the flexibility and scalability of the system, and non-technical users can also generate SQL queries by asking questions in natural language without having to understand complex SQL syntax. At the same time, converting natural language into structured SQL pseudocode helps to optimize the query logic and improve the accuracy and speed of data retrieval.

[0074] As an alternative implementation, in the embodiments of the present invention, the present application uses natural language processing technology to achieve seamless docking between user questions and database queries, enabling users to obtain the required data in a more natural and convenient manner.

[0075] 104. The interaction system uses a JSON data format translation model to convert the SQL pseudocode into an array in JSON data format.

[0076] As an alternative implementation, in the embodiments of the present invention, the system can further convert the SQL pseudocode into an array in JSON data format. JSON (JavaScript Object Notation) is a lightweight data interchange format that is easy for humans to read and write, and is also easy for machines to parse and generate. The purpose of converting the SQL pseudocode into an array in JSON data format is to more conveniently transmit and process data in the system. This JSON array may contain all the information required to execute the query, such as data sources, query conditions, data fields, etc., and this information will be organized in a structured manner for subsequent data retrieval and visualization.

[0077] As an alternative implementation, in the embodiments of the present invention, JSON, as a lightweight data interchange format, helps to standardize and uniformly process data, facilitating subsequent data analysis and visualization. At the same time, data in JSON format is easy to be parsed and processed by various programming languages and systems, facilitating cross-platform transmission and sharing of data. Moreover, JSON supports complex data structures, can better express the hierarchical relationship and attribute information of data, and enhances the expressiveness and readability of data.

[0078] 105. After the interaction system determines the dimension information, data filtering information, and sorting information in the visualization chart option information based on the JSON data format array, it outputs the visualization chart.

[0079] As an alternative implementation, in the embodiments of the present invention, the system can determine the specific options of the visualization chart according to the information in the JSON data format array, including dimension information, data filtering information, and sorting information. These information will guide the system on how to generate the chart, including which data fields to select as the dimensions of the chart, how to filter the data, and how to sort the data. Once these options are determined, the system can generate and output the visualization chart required by the user according to this information. This chart will visually display the data and help the user better understand the story and trend behind the data.

[0080] As an alternative implementation, in the embodiments of the present invention, this application displays data in the form of a visualization chart, enabling the user to more intuitively understand the distribution, trend, and relationship of the data, and improving the data insight ability. At the same time, the user can customize the dimensions, filtering conditions, and sorting methods of the chart according to needs to obtain a personalized data display effect and enhance the user experience. The visualization chart provides intuitive and comprehensive data support for decision-makers, helps to quickly discover the rules and trends in the data, and assists in decision-making.

[0081] As an alternative implementation, in the embodiments of the present invention, this application can display the processed and transformed data to the user in the form of a visualization chart to help the user better understand the data, thereby supporting more efficient decision-making and data analysis work.

[0082] In Figure 1 the intelligent interaction method, taking the interaction system as the execution subject as an example for description. It should be noted that Figure 1 the execution subject of the intelligent interaction method can also be an independent device associated with the interaction system, which is not limited in the embodiments of the present invention.

[0083] It can be seen that implementing Figure 1 the described intelligent interaction method can provide more accurate and personalized data display for users to enhance the user experience and satisfaction.

[0084] In addition, implementing Figure 1 the described intelligent interaction method can quickly and accurately screen out the metrics most relevant to the user's question from a large number of metric texts, providing high-quality input for subsequent data analysis and visualization. Embodiment 2

[0085] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of another intelligent interaction method disclosed in the embodiments of the present invention. As shown in Figure 2 , the intelligent interaction method may include the following steps:

[0086] 201. The interaction system detects whether there is an index whose similarity to the question content reaches a second specified threshold. If so, step 202 is executed; if not, steps 203 to 211 are executed.

[0087] As an alternative implementation, in the embodiments of the present invention, the system may first detect whether there is an index whose similarity to the question content reaches a second specified threshold. This index may be left when the user asked a question and generated a visualization chart before, and is used to quickly retrieve the answers to similar questions. If an index similar to the question content is found, the system can directly output the corresponding visualization chart and end this process. This improves efficiency and avoids repeated processing of similar questions.

[0088] 202. The interaction system outputs the corresponding visualization chart and ends this process.

[0089] As an alternative implementation, in the embodiments of the present invention, by detecting whether there is an index with a high similarity to the question content, the system can quickly identify and output the previously generated visualization chart, avoiding repeated calculation and generation processes. At the same time, when a similar index is found, the system can directly use the previous result without having to execute a complex processing flow again, thus saving computing resources and time.

[0090] 203. After preprocessing the question content using natural language processing technology, the interaction system uses the Word Embedding model to convert the question content into a fixed-length vector representation.

[0091] As an alternative implementation, in the embodiments of the present invention, if the system does not find a similar index, the system may first preprocess the question content using natural language processing technology (such as word segmentation, stop word removal, word embedding, etc.), and then use the Word Embedding model to convert the processed question content into a fixed-length vector representation. Then, the system uses the cosine similarity formula and the approximate nearest neighbor search algorithm to search for index text vectors similar to the question content vector in the index text database, and selects the index text with a similarity greater than the first specified threshold as the current index option.

[0092] 204. The interaction system respectively uses the cosine similarity formula and the approximate nearest neighbor search algorithm to calculate the cosine similarity between the index text vectors in the index text database and the question content vector.

[0093] 205. The interaction system selects the index text with a cosine similarity greater than the first specified threshold from the index text database as the current index option.

[0094] As an alternative implementation, in the embodiments of the present invention, the present application can deeply understand the semantic information of the user's question and convert it into a vector representation that can be processed by a computer by using natural language processing technology and the Word Embedding model. At the same time, through the cosine similarity formula and the approximate nearest neighbor search algorithm, the system can quickly find the most relevant metric text to the user's question in a large number of metric texts, improving the accuracy and efficiency of the search.

[0095] As an alternative implementation, in the embodiments of the present invention, first, the system can preprocess all documents in the metric text database and the question content into a suitable format. This step usually uses various techniques in natural language processing (NLP), such as word segmentation, word embedding (such as Word2Vec or BERT), stop word removal, etc. Subsequently, the system can use a pre-trained Word Embedding model (such as BERT) to convert each document and query into a fixed-length vector representation (models such as BERT can capture the semantic information in the text and convert it into a high-dimensional vector). Then, the system can compare the vector representations of the input query and the documents in the text database through cosine similarity or other distance metrics (such as Euclidean distance). The formula for cosine similarity is: cosine similarity = (A · B) / (||A|| × ||B||), where A and B are the vector representations of the query and the document, respectively. Finally, to improve efficiency, especially when dealing with large-scale data, the present application can use approximate nearest neighbor search algorithms, such as FAISS, Annoy, or ScaNN. These algorithms accelerate the similarity calculation process by building an index, thereby quickly finding the document most similar to the query.

[0096] 206. After the interaction system takes the metric with the highest relevance in the current metric options as the target metric, it obtains the visualization chart option information corresponding to the target metric; wherein, the chart option information at least includes dimension information, data filtering information, and sorting information.

[0097] In the embodiments of the present invention, since there may be errors when the system independently judges and selects metrics, the user can modify and reselect them. If the user reselects another target metric from the current metric options and takes the other target metric as the target metric.

[0098] As an alternative implementation, in the embodiments of the present invention, the system can accurately select the most relevant metric to the user's question as the target metric, ensuring the accuracy and pertinence of the subsequent generated visualization chart. At the same time, the obtained visualization chart option information corresponding to the target metric includes key elements such as dimension information, data filtering information, and sorting information, providing a basis for generating high-quality visualization charts.

[0099] 207. After the interactive system trains a SQL pseudocode translation model using question training data and the DSPy framework, it inputs the question content into the SQL pseudocode translation model to obtain SQL pseudocode; wherein, the SQL pseudocode translation model is a translator based on the chain of thought.

[0100] As an alternative implementation, in the embodiments of the present invention, the system can use question training data and the DSPy framework to train a SQL pseudocode translation model. This model, which is a translator based on the chain of thought, can convert the user's natural language question into SQL pseudocode. Then, the system inputs the question content into this model to obtain SQL pseudocode.

[0101] As an alternative implementation, in the embodiments of the present invention, the system can pre-prepare several translation examples for question completion, which record how to translate user questions into SQL pseudocode. Subsequently, the system can use the DSPy framework, use these examples as training data, and train a SQL pseudocode translation model based on the chain of thought. Finally, the system can encapsulate this SQL pseudocode translation model into an API interface to accept user questions as input and output SQL pseudocode.

[0102] 208. After the interactive system trains a JSON data format translation model using SQL training data and the DSPy framework, it inputs the GroupBy part, WHERE part, and ORDER BY part in the SQL pseudocode into the JSON data format translation model respectively to obtain a JSON data format array; wherein, the JSON data format translation model is a translator based on the chain of thought.

[0103] As an alternative implementation, in the embodiments of the present invention, the system can prepare several translation examples for grouping dimensions in advance, which record how to translate the GroupBy part, WHERE part, and ORDER BY part of SQL pseudocode into the GroupBy part, WHERE part, and ORDER BY part in JSON data format. Subsequently, the system can use the DSPy framework to use these examples as training data to train a JSON data format translation model based on the chain of thought. Finally, the system can combine the JSON data format translation model and the conversion code and package them into an API interface to parse the GroupBy part, WHERE part, and ORDER BY part of SQL pseudocode into JSON data format parameters for grouping dimension conditions, data filtering conditions, and sorting setting conditions respectively.

[0104] As an alternative implementation, in the embodiments of the present invention, the system can use SQL training data and the DSPy framework to train a JSON data format translation model. This model is also a translator based on the chain of thought and can convert different parts of SQL pseudocode (such as GroupBy, WHERE, ORDER BY) into JSON data format arrays. The system inputs these parts of SQL pseudocode into the model respectively to obtain JSON data format arrays.

[0105] As an alternative implementation, in the embodiments of the present invention, by using the SQL pseudocode translation model and the JSON data format translation model based on the chain of thought, the present application can convert the user's natural language question into executable SQL pseudocode and JSON data format arrays, realizing the intelligent conversion from natural language to computer instructions. At the same time, by processing the GroupBy, WHERE, and ORDER BY parts of SQL pseudocode respectively, the system can flexibly generate JSON data format arrays that meet the user's needs, providing flexible data support for subsequent visualization chart generation.

[0106] 209. The interaction system uses behavior tracing technology to obtain user interaction behavior records.

[0107] In the embodiments of the present invention, when the user visits for the first time, there is no user interaction behavior (that is, the user does not perform any modification operations). Therefore, when the user visits for the first time, step 209 does not need to be passed. The system can directly determine the dimension information, data filtering information, and sorting information in the visualization chart options information according to the JSON data format array, thereby determining the visualization chart and directly outputting it.

[0108] As an alternative implementation, in the embodiments of the present invention, the system can determine parameters such as dimensions, data filtering, and sorting in the visualization chart option information according to the information in the JSON data format array. At the same time, the system uses behavior tracking technology to obtain user interaction behavior records, which may be used to optimize subsequent user experiences or analyze user behaviors.

[0109] As an alternative implementation, in the embodiments of the present invention, after the user asks a question, the system can generate questions and options for the user step by step. If the default selected option is not what the user wants, the user can switch the option. And these user behavior actions can be recorded by the behavior tracking function. Then, the next time the user asks a similar question, the large model can provide more accurate default option selections based on these behavior records.

[0110] 210. After the interaction system determines the dimension information, data filtering information, and sorting information in the visualization chart option information according to the JSON data format array, it combines the user interaction behavior records with the dimension information, data filtering information, and sorting information in the visualization chart option information to determine the visualization chart and perform the operation of outputting the visualization chart.

[0111] As an alternative implementation, in the embodiments of the present invention, the system can synthesize the user interaction behavior records and the visualization chart option information to determine the final visualization chart style and content, and output it to the user.

[0112] As an alternative implementation, in the embodiments of the present invention, the present application obtains user interaction behavior records through behavior tracking technology and combines information such as dimensions, data filtering, and sorting in the visualization chart option information. The system can generate visualization charts that meet the personalized needs of users. At the same time, the generated visualization charts intuitively display the relationships and trends between data, helping users better understand the story behind the data and make more informed decisions.

[0113] 211. The interaction system stores the visualization chart and the question content; where the question content is the index of the visualization chart, and this process ends.

[0114] As an alternative implementation, in the embodiments of the present invention, by storing the visualization chart and the question content, the present application can form a knowledge base or a historical record library, which is convenient for users to retrieve similar query results or reuse previous query processes in the future. Moreover, when the user asks a similar question again, the system can directly retrieve and output relevant results from the storage library, further improving the system response speed and user experience.

[0115] As an alternative implementation, in the embodiments of the present invention, when a user poses a question or query requirement, the question may be relatively broad or imprecise, i.e., the system needs further parsing and refinement. Subsequently, after receiving the user's question, the system can use a large model to parse the question. The large model can recommend a set of possible query conditions by analyzing information such as the semantics and context of the question. These query conditions are a kind of parsing and concretization of the user's original question, which helps to narrow the search scope or precisify the query target. Subsequently, the system can give the first query direction or hypothesis based on the question itself. These initial conditions will be recorded and used as the basis for subsequent user behavior playback and query optimization. After the user sees the query conditions recommended by the large model, they may further interact according to their own understanding and needs, such as selecting, modifying, or adding query conditions. These user behaviors (such as clicks, inputs, etc.) will be recorded by the system and processed by "playback". The purpose of playback is to simulate the whole process of the user from the initial conditions to the final query conditions, so as to better understand the user's intentions and needs. After the user's behavior playback and possible multiple interactions, the system will obtain a set of final query conditions. These final query conditions are more precise and in line with the user's actual needs. The final query conditions will be written into the knowledge base. In the knowledge base, the index is the user's question and context (i.e., the specific situation and environment when the user asks the question), and the content is the user's final query conditions. Such a design enables the system to quickly respond to future similar questions or queries and provide accurate query results by retrieving the knowledge base. As time goes by and user behaviors change, the knowledge base needs to be continuously optimized and updated. The system can analyze data such as the user's query history and feedback information to discover potential problems and improvement points, and then iteratively optimize the knowledge base. And this process reflects the application of artificial intelligence technology in user query assistance and information retrieval. Through the parsing ability of the large model, the user behavior playback mechanism, and the construction and optimization of the knowledge base, the system can more accurately understand the user's intentions and needs and provide more precise and personalized query results.

[0116] It can be seen that implementing Figure 2 the other intelligent interaction method described can provide users with more accurate and personalized data display to improve user experience and satisfaction.

[0117] In addition, implementing Figure 2 the other intelligent interaction method described can improve the interaction efficiency. Embodiment III

[0118] Please refer to Figure 3 , Figure 3 which is a schematic structural diagram of an interaction system disclosed in the embodiments of the present invention. As Figure 3, the interactive system 300 may include a matching unit 301, a first acquisition unit 302, a first conversion unit 303, a second conversion unit 304, and an output unit 305, where:

[0119] The matching unit 301 is configured to respectively use a distance metric algorithm and an approximate nearest neighbor search algorithm to match, from an index text database, index texts whose relevance to the question content is greater than a first specified threshold as current index options.

[0120] The first acquisition unit 302 is configured to, after using the index with the highest relevance in the current index options as the target index, acquire visualization chart option information corresponding to the target index; wherein, the chart option information at least includes dimension information, data filtering information, and sorting information.

[0121] The first conversion unit 303 is configured to use an SQL pseudocode translation model to convert the question content into SQL pseudocode.

[0122] The second conversion unit 304 is configured to use a JSON data format translation model to convert the SQL pseudocode into a JSON data format array.

[0123] The output unit 305 is configured to output a visualization chart after determining the dimension information, data filtering information, and sorting information in the visualization chart option information according to the JSON data format array.

[0124] As an optional implementation manner, in the embodiment of the present invention, the matching unit 301 may first use a distance metric algorithm (such as cosine similarity, Euclidean distance, etc.) to calculate the similarity or distance between the user's question and each index text in the database. Then, an approximate nearest neighbor search algorithm (such as KD tree, ball tree, LSH, etc.) may be used to accelerate the search process and quickly find the index text most similar to the user's question from a large number of texts. The relevance of these texts needs to be greater than a preset threshold to ensure that only index texts highly relevant to the user's question are selected as the current index options.

[0125] As an optional implementation manner, in the embodiment of the present invention, through the approximate nearest neighbor search algorithm, the matching unit 301 can quickly find index texts similar to the question content in a large-scale index text database, significantly improving the efficiency compared with full-scale search. At the same time, combined with the distance metric algorithm, it can quantify the similarity between the question content and the index text, ensuring that only index texts with a relevance greater than the specified threshold are selected, improving the accuracy of matching. The user can quickly obtain index options closely related to the question, reducing the interference of invalid information and enhancing the fluency and satisfaction of the interaction.

[0126] As an alternative implementation, in the embodiments of the present invention, the present application can quickly and accurately screen out the metrics most relevant to the user's question from a vast amount of metric texts, providing high-quality input for subsequent data analysis and visualization.

[0127] As an alternative implementation, in the embodiments of the present invention, the first acquisition unit 302 can select the metric with the highest relevance to the user's question from the current metric options as the target metric. Then, the first acquisition unit 302 queries and obtains the visualization chart option information corresponding to this target metric. This information is crucial for generating the chart required by the user because it defines the presentation method of the chart. The dimension information included at least (such as the data fields on the X-axis and Y-axis), the data filtering information (used to limit the data range displayed in the chart), and the sorting information (specifying the sorting method of the data in the chart) jointly determine the appearance and content of the chart.

[0128] As an alternative implementation, in the embodiments of the present invention, the first acquisition unit 302 can automatically extract and display the corresponding visualization chart option information according to the characteristics of the target metric, enabling the user to quickly customize the chart according to their own needs. At the same time, with clear dimension, data filtering, and sorting information, the user can more intuitively understand the data and make decisions quickly. Moreover, providing rich chart option information increases the interaction between the user and the system, improving the flexibility and usability of the system.

[0129] As an alternative implementation, in the embodiments of the present invention, the present application can provide the user with an intuitive and efficient data visualization tool, helping the user better understand and analyze the data by automatically acquiring and displaying the chart option information related to the target metric.

[0130] As an alternative implementation, in the embodiments of the present invention, the first conversion unit 303 can convert the user's natural language question into a form of SQL pseudo-code. The SQL pseudo-code is not a real SQL query statement, but an intermediate representation form that is closer to natural language but retains the SQL query structure. This conversion is achieved through a trained translation model that can understand the user's question intention and map it to the corresponding SQL query logic to convert the user's unstructured query request into a structured query that the system can understand and execute.

[0131] As an alternative embodiment, in the embodiments of the present invention, through model translation, the first conversion unit 303 can support more diverse query requirements, improve the flexibility and scalability of the system, and non-technical users can also generate SQL queries by asking natural language questions without having to understand complex SQL syntax. At the same time, converting natural language into structured SQL pseudocode helps to optimize the query logic and improve the accuracy and speed of data retrieval.

[0132] As an alternative embodiment, in the embodiments of the present invention, the present application uses natural language processing technology to achieve seamless docking between user questions and database queries, enabling users to obtain the required data in a more natural and convenient way.

[0133] As an alternative embodiment, in the embodiments of the present invention, the second conversion unit 304 can further convert the SQL pseudocode into an array in JSON data format. JSON (JavaScript Object Notation) is a lightweight data interchange format that is easy for humans to read and write, and is also easy for machines to parse and generate. The purpose of converting the SQL pseudocode into an array in JSON data format is to facilitate the transmission and processing of data in the system. This JSON array may contain all the information required to execute the query, such as data sources, query conditions, data fields, etc., and this information will be organized in a structured manner for subsequent data retrieval and visualization.

[0134] As an alternative embodiment, in the embodiments of the present invention, JSON, as a lightweight data interchange format, helps to standardize and uniformly process data, facilitating subsequent data analysis and visualization. At the same time, data in JSON format is easy to be parsed and processed by various programming languages and systems, facilitating cross-platform transmission and sharing of data. Moreover, JSON supports complex data structures and can better express the hierarchical relationship and attribute information of data, enhancing the expressiveness and readability of data.

[0135] As an alternative embodiment, in the embodiments of the present invention, the output unit 305 can determine the specific options for the visualization chart based on the information in the JSON data format array, including dimension information, data filtering information, and sorting information. This information will guide the system on how to generate the chart, including which data fields to select as the dimensions of the chart, how to filter the data, and how to sort the data. Once these options are determined, the system can generate and output the visualization chart required by the user based on this information. This chart will intuitively display the data and help users better understand the story and trends behind the data.

[0136] As an alternative implementation, in the embodiments of the present invention, the present application displays data in the form of visual charts, enabling users to more intuitively understand the distribution, trends, and relationships of the data, and improving the data insight ability. At the same time, users can customize the dimensions, filtering conditions, and sorting methods of the charts according to their needs to obtain personalized data display effects and enhance the user experience. The visual charts provide intuitive and comprehensive data support for decision-makers, helping to quickly discover the laws and trends in the data and assisting in decision-making.

[0137] As an alternative implementation, in the embodiments of the present invention, the present application can display the processed and transformed data to users in the form of visual charts to help users better understand the data, thereby supporting more efficient decision-making and data analysis work.

[0138] It can be seen that implementing Figure 3 the described interactive system can provide users with more accurate and personalized data display to enhance the user experience and satisfaction.

[0139] In addition, implementing Figure 3 the described interactive system can quickly and accurately screen out the metrics most relevant to the user's question from a large number of metric texts, providing high-quality input for subsequent data analysis and visualization. Embodiment Four

[0140] Please refer to Figure 4 , Figure 4 which is a schematic structural diagram of another interactive system disclosed in the embodiments of the present invention. Among them, Figure 4 the interactive system is optimized from Figure 3 the interactive system. Compared with Figure 3 the interactive system, Figure 4 the matching unit 301 of

[0141] a transformation sub-unit 3011, which is used to convert the question content into a fixed-length vector representation by using the Word Embedding model after preprocessing the question content by using natural language processing technology.

[0142] As an alternative implementation, in the embodiments of the present invention, if the system fails to find a similar index, the conversion subunit 3011 may first preprocess the question content using natural language processing techniques (such as word segmentation, stop word removal, word embedding, etc.), and then use the Word Embedding model to convert the processed question content into a fixed-length vector representation. Next, the calculation subunit 3012 uses the cosine similarity formula and the approximate nearest neighbor search algorithm to search for index text vectors similar to the question content vector in the index text database, and the selection subunit 3013 selects the index text with a similarity greater than the first specified threshold as the current index option.

[0143] The calculation subunit 3012 is configured to calculate the cosine similarity between the index text vector in the index text database and the question content vector by using the cosine similarity formula and the approximate nearest neighbor search algorithm respectively.

[0144] The selection subunit 3013 is configured to select the index text with a cosine similarity greater than the first specified threshold from the index text database as the current index option.

[0145] As an alternative implementation, in the embodiments of the present invention, by using natural language processing techniques and the Word Embedding model, the conversion subunit 3011 can deeply understand the semantic information of the user's question and convert it into a vector representation that can be processed by a computer. At the same time, through the cosine similarity formula and the approximate nearest neighbor search algorithm, the calculation subunit 3012 can quickly find the index text most relevant to the user's question among a large number of index texts, improving the accuracy and efficiency of the search.

[0146] As an alternative implementation, in the embodiments of the present invention, first, the transformation subunit 3011 can preprocess all documents and query content in the index text database into a suitable format. This step usually uses various techniques in natural language processing (NLP), such as word segmentation, word embedding (such as Word2Vec or BERT), stop word removal, etc. Subsequently, the transformation subunit 3011 can use a pre-trained Word Embedding model (such as BERT) to convert each document and query into a fixed-length vector representation (such models as BERT can capture semantic information in the text and convert it into a high-dimensional vector). Then, the calculation subunit 3012 can compare the vector representations of the input query and the documents in the text database through cosine similarity or other distance metrics (such as Euclidean distance). The formula for cosine similarity is: cosine similarity = (A · B) / (||A|| × ||B||), where A and B are the vector representations of the query and the document respectively. Finally, to improve efficiency, especially when dealing with large-scale data, the present application can use approximate nearest neighbor search algorithms, such as FAISS, Annoy, or ScaNN. These algorithms accelerate the similarity calculation process by constructing an index, so as to quickly find the document most similar to the query.

[0147] Compared with Figure 3 the interaction system of Figure 4 the first transformation unit 303 includes:

[0148] A first input subunit 3031, configured to input the query content into the SQL pseudo-code translation model after training the SQL pseudo-code translation model by using the query training data and the DSPy framework, so as to obtain SQL pseudo-code; wherein, the SQL pseudo-code translation model is a translator based on the chain of thought.

[0149] As an alternative implementation, in the embodiments of the present invention, the first input subunit 3031 can train a SQL pseudo-code translation model by using the query training data and the DSPy framework. This model is a translator based on the chain of thought and can convert the user's natural language query into SQL pseudo-code. Then, the system inputs the query content into this model to obtain SQL pseudo-code.

[0150] As an alternative implementation, in the embodiments of the present invention, the system can prepare several translation examples for question completion in advance, which record how to translate user questions into SQL pseudocode. Subsequently, the system can use the DSPy framework, take these examples as training data, and train a SQL pseudocode translation model based on the chain of thought. Finally, the system can encapsulate the SQL pseudocode translation model into an API interface to accept user questions as input and output SQL pseudocode.

[0151] Compared with Figure 3 the interactive system of Figure 4 the second conversion unit 304 of

[0152] A second input subunit 3041, configured to, after training a JSON data format translation model using SQL training data and the DSPy framework, input the GroupBy part, WHERE part, and ORDER BY part in the SQL pseudocode into the JSON data format translation model respectively to obtain a JSON data format array; wherein, the JSON data format translation model is a translator based on the chain of thought.

[0153] As an alternative implementation, in the embodiments of the present invention, the system can prepare several translation examples for grouping dimensions in advance, which record how to translate the GroupBy part, WHERE part, and ORDER BY part in the SQL pseudocode into the GroupBy part, WHERE part, and ORDER BY part in the JSON data format. Subsequently, the system can use the DSPy framework, take these examples as training data, and train a JSON data format translation model based on the chain of thought. Finally, the system can combine the JSON data format translation model and the conversion code and encapsulate them into an API interface to parse the GroupBy part, WHERE part, and ORDER BY part in the SQL pseudocode into JSON data format parameters of grouping dimension conditions, data filtering conditions, and sorting setting conditions respectively.

[0154] As an alternative implementation, in the embodiments of the present invention, the system can train a JSON data format translation model using SQL training data and the DSPy framework. This model is also a translator based on the chain of thought and can convert different parts (such as GroupBy, WHERE, ORDER BY) of the SQL pseudocode into a JSON data format array. The system inputs these parts of the SQL pseudocode into the model respectively to obtain a JSON data format array.

[0155] As an alternative implementation, in the embodiments of the present invention, the present application can convert the user's natural language question into executable SQL pseudocode and an array in JSON data format by using a SQL pseudocode translation model and a JSON data format translation model based on the chain of thought, realizing the intelligent conversion from natural language to computer instructions. At the same time, by separately processing the GroupBy, WHERE, and ORDER BY parts of the SQL pseudocode, the system can flexibly generate an array in JSON data format that meets the user's needs, providing flexible data support for subsequent visualization chart generation.

[0156] Compared with Figure 3 the interaction system of Figure 4 the interaction system also includes:

[0157] A first determination unit 306, configured to, after the first acquisition unit 302 takes the most relevant metric in the current metric options as the target metric and before obtaining the visualization chart option information corresponding to the target metric, if the user reselects another target metric from the current metric options, take the other target metric as the target metric.

[0158] A first execution unit 307, configured to execute the operation of obtaining the visualization chart option information corresponding to the target metric.

[0159] In the embodiments of the present invention, since there may be errors when the system automatically determines and selects metrics, the user can modify and reselect them by himself. If the user reselects another target metric from the current metric options, the first determination unit 306 can take the other target metric as the target metric.

[0160] As an alternative implementation, in the embodiments of the present invention, the system can accurately select the metric most relevant to the user's question as the target metric, ensuring the accuracy and pertinence of the subsequent generated visualization chart. At the same time, the obtained visualization chart option information corresponding to the target metric includes key elements such as dimension information, data filtering information, and sorting information, providing a basis for generating high-quality visualization charts.

[0161] Compared with Figure 3 the interaction system of Figure 4 the interaction system also includes:

[0162] A second acquisition unit 308, configured to, after the second conversion unit 304 converts the SQL pseudocode into an array in JSON data format by using a JSON data format translation model and before the output unit 305 determines the dimension information, data filtering information, and sorting information in the visualization chart option information according to the array in JSON data format, use behavior buried point technology to obtain user interaction behavior records.

[0163] As an alternative implementation, in the embodiments of the present invention, the system can determine parameters such as dimensions, data filtering, and sorting in the visualization chart option information according to the information in the JSON data format array. Meanwhile, the second acquisition unit 308 can use the behavior tracing technology to obtain user interaction behavior records, which may be used to optimize the subsequent user experience or analyze user behavior.

[0164] As an alternative implementation, in the embodiments of the present invention, after the user asks a question, the system can generate questions and options for the user step by step. If the default selected option is not what the user wants, the user can switch the option. And these user behavior actions can be recorded by the behavior tracing function. Then, the next time the user asks a similar question, the large model can provide more accurate default option selections based on these behavior records.

[0165] The determination and execution unit 309 is configured to, after the output unit 305 determines the dimension information, data filtering information, and sorting information in the visualization chart option information according to the JSON data format array and before outputting the visualization chart, combine the user interaction behavior records with the dimension information, data filtering information, and sorting information in the visualization chart option information to determine the visualization chart and perform the operation of outputting the visualization chart.

[0166] As an alternative implementation, in the embodiments of the present invention, the determination and execution unit 309 can synthesize the user interaction behavior records and the visualization chart option information to determine the final visualization chart style and content and output it to the user.

[0167] As an alternative implementation, in the embodiments of the present invention, the present application obtains user interaction behavior records through the behavior tracing technology and combines the information such as dimensions, data filtering, and sorting in the visualization chart option information. The determination and execution unit 309 can generate a visualization chart that meets the personalized needs of the user. Meanwhile, the generated visualization chart intuitively shows the relationships and trends between the data, which helps the user better understand the story behind the data and make more informed decisions.

[0168] The storage unit 310 is configured to store the visualization chart and the question content; wherein, the question content is the index of the visualization chart.

[0169] As an alternative implementation, in the embodiments of the present invention, the storage unit 310 can form a knowledge base or a historical record library by storing visualization charts and question contents, which is convenient for users to retrieve similar query results or reuse previous query processes in the future. Moreover, when the user asks a similar question again, the system can directly retrieve and output relevant results from the repository, further improving the system response speed and user experience.

[0170] As an alternative implementation, in the embodiments of the present invention, when a user raises a question or a query requirement, the question may be relatively broad or imprecise, that is, further parsing and refinement by the system are required. Subsequently, after receiving the user's question, the system can use a large model to parse the question. The large model can recommend a set of possible query conditions by analyzing information such as the semantics and context of the question. These query conditions are a kind of parsing and specification of the user's original question, which helps to narrow the search scope or refine the query target. Subsequently, the system can give the first query direction or hypothesis based on the question itself. These initial conditions will be recorded and used as the basis for subsequent user behavior replay and query optimization. After the user sees the query conditions recommended by the large model, they may further interact according to their own understanding and needs, such as selecting, modifying, or adding query conditions. These user behaviors (such as clicks, inputs, etc.) will be recorded by the system and processed by "replaying". The purpose of replaying is to simulate the whole process of the user from the initial conditions to the final query conditions, so as to better understand the user's intentions and needs. After the user's behavior replay and possible multiple interactions, the system will obtain a set of final query conditions. These final query conditions are more accurate and in line with the actual needs of the user. The final query conditions will be written into the knowledge base. In the knowledge base, the index is the user's question and context (that is, the specific situation and environment when the user asks the question), and the content is the user's final query conditions. Such a design enables the system to quickly respond to future similar questions or queries and provide accurate query results by retrieving the knowledge base. As time goes by and user behaviors change, the knowledge base needs to be continuously optimized and updated. The system can discover potential problems and improvement points by analyzing data such as the user's query history and feedback information, and then iteratively optimize the knowledge base. And this process reflects the application of artificial intelligence technology in user query assistance and information retrieval. Through the parsing ability of the large model, the user behavior replay mechanism, and the construction and optimization of the knowledge base, the system can more accurately understand the user's intentions and needs and provide more accurate and personalized query results.

[0171] Compared with Figure 3 the interactive system of Figure 4 the interactive system also includes:

[0172] The detection unit 311 is configured to detect whether there is an index whose similarity to the question content reaches a second specified threshold before the matching unit 301 uses the distance metric algorithm and the approximate nearest neighbor search algorithm respectively to match the index texts in the index text database whose relevance to the question content is greater than a first specified threshold as the current index option.

[0173] As an optional implementation manner, in the embodiment of the present invention, the detection unit 311 may first detect whether there is an index whose similarity to the question content reaches a second specified threshold. This index may be left when the user asked a question before and a visualization chart was generated, and is used to quickly retrieve the answers to similar questions. If an index similar to the question content is found, the output unit 305 may directly output the corresponding visualization chart and end this process. This improves the efficiency and avoids repeated processing of similar questions.

[0174] As an optional implementation manner, in the embodiment of the present invention, the output unit 305 is further configured to output the corresponding visualization chart when the detection unit 311 detects that there is an index whose similarity to the question content reaches a second specified threshold.

[0175] The second execution unit 312 is configured to, when the detection unit 311 detects that there is no index whose similarity to the question content reaches a second specified threshold, perform the operation of using the distance metric algorithm and the approximate nearest neighbor search algorithm respectively to match the index texts in the index text database whose relevance to the question content is greater than a first specified threshold as the current index option.

[0176] As an optional implementation manner, in the embodiment of the present invention, by detecting whether there is an index with a high similarity to the question content, the system can quickly identify and output the previously generated visualization chart, avoiding repeated calculation and generation processes. At the same time, when a similar index is found, the system can directly use the previous result without having to execute a complex processing flow again, thereby saving computing resources and time.

[0177] It can be seen that implementing Figure 4 the described another interactive system can provide users with more accurate and personalized data display to improve the user experience and satisfaction.

[0178] In addition, implementing Figure 4 the described another interactive system can improve the interaction efficiency. Embodiment Five

[0179] Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of another interactive system disclosed in the embodiment of the present invention. As Figure 5 shown, the interactive system may include:

[0180] A memory 501 storing executable program code;

[0181] A processor 502 coupled to the memory 501;

[0182] Wherein, the processor 502 calls the executable program code stored in the memory 501 and executes Figures 1 - 2 Any one of the intelligent interaction methods.

[0183] An embodiment of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute Figures 1 - 2 Any one of the intelligent interaction methods.

[0184] An embodiment of the present invention further discloses a computer program product, wherein when the computer program product runs on a computer, it causes the computer to execute some or all of the steps of the methods in the above method embodiments.

[0185] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium includes read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc memories, magnetic disk memories, tape memories, or any other computer-readable medium capable of carrying or storing data.

[0186] The above has introduced in detail an intelligent interaction method and an interaction system disclosed in the embodiments of the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. An intelligent interaction method, characterized in that: include: Using a distance measurement algorithm and an approximate nearest neighbor search algorithm respectively, an indicator text having a correlation with the question content greater than a first specified threshold is matched from an indicator text database as a current indicator option; After taking the indicator with the highest correlation among the current indicator options as the target indicator, obtaining the visualization chart option information corresponding to the target indicator; wherein the chart option information at least includes dimension information, data filtering information and sorting information, the dimension information includes data fields on the X-axis and the Y-axis, the data filtering information includes information for limiting the data range displayed in the chart, and the sorting information includes a sorting method for specifying the data in the chart; Using a SQL pseudocode translation model, converting the question content into SQL pseudocode; Using the JSON data format translation model, convert the SQL pseudo code into a JSON data format array; After determining the dimension information, data screening information and sorting information in the visualization chart option information according to the JSON data format array, outputting the visualization chart; The method of using a distance measurement algorithm and an approximate nearest neighbor search algorithm to match an indicator text having a correlation with the question content greater than a first specified threshold from an indicator text database as a current indicator option includes: After preprocessing the question content by using natural language processing technology, the question content is converted into a vector representation of a fixed length by using a Word Embedding model; Using the cosine similarity formula and the approximate nearest neighbor search algorithm respectively, the cosine similarity between the indicator text vector and the question content vector in the indicator text database is calculated; Selecting the indicator text whose cosine similarity is greater than the first specified threshold from the indicator text database as the current indicator option; The SQL pseudo code translation model is used to convert the question content into SQL pseudo code, including: After the SQL pseudocode translation model is trained using the question training data and the DSPy framework, the question content is input into the SQL pseudocode translation model to extract the latest intent related to the query from the question content, and then the latest intent is segmented, and the segmentation results are grouped according to SQL verbs to obtain the SQL pseudocode; wherein the SQL pseudocode translation model is a translator based on thought chain; The method of using the JSON data format translation model to convert the SQL pseudo code into a JSON data format array includes: After the JSON data format translation model is trained using SQL training data and the DSPy framework, the GroupBy part, the WHERE part and the ORDER BY part in the SQL pseudocode are respectively input into the JSON data format translation model to obtain the JSON data format array; wherein the JSON data format translation model is a translator based on thought chain; After taking the indicator with the highest correlation among the current indicator options as the target indicator and before obtaining the visualization chart option information corresponding to the target indicator, the method further includes: If the user reselects another target indicator from the current indicator options, the other target indicator is used as the target indicator; Execute the operation of obtaining the visualization chart option information corresponding to the target indicator; After converting the SQL pseudo code into a JSON data format array by using the JSON data format translation model, and before determining the dimension information, data screening information and sorting information in the visualization chart option information according to the JSON data format array, the method further includes: Use behavior tracking technology to obtain user interaction behavior records; Furthermore, after determining the dimension information, data filtering information, and sorting information in the visualization chart option information according to the JSON data format array, and before outputting the visualization chart, the method further includes: Determine the visual chart by combining the user interaction behavior record and the dimension information, data screening information and sorting information in the visual chart option information, and perform the operation of outputting the visual chart; The visualization chart and the question content are stored so that when the user asks a similar question again, the user can directly retrieve and output relevant results from the repository; wherein the question content is an index of the visualization chart; Before using the distance measurement algorithm and the approximate nearest neighbor search algorithm to match the indicator text having a correlation with the question content greater than a first specified threshold from the indicator text database as the current indicator option, the method further includes: Detect whether there is an index whose similarity with the question content reaches a second specified threshold; if so, output the corresponding visualization chart; If not, the operation of using the distance measurement algorithm and the approximate nearest neighbor search algorithm respectively to match the indicator text having a correlation with the question content greater than the first specified threshold from the indicator text database as the current indicator option is performed.

2. An interactive system, characterized in that: The interactive system comprises: A matching unit, used to use a distance measurement algorithm and an approximate nearest neighbor search algorithm to match an indicator text having a correlation with the question content greater than a first specified threshold from an indicator text database as a current indicator option; A first acquisition unit is used to acquire, after taking the indicator with the highest correlation among the current indicator options as the target indicator, visual chart option information corresponding to the target indicator; wherein the chart option information at least includes dimension information, data filtering information and sorting information, the dimension information includes data fields on the X-axis and the Y-axis, the data filtering information includes information for limiting the data range displayed in the chart, and the sorting information includes a sorting method for specifying data in the chart; A first conversion unit, configured to convert the question content into SQL pseudo code by using a SQL pseudo code translation model; A second conversion unit is used to convert the SQL pseudo code into a JSON data format array by using a JSON data format translation model; An output unit, configured to output a visual chart after determining the dimension information, data screening information and sorting information in the visual chart option information according to the JSON data format array; The matching unit comprises: A conversion subunit, configured to convert the question content into a vector representation of a fixed length by using a Word Embedding model after preprocessing the question content by using a natural language processing technology; A calculation subunit, used to calculate the cosine similarity between the indicator text vector in the indicator text database and the question content vector using the cosine similarity formula and the approximate nearest neighbor search algorithm respectively; A selection subunit, configured to select, from the indicator text database, an indicator text whose cosine similarity is greater than the first specified threshold as the current indicator option; The first conversion unit comprises: A first input subunit is used for inputting the question content into the SQL pseudocode translation model after the SQL pseudocode translation model is trained by using the question training data and the DSPy framework, so as to extract the latest intent related to the query from the question content, and then perform word segmentation processing on the latest intent, and group the word segmentation results according to SQL verbs to obtain the SQL pseudocode; wherein the SQL pseudocode translation model is a translator based on thought chain; The second conversion unit comprises: A second input subunit is used to input the GroupBy part, the WHERE part and the ORDER BY part in the SQL pseudocode into the JSON data format translation model respectively after the JSON data format translation model is trained by using SQL training data and the DSPy framework, so as to obtain the JSON data format array; wherein the JSON data format translation model is a translator based on thought chain; The interactive system further comprises: A first determining unit, configured to, after the first obtaining unit uses the indicator with the highest correlation in the current indicator options as the target indicator and before obtaining the visualization chart option information corresponding to the target indicator, if the user reselects another target indicator from the current indicator options, use the other target indicator as the target indicator; A first execution unit, configured to execute the operation of obtaining the visualization chart option information corresponding to the target indicator; The interactive system further comprises: A second acquisition unit is used for obtaining user interaction behavior records by using behavior tracking technology after the second conversion unit converts the SQL pseudo code into a JSON data format array by using a JSON data format translation model and before the output unit determines the dimension information, data screening information and sorting information in the visualization chart option information according to the JSON data format array; The interactive system further comprises: A determination and execution unit, which is used for determining the visual chart in combination with the user interaction behavior record and the dimension information, data filtering information and sorting information in the visual chart option information after the output unit determines the dimension information, data filtering information and sorting information in the visual chart option information according to the JSON data format array and before outputting the visual chart, and performing the operation of outputting the visual chart; A storage unit, used to store the visualization chart and the question content, so that when the user asks a similar question again, the user can directly retrieve and output relevant results from the storage; wherein the question content is an index of the visualization chart; The interactive system further comprises: A detection unit, used for detecting whether there is an index whose similarity with the question content reaches a second specified threshold before the matching unit uses the distance measurement algorithm and the approximate nearest neighbor search algorithm to match the indicator text whose relevance with the question content is greater than the first specified threshold from the indicator text database as the current indicator option; The output unit is further configured to output the corresponding visualization chart when the detection unit detects that there is an index whose similarity with the question content reaches a second specified threshold; The second execution unit is used to execute the operation of matching the indicator text whose correlation with the question content is greater than the first specified threshold from the indicator text database as the current indicator option by using the distance measurement algorithm and the approximate nearest neighbor search algorithm respectively when the detection unit detects that there is no index whose similarity with the question content reaches the second specified threshold.

Citation Information

Patent Citations

  • Document database management method and device

    CN108073590A

  • Artificial intelligence data analysis method and device conforming to business logic, equipment and medium

    CN118485160A