Method, apparatus, device, medium and program product for retrieving information

By determining the semantic characteristics of the input text and matching the similarity with the database query statement, the problem that users find it difficult to determine data query tables and fields in massive data is solved, and the efficiency and user experience of database query are improved.

CN119201986BActive Publication Date: 2025-03-11BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411718321.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-03-11
Estimated Expiration
2044-11-27

AI Technical Summary

Technical Problem

When processing massive data, it is difficult for users to determine which data table or field should be used for data query, and there are differences in SQL syntax supported by different types of data query engines, resulting in inefficient users to write SQL statements.

Method used

By receiving the input text, its target semantic features are determined, and the similarity of multiple reference semantic features is matched, thereby determining a set of database query statements corresponding to the input text from multiple database query statements.

Benefits of technology

It improves the retrieval efficiency of database query statements, simplifies the process of users writing SQL statements, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201986B_ABST
    Figure CN119201986B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to methods, devices, equipment, media and program products for retrieving information, and relate to the fields of data processing technology, text generation technology, large model technology and large language model technology. The method includes determining a target semantic feature of the input text in response to receiving an input text. The method also includes determining multiple similarities between the target semantic feature and multiple reference semantic features, wherein one of the multiple reference semantic features corresponds to one of the multiple database query statements. The method also includes determining a group of database query statements corresponding to the input text from the multiple database query statements based on the multiple similarities. Through this method, the database query statement corresponding to the input text can be obtained based on the matching of the semantic features of the input text and the semantic features corresponding to the database query statement, thereby improving the retrieval efficiency of the database query statement and improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure generally relate to the field of information retrieval, and more particularly to methods, devices, equipment, media, and program products for retrieving information. Background Art

[0002] At present, in terms of data processing, there are many operations on data, such as data query, data cleaning, data screening, data calculation, etc. Usually, for a small amount of data, data processing can be performed by manual processing. For example, data processing on the sales and sales of a small number of commodities can be quickly processed by using a table dedicated to processing such data, and the processing method of these data can be changed according to actual needs, such as reverse sorting, taking the average, taking the median, etc.

[0003] With the rapid development of data processing, processing a small amount of data can no longer meet the needs of daily life and work. With the exponential growth of data volume, challenges have emerged in processing large amounts of data. Usually, it is necessary to extract the required target data from massive amounts of data, but the efficiency of using traditional manual methods is extremely low, so databases specifically designed for processing massive amounts of data have gradually been developed to handle the corresponding needs. At present, various types of database languages ​​have emerged, and their syntax has certain differences, which has raised the threshold for people in daily use to a certain extent. Summary of the invention

[0004] Embodiments of the present disclosure provide a method, apparatus, device, medium, and program product for retrieving information.

[0005] According to a first aspect of the present disclosure, a method for retrieving information is provided. The method includes, in response to receiving input text, determining a target semantic feature of the input text. The method also includes determining multiple similarities between the target semantic feature and multiple reference semantic features, wherein one of the multiple reference semantic features corresponds to one of the multiple database query statements. The method also includes determining, based on the multiple similarities, a set of database query statements corresponding to the input text from the multiple database query statements.

[0006] In a second aspect of the present disclosure, a device for retrieving information is provided. The device includes a target semantic feature determination module configured to determine a target semantic feature of the input text in response to receiving an input text; multiple similarity determination modules configured to determine multiple similarities between the target semantic feature and multiple reference semantic features, one of the multiple reference semantic features corresponding to one of the multiple database query statements; and a group of database query statement determination module configured to determine a group of database query statements corresponding to the input text from the multiple database query statements based on the multiple similarities.

[0007] In a third aspect of the present disclosure, an electronic device is provided, comprising at least one processor; and a storage device for storing at least one program, wherein when the at least one program is executed by the at least one processor, the at least one processor implements the method according to the first aspect of the present disclosure.

[0008] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method according to the first aspect of the present disclosure is implemented.

[0009] In a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, which implements the method according to the first aspect of the present disclosure when executed by a processor.

[0010] It should be understood that the contents described in this content section are not intended to limit the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, wherein like reference numerals generally represent like components throughout the exemplary embodiments of the present disclosure.

[0012] Figure 1 A schematic diagram illustrating an example environment in which the apparatus and / or methods of some embodiments of the present disclosure may be implemented;

[0013] Figure 2 A schematic diagram illustrating an example method for retrieving information according to some embodiments of the present disclosure;

[0014] Figure 3 A schematic diagram illustrating a flow chart for retrieving information according to some embodiments of the present disclosure;

[0015] Figure 4A schematic diagram illustrating another example method for retrieving information according to some embodiments of the present disclosure is illustrated;

[0016] Figure 5 A schematic diagram illustrating another flow chart for retrieving information according to some embodiments of the present disclosure;

[0017] Figure 6 A schematic diagram illustrating an example of retrieving information according to some embodiments of the present disclosure is illustrated;

[0018] Figure 7 A schematic block diagram of an apparatus for retrieving information according to some embodiments of the present disclosure is illustrated;

[0019] Figure 8 A schematic block diagram of an example device suitable for implementing various embodiments of the present disclosure is illustrated.

[0020] In the various drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION

