Data retrieval method and device, electronic equipment and computer program product
Through a two-stage query method, combining user queries with data table abstracts and field names, data tables and field sets are retrieved, which solves the problem of only retrieving data tables but not fields in the existing technology, and achieves a more comprehensive return of data retrieval results. , improving user experience and applicability.
Patent Information
- Application Number
- CN202410473874.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-19
- Publication Date
- 2024-09-10
AI Technical Summary
Existing data retrieval technology only performs retrieval of data tables without retrieval of corresponding fields, resulting in users being unable to complete complete data queries and unable to return retrieval results that meet user needs.
A two-stage query method is adopted. First, the data table collection is retrieved based on the user query and the data table summary and field names. Then the field collection is retrieved from each data table based on the user query and field names, and the retrieval results of the data tables and fields are returned.
Ensure that search results are more in line with user needs, provide a better data retrieval experience, support complex query requirements, and return corresponding field search results.
Smart Images

Figure CN118626529A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more particularly to a method, device, electronic device and computer program product for data retrieval. Background Art
[0002] In today's information age, the value of data is increasingly valued. The emergence of massive data has made how to efficiently and accurately retrieve the information required by users from it an important topic in technology research and development. The data table retrieval task came into being. It retrieves data tables related to user queries from databases including large-scale data table collections, helping users quickly and accurately obtain information in the database.
[0003] Through data table retrieval technology, users can quickly and accurately extract the information they need from massive data, providing important support for decision-making, data analysis, scientific research, etc. Data table retrieval not only improves the efficiency of information retrieval, but also provides users with more accurate and convenient data services, promoting the development of all walks of life. Therefore, table retrieval technology is of great significance in the current information age, and has a far-reaching impact on promoting data-driven decision-making and promoting scientific research. Summary of the invention
[0004] Embodiments of the present disclosure provide a data retrieval method, apparatus, electronic device, computer program product, and medium.
[0005] According to a first aspect of the present disclosure, a method for data retrieval is provided. The method includes determining the table query similarity between the user query and each data table in a database based on the user query, a data table summary, and a field name. The method also includes retrieving a target data table set from the database based on the table query similarity, the target data table set including data associated with the user query. The method also includes determining the field query similarity between the user query and each field of each data table in the target data table set based on the user query and the field name. The method also includes retrieving a target field set from each data table in the target data table set based on the field query similarity. In addition, the method also includes determining a retrieval result of the data retrieval based on the target data table set and the corresponding target field set.
[0006] According to a second aspect of the present disclosure, a device for data retrieval is provided. The device includes a table similarity determination module, which is configured to determine the table query similarity between the user query and each data table in the database based on the user query, the data table summary and the field name. The device also includes a target data table retrieval module, which retrieves a target data table set from the database based on the table query similarity, and the target data table set includes data associated with the user query. The device also includes a field similarity determination module, which is configured to determine the field query similarity between the user query and each field of each data table in the target data table set based on the user query and the field name. The device also includes a target field determination module, which is configured to retrieve a target field set from each data table in the target data table set based on the field query similarity. In addition, the device also includes a retrieval result determination module, which is configured to determine the retrieval result of the data retrieval based on the target data table set and the corresponding target field set.
[0007] According to a third aspect of the present disclosure, an electronic device is provided, comprising a processor and a memory coupled to the processor, wherein the memory has instructions stored therein, and when the instructions are executed by the processor, the electronic device executes the method according to the first aspect.
[0008] In a fourth aspect of the present disclosure, a computer readable storage medium is provided. The computer program product is tangibly stored on a non-transitory computer readable medium and includes computer executable instructions, which when executed cause a computer to perform the steps of the method of the first aspect of the present disclosure.
[0009] In a fifth aspect of the present disclosure, a computer-readable storage medium is provided, wherein one or more computer instructions are stored on the computer-readable storage medium, wherein the one or more computer instructions are executed by a processor to implement the method according to the first aspect.
[0010] The purpose of this Summary is to introduce a selection of concepts in a simplified form that are further described in the Detailed Description below. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0012] Figure 1A schematic diagram showing an example environment in which devices and / or methods according to embodiments of the present disclosure may be implemented;
[0013] Figure 2 A flow chart showing a method for data retrieval according to an embodiment of the present disclosure is shown;
[0014] Figure 3A A flowchart showing a process of data retrieval according to an embodiment of the present disclosure is shown;
[0015] Figure 3B A schematic diagram showing a process of recalling a data table set according to an embodiment of the present disclosure;
[0016] Figure 3C A schematic diagram showing a process of recalling a field set according to an embodiment of the present disclosure;
[0017] Figure 4 A schematic diagram showing a process of performing field recall using data heat according to an embodiment of the present disclosure is shown;
[0018] Figure 5 A flowchart showing a process of training a ranking model according to an embodiment of the present disclosure is shown;
[0019] Figure 6A-6D A schematic diagram showing a data table search and field search process according to an embodiment of the present disclosure is combined;
[0020] Figure 7 A block diagram showing an apparatus for data retrieval according to some embodiments of the present disclosure; and
[0021] Figure 8 A block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0022] Throughout the drawings, the same or similar reference numbers denote the same or similar elements. DETAILED DESCRIPTION
[0023] 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.
[0024] 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.
[0025] 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, unless explicitly stated. Other explicit and implicit definitions may also be included below.
[0026] As mentioned above, data retrieval tasks involving data table retrieval play an important role in the current information age. Current data retrieval technology usually only performs data table retrieval without corresponding field retrieval, and users cannot complete corresponding data queries when they only know the data table retrieval results without field retrieval results. To this end, the embodiment of the present disclosure proposes a data retrieval scheme, which adopts a two-stage query. First, according to the user query and the data table summary and the field name, a data table set is retrieved, and then according to the user query and the field name, a field set is retrieved from each data table, and then the data table set and the corresponding field set are returned to the user as the retrieval result. Therefore, according to the scheme of the embodiment of the present disclosure, when the user performs data retrieval, not only the data table retrieval result can be returned, but also the corresponding field retrieval result can be returned, ensuring that the retrieval result is more in line with the user's needs, providing users with a better data retrieval experience, and having a wide range of applicability and being able to support complex query requirements.
[0027] Figure 1 Schematic diagram of an example environment in which the device and / or method according to an embodiment of the present disclosure may be implemented. Figure 1As shown, the example environment 100 may include a computing device 110, which may be a user terminal, a mobile device, a computer, etc., or a computing system, a single server, a distributed server, or a cloud-based server. The computing device 110 may include a database 120, and the database 120 may include a data table 130-1, a data table 130-2, ..., and a data table 130-N (hereinafter referred to as data table 130 individually or collectively). It should be understood that the database 120 may include millions or even tens of millions of data tables, and the database 120 may be a collection of databases, not limited to a single database. In addition, the database 120 may include a data table summary 132-1, a field 134-1, and a corresponding field name 136-1 corresponding to the data table 130-1. For example, the data table summary 132-1 may be a description text of the data table 130-1, recording information related to the data table 130, including but not limited to, for example, table name, corresponding application, usage scenario, etc. In some embodiments, the data table summary may be generated through a pre-trained language model through a data table. Field 134-1 is all the fields included in data table 130-1. In addition, database 120 may also include data table summary 132-2, field 134-2 and field name 136-2 corresponding to data table 130-2, and data table summary 132-N, field 134-N and field name 136-N corresponding to data table 130-N. Data table summaries 132-1 to 132-N are hereinafter individually or collectively referred to as data table summaries 132, and fields 134-1 to 134-N are hereinafter individually or collectively referred to as fields 134. Fields 136-1 to 136-N are hereinafter individually or collectively referred to as fields 136.
[0028] like Figure 1 As shown, the computing device 110 can receive a user's query 140 (also referred to as a first query). For example, the query 140 can be "What is the recent daily activity of each application" to retrieve the daily activity data of each application, that is, the number of daily active users, that is, the number of users who use the product or website every day, which is generally used to reflect the actual number of users of the website, application, etc. and other operational conditions. If the database 120 has a small number of data tables, the querying user can determine which data tables should be used to query the data. However, as the number of tables increases (for example, millions of data tables), it is difficult for users to determine which data tables should be used to obtain the information they want to query, so a data table retrieval system 150 is needed to retrieve some data tables for users to use based on the query 140, such as returning data tables related to daily activity data to users.
[0029] The data table retrieval system 150 can retrieve a target data table set 152 from the database 120 according to the query 140 and the data table summary 132. For example, the data table retrieval system 150 can determine the target data table set 152 according to the query 140 and the data table summary 132. Then, the data table retrieval system 150 can determine a target field set 154 from the target data table set 152 according to the query 140 and the field name 136. For example, the target data table set 152 can include 10 data tables, and the target field set 154 can include a target field for each of the 10 data tables. Finally, the data table retrieval system 150 can return the data table retrieval system 150 and the target data table set 152 to the user as a retrieval result 160, and the user can determine the required data table and field according to the retrieval result 160.
[0030] It should be understood that the architecture and functions in the example environment 100 are described for exemplary purposes only and do not imply any limitation on the scope of the present disclosure. Embodiments of the present disclosure may also be applied to other environments with different structures and / or functions.
[0031] The following will combine Figures 2 to 8 The process according to the embodiment of the present disclosure is described in detail. For ease of understanding, the specific data mentioned in the following description are exemplary and are not intended to limit the scope of protection of the present disclosure. It is understood that the embodiments described below may also include additional actions not shown and / or the actions shown may be omitted, and the scope of the present disclosure is not limited in this respect.
[0032] Figure 2 200 according to an embodiment of the present disclosure. At block 202, the similarity between the user query and each data table in the database may be determined based on the user query, the data table summary, and the field name. Figure 1 The data table retrieval system 150 may determine the table query similarity between the user query 140 and each data table 130 in the database 120 based on the user query 140 , the data table summary 132 , and the field name 136 .
[0033] At block 204, a target data table set may be retrieved from a database based on the table query similarity, the target data table set including data associated with the user query. Figure 1 The data table retrieval system 150 may retrieve a target data table set 152 from the database 120 based on the table query similarity, where the target data table set 152 includes data associated with the user query 140 .
[0034] At block 206, based on the user query and the field name, the field query similarity between the user query and each field of each data table in the target data table set may be determined. Figure 1 The data table retrieval system 150 may determine the field query similarity between the user query 140 and each field of each data table in the target data table set 152 based on the user query 140 and the field name 136 .
[0035] At block 206, a target field set may be retrieved from each data table in the target data table set based on the field query similarity. Figure 1 The data table retrieval system 150 may retrieve a target field set 154 from each data table in the target data table set 152 based on the field query similarity.
[0036] Therefore, according to method 200 of an embodiment of the present disclosure, according to the scheme of an embodiment of the present disclosure, when a user performs data search, not only can the data table search results be returned, but also the corresponding field search results can be returned, ensuring that the search results are more in line with user needs, providing users with a better data retrieval experience, and having wide applicability and being able to support complex query requirements.
[0037] Figure 3A FIG. 3 is a flow chart showing a process 300A of data retrieval according to an embodiment of the present disclosure. Figure 3A As shown, at block 301, the user's query can be rewritten based on domain knowledge. Figure 1 As shown, the data table retrieval system 150 can obtain the user's query 140 (also called the first query), and can rewrite the query 140 based on domain knowledge to generate a rewritten query (also called the second query), and use the rewritten query in subsequent processing. For example, the user's query is "What is the recent DAU of each application?", then according to the domain knowledge of the table granularity, that is, the DAU (Daily Active User) field and the daily active field have the same meaning, the user's query can be rewritten as "What is the recent daily activeness of each application?". In addition, the user's query can also be rewritten based on the knowledge of the global granularity or the business granularity. For example, the user's query is "What is the recent daily activeness of application AAA?" According to the knowledge of the business granularity, "application AAA" and "application BBB" have the same meaning, so the user's query can be rewritten as "What is the recent daily activeness of application BBB?". In some embodiments, the user's query can be rewritten based on rules generated based on domain knowledge. In some embodiments, the user's query can be intelligently rewritten based on a pre-trained model that integrates domain knowledge. By rewriting user queries based on domain knowledge of different granularities, we can avoid inconsistencies in query content caused by user usage habits, thereby improving the relevance and accuracy of query results.
[0038] At block 302, a target set of data tables may be retrieved from a database based on the rewritten query. Figure 1 As shown, based on the rewritten query, the data table retrieval system 150 can retrieve the data table 130 in the database 120 to obtain the target data table set 152. Retrieving a data table set from a database can also be called recalling a data table set from a database. Figure 3B To describe the process of recalling a collection of data tables in a database.
[0039] Figure 3B FIG. 3 is a schematic diagram showing a process 300B of recalling a data table set according to an embodiment of the present disclosure. Figure 3B As shown, at box 310, the vector of the rewritten query (hereinafter referred to as the query vector) can be obtained. In some embodiments, the query vector can be obtained using a pre-trained model. At box 311, a first-way recall of the data table can be performed based on the user query and the data table summary. In some embodiments, a set of data tables (also referred to as a first set of data tables) can be recalled from a database based on the similarity between the query vector and the summary vector generated using the data table summary. In some embodiments, a data table summary can be generated using a pre-trained model based on the content information of the data table (e.g., table name, field name, or field metadata), and the data table summary can be processed using another pre-trained model to generate a summary vector stored in a vector library.
[0040] At box 312, a second recall of the data table can be performed based on the user query and the field name. In some embodiments, a data table set (also referred to as a second data table set) can be recalled from the database based on the similarity between the field vector of the field name and the query vector. For example, multiple field vectors of the data table can be obtained, and the field vector can be pre-generated and stored in a vector library by processing field information (e.g., field name and / or field metadata) by a pre-trained model. In some embodiments, multiple similarities can be generated based on multiple field vectors and the query vector, and the similarity between the data table and the query vector can be determined based on the multiple similarities. For example, the data table includes three fields A, field B, and field C, the similarity between field A and the query vector is 0.6, the similarity between field B and the query vector is 0.7, and the similarity between field C and the query vector is 0.8, then the similarity between the data table and the query vector can be determined to be (0.6+0.7+0.8) / 3. It should be understood that the above method is only an example method for determining table similarity by field similarity, and the embodiments of the present disclosure are not limited to this.
[0041] At block 313, post-processing may be performed on the multi-way recall to determine a target data table set (eg, Figure 1The target data table set 152 or Figure 3A Target data table set in the first-way table recall). For example, the result of the first-way table recall and the result of the second-way table recall can be fused, and deduplication processing can be performed. In some embodiments, the first-way data table recall and the second-way data table recall can be fused according to pre-set rules to obtain a predetermined number of data tables. For example, the first-way data table recall can be mainly used, and the second-way data table recall can be used as a supplement to obtain a predetermined number of data tables (for example, 20). For example, the second-way data table recall can be mainly used, and the first-way data table recall can be used as a supplement to obtain a predetermined number of data tables. It should be understood that the two-way data table recall shown here is only an example, and the embodiments of the present disclosure may also adopt a one-way data table recall, or expand it to adopt more-way data table recall.
[0042] Return to reference Figure 3A As mentioned above, at box 302, the target data table set can be retrieved, and then proceeding to box 303, the target field set can be retrieved based on the target data table set and the rewritten query. As mentioned above, the embodiments of the present disclosure can retrieve the data tables required by users from a massive data table set. However, the retrieved table may include a large number of fields, and the user still cannot quickly determine the required fields. Therefore, the solution provided by the embodiments of the present disclosure can also retrieve the required fields for the user. Retrieving a field set from a data table set can also be called recalling a field set from a data table set. This will be discussed in conjunction with Figure 3C Describes the process of recalling a collection of fields.
[0043] Figure 3C FIG. 3 is a schematic diagram showing a process 300C of recalling a field set according to an embodiment of the present disclosure. Figure 3C As shown, at block 320, multiple fields may be obtained from the target data table set. For example, the target data table set may include 20 data tables, and the K most popular fields in each data table may be obtained, that is, 20*K fields may be obtained. At block 321, based on the query vector (e.g., Figure 3B The query vector) and the field vector are used to perform the first-pass field recall. For example, the first-pass field recall can be performed by calculating the vector similarity between the query vector and the field vector. In some embodiments, the field vector can be generated by pre-training the field name. In addition, data heat can also be applied to the field recall stage, which will be combined with Figure 4 Describe this.
[0044] At box 322, a second field recall may be performed based on the user query and the field name. For example, field recall may be performed based on the literal match (e.g., text similarity) between the user query and the field. In some embodiments, the user query may be rewritten based on domain knowledge, and then the literal match between the user query and the field may be calculated. At box 323, the multi-way field recall may be post-processed to determine the target field set. For example, the result of the first field recall and the result of the second field recall may be fused, and deduplication may be performed. In some embodiments, a predetermined number of fields (e.g., 20 for each data table) may be obtained according to a pre-set rule. For example, the first field recall may be used as the main method, and the second field recall may be used as the supplementary method to obtain a predetermined number of fields. In addition, the second field recall may be used as the main method, and the first field recall may be used as the supplementary method to obtain a predetermined number of fields. It should be understood that the two-way field recall shown here is only an example, and the embodiments of the present disclosure may also adopt a one-way field recall, or may be extended to adopt more-way field recall.
[0045] Return to reference Figure 3A As mentioned above, at box 303, the target field set can be retrieved, and then proceeding to box 304, the target data table set and the target field set can be filtered. For example, the status of each data table in the target data table set can be obtained. If the data table is no longer maintained, the data table and its fields can be filtered. In some embodiments, it can be determined whether the data table is in a maintenance state by judging the data update date in the data table. In addition, the metadata of each field in the target field set can be obtained to determine whether to filter the field. For example, if the meta information of the field cannot be queried, it can be determined to filter the field.
[0046] At block 305, the target data table set may be semantically sorted, and a third data table set may be retrieved from the target data table set. For example, each data table in the target data table set may be combined with a corresponding plurality of fields in the target field set, prompt content for each data table may be generated, and an online sorting model may be requested to score each data table. In some embodiments, the online sorting model may be a pre-trained language model.
[0047] At box 306, a fourth set of data tables can be retrieved from the third set of data tables based on table statistics. In some embodiments, each data table in the third set of data tables can be scored based on table statistics based on a heat ranking model (e.g., a machine learning model or a deep learning model), and the fourth set of data tables can be retrieved based on the score. For example, table statistics may include, but are not limited to: historical retrieval volume of a data table, historical query volume of a data table, retrieval volume in a certain time period, and query volume in a certain time period, etc., all of which can reflect the usage popularity information of the data table. The retrieval volume can reflect the number of times a data table is presented to a user, and the query volume can reflect the number of times a user queries a data table. Then, click-through rate = retrieval volume / query volume can be constructed to reflect the popularity of the data table. In addition, other table statistics or data constructed by table statistics can be used as features for scoring and sorting by machine learning models, and the present disclosure does not limit this. In some embodiments, other data can also be used for scoring, such as a recall path identifier (i.e., the number of recalls from which the data table comes), a semantic sorting score value, a semantic sorting ranking, and the like. The following will be combined with Figure 5 Describe the training process of this ranking model.
[0048] At box 307, the data table set and the field set may be post-processed. In some embodiments, a date field set of each data table in the fourth data table set may be obtained. In some embodiments, a hot field set of each data table in the fourth data table set may be determined based on field statistics. In addition, in some embodiments, a combined field set may be generated based on the date field set, the hot field set, and the target field set, and the combined field set may be returned to the user.
[0049] Figure 4 FIG. 4 is a schematic diagram showing a process 400 of performing field recall using data heat according to an embodiment of the present disclosure. Figure 4 As shown, at box 402, the semantic similarity between the field and the user query can be determined. For example, the semantic similarity can be determined based on the field vector and the text vector. It should be understood that the user query can be a rewritten user query. In addition, text similarity and semantic similarity should be distinguished. For example, "DAU" and "Daily Activity" have zero text similarity, but both represent the same semantics, namely the number of daily active users, and the semantic similarity is very high. At box 404, the usage heat of the field can be determined. For example, the usage heat of a field can be represented by the usage heat (normalized) within the past 60 days. In the field recall stage, facing fields with high text matching (for example, many fields are called "lead rate" or "XX lead rate"), introducing field heat data is the key to distinguishing these fields.
[0050] At block 406, the ranking score of the field may be determined. For example, the field ranking score may be calculated by formula (1), and the field with the highest score may be selected:
[0051] score = a*semantic_score+b*hot_score (1)
[0052] Wherein, semantic_score is the similarity score calculated by the query vector and the field vector, hot_score is the heat score of the field (for example, the usage heat in the past 60 days), and parameters a and b are weights. In some embodiments, parameters a and b are configured by experts to meet the characteristics of the business itself. In some embodiments, the optimal values of parameters a and b are obtained through a grid search strategy to ensure the accuracy and effectiveness of the scores.
[0053] Therefore, by integrating popularity information to perform field recall, not only the semantic relevance between the field and the user query is fully considered, but also the actual usage popularity of the field is taken into account. In particular, when there are multiple semantically similar fields in the same data table, usage popularity becomes an effective means of distinction.
[0054] Figure 5 A flowchart of a process 500 for training a sorting model according to an embodiment of the present disclosure is shown. In the recall process of a data table, facing multiple data tables with similar content (for example, multiple tables are all related to "trading volume"), the introduction of user usage habits is crucial to optimizing the user experience. At box 502, training data for the sorting model is prepared. In some embodiments, the training data may include table statistics and semantic sorting scores. In addition, the recall path identifier of the table (i.e., the data table comes from which recall path), the semantic sorting ranking, and the long / medium / short-term usage heat of the data table, etc. can also be used as training data. As mentioned above, the usage heat can be constructed by table statistics related to the table usage. At box 504, data features are constructed based on the training data. For example, missing values can be processed, feature normalization processing, noise point processing, feature continuous value analysis, and correlation analysis between features can be performed. At box 506, a sorting model is trained based on the training data and data features. In some embodiments, the sorting model can be a machine learning model or a deep learning model.
[0055] Therefore, in the final sorting stage of the data table, we do not rely solely on semantic relevance for sorting. Instead, we use a sorting model that integrates multiple features such as data usage popularity. This sorting model combines multi-dimensional features such as semantic sorting scores, sorting positions, and long / medium / short-term usage popularity of the data table to achieve accurate sorting of the recalled data table.
[0056] Figure 6A-6DThe combined diagram shows a schematic diagram of a data table search and field search process 600A-600D according to an embodiment of the present disclosure. Fig. 6A , at box 601, a user query is input. At box 602, query rewriting can be performed based on knowledge. Global granular knowledge and business strength knowledge can be obtained from box 603. At box 604, a rewritten query can be generated. In some embodiments, query rewriting can be performed based on rules generated by knowledge. In some embodiments, a model trained with knowledge can be used for intelligent rewriting. At box 606, table information and field information can be obtained. At box 607, summary information of the table can be generated using a pre-trained generative model, and a table vector can be generated based on the summary information of the table and a field vector can be generated based on the field information. At box 608, the table vector and the field vector can be stored in a vector library.
[0057] At box 609, the vector library can be requested in parallel to obtain field vectors. For example, the popular field information of each table is requested from the vector library. At box 610, the popular field information can be parsed and aggregated into data table features for sorting, and finally the table ID of the TOP K is returned to complete the first-way table recall. For example, the similarity between the table and the query vector can be determined based on the similarity between the field and the query vector. At box 611, the vector library can be requested to obtain the vector of the table summary. At box 612, the table summary and table ID of the TOP K can be parsed and recalled to complete the second-way table recall. For example, the recall can be performed based on the similarity between the query vector and the vector of the table summary. Proceed to box 613, the two-way recall is merged, and 20 data tables are retrieved for deduplication. It should be understood that other numbers of data tables can also be retrieved. Refer to the following. Figure 6B The table search and field search process 600B of the embodiment of the present disclosure is continued to be described.
[0058] like Figure 6B As shown, at box 614 (following Fig. 6AIn box 613 in the query result query, the vector database and the data heat interface can be requested in parallel. For example, the field vector can be obtained from the vector database interface, and the field heat information can be obtained from the data heat interface. At box 615, various TOP M fields of the recall table can be obtained. For example, the TOP 10 fields in the recall table can be obtained. At box 616, the vector retrieval score and the field heat score can be fused. For example, the vector retrieval score can be calculated based on the similarity between the query vector and the field vector, and the field heat can be the usage heat of the field in the past 60 days. At box 617, the fields can be sorted according to the scores after the vector retrieval score and the field heat are fused to complete the first recall. For example, the fields are sorted according to the fused scores of each field. At box 618, the query is rewritten based on the knowledge of the data set granularity. At box 619, the literal similarity between the candidate field and the user query can be calculated. For example, the literal similarity is determined based on the text matching between the candidate field and the user query. At box 620, the results that meet the literal similarity threshold can be set to prioritize recall to complete the second recall. For example, the literal similarity can be set to be greater than 90% to set the priority recall. At box 621, the two recall results can be fused, and the high literal similarity results are returned first and then the semantic heat fusion results are returned. At box 622, the data is assembled and returned according to the data table granularity. For example, the recalled table and its corresponding recall fields can be determined and returned. Refer to the following Figure 6C The data table search and field search process 600C of the embodiment of the present disclosure is continued to be described.
[0059] like Figure 6C As shown, at box 623 (followed by Figure 6B In box 622), metadata is called to enrich entity information and filter illegal indicators. For example, the metadata is shown in box 624, including the popularity information of the data table, the popularity, name, description and other information of the field. At box 625, a legal and verified data set and field are returned. For example, the recalled field meta information (such as expression, description, etc.) can be queried to enrich the returned data, and the fields for which meta information cannot be queried can be filtered out. At box 626, the user query and the text of the table can be preprocessed and composed into prompt content, and an online semantic ranking model is requested to score. In some embodiments, a pre-trained generative model can be used to process the prompt content to generate a score. At box 627, a text ranking score for the degree of relevance between the user query and the table can be obtained. At box 628, a semantic ranking result can be obtained. For example, the table can be sorted according to the semantic score, and a data table with a predetermined threshold can be returned. Refer to the following Fig.6D The table search and field search process 600D of the embodiment of the present disclosure is continued to be described.
[0060] like Fig.6DAs shown, at box 629 (followed by Figure 6B In box 628 in the figure, the popularity information of the recalled data table, the table recall path identifier, the semantic scoring information and the sorting position can be obtained. For example, the popularity information can be the click-through rate data of the table. At box 630, feature extraction can be performed and the extracted features can be combined, and the click-through rate model can be requested in parallel. At box 631, the click-through rate model sorting score can be obtained and the recalled data table can be sorted. For example, the click-through rate model can predict the click-through rate score of each data table, and sort the data table according to the click-through rate score. At box 632, the top-ranked data sets can be selected, and the popular date fields, popular related fields and recall fields in the data sets can be selected according to the popularity. At box 633, the tables and fields are assembled according to the table granularity and returned to the user.
[0061] Figure 7 A block diagram of a device 700 for data retrieval according to some embodiments of the present disclosure is shown. The device 700 includes a table similarity determination module 702, which is configured to determine the table query similarity between the user query and each data table in the database based on the user query, the data table summary and the field name. The device 700 also includes a target data table retrieval module 704, which retrieves a target data table set from the database based on the table query similarity, and the target data table set includes data associated with the user query. The device 700 also includes a field similarity determination module 706, which is configured to determine the field query similarity between the user query and each field of each data table in the target data table set based on the user query and the field name. The device 700 also includes a target field determination module 708, which is configured to retrieve a target field set from each data table in the target data table set based on the field query similarity. In addition, the device 700 also includes a retrieval result determination module 710, which is configured to determine the retrieval result of the data retrieval based on the target data table set and the corresponding target field set.
[0062] Figure 8 A block diagram of an electronic device 800 is shown in accordance with certain embodiments of the present disclosure. Figure 8 8 is a block diagram of an electronic device 800 according to some embodiments of the present disclosure. The device 800 may be a device or apparatus described in an embodiment of the present disclosure. Figure 8As shown, the device 800 includes a central processing unit (CPU) and / or a graphics processing unit (GPU) 801, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 802 or 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 800 can also be stored. The CPU / GPU 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. Although not shown in FIG. Figure 8 As shown in FIG. 8 , device 800 may also include a co-processor.
[0063] 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.
[0064] The various methods or processes described above may be performed by the CPU / GPU 801. For example, in some embodiments, the methods may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the CPU / GPU 801, one or more steps or actions in the methods or processes described above may be performed.
[0065] In some embodiments, the methods and processes described above may be implemented as 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.
[0066] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can 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 list) of computer readable storage medium 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 here 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 (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0067] 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.
[0068] The computer program instructions for performing the disclosed operation may be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, programming languages including object-oriented programming languages, and conventional procedural programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, executed as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via 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., utilizing an Internet service provider to connect via the Internet). In certain embodiments, by utilizing the state information of a computer-readable program instruction to customize 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 a computer-readable program instruction, thereby realizing various aspects of the present disclosure.
[0069] 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.
[0070] 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.
[0071] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the equipment, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each frame in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the frame can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous frames can actually be executed substantially in parallel, and they can also be executed in the opposite order sometimes, depending on the functions involved. It should also be noted that each frame in the block diagram and / or flow chart, and the combination of frames in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0072] 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 changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice 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.
[0073] Some example implementations of the present disclosure are listed below.
[0074] Example 1. A method for data retrieval, comprising:
[0075] Based on the user query, the data table summary and the field name, determining the table query similarity between the user query and each data table in the database;
[0076] Retrieving a target data table set from the database based on the table query similarity, the target data table set including data associated with the user query;
[0077] Based on the user query and the field name, determining a field query similarity between the user query and each field of each data table in the target data table set;
[0078] Retrieving a target field set from each data table in the target data table set based on the field query similarity; and
[0079] Based on the target data table set and the corresponding target field set, a search result of the data search is determined.
[0080] Example 2. The method according to Example 1, wherein retrieving the target data table set from the database comprises:
[0081] Retrieving a first set of data tables from the database based on the user query and the data table summary;
[0082] Retrieving a second set of data tables from the database based on the user query and the field names; and
[0083] The target data table set is determined based on the first data table set and the second data table set.
[0084] Example 3. The method according to examples 1-2, wherein retrieving the target data table set from the database comprises:
[0085] Generate a query vector for the user query through a pre-trained model;
[0086] Acquire a summary vector of the data table summary from a vector library, where the summary vector is generated by the pre-trained model;
[0087] Retrieving a first set of data tables from the database by determining a vector similarity between the query vector and the summary vector;
[0088] Acquire a field vector of the field name from the vector library, where the field vector is generated by the pre-trained model;
[0089] Retrieving a second set of data tables from the database by determining vector similarity between the query vector and the field vector; and
[0090] The target data table set is determined by performing deduplication fusion on the first data table set and the second data table set.
[0091] Example 4. The method of Examples 1-3, wherein retrieving the target field set from each data table in the target data table set comprises:
[0092] Retrieving a first set of fields from each data table in the target data table set based on the user query and the field names;
[0093] Retrieving a second set of fields from each data table in the target set of data tables based on the user query and the field vector of field names; and
[0094] The target field set of each data table in the target data table set is determined based on the first field set and the second field set.
[0095] Example 5. The method of Examples 1-4, wherein retrieving the target field set from each data table in the target data table set comprises:
[0096] generating a rewritten user query based on domain knowledge associated with the user query;
[0097] Retrieving the first set of fields from each data table in the target data table set by determining the literal similarity between the rewritten user query and the field name;
[0098] Generate a query vector for the user query through a pre-trained model;
[0099] Retrieving the second set of fields from each data table in the target data table set by determining vector similarity between the query vector and the field vector;
[0100] The target field set is determined by performing deduplication fusion on the first field set and the second field set based on a predefined rule.
[0101] Example 6. The method according to examples 1-5, wherein retrieving the second set of fields from each data table in the target data table set further comprises:
[0102] Determine field popularity based on field statistics; and
[0103] The second field set is retrieved based on the vector similarity and the field popularity.
[0104] Example 7. The method according to examples 1-6 further includes:
[0105] Acquiring domain knowledge associated with the user query; and
[0106] Based on the user query and the domain knowledge, a rewritten user query is generated.
[0107] Example 8. The method according to examples 1-7 further includes:
[0108] Generate prompt information based on the user query and the target data table set;
[0109] Based on the prompt information, using a pre-trained model to generate a semantic ranking score of the target data table set; and
[0110] Based on the semantic ranking score, a third data table set is retrieved from the target data table set.
[0111] Example 9. The method of Examples 1-8, further comprising:
[0112] Determine a heat ranking score of the third data table set based on table statistics of each data table in the third data table set; and
[0113] Based on the heat ranking score, a fourth data table set is retrieved from the third data table set.
[0114] Example 10. The method according to examples 1-9 further includes:
[0115] Obtaining a date field set of each data table in the fourth data table set;
[0116] Determine a hot field set of each data table in the fourth data table set based on field statistics data; and
[0117] A combined field set is generated based on the date field set, the hot field set and the target field set.
[0118] Example 11. A data retrieval device, comprising:
[0119] A table similarity determination module, configured to determine the table query similarity between the user query and each data table in the database based on the user query, the data table summary and the field name;
[0120] a target data table retrieval module, which retrieves a target data table set from the database based on the table query similarity, wherein the target data table set includes data associated with the user query;
[0121] A field similarity determination module is configured to determine, based on the user query and the field name, a field query similarity between the user query and each field of each data table in the target data table set;
[0122] a target field determination module, configured to retrieve a target field set from each data table in the target data table set based on the field query similarity; and
[0123] The retrieval result determination module is configured to determine the retrieval result of the data retrieval based on the target data table set and the corresponding target field set.
[0124] Example 12. The apparatus according to Example 11, wherein the target data table retrieval module comprises:
[0125] A first data table set retrieval module, configured to retrieve a first data table set from the database based on the user query and the data table summary;
[0126] A second data table set retrieval module, configured to retrieve a second data table set from the database based on the user query and the field name; and
[0127] The target data table set determining module is configured to determine the target data table set based on the first data table set and the second data table set.
[0128] Example 13. The apparatus according to examples 11-12, wherein the target data table retrieval module comprises:
[0129] A query vector generation module, configured to generate a query vector of the user query through a pre-trained model;
[0130] A summary vector generation module, configured to obtain a summary vector of the data table summary from a vector library, wherein the summary vector is generated by the pre-trained model;
[0131] a first data table set second retrieval module configured to retrieve a first data table set from the database by determining a vector similarity between the query vector and the summary vector;
[0132] A field vector determination module, configured to obtain a field vector of the field name from the vector library, wherein the field vector is generated by the pre-trained model;
[0133] A second data table set second retrieval module configured to retrieve a second data table set from the database by determining a vector similarity between the query vector and the field vector; and
[0134] The target data table set second determination module is configured to determine the target data table set by performing deduplication fusion on the first data table set and the second data table set.
[0135] Example 14. The apparatus of Examples 11-13, wherein retrieving the target set of fields from each data table in the target set of data tables comprises:
[0136] A first field set retrieval module, configured to retrieve a first field set from each data table in the target data table set based on the user query and the field name;
[0137] A second field set retrieval module configured to retrieve a second field set from each data table in the target data table set based on the user query and the field vector of the field name; and
[0138] The target field set determination module is configured to determine the target field set of each data table in the target data table set based on the first field set and the second field set.
[0139] Example 15. The apparatus of Examples 11-14, wherein retrieving the target set of fields from each data table in the target set of data tables comprises:
[0140] A user query rewriting module, configured to generate a rewritten user query based on domain knowledge associated with the user query;
[0141] A first field set second module, configured to retrieve the first field set from each data table in the target data table set by determining a literal similarity between the rewritten user query and the field name;
[0142] A query vector generation module, configured to generate a query vector of the user query through a pre-trained model;
[0143] A second field set second retrieval module, configured to retrieve the second field set from each data table in the target data table set by determining a vector similarity between the query vector and the field vector;
[0144] The second target field set determination module is configured to determine the target field set by performing deduplication fusion on the first field set and the second field set based on a predefined rule.
[0145] Example 16. The apparatus of Examples 11-15, wherein the second field set second search module further comprises:
[0146] A field popularity determination module is configured to determine field popularity based on field statistical data; and
[0147] The second field set third retrieval module is configured to retrieve the second field set based on the vector similarity and the field popularity.
[0148] Example 17. The apparatus of Examples 11-16, further comprising:
[0149] A domain knowledge acquisition module, configured to acquire domain knowledge associated with the user query; and
[0150] The rewritten query generation module is configured to generate a rewritten user query based on the user query and the domain knowledge.
[0151] Example 18. The apparatus of Examples 11-17, further comprising:
[0152] A prompt information generating module, configured to generate prompt information based on the user query and the target data table set;
[0153] A semantic score generating module, configured to generate a semantic ranking score of the target data table set based on the prompt information using a pre-trained model; and
[0154] The third data table set retrieval module is configured to retrieve a third data table set from the target data table set based on the semantic ranking score.
[0155] Example 19. The apparatus of Examples 11-18, further comprising:
[0156] a heat score generating module, which determines a heat ranking score of the third data table set based on table statistical data of each data table in the third data table set; and
[0157] The fourth data table set retrieval module retrieves a fourth data table set from the third data table set based on the popularity ranking score.
[0158] Example 20. The apparatus of Examples 11-19, further comprising:
[0159] A date field set acquisition module, configured to acquire a date field set of each data table in the fourth data table set;
[0160] A hot field set acquisition module, configured to determine a hot field set of each data table in the fourth data table set based on field statistical data; and
[0161] The combined field set generating module is configured to generate a combined field set based on the date field set, the popular field set and the target field set.
[0162] Example 21. An electronic device comprising:
[0163] Processor; and
[0164] A memory coupled to the processor, the memory having instructions stored therein, wherein when the instructions are executed by the processor, the electronic device performs actions, the actions comprising:
[0165] Based on the user query, the data table summary and the field name, determining the table query similarity between the user query and each data table in the database;
[0166] Retrieving a target data table set from the database based on the table query similarity, the target data table set including data associated with the user query;
[0167] Based on the user query and the field name, determining a field query similarity between the user query and each field of each data table in the target data table set;
[0168] Retrieving a target field set from each data table in the target data table set based on the field query similarity; and
[0169] Based on the target data table set and the corresponding target field set, a search result of the data search is determined.
[0170] Example 22. The electronic device of claim 21, wherein retrieving the target data table set from the database comprises:
[0171] Retrieving a first set of data tables from the database based on the user query and the data table summary;
[0172] Retrieving a second set of data tables from the database based on the user query and the field names; and
[0173] The target data table set is determined based on the first data table set and the second data table set.
[0174] Example 23. The electronic device of claims 21-22, wherein retrieving the target data table set from the database comprises:
[0175] Generate a query vector for the user query through a pre-trained model;
[0176] Acquire a summary vector of the data table summary from a vector library, where the summary vector is generated by the pre-trained model;
[0177] Retrieving a first set of data tables from the database by determining a vector similarity between the query vector and the summary vector;
[0178] Acquire a field vector of the field name from the vector library, where the field vector is generated by the pre-trained model;
[0179] Retrieving a second set of data tables from the database by determining vector similarity between the query vector and the field vector; and
[0180] The target data table set is determined by performing deduplication fusion on the first data table set and the second data table set.
[0181] Example 24. The electronic device of claims 21-23, wherein retrieving the target set of fields from each data table in the target set of data tables comprises:
[0182] Retrieving a first set of fields from each data table in the target data table set based on the user query and the field names;
[0183] Retrieving a second set of fields from each data table in the target set of data tables based on the user query and the field vector of field names; and
[0184] The target field set of each data table in the target data table set is determined based on the first field set and the second field set.
[0185] Example 25. The electronic device of claims 21-24, wherein retrieving the target set of fields from each data table in the target set of data tables comprises:
[0186] generating a rewritten user query based on domain knowledge associated with the user query;
[0187] Retrieving the first set of fields from each data table in the target data table set by determining the literal similarity between the rewritten user query and the field name;
[0188] Generate a query vector for the user query through a pre-trained model;
[0189] Retrieving the second set of fields from each data table in the target data table set by determining vector similarity between the query vector and the field vector;
[0190] The target field set is determined by performing deduplication fusion on the first field set and the second field set based on a predefined rule.
[0191] Example 26. The electronic device of claims 21-25, wherein retrieving the second set of fields from each data table in the target set of data tables further comprises:
[0192] Determine field popularity based on field statistics; and
[0193] The second field set is retrieved based on the vector similarity and the field popularity.
[0194] Example 27. The electronic device of claims 21-26, wherein the actions further include:
[0195] Acquiring domain knowledge associated with the user query; and
[0196] Based on the user query and the domain knowledge, a rewritten user query is generated.
[0197] Example 28. The electronic device of claims 21-27, wherein the actions further include:
[0198] Generate prompt information based on the user query and the target data table set;
[0199] Based on the prompt information, using a pre-trained model to generate a semantic ranking score of the target data table set; and
[0200] Based on the semantic ranking score, a third data table set is retrieved from the target data table set.
[0201] Example 29. The electronic device of claims 21-28, wherein the actions further include:
[0202] Determine a heat ranking score of the third data table set based on table statistics of each data table in the third data table set; and
[0203] Based on the heat ranking score, a fourth data table set is retrieved from the third data table set.
[0204] Example 30. The electronic device of claims 21-29, wherein the actions further comprise:
[0205] Obtaining a date field set of each data table in the fourth data table set;
[0206] Determine a hot field set of each data table in the fourth data table set based on field statistics data; and
[0207] A combined field set is generated based on the date field set, the hot field set and the target field set.
[0208] Example 31 A computer-readable storage medium having one or more computer instructions stored thereon, wherein the one or more computer instructions are executed by a processor to implement a method according to any one of Examples 1 to 10.
[0209] Example 32. A computer program product tangibly stored on a computer-readable medium and comprising computer-executable instructions that, when executed by a device, cause the device to perform a method according to any one of Examples 1 to 10.
[0210] Although the disclosure has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Instead, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A data retrieval method, comprising: Based on the user query, the data table summary and the field name, determining the table query similarity between the user query and each data table in the database; Retrieving a target data table set from the database based on the table query similarity, the target data table set including data associated with the user query; Based on the user query and the field name, determining a field query similarity between the user query and each field of each data table in the target data table set; Retrieving a target field set from each data table in the target data table set based on the field query similarity; as well as Based on the target data table set and the corresponding target field set, a search result of the data search is determined.
2. The method according to claim 1, wherein retrieving the target data table set from the database comprises: Retrieving a first set of data tables from the database based on the user query and the data table summary; Retrieving a second set of data tables from the database based on the user query and the field names; as well as The target data table set is determined based on the first data table set and the second data table set.
3. The method according to claim 2, wherein retrieving the target data table set from the database comprises: Generate a query vector for the user query through a pre-trained model; Acquire a summary vector of the data table summary from a vector library, where the summary vector is generated by the pre-trained model; Retrieving a first set of data tables from the database by determining a vector similarity between the query vector and the summary vector; Acquire a field vector of the field name from the vector library, where the field vector is generated by the pre-trained model; Retrieving a second set of data tables from the database by determining a vector similarity between the query vector and the field vector; as well as The target data table set is determined by performing deduplication fusion on the first data table set and the second data table set.
4. The method according to claim 1, wherein retrieving the target field set from each data table in the target data table set comprises: Retrieving a first set of fields from each data table in the target data table set based on the user query and the field names; Retrieving a second set of fields from each data table in the target set of data tables based on the user query and the field vector of the field names; as well as The target field set of each data table in the target data table set is determined based on the first field set and the second field set.
5. The method according to claim 4, wherein retrieving the target field set from each data table in the target data table set comprises: generating a rewritten user query based on domain knowledge associated with the user query; Retrieving the first set of fields from each data table in the target data table set by determining a literal similarity between the rewritten user query and the field name; Generate a query vector for the user query through a pre-trained model; Retrieving the second set of fields from each data table in the target data table set by determining vector similarity between the query vector and the field vector; The target field set is determined by performing deduplication fusion on the first field set and the second field set based on a predefined rule.
6. The method according to claim 5, wherein retrieving the second field set from each data table in the target data table set further comprises: Determine field popularity based on field statistics; as well as The second field set is retrieved based on the vector similarity and the field popularity.
7. The method according to claim 1, further comprising: Acquiring domain knowledge associated with the user query; as well as Based on the user query and the domain knowledge, a rewritten user query is generated.
8. The method according to claim 1, further comprising: Generate prompt information based on the user query and the target data table set; Based on the prompt information, using a pre-trained model to generate a semantic ranking score of the target data table set; as well as Based on the semantic ranking score, a third data table set is retrieved from the target data table set.
9. The method according to claim 8, further comprising: Determine a popularity ranking score of the third data table set based on table statistical data of each data table in the third data table set; as well as Based on the heat ranking score, a fourth data table set is retrieved from the third data table set.
10. The method according to claim 9, further comprising: Obtaining a date field set of each data table in the fourth data table set; Determine a hot field set of each data table in the fourth data table set based on field statistical data; as well as A combined field set is generated based on the date field set, the hot field set and the target field set.
11. A data retrieval device, comprising: A table similarity determination module, configured to determine the table query similarity between the user query and each data table in the database based on the user query, the data table summary and the field name; a target data table retrieval module, which retrieves a target data table set from the database based on the table query similarity, wherein the target data table set includes data associated with the user query; A field similarity determination module is configured to determine, based on the user query and the field name, a field query similarity between the user query and each field of each data table in the target data table set; A target field determination module is configured to retrieve a target field set from each data table in the target data table set based on the field query similarity; as well as The retrieval result determination module is configured to determine the retrieval result of the data retrieval based on the target data table set and the corresponding target field set.
12. An electronic device comprising: processor; as well as A memory coupled to the processor, the memory having instructions stored therein, wherein when the instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 10.
13. A computer program product tangibly stored on a non-transitory computer readable medium and comprising computer executable instructions for performing the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Data query method and device, equipment and medium
CN112989171A
Method and device for generating SQL (Structured Query Language) query instruction
CN117493367A
Knowledge base search and retrieval based on document similarity
US20170060366A1
Cited By
Method and device for determining data table, equipment, medium and product
CN119271805A