[0021] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0022] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0023] For example, when receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0024] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0025] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0026] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0027] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0028] In the process of retrieving information, there are still many problems that need to be solved. For example, in the data query scenario, users usually need to write database statements, such as Structured Query Language (SQL) statements, to query specified data in massive data. In actual data business, there are usually many data tables, and the names of various data tables are often similar. In the actual work process, users may confuse data tables with similar names, or cannot determine which data table should be used for data query or other data operations. Furthermore, in the data tables related to the actual business, there are also many fields with similar meanings, making it difficult for users to determine which fields to use for data query.

[0029] In addition, when users use data query engines to process data query work, they may use many different types of data query engines, such as Hive, Clickhouse, etc. There are certain differences in the SQL syntax supported by these different data query engines. For users who are only familiar with a certain SQL syntax, it is difficult to write another SQL syntax. For example, when users want to query data, they usually need to learn how to use SQL to query data through existing SQL query examples. At this time, users need to learn according to SQL templates and business standard operating procedures (Standard Operating Procedure, SOP). However, this method requires continuous manual input, and as the business becomes more and more complex and the data tables continue to grow, it will take longer and longer to query SOP documents, greatly reducing user work efficiency and user experience.

[0030] At least to solve the above and other potential problems, an embodiment of the present disclosure proposes a method for retrieving information. In this method, after receiving the input text at a computing device, the target semantic feature of the input text can be determined. Then, the computing device also determines multiple similarities between the target semantic feature and multiple reference semantic features. Among them, one reference semantic feature among the multiple reference semantic features corresponds to one database query statement in multiple database query statements. After determining the multiple similarities, the computing device can determine a group of database query statements corresponding to the input text from the multiple database query statements. Through this method, the database query statement corresponding to the input text can be obtained based on the matching of the semantic features of the input text and the semantic features corresponding to the database query statement, thereby improving the retrieval efficiency of the database query statement and improving the user experience.

[0031] The embodiments of the present disclosure will be described in detail below in conjunction with the accompanying drawings. Figure 1 An example environment in which the device and / or method of an embodiment of the present disclosure can be implemented is shown. In environment 100, a computing device 102 can receive an input text 104, and then further determine a target semantic feature 106 of the input text 104. After determining the target semantic feature 106, the computing device 102 will also determine multiple similarities 112 between the target semantic feature 106 and multiple reference semantic features 108. Each of the multiple reference semantic features 108 corresponds to a database query statement in multiple database query statements 110. After determining the multiple similarities 112, the computing device 102 can use the multiple similarities 112 to determine a group of database query statements 114 corresponding to the input text 104 from the multiple database query statements 110 for use by the user.

[0032] Examples of computing device 102 include, but are not limited to, a personal computer, a server computer, a handheld or laptop device, a mobile device (such as a mobile phone, a personal digital assistant (PDA), a media player, etc.), a multiprocessor system, consumer electronics, a minicomputer, a mainframe computer, a distributed computing environment including any of the above systems or devices, and the like.

[0033] like Figure 1As shown, first, after receiving the input text 104, the computing device 102 determines the target semantic feature 106 of the input text 104. The input text 104 can be received directly from the user or received from other computing devices via the network. In some embodiments, the input text 104 can be a query text for querying data information, for example, how many devices are active in the past 7 days, or how much income is in the past five days. The above examples are only used to describe the present disclosure, rather than to specifically limit the present disclosure. The input text 104 can be any suitable text related to the data in the database.

[0034] After receiving the input text 104, the computing device 102 may further determine the target semantic feature 106 of the input text 104. For example, the computing device 102 may perform a vectorization operation on the input text 104 to convert the input text 104 into a quantitative representation, so as to further determine the target semantic feature 106 based on the determined quantitative representation. The semantic feature 106 includes semantic information for the entire input text.

[0035] After determining the target semantic feature 106 , the computing device 102 may further determine a plurality of similarities 112 between the target semantic feature 106 and a plurality of reference semantic features 108 , wherein each of the plurality of reference semantic features 108 corresponds to a database query statement in the plurality of database query statements 110 .

[0036] In some embodiments, a mapping relationship exists between multiple reference semantic features 108 and multiple database query statements 110, and each of the multiple reference semantic features corresponds one-to-one to a specified database query statement in the multiple database query statements 110. For example, multiple reference semantic features 108 and multiple database query statements 110 having a mapping relationship can be stored in a vector database. In one example, there is a data table in the vector database, and a row of each data table includes at least one reference semantic feature and one database query statement. The above examples are only used to describe the present disclosure, and are not specific limitations of the present disclosure. The mapping relationship between multiple reference semantic features 108 and multiple database query statements 110 can be stored in any suitable data file or storage device.

[0037] Finally, after determining the plurality of similarities 112, the computing device 102 uses the determined plurality of similarities 112 to determine a set of database query statements 114 corresponding to the input text 104 from the plurality of database query statements 110. The set of database query statements 114 is then provided or displayed to the user.

[0038] In some embodiments, a set of database query statements 114 displayed to the user may include a predetermined number of database query statements and be arranged and displayed in a predetermined manner. For example, a set of database query statements 114 includes 3 database query statements and are arranged in descending order or ascending order according to their similarity to the input text.

[0039] Through this method, a database query statement corresponding to the input text can be obtained according to the matching of the semantic features of the input text and the semantic features corresponding to the database query statement, thereby improving the retrieval efficiency of the database query statement and improving the user experience.

[0040] Combined with the above Figure 1 A schematic diagram of an example environment in which the devices and / or methods of some embodiments of the present disclosure may be implemented is described below. Figure 2 A schematic diagram depicting an example method for retrieving information according to some embodiments of the present disclosure. Figure 2 The method in can be Figure 1 Executed by computing device 102 or any suitable computing device.

[0041] like Figure 2 As shown, in the exemplary method 200, at block 202, the computing device 102 determines a target semantic feature of the input text in response to receiving the input text. In order to accurately retrieve the corresponding database query statement, the semantic information of the input text needs to be used.

[0042] In some embodiments, after the computing device 102 receives the input text 104, it will perform a vectorization operation on the input text 104 to determine the target semantic features 106. For example, the computing device 102 will determine a quantitative representation for each word in the input text 104, which can also be referred to as a first quantitative representation. The computing device 102 can also determine a quantitative representation for the position of the word in the input text 104, which can also be referred to as a second quantitative representation. Then, the computing device 102 determines the semantic features of the input text 104 according to the first quantization table and the second quantitative representation. In one example, the computing device 102 connects the quantitative representation of each determined word to form a first combined quantitative representation, and connects the quantitative representation of the position of each word to form a second combined quantitative representation, and then combines the two combined quantitative representations, such as adding them. Then, the combined quantitative representation is input into the machine learning model to obtain the target semantic features 106 for the input text 104. In one example, the machine learning model is a transformer model. In another example, the machine learning model is a convolutional neural network model. The above examples are only used to describe the present disclosure, and are not specific limitations of the present disclosure. In another example, the computing device 102 may obtain a mapping relationship between the quantitative representation and the semantic feature. Then, based on the mapping relationship, the computing device 102 obtains the target semantic feature 106 corresponding to the input text 104 .

[0043] In some instances, the computing device 102 directly applies the input text 104 to the machine learning model to determine the target semantic feature 106. Additionally, the machine learning model is a large language model (LLM). It will be understood that the machine learning model may also be any other type of machine learning model that can implement the technical solution of the present disclosure, and the present disclosure is not limited thereto.

[0044] Then, at block 204 , the computing device 102 determines a plurality of similarities between the target semantic feature and a plurality of reference semantic features, one of the plurality of reference semantic features corresponding to one of the plurality of database query statements.

[0045] After the computing device 102 determines the target semantic feature 106, it also obtains multiple reference semantic features 108 and multiple database query statements 110 corresponding to the multiple reference semantic features 108. Each reference semantic feature corresponds to a database query statement in the multiple database query statements 110. Then, the computing device 102 further determines multiple similarities between the target semantic feature 106 and the multiple reference semantic features 108.

[0046] In some embodiments, when determining the similarity between the target semantic feature 106 and the multiple reference semantic features 108, the computing device 102 may determine the distance between the target semantic feature and each of the multiple reference semantic features. For example, the target semantic feature is represented as a vector, and each of the multiple reference semantic features may also be represented as a vector. Then, the computing device determines the similarity between the target semantic feature and the reference semantic feature based on the distance. For example, the similarity between the semantic features is calculated using the distance according to a predetermined function, such as the similarity is the inverse of the distance.

[0047] When calculating similarity, there are usually many other ways to calculate the similarity between semantic features, for example, cosine similarity can be used to calculate the multiple similarities 112 between the target semantic feature 106 and the multiple reference semantic features 108. It is understandable that other ways of calculating the similarity of features represented by text quantification can also be used to calculate the multiple similarities 112.

[0048] In some embodiments, a mapping relationship exists between the plurality of reference semantic features 108 and the plurality of database query statements 110, and each of the plurality of reference semantic features corresponds one-to-one to a specified database query statement in the plurality of database query statements 110. Finally, at block 206, the computing device 102 determines a set of database query statements corresponding to the input text from the plurality of database query statements based on the plurality of similarities. After determining the plurality of similarities 112, the computing device 102 can use the plurality of similarities 112 to determine a set of database query statements 114 corresponding to the input text 104 from the plurality of database query statements 110.

[0049] In some embodiments, the computing device 102 may select a first group of similarities greater than a first threshold similarity from a plurality of similarities. In one example, the first threshold similarity may be predetermined, and all similarities greater than the first threshold similarity may be selected. In another example, a plurality of similarities may be sorted, such as in descending order. If a predetermined number of similarities is selected, the similarity ranked at the predetermined number + 1 position may be used as the threshold similarity. For example, if the top N higher similarities are to be selected, the similarity ranked at the N+1 position may be used as the threshold similarity. The above examples are only used to describe the present disclosure, and are not specific limitations of the present disclosure. Next, the computing device 102 may determine a group of reference semantic features corresponding to the first group of similarities from a plurality of reference semantic features. Since the similarity is calculated based on the reference semantic features and the target semantic features, each similarity corresponds to a reference semantic feature. Then, the computing device 102 further determines a group of database query statements corresponding to a group of reference semantic features from a plurality of database query statements 110. Since each reference semantic feature corresponds to a database query statement, a group of database query statements 114 may be obtained based on the obtained group of reference semantic features.

[0050] In some embodiments, in addition to calculating the similarities between the target semantic feature 106 and the multiple reference semantic features 102, the computing device 102 further combines the similarities between the texts to determine a set of database query statements 114. Figure 4 and Figure 5 Give a description.

[0051] In some embodiments, the association relationship between multiple reference semantic features and multiple database query statements 110 is predetermined and stored. In this process, multiple database query statements 110 can be obtained first. Then, the data table corresponding to each target database query statement in the multiple database query statements 110 is further determined, and then the data table information of the data table is determined. Among them, the data table information includes at least one of the following: the name, description, field name, field type, and field description of the data table. In addition, the above data table information can also be obtained according to the data definition language DDL (Data Definition Language, DDL) corresponding to the data table. Then, the obtained data table information can be combined with the corresponding database query statement to determine multiple reference texts corresponding to the multiple database query statements. Each reference text in the multiple reference texts is used to describe the operation of the target database query statement, and the reference text is a natural language text for describing the database operation. For example, the reference text can be obtained by processing the data table information and the corresponding database query statement through a machine learning model, such as through a SQL2NL model.

[0052] After the target reference text is obtained, the target reference semantic features for the target reference text are further determined, and the process is similar to the process of obtaining the target semantic features according to the input text described above. Then, the target database query statement and the target semantic features are stored in association.

[0053] Through this method, a database query statement corresponding to the input text can be obtained according to the matching of the semantic features of the input text and the semantic features corresponding to the database query statement, thereby improving the retrieval efficiency of the database query statement and improving the user experience.

[0054] Combined with the above Figure 2 A schematic diagram of an example method for retrieving information according to some disclosed embodiments is described. Figure 3 A schematic diagram depicting a flow chart for retrieving information according to some embodiments of the present disclosure. Figure 3 An example of Figure 1 The system may be executed by the computing device 102 shown in FIG. 1 or any suitable device.

[0055] like Figure 3 In the example 300 shown, it can be seen that the two dashed boxes on the left are data preparation work in an offline state, while the dashed box on the right is the actual process of the user retrieving information in an online state. The process of the retrieval process is described in detail below.

[0056] First, the process of user online search is described. When the user search begins at box 318, the user search is input into the search engine as input text. At this time, the computing device 102 uses semantic features to search.

[0057] After the computing device 102 receives the user query, it will perform a text vectorization operation on the user query at box 320 to convert the user query into a vector 322 corresponding to the user query so as to further determine the target semantic feature according to the determined quantitative representation. For example, the large language model technology is used to perform a comprehensive and detailed vectorization conversion on the text content input by the user, so as to accurately obtain the user input vector.

[0058] In some embodiments, during the text vectorization (LLM) process, the user search includes a total of 7 characters, each of which is written as a vector in the form of [a1], [a2], [a3], [a4], [a5], [a6], [a7] using quantization, and the position corresponding to each character is written as a vector in the form of [b1], [b2], [b3], [b4], [b5], [b6], [b7]. The vectors of each character are then combined to form a vector, and the vectors of the positions are also combined to form a vector, and then the two vectors are added to obtain a quantization representation of the input text. Then, the quantization representation is input into a machine learning model, such as a large language model, to obtain a vector 322 corresponding to the user search.

[0059] Subsequently, the vector 322 corresponding to the user search is used to perform a matching operation through semantic matching 324. For example, the vector corresponding to the previously determined user search is matched with multiple reference semantic features in the vector database 316. By calculating the first multiple similarities between the target semantic feature and the multiple reference semantic features, a group of reference semantic features whose similarity is greater than a predetermined threshold is determined, and then a group of database query statements corresponding to the group of reference semantic features are determined, such as SQL example 326. In one example, LLM technology is used to perform a comprehensive and detailed vectorization conversion on the text content input by the user, so as to accurately obtain the user input vector. After that, a powerful search function is used to perform in-depth semantic search on the huge vector database. In order to ensure the accuracy and effectiveness of the search results, a reasonable and strict semantic similarity threshold is set. According to the calculated semantic similarity, the top N results with the highest similarity are screened and retained.

[0060] Next, the process of preparing data in an offline state is described. First, the computing device 102 obtains the historical query SQL 302. At box 304, data table information is obtained according to the historical query SQL, where the data table information includes at least one of the following: the name, description, field name, field type, and field description of the data table. Additionally, the above data table information can also be obtained according to the data definition language DDL (Data Definition Language, DDL) corresponding to the data table.

[0061] Then, at box 306, SQL2NL (Structured Query Language to Natural Language, SQL2NL) operation is performed. In this step, the historical query SQL is converted into natural language using a machine learning model. Specifically, the machine learning model converts the original specific database query language SQL into understandable natural language by understanding the names, descriptions, field names, field types, field descriptions, etc. in the historical query SQL and data table information.

[0062] For example, when using LLM SQL2NL, by using In-Context Learning, we add corresponding big model system prompts to guide the big model to use the Chain-of-Thought method to gradually break down the problem, such as: fully understand the provided data table information; based on the data table information, deeply understand the input SQL statement; express the input SQL statement in natural language. Because the big model has a strong ability to understand the subject and rich world knowledge, it can achieve extremely accurate natural language interpretation of SQL.

[0063] For example, one of the historical query SQLs is "select count('item_id') fromtable", then after SQL2NL, it is converted into Chinese "What is the total order quantity?" In this way, SQL is converted into easy-to-understand natural language, which improves the efficiency of subsequent index construction and the accuracy of online retrieval matching results.

[0064] Additionally, the machine learning model used in this application is a large language model based on the Transformer self-attention mechanism. Other types of machine learning models with the same function can also be used, and this application does not limit this.

[0065] Further, the natural language & historical query SQL 308 corresponding to the converted SQL is used to construct index information. The constructed index information is semantic index information. When the semantic index is constructed 314, at box 312, the natural language text corresponding to the historical query SQL 302 is also vectorized (LLM), for example, using a bag of words model, TF-IDF algorithm, One-Hot encoding, etc. to vectorize, thereby determining a vector 310 corresponding to the natural language text. Then further processing is performed to obtain multiple reference semantic features corresponding to the natural language text.

[0066] After a plurality of reference semantic features corresponding to a plurality of reference texts are determined, the historical query SQL 302 is associated with the plurality of reference semantic features and stored in the vector database 316 for subsequent use by users in online retrieval.

[0067] Combined with the above Figure 3 A schematic diagram of a flow chart for retrieving information according to some disclosed embodiments is described. Figure 4 A schematic diagram depicting another example method for retrieving information according to some embodiments of the present disclosure. Figure 4 The method in can be Figure 1 Executed by computing device 102 or any suitable computing device.

[0068] Above Figure 2 The process of determining a set of database query statements 114 based on multiple similarities is mainly described in the above. The process of further combining text-related similarities to determine a set of database query statements 114 is described below. For example, the similarity between the input text 104 and multiple reference texts is calculated. The multiple reference texts have been subjected to index building processing. For ease of understanding, the multiple similarities 112 between the target semantic feature 106 and the multiple reference semantic features 108 are the first multiple similarities, and the similarity between the input text 104 and the multiple reference texts is the second multiple similarities.

[0069] In example 400, computing device 102 may determine a set of keywords in input text at block 402. In addition to performing semantic matching, computing device 102 may also perform keyword matching.

[0070] In one example, the computing device 102 uses a machine learning model to extract a set of keywords from an input text. For example, a large language model is used to extract keywords from an input text. At this time, nouns or adjectives in the input text can be selected as keywords to reflect the core content and theme of the text. In another example, the computing device 102 can use any suitable keyword determination method to identify keywords in the input text, such as a word frequency statistics method, a part-of-speech tagging method, etc. The above examples are only used to describe this disclosure, and are not specific limitations of the disclosure.

[0071] At box 404, the computing device 102 determines the second multiple similarities between the input text and multiple reference texts based on a group of keywords, and one of the multiple reference texts corresponds to a database query statement in the multiple database query statements. In this process, for a reference text, the computing device 102 can calculate the similarity and relevance between the key words and the reference text. Then, the similarity between the input text and the reference text is determined based on the similarity and relevance for the keyword. For example, the similarities of all keywords are added and averaged, and then the relevance is weighted averaged. Next, the two average values ​​are weighted summed to determine the similarity between the input text and the reference text. The above examples are only used to describe the present disclosure, but not specifically limited to the present disclosure.

[0072] At block 406 , the computing device 102 determines a set of database query statements corresponding to the input text from the plurality of database query statements based on the first plurality of similarities and the second plurality of similarities.

[0073] For the convenience of description, the group of database query statements described above can be referred to as the first group of database query statements. In some embodiments, the computing device 102 can select a second group of similarities greater than the second threshold similarity from the first plurality of similarities. For example, the first N larger similarities are selected to form the second group of similarities. Then, the computing device 102 can determine the reference semantic features corresponding to the second group of similarities, thereby determining the second group of database query statements corresponding to the second group of similarities in a plurality of database query statements according to the corresponding relationship between the reference semantic features and the database query statements. The computing device 102 also selects a third group of similarities greater than the third threshold similarity from the second plurality of similarities. For example, the first N larger similarities are also selected to form the second group of similarities. Then, the device 102 determines the reference text corresponding to the second group of similarities. Thus, according to the corresponding relationship between the reference text and the database query statements, the third group of database query statements corresponding to the third group of similarities in a plurality of database query statements are determined. Thus, the computing device 102 may use the second group of similarities and the third group of similarities to determine a first group of database query statements corresponding to the input text from the second group of database query statements and the third group of database query statements.

[0074] At this time, for each database query statement in the query statement set formed by the second group of database query statements and the third group of database query statements, the similarity corresponding to the semantic feature and the similarity corresponding to the text can be determined. Then, the combined similarity is determined by weighting the two similarities. Then, the first group of database query statements is selected based on the multiple combined similarities. For example, the multiple combined similarities are sorted, and the database query statements corresponding to the larger N combined similarities are selected as the first group of database query statements.

[0075] In some embodiments, the computing device can determine multiple combined similarities between multiple database query statements and input text according to the first multiple similarities and the second multiple similarities. At this time, a corresponding semantic similarity and a corresponding text similarity are calculated for each data query statement. For example, the computing device 102 determines a first similarity corresponding to a target database query statement in multiple database query statements in the first multiple similarities. The computing device 102 further determines a second similarity corresponding to the target query statement in the second multiple similarities. Then, according to the first similarity and the second similarity, the combined similarity between the input text and the target database query statement is determined. For example, the combined similarity is determined by performing a weighted operation on the first similarity and the second similarity. Then, the computing device 102 selects a group of combined similarities greater than a predetermined fourth threshold similarity from the multiple combined similarities. A group of database query statements corresponding to a group of combined similarities are selected from the multiple database query statements.

[0076] In addition, the computing device 102 may also perform text index processing on each reference text among the multiple reference texts, and may also store the target database query statement and the text index corresponding to the target reference text in association.

[0077] Figure 5 A schematic diagram of another flow chart for retrieving information according to some embodiments of the present disclosure is illustrated. In example 500, the relevant contents of reference numerals 502, 504, 506, 508, 510, 512, 514, 516, 518, 520, 522, 524 are the same as Figure 3 302, 304, 306, 308, 310, 312, 314, 316, 318, 320, 322, 324 correspond to each other, so you can refer to Figure 3 , and the following mainly describes the differences between Example 500 and Example 300.

[0078] In example 500 , it can be seen that the two dashed boxes on the left represent data preparation work in an offline state, while the dashed box on the right represents the actual process of a user retrieving information in an online state.

[0079] First, the user searches online. In addition to semantic matching, the computing device 102 also searches by using the keywords of the user search as the input text. After the computing device 102 receives the user search 518, it will perform keyword extraction (using LLM) on the user search at box 526, and then determine the keywords of the user search at box 528, and then perform text matching at box 530. For example, use LLM to extract keywords. The user search input by the user is a string of natural language. Before text matching, it is necessary to extract the keywords in the user search, remove invalid information, and improve the text matching effect. With the help of LLM in the form of a thinking chain, guide LLM to complete the entity recognition process step by step according to the steps, and finally output it in a structured form. For example, the prompts given are to understand the user's input problem; ignore the redundant information in the input problem; extract the keywords, among which nouns and adjectives are particularly important; and output in a structured manner.

[0080] The text matching process is to match the keywords retrieved by the user with the natural language texts of multiple natural language texts in the text database 538, and calculate the second plurality of similarities between the input text 104 and the multiple natural language texts by using keyword matching.

[0081] For example, if the input text 104 is “How many devices were active in the past 7 days?”, the extracted keywords are “past 7 days”, “status”, “active” and “number of devices”. These keywords are then matched 530 with reference keywords in a plurality of reference texts in the text database 538.

[0082] Additionally, text matching is implemented using the ElasticSearch engine. ElasticSearch is used to perform text matching on the keywords extracted by LLM. First, LLM is used to extract representative and important keywords from a given text. These keywords can accurately reflect the core content and theme of the text. Then, these extracted keywords are used to perform text matching operations on the ElasticSearch database. In this process, ElasticSearch will calculate the similarity between texts based on the similarity and relevance between the keywords and the texts in the database. Then, the top N similarities can be taken, and the matching scores returned by ElasticSearch can be retained for subsequent fusion. According to the matching scores, the top N matching results are selected. These matching results are considered to be the most relevant and most matching texts to the keywords. At the same time, the specific matching scores of each matching result returned by ElasticSearch are retained. It is understandable that users can also use other engines that can achieve text matching effects, and this application is not limited here.

[0083] After the semantic matching 524 and the text matching 530 are completed, at block 532, the scores can be fused and the top N scores can be selected. This step mainly performs a weighted operation on the first plurality of similarities and the second plurality of similarities. For example, if the similarity is represented by a score value, each similarity score value in the first plurality of similarities can be represented as Score v , which is the normalized semantic similarity, and the score of each similarity in the second plurality of similarities can be expressed as Score t , which is the normalized text similarity. Then the score value of each similarity in the combined similarity after the weighted operation can be expressed as Score = α ∗ Score v + β ∗ Score t ,in α and β The value of can be defined by the user and is not limited in this application.

[0084] Finally, the score of each similarity in the calculated combined similarity is Score The similarities exceeding the predetermined threshold are taken, and a group of database query statements corresponding to the similarities exceeding the predetermined threshold are displayed to the user as SQL examples 534. Additionally, the scores in the calculated combined similarities can be sorted in descending order, and a group of database query statements corresponding to a predetermined number of combined similarities in the front row are displayed to the user as SQL examples 534, and the predetermined number can be defined by the user, for example, the predetermined number is 5.

[0085] In some embodiments, the data information corresponding to the example SQL may also be displayed to the user at the same time as the example SQL is displayed to the user, so that the user can determine whether the example SQL meets the retrieval expectations.

[0086] For the offline data preparation process, the natural language & historical query SQL corresponding to the converted SQL is used to build index information. The built index information is divided into two parts, one of which is semantic index information and the other is text index information.

[0087] The text index construction is described below. When the text index construction is performed in box 536, a search engine, such as ElasticSearch, is used to store the natural language text generated from the historical query SQL 502, and then the natural language text is indexed to improve the accuracy and efficiency of the search. The historical query SQL statement is then associated with multiple natural language texts and corresponding index information and stored in a text database for subsequent online user retrieval. The above natural language text can also be called reference text.

[0088] It is understandable that the vector database 516 and the text database 538 are not limited to the form of databases, and they can be any device with storage capabilities, such as a cloud server, a local hard disk, etc. This application does not make any limitation here.

[0089] Combine the following Figure 6 A schematic diagram illustrating an example of retrieving information according to some embodiments of the present disclosure is provided. Figure 6 In the example 600 shown, an example of an actual search process is taken as an example. When the user starts to search, firstly, "What is the total order quantity?" is input into the search module 604 as input text 602. Then, after the search module 604 performs the search, the example SQL is output.

[0090] For example, after the retrieval, three sample SQL statements are output, which are “SELECT COUNT(*) AStotal_orders FROM orders” 606 , “SELECT COUNT(*) AS total_orders FROM orders” 608 , and “select count('item_id') from table” 610 .

[0091] The above three example SQLs are displayed according to the relevance to the input text 602, for example, they are sorted from high to low according to the numerical value of the relevance to the input text 602. In addition, the number of displayed example SQLs is also a preset number, for example, three example SQLs are displayed in example 600.

[0092] For another example, the three example SQL statements are displayed to the user because they have reached a predetermined threshold of relevance. For example, the three example SQL statements have reached a relevance of 0.8 and are then displayed to the user as output results of the search.

[0093] Additionally, a predetermined threshold may be set and the results may be sorted from high to low according to the relevance values, and the sample SQLs that meet the requirements may be displayed to the user as the output results of the search.

[0094] like Figure 7 As shown, the device 700 includes a target semantic feature determination module 702, which is configured to determine the target semantic feature of the input text in response to receiving the input text; multiple similarity determination modules 704, which are configured to determine multiple similarities between the target semantic feature and multiple reference semantic features, one of the multiple reference semantic features corresponds to a database query statement in multiple database query statements; and a group of database query statement determination module 706, which is configured to determine a group of database query statements corresponding to the input text from the multiple database query statements based on the multiple similarities.

[0095] In some embodiments, the target semantic feature determination module 702 includes: a first quantitative representation and a second quantitative representation determination module, configured to determine a first quantitative representation for a word in an input text and a second quantitative representation for the position of the word in the input text; and a target semantic feature determination module, configured to determine the target semantic feature of the input text based on the first quantitative representation and the second quantitative representation.

[0096] In some embodiments, the target semantic feature determination module 702 includes: a machine learning module application module configured to determine the target semantic feature by applying the input text to a machine learning model.

[0097] In some embodiments, multiple similarity determination modules 704 include: a distance determination module between a target semantic feature and each reference semantic feature, configured to determine the distance between the target semantic feature and each reference semantic feature in multiple reference semantic features; and a similarity determination module, configured to determine the similarity between the target semantic feature and the reference semantic feature based on the distance.

[0098] In some embodiments, a group of database query statement determination modules 706 include: a group of similarity selection modules, configured to select a first group of similarities greater than a first threshold similarity from multiple similarities; a group of reference semantic feature determination modules, configured to determine a group of reference semantic features from multiple reference semantic features corresponding to the first group of similarities; and a group of database query statement selection modules, configured to determine a group of database query statements corresponding to a group of reference semantic features from multiple database query statements.

[0099] In some embodiments, a group of database query statements is a first group of database query statements, and a group of database query statement determination modules includes: a second group similarity determination module, configured to select a second group of similarities greater than a second threshold similarity from the first plurality of similarities; a second group of database query statement determination module, configured to determine a second group of database query statements corresponding to the second group of similarities among the plurality of database query statements; a third group similarity determination module, configured to select a third group of similarities greater than a third threshold similarity from the second plurality of similarities; a third group of database query statement determination module, configured to determine a third group of database query statements corresponding to the third group of similarities among the plurality of database query statements; and a query statement determination module, configured to determine the first group of database query statements corresponding to the input text from the second group of database query statements and the third group of database query statements based on the second group of similarities and the third group of similarities.

[0100] In some embodiments, a group of database query statement determination modules include: multiple combination similarity determination modules, configured to determine multiple combination similarities between multiple database query statements and input text based on first multiple similarities and second multiple similarities; a group of combination similarity selection modules, configured to select a group of combination similarities greater than a fourth threshold similarity from the multiple combination similarities; and a group of database query statement selection modules, configured to select a group of database query statements corresponding to the group of combination similarities from the multiple database query statements.

[0101] In some embodiments, multiple combined similarity determination modules include: a first similarity determination module, configured to determine a first similarity among the first multiple similarities corresponding to a target database query statement among multiple database query statements; a second similarity determination module, configured to determine a second similarity among the second multiple similarities corresponding to the target query statement; and a combined similarity determination module, configured to determine the combined similarity between the input text and the target database query statement based on the first similarity and the second similarity.

[0102] In some embodiments, the combined similarity determination module includes: a weighting module configured to determine the combined similarity by performing a weighting operation on the first similarity and the second similarity.

[0103] In some embodiments, the device 700 also includes: a data table information acquisition module, configured to acquire data table information of a data table corresponding to a target database query statement among multiple database query statements; and a target reference text determination module, configured to determine a target reference text among multiple reference texts for describing the target database query statement based on the data table information and the target database query statement.

[0104] In some embodiments, the device 700 also includes: a target reference semantic feature determination module, configured to determine the target reference semantic feature for the target reference text; and a target database query statement and target reference semantic feature storage module, configured to store the target database query statement and the target reference semantic feature in association.

[0105] In some embodiments, the apparatus 700 further includes: a text index determination module configured to determine a text index for a target reference text based on the target reference text; and a target database query statement and text index storage module configured to store the target database query statement and the text index in association.

[0106] In some embodiments, the data table information includes at least one of the following: a name, a description, a field name, a field type, and a field description for the data table.

[0107] Figure 8 A schematic block diagram of an example device 800 that may be used to implement embodiments of the present disclosure is shown. Figure 1 The computing device 102 in the embodiment can be implemented by using the device 800. As shown in the figure, the device 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 802 or computer program instructions loaded from a storage unit 808 to a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device can also be stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0108] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0109] The various processes and processing described above, such as method 200 and example 400, may be performed by the processing unit 801. For example, in some embodiments, method 200 and example 400 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by CPU 801, one or more actions of the example method 200 and example 400 described above may be performed.

[0110] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.

[0111] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive lists) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer-readable storage medium used herein is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (e.g., a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.

[0112] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0113] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of the computer-readable program instructions to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit may execute the computer-readable program instructions, thereby implementing various aspects of the present disclosure.

[0114] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0115] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0116] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0117] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and the part of the module, program segment or instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0118] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A method for retrieving information, comprising: In response to receiving input text, determining a target semantic feature of the input text; determining a first plurality of similarities between the target semantic feature and a plurality of reference semantic features, wherein a reference semantic feature of the plurality of reference semantic features corresponds to a database query statement of a plurality of database query statements and is generated from a reference text converted from the database query statement, the reference semantic feature and the database query statement being stored in association; determining a set of keywords in the input text; determining, based on the set of keywords, a second plurality of similarities between the input text and a plurality of reference texts, a reference text in the plurality of reference texts corresponding to a database query statement in the plurality of database query statements, each reference text in the plurality of reference texts being a natural language text for describing a database operation; as well as Based on the first plurality of similarities and the second plurality of similarities, a group of database query statements corresponding to the input text is determined from the plurality of database query statements.

2. The method according to claim 1, wherein determining the target semantic feature of the input text comprises: Determining a first quantized representation for a character in the input text and a second quantized representation for a position of the character in the input text; as well as Based on the first quantized representation and the second quantized representation, a target semantic feature of the input text is determined.

3. The method according to claim 1, wherein determining the target semantic feature of the input text comprises: The target semantic feature is determined by applying the input text to a machine learning model.

4. The method according to claim 1, wherein determining a first plurality of similarities between the target semantic feature and a plurality of reference semantic features comprises: determining a distance between the target semantic feature and each of the reference semantic features; as well as Based on the distance, a similarity between the target semantic feature and the reference semantic feature is determined.

5. The method according to claim 1, wherein the group of database query statements is a first group of database query statements, and based on the first plurality of similarities and the second plurality of similarities, determining a group of database query statements corresponding to the input text from the plurality of database query statements comprises: selecting a second set of similarities from the first plurality of similarities that are greater than a second threshold similarity; determining a second group of database query statements corresponding to the second group of similarities among the plurality of database query statements; selecting a third group of similarities from the second plurality of similarities that are greater than a third threshold similarity; Determine a third group of database query statements corresponding to the third group of similarities among the plurality of database query statements; as well as Based on the second group of similarities and the third group of similarities, the first group of database query statements corresponding to the input text are determined from the second group of database query statements and the third group of database query statements.

6. The method according to claim 1, wherein determining a group of database query statements corresponding to the input text from the plurality of database query statements based on the first plurality of similarities and the second plurality of similarities comprises: Determining a plurality of combined similarities between the plurality of database query statements and the input text based on the first plurality of similarities and the second plurality of similarities; Selecting a group of combined similarities greater than a fourth threshold similarity from the plurality of combined similarities; as well as A group of database query statements corresponding to the group of combined similarities is selected from the plurality of database query statements.

7. The method according to claim 6, wherein determining a plurality of combined similarities between the plurality of database query statements and the input text comprises: determining a first similarity among the first plurality of similarities corresponding to a target database query statement among the plurality of database query statements; Determining a second similarity among the second plurality of similarities corresponding to the target query statement; as well as Based on the first similarity and the second similarity, a combined similarity between the input text and the target database query statement is determined.

8. The method according to claim 7, wherein determining the combined similarity between the input text and the target database query statement comprises: The combined similarity is determined by performing a weighted operation on the first similarity and the second similarity.

9. The method according to claim 1, further comprising: Acquire data table information of a data table corresponding to a target database query statement among the multiple database query statements; as well as Based on the data table information and the target database query statement, a target reference text for describing the target database query statement is determined from among the multiple reference texts.

10. The method according to claim 9, further comprising: determining a target reference semantic feature for the target reference text; as well as The target database query statement and the target reference semantic feature are stored in association.

11. The method according to claim 10, further comprising: Based on the target reference text, determining a text index for the target reference text; as well as The target database query statement and the text index are stored in association.

12. The method according to claim 9, wherein the data table information includes at least one of the following: The name, description, field name, field type, and field description of the data table.

13. A device for retrieving information, comprising: a target semantic feature determination module, configured to determine a target semantic feature of the input text in response to receiving the input text; a plurality of similarity determination modules configured to determine a first plurality of similarities between the target semantic feature and a plurality of reference semantic features, wherein a reference semantic feature of the plurality of reference semantic features corresponds to a database query statement of a plurality of database query statements and is generated from a reference text converted from the database query statement, the reference semantic feature and the database query statement being stored in association; a set of keyword determination modules configured to determine a set of keywords in the input text; A second plurality of similarity determination modules is configured to determine, based on a set of keywords, a second plurality of similarities between the input text and a plurality of reference texts, one of the plurality of reference texts corresponding to one of the plurality of database query statements, each of the plurality of reference texts being a natural language text for describing a database operation; as well as A group of database query statements determining module is configured to determine a group of database query statements corresponding to the input text from the plurality of database query statements based on the first plurality of similarities and the second plurality of similarities.

14. An electronic device comprising: at least one processor; as well as A storage device, used for storing at least one program, when the at least one program is executed by the at least one processor, so that the at least one processor implements the method according to any one of claims 1-12.

15. A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1 to 12 when executed by a processor.

16. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • SQL (Structured Query Language) statement generation method and device based on large language model, equipment and medium

    CN117743371A