Information query method and device, computer equipment, storage medium and program product
By obtaining the unstructured query statements and preset query combinations of users, combining and filtering according to similarity and matching, the problem of inaccurate query in traditional intelligent question-and-answer methods is solved, and more accurate information query results are achieved.
Patent Information
- Application Number
- CN202411178404.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-12-20
AI Technical Summary
When traditional intelligent question-and-answer methods process unstructured query statements, the conversion to structured data may lead to inaccurate answers and cannot effectively match user intentions.
By obtaining the user's unstructured query statement and preset query combination, combining and filtering according to similarity and matching degree, more accurate structured query information is generated to improve the relevance of query results.
It improves the accuracy and relevance of information queries, can feedback users' query results more accurately, and enhances the response capabilities of the intelligent question-and-answer system.
Smart Images

Figure CN119166769A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an information query method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of computer technology, intelligent question-answering technology has emerged. Intelligent question-answering technology is a technology that can automatically identify questions, extract keywords and context, and generate corresponding answers. Intelligent question-answering technology is widely used in various fields, such as knowledge question-answering, intelligent customer service, and intelligent recommendation.
[0003] Traditional intelligent question-answering methods usually pre-build a structured question-answering database, which stores massive amounts of structured data and corresponding answers. When a user needs to make a query, the user's unstructured query statement is converted into structured data, and the structured data that is the same as the structured data of the user's query statement is filtered from the question-answering database, and the filtered structured data query answer is returned to the user. However, most intelligent question-answering application scenarios mainly rely on a large number of unstructured query statements. If they are directly converted into structured data, there may be a large difference between the meaning of the user's query statement and the query answer, resulting in inaccurate answers. Summary of the invention
[0004] Based on this, it is necessary to provide an information query method, device, computer equipment, computer-readable storage medium and computer program product that can improve accuracy in response to the above technical problems.
[0005] In one aspect, the present application provides an information query method. The method comprises:
[0006] Acquire a first candidate query combination and an unstructured target query statement, wherein the first candidate query combination includes an unstructured preset query statement and structured query information of the preset query statement;
[0007] When the similarity between the target query statement and the preset query statement in the first candidate query combination satisfies a similarity condition, combining the target query statement with the structured query information of the preset query statement that satisfies the similarity condition to obtain a second candidate query combination;
[0008] Determining a degree of match between a target query statement and structured query information in the second candidate query combination;
[0009] According to the matching degree, selecting a target query combination from the second candidate query combination;
[0010] Information query is performed according to the target query combination to obtain query results for the target query statement.
[0011] On the other hand, the present application also provides an information query device. The device comprises:
[0012] An acquisition module, configured to acquire a first candidate query combination and an unstructured target query statement, wherein the first candidate query combination includes an unstructured preset query statement and structured query information of the preset query statement;
[0013] a combining module, configured to combine the target query statement with the structured query information of the preset query statement satisfying the similarity condition to obtain a second candidate query combination when the similarity between the target query statement and the preset query statement in the first candidate query combination satisfies a similarity condition;
[0014] A determination module, used to determine the matching degree between the target query statement and the structured query information in the second candidate query combination;
[0015] A screening module, configured to screen a target query combination from the second candidate query combination according to the matching degree;
[0016] The query module is used to perform information query according to the target query combination to obtain query results for the target query statement.
[0017] On the other hand, the present application also provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0018] Acquire a first candidate query combination and an unstructured target query statement, wherein the first candidate query combination includes an unstructured preset query statement and structured query information of the preset query statement;
[0019] When the similarity between the target query statement and the preset query statement in the first candidate query combination satisfies a similarity condition, combining the target query statement with the structured query information of the preset query statement that satisfies the similarity condition to obtain a second candidate query combination;
[0020] Determining a degree of match between a target query statement and structured query information in the second candidate query combination;
[0021] According to the matching degree, selecting a target query combination from the second candidate query combination;
[0022] Information query is performed according to the target query combination to obtain query results for the target query statement.
[0023] On the other hand, the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0024] Acquire a first candidate query combination and an unstructured target query statement, wherein the first candidate query combination includes an unstructured preset query statement and structured query information of the preset query statement;
[0025] When the similarity between the target query statement and the preset query statement in the first candidate query combination satisfies a similarity condition, combining the target query statement with the structured query information of the preset query statement that satisfies the similarity condition to obtain a second candidate query combination;
[0026] Determining a degree of match between a target query statement and structured query information in the second candidate query combination;
[0027] According to the matching degree, selecting a target query combination from the second candidate query combination;
[0028] Information query is performed according to the target query combination to obtain query results for the target query statement.
[0029] On the other hand, the present application also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0030] Acquire a first candidate query combination and an unstructured target query statement, wherein the first candidate query combination includes an unstructured preset query statement and structured query information of the preset query statement;
[0031] When the similarity between the target query statement and the preset query statement in the first candidate query combination satisfies a similarity condition, combining the target query statement with the structured query information of the preset query statement that satisfies the similarity condition to obtain a second candidate query combination;
[0032] Determining a degree of match between a target query statement and structured query information in the second candidate query combination;
[0033] According to the matching degree, selecting a target query combination from the second candidate query combination;
[0034] Information query is performed according to the target query combination to obtain query results for the target query statement.
[0035] The above-mentioned information query method, device, computer equipment, computer-readable storage medium and computer program product obtain the user's unstructured target query statement and obtain a preset first candidate query combination, which includes an unstructured preset query statement and structured query information of the preset query statement, so as to query whether there is a query statement consistent with or similar to the user query statement in the combination. When the similarity between the target query statement and the preset query statement in the first candidate query combination meets the similarity condition, it means that there is a query statement consistent with or similar to the user query statement in the first candidate query combination, and these preset query statements consistent with or similar to the user query statement are recalled by similarity. The preset query statement and the target query statement are combined to form a second candidate query combination, and the matching degree between the target query statement and the structured query information in the second candidate query combination is determined, and it is possible to perform a second screening according to the matching degree to screen the target query combination from the second candidate query combination, so that the structured query information with high relevance to the user query statement can be screened out by the matching degree. The screened structured query information is used as enhanced prompt information of the user query statement in the information query, so that a more accurate information query is performed according to the target query combination, so that a more accurate query result can be fed back to the user.
[0036] On the other hand, the present application provides an information query model processing method. The method comprises:
[0037] Acquire a first candidate query combination sample and an unstructured target query statement sample, wherein the first candidate query combination sample includes an unstructured preset query statement sample and a structured query information sample of the preset query statement sample;
[0038] When the similarity between the target query sentence sample and the preset query sentence sample in the first candidate query combination sample satisfies the sample similarity condition, combining the target query sentence sample with the structured query information sample of the preset query sentence sample that satisfies the sample similarity condition to obtain a second candidate query combination sample;
[0039] Determining a sample matching degree between a target query statement sample and a structured query information sample in the second candidate query combination sample;
[0040] According to the sample matching degree, selecting a target query combination sample from the second candidate query combination samples;
[0041] Performing information query according to the target query combination sample to obtain a predicted query result for the target query statement sample;
[0042] An expected query result for the target query statement sample is obtained, and model training is performed based on the predicted query result and the expected query result to obtain an information query model.
[0043] On the other hand, the present application also provides an information query model processing device. The device includes:
[0044] A sample acquisition module, used to acquire a first candidate query combination sample and an unstructured target query statement sample, wherein the first candidate query combination sample includes an unstructured preset query statement sample and a structured query information sample of the preset query statement sample;
[0045] A sample combination module, configured to combine the target query statement sample with the structured query information sample of the preset query statement sample that meets the sample similarity condition to obtain a second candidate query combination sample when the similarity between the target query statement sample and the preset query statement sample in the first candidate query combination sample meets the sample similarity condition;
[0046] A sample determination module, used to determine a sample matching degree between a target query statement sample and a structured query information sample in the second candidate query combination sample;
[0047] A sample screening module, used for screening a target query combination sample from the second candidate query combination samples according to the sample matching degree;
[0048] A sample query module, used to perform information query according to the target query combination sample to obtain a predicted query result for the target query statement sample;
[0049] The training module is used to obtain the expected query result for the target query statement sample, perform model training based on the predicted query result and the expected query result, and obtain an information query model.
[0050] On the other hand, the present application also provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0051] Acquire a first candidate query combination sample and an unstructured target query statement sample, wherein the first candidate query combination sample includes an unstructured preset query statement sample and a structured query information sample of the preset query statement sample;
[0052] When the similarity between the target query sentence sample and the preset query sentence sample in the first candidate query combination sample satisfies the sample similarity condition, combining the target query sentence sample with the structured query information sample of the preset query sentence sample that satisfies the sample similarity condition to obtain a second candidate query combination sample;
[0053] Determining a sample matching degree between a target query statement sample and a structured query information sample in the second candidate query combination sample;
[0054] According to the sample matching degree, selecting a target query combination sample from the second candidate query combination samples;
[0055] Performing information query according to the target query combination sample to obtain a predicted query result for the target query statement sample;
[0056] An expected query result for the target query statement sample is obtained, and model training is performed based on the predicted query result and the expected query result to obtain an information query model.
[0057] On the other hand, the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0058] Acquire a first candidate query combination sample and an unstructured target query statement sample, wherein the first candidate query combination sample includes an unstructured preset query statement sample and a structured query information sample of the preset query statement sample;
[0059] When the similarity between the target query sentence sample and the preset query sentence sample in the first candidate query combination sample satisfies the sample similarity condition, combining the target query sentence sample with the structured query information sample of the preset query sentence sample that satisfies the sample similarity condition to obtain a second candidate query combination sample;
[0060] Determining a sample matching degree between a target query statement sample and a structured query information sample in the second candidate query combination sample;
[0061] According to the sample matching degree, selecting a target query combination sample from the second candidate query combination samples;
[0062] Performing information query according to the target query combination sample to obtain a predicted query result for the target query statement sample;
[0063] An expected query result for the target query statement sample is obtained, and model training is performed based on the predicted query result and the expected query result to obtain an information query model.
[0064] On the other hand, the present application also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0065] Acquire a first candidate query combination sample and an unstructured target query statement sample, wherein the first candidate query combination sample includes an unstructured preset query statement sample and a structured query information sample of the preset query statement sample;
[0066] When the similarity between the target query statement sample and the preset query statement sample in the first candidate query combination sample satisfies the sample similarity condition, combining the sample target query statement with the structured query information sample of the preset query statement sample that satisfies the sample similarity condition to obtain a second candidate query combination sample;
[0067] Determining a sample matching degree between a target query statement sample and a structured query information sample in the second candidate query combination sample;
[0068] According to the sample matching degree, selecting a target query combination sample from the second candidate query combination samples;
[0069] Performing information query according to the target query combination sample to obtain a predicted query result for the target query statement sample;
[0070] An expected query result for the target query statement sample is obtained, and model training is performed based on the predicted query result and the expected query result to obtain an information query model.
[0071] The above-mentioned information query model processing method, device, computer equipment, computer-readable storage medium and computer program product obtain a first candidate query combination sample and an unstructured target query statement sample, wherein the first candidate query combination sample includes an unstructured preset query statement sample and a structured query information sample of the preset query statement sample, so that it is possible to query whether there is a query statement sample that is consistent with or similar to the user query statement in the combination sample. When the similarity between the target query statement sample and the preset query statement sample in the first candidate query combination sample meets the sample similarity condition, it indicates that there are query statement samples that are consistent with or similar to the user query statement in the first candidate query combination sample, and these preset query statement samples that are consistent with or similar to the user query statement are recalled by similarity. The preset query statement sample and the target query statement sample are combined to form a second candidate query combination sample, and the matching degree between the target query statement sample and the structured query information sample in the second candidate query combination sample is determined, and it is possible to perform a second screening according to the matching degree to screen the target query combination sample from the second candidate query combination sample, so that the structured query information with high relevance to the user query statement can be screened out by the matching degree. The filtered structured query information is used as enhanced prompt information for the user query statement in the information query, so that more accurate information query can be performed according to the target query combination to obtain the query results predicted by the model. The expected query results for the target query statement sample are obtained, and the model is trained based on the predicted query results and the expected query results. The difference between the query results predicted by the model and the actual query results can be gradually reduced to improve the accuracy of the model, so that the information query model finally obtained can accurately filter out preset query statements that are similar or consistent with the user query statement, and can accurately and quickly filter out the most relevant structured information from the existing structured query information to perform information query, thereby improving the accuracy of information query. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1 An application environment diagram of an information query method in an embodiment;
[0073] Figure 2 A schematic diagram of a flow chart of an information query method in an embodiment;
[0074] Figure 3 A schematic diagram of an embodiment in which a first candidate query combination includes multiple query combinations;
[0075] Figure 4 A schematic diagram of the architecture of an information query method in an embodiment;
[0076] Figure 5 is a schematic diagram of the architecture of an information query method in another embodiment;
[0077] Figure 6 A schematic diagram of generating merged structured query information in one embodiment;
[0078] Figure 7 A schematic diagram of a process of generating multiple query combinations through a query template in one embodiment;
[0079] Figure 8 A schematic diagram of a flow chart of an information query model processing method in one embodiment;
[0080] Fig. 9 A schematic diagram of displaying a user query statement and query results in a user interface of an information query application in one embodiment;
[0081] Fig.10 A schematic diagram of displaying user query results in another embodiment;
[0082] Fig.11 A schematic diagram of an architecture in information query model training in another embodiment;
[0083] Fig.12 A schematic diagram of an information query model in an application according to another embodiment;
[0084] Fig.13 is a structural block diagram of an information query device in an embodiment;
[0085] Fig.14 is a structural block diagram of an information query model processing device in an embodiment;
[0086] Fig.15 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0087] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0088] The information query method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other servers. Both the terminal 102 and the server 104 can independently execute the information query method provided in the embodiment of the present application. The terminal 102 and the server 104 can also be used in conjunction to execute the information query method provided in the embodiment of the present application. When the terminal 102 and the server 104 are used in conjunction to execute the information query method provided in the embodiment of the present application, the terminal 102 obtains an unstructured target query statement and sends the unstructured target query statement to the server 104. The server 104 obtains a first candidate query combination, and the first candidate query combination includes an unstructured preset query statement and structured query information of the preset query statement. When the similarity between the target query statement and the preset query statement in the first candidate query combination meets the similarity condition, the server 104 combines the target query statement with the structured query information of the preset query statement that meets the similarity condition to obtain a second candidate query combination. The server 104 determines the matching degree between the target query statement and the structured query information in the second candidate query combination. The server 104 selects the target query combination from the second candidate query combination according to the matching degree, performs information query according to the target query combination, obtains the query result for the target query statement, and feeds back the query result to the terminal 102 .
[0089] In this embodiment, a method for processing an information query model is also provided, which can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other servers. Both the terminal 102 and the server 104 can independently execute the information query method provided in the embodiment of the present application. The terminal 102 and the server 104 can also be used in collaboration to execute the information query model processing method provided in the embodiment of the present application. When the terminal 102 and the server 104 are used in collaboration to execute the information query model processing method provided in the embodiment of the present application, the terminal 102 can obtain the first candidate query combination sample and the unstructured target query statement sample from the server 104, and the first candidate query combination sample includes an unstructured preset query statement sample and a structured query information sample of the preset query statement sample. When the similarity between the target query statement sample and the preset query statement sample in the first candidate query combination sample meets the sample similarity condition, the terminal 102 combines the sample target query statement with the structured query information sample of the preset query statement sample that meets the sample similarity condition to obtain a second candidate query combination sample. The terminal 102 determines the sample matching degree between the target query sentence sample and the structured query information sample in the second candidate query combination sample. The terminal 102 selects the target query combination sample from the second candidate query combination sample according to the sample matching degree. The terminal 102 performs information query according to the target query combination sample to obtain the predicted query result for the target query sentence sample. The terminal 102 obtains the expected query result for the target query sentence sample, performs model training based on the predicted query result and the expected query result, and obtains the information query model. The information query model can be run on the terminal 102 or on the server 104.
[0090] The terminal 102 may be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0091] In one embodiment, Figure 2 As shown, an information query method is provided, which is applied to Figure 1 The computer device in Figure 1 The following steps are taken as an example:
[0092] Step S202: obtaining a first candidate query combination and an unstructured target query statement, wherein the first candidate query combination includes an unstructured preset query statement and structured query information of the preset query statement.
[0093] The first candidate query combination includes at least one candidate query combination. Figure 3 As shown, the first candidate query combination includes three candidate query combinations A, B, and C. Query combination A includes an unstructured preset query statement a1 and structured query information a2, query combination B includes an unstructured preset query statement b1 and structured query information b2, and query combination C includes an unstructured preset query statement c1 and structured query information c2. The first candidate query combination includes an unstructured preset query statement and structured query information of the preset query statement. The structured query information of the preset query statement refers to the information formed after the query statement that does not have a fixed format and structure is converted into a fixed format and structure.
[0094] A query combination may include an unstructured preset query statement and a structured query information.
[0095] Unstructured preset query statements refer to preset unstructured query statements. Unstructured query statements refer to query statements without a fixed format and structure. Unstructured query statements may include at least one of the following types: text, image, audio, and video. Unstructured target query statements refer to user query statements, which are query statements generated by users using natural language.
[0096] Unstructured query statements and structured query information are two different data forms. Structured query information refers to information with a fixed format and structure. Structured query information is a type of structured data, which can be data organized and stored in the form of tables or databases.
[0097] Specifically, the computer device may obtain an unstructured target query statement initiated by a user, and obtain a first candidate query combination.
[0098] The computer device may determine the domain to which the unstructured target query statement belongs, and determine to obtain a first candidate query combination corresponding to the domain to which the target query statement belongs.
[0099] In one embodiment, obtaining an unstructured target query statement includes:
[0100] An unstructured original query statement is obtained, and entities in the original query statement are extracted; the domain to which the original query statement belongs is determined, and semantic information of the entity in the domain to which the original query statement belongs is determined; based on the semantic information of the entity, the original query statement is rewritten to obtain an unstructured target query statement.
[0101] Entity refers to a word or phrase with descriptive meaning or specific meaning. Entity can usually be a person's name, place name, organization name, product name, or content with a certain meaning in a certain field, such as the name of a disease, drug, organism in the medical field, or a special word involved in law, but not limited to these.
[0102] The semantic information expressed by the target query is the same as the semantic information expressed by the original query. In other embodiments, the semantic information expressed by the target query is more than the semantic information expressed by the original query, so that the rewritten query is easier to understand.
[0103] In this embodiment, the context information of the entity in the original query statement may be determined, and the original query statement may be rewritten according to the semantic information and context information of the entity to obtain an unstructured target query statement.
[0104] By rewriting some query statements that contain professional terms or are prone to ambiguity into general expressions that can be understood by the public, the difficulty of understanding by computer devices can be reduced, thereby improving query accuracy.
[0105] In one of the embodiments, the method further includes: obtaining a structured data set, the structured data set including multiple metadata, each metadata may include a preset entity category and multiple preset entities belonging to the preset entity category; combining each metadata respectively to obtain multiple structured query information; obtaining multiple unstructured query templates, filling the multiple structured query information into each unstructured query template respectively, to obtain multiple unstructured query statements; combining each unstructured query statement with the structured query information filled in the unstructured query statement, to obtain multiple query combinations.
[0106] The metadata are combined, specifically, the preset entity categories in different metadata may be combined, or the preset entities of the preset entity categories in different metadata may be combined.
[0107] In other embodiments, each metadata may include a preset entity category, a plurality of sub-entity categories corresponding to the preset entity category, and a plurality of preset entities belonging to the sub-entity category.
[0108] Step S204: when the similarity between the target query statement and the preset query statement in the first candidate query combination satisfies the similarity condition, the target query statement is combined with the structured query information of the preset query statement that satisfies the similarity condition to obtain a second candidate query combination.
[0109] The similarity condition is a constraint condition on the similarity between the preset query statement selected according to the similarity condition and the target query statement.
[0110] The second candidate query combination includes at least one candidate query combination, and a query combination may include a target query statement and a structured query information.
[0111] Specifically, the computer device may obtain each preset query statement in the first candidate query combination, and respectively calculate the similarity between each preset query statement and the target query statement. The computer device obtains a similarity condition, selects similarities that meet the similarity condition from each similarity, determines a preset query statement corresponding to the selected similarity, and thus combines the structured query information of the preset query statement with the target query statement to obtain a second candidate query combination.
[0112] Step S206: determining the degree of match between the target query statement in the second candidate query combination and the structured query information.
[0113] The matching degree refers to the correlation between the target query statement and the structured query information.
[0114] Specifically, the second candidate query combination includes at least one candidate query combination, and for each query combination, the computer device calculates the matching degree between the target query statement in the query combination and the structured query information.
[0115] In this embodiment, the computer device can extract entities from the target query statement, determine the entity category to which the entity belongs, and generate structured query information for the target query statement based on the entity and the entity category. The computer device determines the degree of match between the structured query information of the target query statement and each structured query information in the second candidate query combination.
[0116] In other embodiments, the structured query information includes at least one entity and an entity category to which each entity belongs. The computer device may extract entities from the target query statement, determine the entity category to which the entities belong, determine the degree of match between the entities and the entity category to which the entities belong in the target query statement and the entities and the entity category to which the entities belong in the structured query information, and use the degree of match as the degree of match between the target query statement and the structured query information.
[0117] Step S208: Filter the target query combination from the second candidate query combination according to the matching degree.
[0118] Specifically, the computer device selects a target query combination that meets the matching condition from the second candidate query combination according to the matching degree, wherein the matching condition is a constraint condition on the matching degree between the structured query information selected according to the matching condition and the target query statement.
[0119] Step S210: perform information query according to the target query combination to obtain query results for the target query statement.
[0120] The query result is the reply information for the target query statement. The reply information may include description information corresponding to the structured information. For example, if the structured information includes an entity, the description information is information used to describe the entity.
[0121] Specifically, the computer device performs information query in the knowledge base according to the target query combination to obtain a query result for the target query statement.
[0122] In one embodiment, the information query method can be implemented through an information query model, and the computer device obtains an unstructured target query statement and inputs the unstructured target query statement into the information query model. The information query model automatically obtains a first candidate query combination from the knowledge base, and calculates the similarity between the target query statement and the preset query statement in the first candidate query combination. When the similarity between the target query statement and the preset query statement in the first candidate query combination meets the similarity condition, the information query model combines the target query statement with the structured query information of the preset query statement that meets the similarity condition to obtain a second candidate query combination. The information query model determines the matching degree between the target query statement and the structured query information in the second candidate query combination, and selects the target query combination from the second candidate query combination according to the matching degree. The information query model performs information query according to the target query combination to obtain a query result for the target query statement.
[0123] In one of the embodiments, the information query model includes a first information query model and a second information query model, and the knowledge base includes a first knowledge base and a second knowledge base.
[0124] In one embodiment, Figure 4 As shown, the similarity between the target query statement and the preset query statement in the first candidate query combination can be determined through the first information query model. When the similarity between the target query statement and the preset query statement in the first candidate query combination meets the similarity condition, the target query statement is combined with the structured query information of the preset query statement that meets the similarity condition through the first information query model to obtain a second candidate query combination. The matching degree between the target query statement and the structured query information in each second candidate query combination is determined through the first information query model, and the target query combination is screened from the second candidate query combination based on the matching degree. Through the first information query model, information query is performed according to the target query combination to obtain query results for the target query statement.
[0125] When the similarity between the target query statement and the preset query statement in the first candidate query combination meets the dissimilarity condition, structured query language information for the target query statement is generated through the second information query model, and information query is performed according to the generated structured query language information to obtain a query result for the target query statement.
[0126] In this embodiment, two question-answering models are provided. When the similarity between the target query statement and the preset query statement in the first candidate query combination meets the similarity condition, the first information query model is used to further filter out the structured query information matching the user's question, so that the filtered structured query information is more accurate, the query results are more in line with the user's intention, and the user's request can be responded to more quickly. When all preset query statements do not meet the conditions, the second information query model can be called to generate structured query language information in real time to achieve information query.
[0127] In one of the embodiments, when the similarity between the target query statement and the preset query statement in the first candidate query combination meets the dissimilarity condition, the structured query information in the first candidate query combination is generated into merged structured query information through the second information query model. Information query is performed according to the merged structured query information to obtain query results for the target query statement. In the case that the first information query model cannot solve the user's problem, the merged structured query language information can be generated in real time through the second information query model, and the merged structured query language information is generated based on multiple structured query information screened out by the first information query model, so that the merged structured query language information is more accurate, thereby making the information query more accurate.
[0128] In other embodiments, Figure 5 As shown, the first candidate query combination is stored in the first knowledge base, and the first information query model obtains the first candidate query combination from the first knowledge base. After obtaining the target query combination, the first information query model is used to perform information query in the second knowledge base according to the target query combination to obtain the query result for the target query statement. The second knowledge base is used to store structured information and description information corresponding to the structured information.
[0129] In this embodiment, by obtaining the user's unstructured target query statement and obtaining a pre-set first candidate query combination, the first candidate query combination includes an unstructured preset query statement and structured query information of the preset query statement, so that it is possible to query whether there is a statement consistent with or similar to the user query statement in the combination. When the similarity between the target query statement and the preset query statement in the first candidate query combination meets the similarity condition, it means that there is a query statement consistent with or similar to the user query statement in the first candidate query combination, and these preset query statements consistent with or similar to the user query statement are recalled by similarity. The preset query statement and the target query statement are combined to form a second candidate query combination, and the matching degree between the target query statement and the structured query information in the second candidate query combination is determined, and it is possible to perform a second screening according to the matching degree to screen the target query combination from the second candidate query combination, so that the structured query information with high relevance to the user query statement can be screened out by the matching degree. The screened structured query information is used as enhanced prompt information of the user query statement in the information query, so that a more accurate information query is performed according to the target query combination, so that a more accurate query result can be fed back to the user.
[0130] In one embodiment, when the similarity between the target query statement and the preset query statement in the first candidate query combination satisfies the similarity condition, the target query statement is combined with the structured query information of the preset query statement that satisfies the similarity condition to obtain a second candidate query combination, including:
[0131] Extracting semantic features of a target query statement and semantic features of a preset query statement; determining the similarity between the preset query statement and the target query statement based on the semantic features of the target query statement and the semantic features of the preset query statement; when the similarity between the target query statement and the preset query statement in the first candidate query combination satisfies a similarity condition, combining the target query statement with structured query information of the preset query statement that satisfies the similarity condition to obtain a second candidate query combination.
[0132] Specifically, the computer device may extract the semantic features of the target query and the semantic features of the preset query. The computer device determines the similarity between the preset query and the target query based on the semantic features of the target query and the semantic features of the preset query, and the similarity represents the semantic similarity between the preset query and the target query.
[0133] When the similarity between the target query statement and the preset query statements in the first candidate query combination meets the similarity condition, the structured query information from the preset query statements that meet the similarity condition is filtered, and the target query statement is combined with each filtered structured query information to obtain a second candidate query combination.
[0134] In this embodiment, the semantic features of the target query statement and the semantic features of the preset query statement are extracted to determine the semantic similarity between the preset query statement and the target query statement based on the semantic features, so that the preset questions that are most similar to the user questions can be preliminarily screened out according to the semantic similarity.
[0135] In one embodiment, determining the degree of match between the target query statement in the second candidate query combination and the structured query information includes:
[0136] Extract entities from the target query statement and determine the entity category to which the entity belongs; generate structured query information for the target query statement based on the semantic features, entities and entity categories of the target query statement;
[0137] The degree of match between the structured query information of the target query statement and the structured query information in the second candidate query combination is determined.
[0138] Specifically, the computer device identifies entities of the target query statement to extract entities in the target query statement. The entity category to which the entity belongs is determined, and structured query information for the target query statement is generated based on the semantic features, entities, and entity categories of the target query statement. The computer device determines the degree of match between the structured query information of the target query statement and the structured query information in the second candidate query combination.
[0139] In this embodiment, entities are extracted from the target query statement, and the entity category to which the entities belong is determined; structured query information for the target query statement is generated based on the semantic features, entities and entity categories of the target query statement. Structured query information with a fixed format and structure can be first reversely generated through the entities in the user's question and the categories to which the entities belong, and then the matching degree is calculated with the structured query information in the combination to ensure that the correlation between the two types of information is calculated under the same format and structure, so that the calculated matching degree is more accurate.
[0140] In one embodiment, the method further comprises:
[0141] When the similarity between the target query statement and the preset query statement in the first candidate query combination does not meet the similarity condition, the structured query information in the first candidate query combination is generated into merged structured query information; information query is performed according to the merged structured query information to obtain a query result for the target query statement.
[0142] Specifically, when the similarity between the target query statement and the preset query statement in the first candidate query combination does not meet the similarity condition, the computer device can generate merged structured query information based on the structured query information in the first candidate query combination. Further, the computer device obtains a preset number of structured query information according to the similarity, merges the preset number of structured query information, and obtains the merged structured query information. Figure 6 As shown, query combination A includes unstructured preset query statement a1 and structured query information a2, query combination B includes unstructured preset query statement b1 and structured query information b2, and query combination C includes unstructured preset query statement c1 and structured query information c2. When the similarity between the target query statement and the preset query statements a1, b1, c1 in query combinations A, B, and C does not meet the similarity condition, the structured query information a2, the structured query information b2, and c2 are merged to obtain merged structured query information.
[0143] In other embodiments, the combined structured query information may be generated based on the target query statement and the structured query information in the first candidate query combination. Alternatively, the structured query information for the target query statement may be generated, and the combined structured query information may be generated based on the structured query information of the target query statement and the structured query information in the first candidate query combination.
[0144] In this embodiment, when the similarity between the target query statement and the preset query statement in the first candidate query combination does not meet the similarity condition, the structured query information in the first candidate query combination is generated into a merged structured query information, so that when the similarity condition is not met, the query scope is reduced by merging the structured query information in multiple candidate query combinations, so that the query information is more specific, and thus information query is performed according to the more specific structured query information, and the query result for the target query statement can be effectively obtained. In addition, the merged structured query language information is generated based on multiple structured query information screened by the first information query model, so that the merged structured query language information is more detailed, more specific, and more accurate, effectively narrowing the query scope, thereby improving the accuracy of information query.
[0145] In one embodiment, information query is performed according to the combined structured query information to obtain query results for the target query statement, including:
[0146] When the similarity between the target query statement and the preset query statement in the first candidate query combination does not meet the similarity condition, extract the entity from the target query statement; filter the structured query information of the existing entity from the structured query information in the first candidate query combination; merge the structured query information of the existing entity to obtain the merged structured query information for the target query statement.
[0147] Specifically, the structured query information includes at least one entity and may also include at least one entity category to which the entity belongs. When the similarity between the target query statement and the preset query statement in the first candidate query combination does not meet the similarity condition, the entity is extracted from the target query statement. Each structured query information containing the entity is filtered from the structured query information in the first candidate query combination, and the structured query information containing the entity is merged to obtain the merged structured query information for the target query statement.
[0148] In this embodiment, when the similarity between the target query statement and the preset query statement in the first candidate query combination does not meet the similarity condition, the entity is extracted from the target query statement; the entity category to which the entity belongs is determined, and the structured query information of the existing entity is filtered from the structured query information in the first candidate query combination, and the structured query information of the existing entity category is filtered; the structured query information of the existing entity and the structured query information of the existing entity category are merged to obtain the merged structured query information for the target query statement. The generated merged structured query information contains all entities and entity categories in the target query statement, so the merged structured query information is more accurate and specific, can narrow the query scope, and improve the query accuracy and efficiency.
[0149] In other embodiments, the computer device may determine the entity category, filter each structured query information having the entity category from the structured query information in the first candidate query combination, merge the structured query information having the entity category, and obtain merged structured query information for the target query statement.
[0150] In this embodiment, when the similarity between the target query statement and the preset query statement in the first candidate query combination does not meet the similarity condition, the entity is extracted from the target query statement, and the structured query information containing the entity is screened out from the structured query information in the first candidate query combination and merged. The obtained merged structured query information includes all the entities in the target query statement, making the merged structured query information more accurate. Using the merged structured query information for information query helps to improve the accuracy and efficiency of information query.
[0151] In one embodiment, the method further comprises:
[0152] When the similarity between the target query statement and the preset query statement in the first candidate query combination does not meet the similarity condition, extract the entity from the target query statement; determine the entity category to which the entity belongs, and determine the query intent of the target query statement; based on the query intent and the entity category, generate structured query information for the target query statement; perform information query based on the structured query information of the target query statement to obtain a query result for the target query statement.
[0153] Specifically, when the similarity between the target query statement and the preset query statement in the first candidate query combination does not meet the similarity condition, an entity is extracted from the target query statement, and the entity category to which the entity belongs is determined. The semantic features of the target query statement are extracted, and the query intent of the target query statement is determined based on the semantic features. The query intent is used to characterize the intent of the target query statement.
[0154] In other embodiments, the intent of the target query statement may be determined based on the semantic information of the entity, or the intent of the target query statement may be determined based on the semantic information of the entity and the entity category.
[0155] The computer device generates structured query information for the target query statement based on the query intent and entity category. Further, the computer device can also generate structured query information for the target query statement based on the entity, query intent and entity category.
[0156] Information query is performed according to the structured query information of the target query statement to obtain query results for the target query statement.
[0157] In this embodiment, structured query information for a target query statement is generated based on query intent and entity categories, including: filtering structured query information of existing entities from the structured query information in the first candidate query combination; and generating structured query information for the target query statement based on query intent, entity categories, and structured query information of existing entities.
[0158] In this embodiment, when the similarity between the target query statement and the preset query statement in the first candidate query combination does not meet the similarity condition, the entity is extracted from the target query statement, the entity category to which the entity belongs is determined, and the query intent of the target query statement is determined, so that when none of the preset query statements meet the similarity condition, the entity in the user's question is extracted, and structured query information is generated in real time according to the category of the entity and the user's query intent, so that when the preset query statement and the corresponding structured query information are unavailable, relatively accurate data query can still be achieved.
[0159] In one embodiment, obtaining a first candidate query combination and an unstructured target query statement includes: obtaining an unstructured target query statement, determining a target domain to which the target query statement belongs; determining a first knowledge base corresponding to the target domain, and obtaining a first candidate query combination from the first knowledge base;
[0160] Performing information query according to the target query combination to obtain query results for the target query statement includes: performing information query in a second knowledge base corresponding to the target field according to the target query combination to obtain query results for the target query statement.
[0161] Specifically, the computer device obtains an unstructured target query statement and determines the target domain to which the target query statement belongs. The target domain corresponds to two knowledge bases, namely a first knowledge base and a second knowledge base. The first knowledge base is used to store query combinations, which include unstructured preset query statements and structured query information of the preset query statements. The second knowledge base is used to store structured query information and reply information corresponding to the structured query information.
[0162] The computer device may obtain multiple query combinations from the first knowledge base and use the multiple query combinations as first candidate query combinations, determine the matching degree between the target query statement in the second candidate query combination and the structured query information, and select the target query combination from the second candidate query combination according to the matching degree.
[0163] The computer device determines a second knowledge base corresponding to the target field, performs information query in the second knowledge base according to the target query combination, obtains reply information in the second knowledge base corresponding to the structured query information in the target query combination, and uses the reply information as the query result of the target query statement.
[0164] In this embodiment, after the reply information is obtained, the reply information and the structured query information can be used as the query result of the target query statement.
[0165] In one embodiment, the target query combination further includes a jump link pointing to a second knowledge base. According to the target query combination, information query is performed in the second knowledge base corresponding to the target field to obtain a query result for the target query statement, including:
[0166] A jump link is obtained from the target query combination, and based on the jump link, the second knowledge base corresponding to the target field is jumped to. Information query is performed in the second knowledge base corresponding to the target field to obtain the query result for the target query statement. Through the jump link, the second knowledge base can be directly jumped to for data query, and the location of the query result can be quickly located, thereby improving the speed of information query.
[0167] In other embodiments, a jump link of the second knowledge base may be set for the structured information in the first candidate query combination, and when the structured information is combined with the target query statement, the jump link is also carried.
[0168] In this embodiment, two knowledge bases can be constructed for one field, and one knowledge base is used to store query combinations to filter out the most matching structured query information. The other knowledge base is used to store the reply information corresponding to the structured query information to perform related queries in combination with the specific field of the user query statement. The query statement and the structured query information are screened in the first knowledge base. After the target query combination is obtained after two screenings, the information query is performed in the second knowledge base corresponding to the target field according to the target query combination, and the query results of the user query statement in the target field can be obtained. In addition, the structured query information obtained after two screenings is used as an enhanced representation of the user query statement, and the use of the enhanced representation for data query can improve the accuracy of the query.
[0169] In one embodiment, the method further comprises:
[0170] A structured data set is obtained, the structured data set includes multiple preset entities; each preset entity is combined respectively to obtain multiple structured query information; multiple unstructured query templates are obtained, and the multiple structured query information is filled into each unstructured query template respectively to obtain multiple unstructured preset query statements; each preset query statement and the structured query information filled in the preset query statement are combined to obtain multiple query combinations.
[0171] The structured data set includes a plurality of metadata, and the metadata includes a preset entity category, a sub-entity category corresponding to the preset entity category, and an entity corresponding to each sub-entity category.
[0172] Specifically, the computer device obtains a structured data set, the structured data set includes multiple preset entities, and combines each preset entity to obtain multiple structured query information. A plurality of unstructured query templates are obtained, and for each structured query information, the structured query information is filled into each unstructured query template to obtain multiple unstructured preset query statements. Each preset query statement and the structured query information filled in the preset query statement are combined to obtain multiple query combinations.
[0173] like Figure 7As shown, the structured data set includes multiple preset entity categories, and each entity category has multiple preset entities. For example, multiple entity categories can be indicators, dimensions, etc., and the enumeration objects under the entity categories are preset entities. In the field of video query, 310 indicators and 675 dimensions are stored in the knowledge base. The indicator can be daily active users, and the dimension can be gender, whether it is a member, content format, etc. Whether it is a member can be specifically divided into members and non-members. Content format refers to the format of video content, which can be divided into long videos, short videos, etc. When the dimension is gender, the enumeration information can be male, female, etc., that is, the preset entities are male and female, and the entity category is dimension.
[0174] By combining these indicators and dimensions, 165 structured query information can be obtained, for example, the structured query information is "Indicator: daily active users; Dimension: Gender (enumeration: female)", "Indicator: daily active users; Dimension: content format (enumeration: long video)".
[0175] When there are 132 unstructured query templates, 43.25 million unstructured query statements can be generated. For example, when the query template is "Please help me analyze the [metric] of [enumeration]", the structured query information "metric: daily active users; dimension: gender (enumeration: female)" is filled into the query template, and the unstructured query statement obtained is "Please help me analyze the female daily active users".
[0176] For example, when the query template is "Which [enumeration] has the most [metric]?", the structured query information "metric: daily active users; dimension: content format (enumeration: long video)" is filled into the query template, and the unstructured query statement obtained is "Which long video has the most daily active users?"
[0177] In this embodiment, a structured data set corresponding to the target domain is obtained, and the structured data set includes multiple preset entities in the target domain. The preset entities are combined respectively to obtain multiple structured query information. An unstructured query template corresponding to the target domain is obtained, and for each structured query information, the structured query information is filled into each unstructured query template to obtain multiple unstructured preset query statements. For each unstructured preset query statement, the preset query statement and the structured query information in the preset query statement are combined to obtain a query combination.
[0178] In one embodiment, the structured data set includes a plurality of preset entities obtained from a second knowledge base. A first knowledge base corresponding to the second knowledge base is constructed, and after the query combination is generated, the query combination is stored in the first knowledge base.
[0179] In this embodiment, the first knowledge base and the second knowledge base can jump to each other, that is, it is possible to jump from the first knowledge base to the second knowledge base, and it is also possible to jump from the second knowledge base to the first knowledge base.
[0180] In this embodiment, a jump address of the second knowledge base can be generated, and the adjustment address can be added to each query combination in the first knowledge base, so that no matter which query combination in the first knowledge base is obtained, it is possible to quickly jump to the second knowledge base for data query.
[0181] In this embodiment, a structured data set is obtained, and the structured data set includes multiple preset entities; each preset entity is combined to obtain multiple structured query information, and multiple unstructured query templates are obtained. The multiple structured query information is filled into each unstructured query template to obtain multiple unstructured preset query statements, so that each structured query information with a fixed format and structure can be converted into a user query statement without a fixed format and structure, so as to be closer to the user's general expression. Each preset query statement and the structured query information filled in the preset query statement are combined to obtain multiple query combinations, so that query statements similar to or consistent with the user's query statement can be quickly found through the query combination, so as to quickly find the structured query information that best matches the user's query statement.
[0182] In one embodiment, Figure 8 As shown, a method for processing an information query model is provided, and the method is applied to Figure 1 The computer device in Figure 1 The following steps are taken as an example:
[0183] Step S802: obtaining a first candidate query combination sample and an unstructured target query sentence sample, wherein the first candidate query combination sample includes an unstructured preset query sentence sample and a structured query information sample of the preset query sentence sample.
[0184] The first candidate query combination sample is a sample used in the training process of the information query model.
[0185] The first candidate query combination sample includes at least one candidate query combination.
[0186] Specifically, the computer device may obtain historical unstructured target query sentences as training samples, and obtain a first candidate query combination sample.
[0187] In this embodiment, an unstructured original query statement sample can be obtained, entities in the original query statement can be extracted, the field to which the original query statement belongs can be determined, and the semantic information of the entity in the field to which the original query statement belongs can be determined. Based on the semantic information of the entity, the original query statement sample can be rewritten to obtain an unstructured target query statement sample.
[0188] Step S804, when the similarity between the target query statement sample and the preset query statement sample in the first candidate query combination sample meets the sample similarity condition, the sample target query statement is combined with the structured query information sample of the preset query statement sample that meets the sample similarity condition to obtain a second candidate query combination sample.
[0189] The sample similarity condition is a constraint condition on the similarity between the preset query statement sample and the target query statement sample selected according to the similarity condition.
[0190] The second candidate query combination sample includes at least one candidate query combination, and a query combination may include a target query sentence sample and a structured query information sample.
[0191] Specifically, the computer device may obtain each preset query statement sample in the first candidate query combination, and respectively calculate the similarity between each preset query statement sample and the target query statement sample. The computer device obtains the sample similarity condition, selects the similarity that satisfies the sample similarity condition from each similarity, determines the preset query statement sample corresponding to the selected similarity, and thus combines the structured query information sample of the preset query statement sample with the target query statement sample to obtain the second candidate query combination sample.
[0192] Step S806: Determine the sample matching degree between the target query statement sample and the structured query information sample in the second candidate query combination sample.
[0193] The sample matching degree refers to the correlation between the target query statement sample and the structured query information sample.
[0194] Specifically, the second candidate query combination sample includes at least one candidate query combination, and for each query combination, the computer device calculates the matching degree between the target query statement sample and the structured query information sample in the query combination.
[0195] Step S808: Filter the target query combination sample from the second candidate query combination samples according to the sample matching degree.
[0196] Specifically, the computer device selects the target query combination sample that meets the sample matching condition from the second candidate query combination sample according to the sample matching degree. The sample matching condition is a constraint condition on the matching degree between the structured query information sample selected according to the sample matching condition and the target query statement sample.
[0197] Step S810: perform information query according to the target query combination sample to obtain a predicted query result for the target query statement sample.
[0198] Specifically, the computer device performs information query in the knowledge base according to the target query combination sample to obtain the predicted query result for the target query statement sample.
[0199] Step S812, obtaining expected query results for the target query statement sample, performing model training based on the predicted query results and the expected query results, and obtaining an information query model.
[0200] The predicted query result is the query result for the target query sentence sample predicted by the model during the training process. The expected query result is the actual query result of the target query sentence sample during the training process, and is the query result that the model is expected to feedback.
[0201] Specifically, the computer device obtains the expected query result for the target query statement sample, and determines the query loss between the predicted query result and the expected query result. The query loss represents the difference between the expected query result and the predicted query result. Model training is performed based on the predicted query result and the expected query result to obtain an information query model.
[0202] It is understandable that the processing of each step in the information query model processing method is the same as the processing of each step in the information query method. The specific processing process of each step in the information query model processing method can refer to the specific processing process of each step in the information query method.
[0203] In this embodiment, a first candidate query combination sample and an unstructured target query sample are obtained, and the first candidate query combination sample includes an unstructured preset query sample and a structured query information sample of the preset query sample, so that it is possible to query whether there is a query sample that is consistent or similar to the user query in the combination sample. When the similarity between the target query sample and the preset query sample in the first candidate query combination sample meets the sample similarity condition, it means that there is a query sample that is consistent or similar to the user query in the first candidate query combination sample, and these preset query samples that are consistent or similar to the user query are recalled by similarity. The preset query sample and the target query sample are combined to form a second candidate query combination sample, and the matching degree between the target query sample and the structured query information sample in the second candidate query combination sample is determined, and it is possible to perform a second screening according to the matching degree to screen the target query combination sample from the second candidate query combination sample, so that the structured query information with high relevance to the user query can be screened out by the matching degree. The screened structured query information is used as enhanced prompt information of the user query in the information query, so that a more accurate information query is performed according to the target query combination, and the query result predicted by the model is obtained. Obtaining the expected query results for the target query statement sample and conducting model training based on the predicted query results and the expected query results can gradually reduce the difference between the query results predicted by the model and the actual query results to improve the accuracy of the model, so that the information query model finally obtained can accurately screen out preset query statements that are similar or consistent with the user query statements, and can accurately and quickly screen out the structured information most relevant to the user query statement from the existing structured query information to conduct information query, thereby improving the accuracy of information query.
[0204] In one embodiment, the method further comprises:
[0205] Obtaining expected structured query information for a target query sentence sample, and determining a structured loss between the expected structured query information and a structured query information sample in the target query combination sample;
[0206] Model training is performed based on the predicted query results and the expected query results to obtain an information query model, including: determining the query loss between the predicted query results and the expected query results; and model training is performed based on the structured loss and the query loss to obtain the information query model.
[0207] Among them, the structured query information samples in the target query combination samples are structured query information samples predicted by the model during the training process for the target query sentence samples.
[0208] The expected structured query information is the structured query information that best matches the target query sentence sample during the training process, and is the structured query information that the expected model can filter out based on the matching degree.
[0209] The structured loss characterizes the difference between the expected structured query information and the structured query information samples in the target query combination samples.
[0210] Specifically, the computer device may obtain expected structured query information for the target query sentence sample, and determine the structured loss between the expected structured query information and the structured query information sample in the target query combination sample.
[0211] The computer device determines the prediction loss between the predicted query result and the expected query result, performs model training based on the structured loss and the prediction loss, and obtains the information query model.
[0212] In this embodiment, the computer device obtains a preset loss function, determines a target loss based on the preset loss function, the structured loss, and the predicted loss, performs model training based on the target loss, and obtains an information query model.
[0213] In this embodiment, the expected structured query information for the target query statement sample is obtained, and the structured loss between the expected structured query information and the structured query information sample in the target query combination sample is determined, so that the difference between the structured query information sample screened out by the model for the target query statement sample and the structured query information screened out by the expected model during the model training process can be calculated. The prediction loss between the predicted query result and the expected query result is determined to determine the difference between the result queried by the model for the target query statement sample and the result queried by the expected model during the model training process. Model training is performed based on the structured loss and the prediction loss to gradually reduce the structured loss and the prediction loss during training, so that the information query model finally obtained can accurately screen out preset query statements that are similar or consistent with the user query statement, and can accurately and quickly screen out the structured information most relevant to the user query statement from the existing structured query information to perform information query, thereby improving the accuracy of information query.
[0214] In one embodiment, an information query method is provided, which is applied to a computer device and includes:
[0215] Obtain an unstructured target query statement and determine the target domain to which the target query statement belongs;
[0216] Determine a first knowledge base corresponding to the target field, and obtain a first candidate query combination from the first knowledge base, where the first candidate query combination includes an unstructured preset query statement and structured query information of the preset query statement;
[0217] Extracting semantic features of the target query statement and semantic features of the preset query statement;
[0218] Determining the similarity between the preset query statement and the target query statement based on the semantic features of the target query statement and the semantic features of the preset query statement;
[0219] When the similarity between the target query statement and the preset query statement in the first candidate query combination satisfies the similarity condition, the target query statement is combined with the structured query information of the preset query statement that satisfies the similarity condition to obtain a second candidate query combination.
[0220] Extract entities from the target query sentence and determine the entity category to which the entity belongs;
[0221] Generate structured query information for the target query statement based on the semantic features, entities and entity categories of the target query statement;
[0222] Determine the degree of match between the structured query information of the target query statement and the structured query information in the second candidate query combination.
[0223] According to the matching degree, a target query combination is screened from the second candidate query combination; according to the target query combination, information query is performed in the second knowledge base corresponding to the target field to obtain a query result for the target query statement.
[0224] Optionally, when the similarity between the target query statement and the preset query statement in the first candidate query combination does not meet the similarity condition, extract the entity from the target query statement; filter the structured query information of the existing entity from the structured query information in the first candidate query combination; merge the structured query information of the existing entity to obtain merged structured query information for the target query statement; perform information query in the second knowledge base according to the merged structured query information to obtain the query result for the target query statement.
[0225] In one embodiment, an application scenario of an information query method is provided. In this application scenario, Fig. 9 and Fig.10 As shown, the information query method provides the information query application with the ability to find structured query information in the target domain, so that the user can interact with the information query application through natural language, thereby querying the structured query information that best matches the user's query statement from the massive amount of domain structured query information, and performing data query according to the structured query information to obtain reply information for the user's query statement, and finally presenting the reply information to the user as a query result.
[0226] like Fig.11The figure shows the architecture of the information query method in this application scenario, which includes the following parts:
[0227] Construction of the first knowledge base: Parse the metadata of the target field, and annotate and classify it to support more refined matching, thereby improving the quality of the generated unstructured query statements. Metadata may include entities, readable gender-specific annotations of entities, entity categories and tags to which entities belong, etc. Among them, readable gender-specific annotations of metadata refer to rewriting the professional terms in the target field into expressions that are understandable to the public, for example, DAU is changed to daily active users. Metadata tags, for example, attribute information such as whether the current data is a finite enumeration value or an infinite enumeration value. Entities in metadata and the entity categories to which entities belong can constitute structured query information.
[0228] Next, the metadata of the target domain is traversed, and the metadata is combined to generate all possible combinations. During the generation process, the validity of the combination can be checked, specifically, whether there is an associated binding relationship between the metadata, and whether the query combination form is executable online, etc., to ensure that the generated query combination has practical significance.
[0229] Metadata can include indicators, dimensions, enumeration values, etc. For example, the metadata is "Indicator: Daily Active Users; Dimension: Gender (Enumeration: Female)". Binding relationships between metadata are pre-set, for example, which metadata a metadata can be combined with, and two metadata with a binding relationship can be combined.
[0230] At the same time, combined with actual business scenarios, multiple unstructured query templates can be manually constructed, and each slot in the unstructured query template can be specifically annotated, which can be linked with the annotation information of private domain knowledge to support more refined matching and improve the quality of generated results. Slot annotation will distinguish the required entities from the corresponding labels, and further support custom filtering conditions for label filtering. The query template is a template for generating unstructured query statements. Multiple combinations are filled into a query template to obtain multiple unstructured query statements. The unstructured query statement and the filled structured query information are spliced to form an unstructured query sample and stored in the offline knowledge base.
[0231] Finally, based on the annotation information of the metadata and the template annotation information in the template library, the metadata and the template are combined in pairs to generate a large number of query combinations. A query combination includes an unstructured query statement and structured query information of the query statement. These query combinations are stored in the first knowledge base, that is, the query statements in the first knowledge base are preset query statements.
[0232] Perform information query based on user query statements, such as Fig.12As shown, it includes query statement rewriting, query statement filtering, structured query information filtering and information query:
[0233] Query statement rewriting: The policy rewriting layer can rewrite the user's unstructured query statements to a certain extent through a series of specific policies, reducing the difficulty of the model's understanding of unstructured query statements in specific fields. Specifically, it may include:
[0234] Dynamically introduce external knowledge bases to identify specific entities. For example, introduce a knowledge base of popular TV series and expand the popular TV series in unstructured query statements with quotation marks.
[0235] Introduce private domain knowledge to rewrite specific expressions in a general way. For example, rewrite user query statements with professional terms into more understandable unstructured query statements. Repair the fluency of user query statements. For example, remove duplicate words when abnormal reduplication occurs.
[0236] Query statement screening: Since the amount of data in the first knowledge base may be huge, it is necessary to first screen out preset query statements that are similar or consistent with the user's query statement from all preset query statements in the first knowledge base through recall.
[0237] Specifically, according to the user query, the preset query in the first knowledge base can be retrieved using the BM25 model, TF-IDF, Jaccard similarity coefficient, etc., to complete a round of rapid screening, and filter out most of the irrelevant preset query statements, so that the massive query statements and structured query information can be quickly reduced to hundreds of levels, so as to provide the downstream sorting layer with the most matching structured query information. Each filtered preset query statement is combined with the user query statement and input into the sorting layer.
[0238] Structured query information filtering can be achieved through the sorting layer: a more refined search is performed based on the recalled preset query statements to find the structured query information that best matches the user's query statement.
[0239] Information query: After filtering out the structured query information that best matches the user's query statement, use the best matching structured query information to query the knowledge base to obtain the query results.
[0240] During the model training process, a sorting model can be trained using PLM, BERT, GPT and other models to complete this task.
[0241] Construct model input samples: The input sample is a query combination sample in the first candidate query combination sample. The structured query information is converted into a specific unstructured query statement (hereinafter referred to as a preset query statement sample), and then the preset query statement sample is spliced with the structured query information sample as the input sample of the model. The preset query statement sample in the input sample is distinguished from the structured query information sample by using special identifiers, and different information is marked with different identifiers to assist the model in better locating key information, reducing the model understanding cost and improving the model performance.
[0242] For example, the preset query statement sample and the structured query information sample can be separated by a special identifier [SEP]. Secondly, when converting the structured query information sample into an unstructured preset query statement sample, a special identifier will also be used to distinguish, that is, the preset query statement sample and the structured query information sample are divided by the identifier. For example: [metric] and [dim] are used as identifiers of different entity categories, the entity category represented by [metric] is a metric, and the entity category represented by [dim] is a dimension. In the query combination sample "How many male DAUs are there today [SEP][metric] DAU[dim] gender", the preset query statement sample is "How many male DAUs are there today", and the structured query information sample is "[metric] DAU [dim] gender", and [metric] indicates that the entity category to which the identified "DAU" belongs is a metric, and [dim] indicates that the entity category to which the identified "gender" belongs is a dimension.
[0243] In the model, the model mainly calculates the correlation between the preset query statement samples and the structured query information samples in the input samples, sorts them according to the correlation, screens out the structured query information samples with the highest correlation, and locates the reply information corresponding to the structured query information sample with the highest correlation from the second knowledge base and returns it to the user as the query result.
[0244] Among them, sample labels are also needed in the model training process. The sample labels are used to characterize whether the preset query statement samples and structured query information in the combined sample are related.
[0245] In terms of model selection, you can choose to use an interactive model architecture, such as a cross encoder-like architecture. Through comparative experiments, it is determined that this model architecture can better learn the correlation between the preset query statements and the user query statements, and better determine whether the structured query information is related to the user query statement. At the same time, through experiments, it is also observed that this model architecture has strong robustness and a certain generalization ability, and can cope with situations that did not occur during the training process.
[0246] The loss function used in model training can be a triplet loss function, such as BatchAll Triplet Loss, BatchHardSoftMarginTripletLoss, etc.
[0247] In this embodiment, the computer device can continuously collect the interaction data between the user and the search application, and continuously optimize the model performance through incremental learning, so that it can better and continuously adjust to the query needs in the actual application scenario. For example, the query results that the user is satisfied with can be used as positive samples, and the query results that the user is not satisfied with can be used as negative samples, and the current model can be mixed with the training samples in a certain proportion to continue training, so that the model can quickly learn new knowledge while maintaining the original ability, thereby providing a sustainable and iterative solution for domain structured knowledge retrieval.
[0248] The information query method of this embodiment can quickly and inexpensively convert structured domain knowledge into a large amount of high-quality unstructured knowledge, can solve the problem of data cold start, and provide strong support for downstream applications, thereby significantly improving the accuracy of the overall process.
[0249] In addition, it can give artificial intelligence the ability to retrieve structured knowledge that matches the current user query statement from the knowledge base. This ability significantly improves the accuracy of the process and user satisfaction in actual application scenarios. After testing, this method can effectively handle up to 36% of actual online problems while maintaining a high accuracy rate of 95%.
[0250] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0251] Based on the same inventive concept, the embodiment of the present application also provides an information query device for implementing the above-mentioned information query method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more information query device embodiments provided below can refer to the limitations on the information query method above, and will not be repeated here.
[0252] In one embodiment, Fig.13 As shown, an information query device 1300 is provided, including:
[0253] The acquisition module 1302 is used to acquire a first candidate query combination and an unstructured target query statement, where the first candidate query combination includes an unstructured preset query statement and structured query information of the preset query statement.
[0254] The combining module 1304 is configured to combine the target query statement with the structured query information of the preset query statement that meets the similarity condition to obtain a second candidate query combination when the similarity between the target query statement and the preset query statement in the first candidate query combination meets the similarity condition.
[0255] The determination module 1306 is used to determine the matching degree between the target query statement in the second candidate query combination and the structured query information.
[0256] The screening module 1308 is used to screen the target query combination from the second candidate query combination according to the matching degree.
[0257] The query module 1310 is used to perform information query according to the target query combination and obtain query results for the target query statement.
[0258] In one embodiment, the combination module 1304 is also used to extract semantic features of the target query statement and the semantic features of the preset query statement; determine the similarity between the preset query statement and the target query statement based on the semantic features of the target query statement and the semantic features of the preset query statement; when the similarity between the target query statement and the preset query statement in the first candidate query combination meets the similarity condition, combine the target query statement with the structured query information of the preset query statement that meets the similarity condition to obtain a second candidate query combination.
[0259] In one embodiment, the determination module 1306 is also used to extract entities from the target query statement and determine the entity category to which the entity belongs; generate structured query information for the target query statement based on the semantic features, entities and entity categories of the target query statement; and determine the degree of match between the structured query information of the target query statement and the structured query information in the second candidate query combination.
[0260] In one embodiment, the apparatus further comprises:
[0261] The generating module is used to generate merged structured query information from the structured query information in the first candidate query combination when the similarity between the target query statement and the preset query statement in the first candidate query combination does not meet the similarity condition.
[0262] The query module 1310 is further used to perform information query according to the combined structured query information to obtain query results for the target query statement.
[0263] In one embodiment, the query module 1310 is also used to extract entities from the target query statement when the similarity between the target query statement and the preset query statement in the first candidate query combination does not meet the similarity condition; filter the structured query information of the existing entities from the structured query information in the first candidate query combination; merge the structured query information of the existing entities to obtain merged structured query information for the target query statement.
[0264] In one embodiment, the apparatus further comprises:
[0265] A generation module, configured to extract an entity from the target query statement when the similarity between the target query statement and the preset query statement in the first candidate query combination does not satisfy a similarity condition; determine the entity category to which the entity belongs, and determine the query intent of the target query statement; generate structured query information for the target query statement based on the query intent and the entity category;
[0266] The query module 1310 is further used to perform information query according to the structured query information of the target query statement to obtain a query result for the target query statement.
[0267] In one embodiment, the acquisition module 1302 is used to acquire an unstructured target query statement, determine the target domain to which the target query statement belongs; determine a first knowledge base corresponding to the target domain, and acquire a first candidate query combination from the first knowledge base; perform information query according to the target query combination to obtain a query result for the target query statement, including: perform information query in a second knowledge base corresponding to the target domain according to the target query combination to obtain a query result for the target query statement.
[0268] In one embodiment, the apparatus further comprises:
[0269] The query combination generation module is used to obtain a structured data set, which includes multiple preset entities; respectively combine the preset entities to obtain multiple structured query information; obtain multiple unstructured query templates, fill the multiple structured query information into each unstructured query template respectively, and obtain multiple unstructured query statements; combine each unstructured query statement with the structured query information filled in the unstructured query statement to obtain multiple candidate query combinations.
[0270] Based on the same inventive concept, the embodiment of the present application also provides an information query model processing device for implementing the information query model processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more information query model processing device embodiments provided below can refer to the limitations on the information query model processing method above, and will not be repeated here.
[0271] In one embodiment, Fig.14 As shown, an information query model processing device 1400 is provided, comprising:
[0272] The sample acquisition module 1402 is used to acquire a first candidate query combination sample and an unstructured target query statement sample. The first candidate query combination sample includes an unstructured preset query statement sample and a structured query information sample of the preset query statement sample.
[0273] The sample combination module 1404 is used to combine the target query statement sample with the structured query information sample of the preset query statement sample that meets the sample similarity condition to obtain a second candidate query combination sample when the similarity between the target query statement sample and the preset query statement sample in the first candidate query combination sample meets the sample similarity condition.
[0274] The sample determination module 1406 is used to determine the sample matching degree between the target query statement sample and the structured query information sample in the second candidate query combination sample.
[0275] The sample screening module 1408 is used to screen the target query combination sample from the second candidate query combination samples according to the sample matching degree.
[0276] The sample query module 1410 is used to perform information query according to the target query combination sample to obtain the predicted query result for the target query statement sample.
[0277] The training module 1412 is used to obtain the expected query results for the target query statement sample, perform model training based on the predicted query results and the expected query results, and obtain an information query model.
[0278] In one embodiment, the training module 1412 is also used to obtain expected structured query information for the target query statement sample, determine the structured loss between the expected structured query information and the structured query information sample in the target query combination sample; determine the prediction loss between the predicted query result and the expected query result; perform model training based on the structured loss and the prediction loss to obtain an information query model.
[0279] Each module in the above-mentioned information query device and information query model processing device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0280] In one embodiment, a computer device is provided, which may be a terminal or a server. Taking a terminal as an example, its internal structure diagram may be as follows: Fig.15 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an information query method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.
[0281] Those skilled in the art will understand that Fig.15 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0282] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0283] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0284] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0285] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0286] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0287] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0288] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An information query method, characterized in that: The method comprises: Acquire a first candidate query combination and an unstructured target query statement, wherein the first candidate query combination includes an unstructured preset query statement and structured query information of the preset query statement; When the similarity between the target query statement and the preset query statement in the first candidate query combination satisfies a similarity condition, combining the target query statement with the structured query information of the preset query statement that satisfies the similarity condition to obtain a second candidate query combination; Determining a degree of match between a target query statement and structured query information in the second candidate query combination; According to the matching degree, selecting a target query combination from the second candidate query combination; Information query is performed according to the target query combination to obtain query results for the target query statement.
2. The method according to claim 1, characterized in that When the similarity between the target query statement and the preset query statement in the first candidate query combination satisfies a similarity condition, combining the target query statement with the structured query information of the preset query statement that satisfies the similarity condition to obtain a second candidate query combination, including: Extracting semantic features of the target query statement and semantic features of the preset query statement; Determining the similarity between the preset query statement and the target query statement according to the semantic features of the target query statement and the semantic features of the preset query statement; When the similarity between the target query statement and the preset query statement in the first candidate query combination meets the similarity condition, the target query statement is combined with the structured query information of the preset query statement that meets the similarity condition to obtain a second candidate query combination.
3. The method according to claim 2, characterized in that The determining the matching degree between the target query statement in the second candidate query combination and the structured query information includes: Extracting entities from the target query statement and determining the entity category to which the entities belong; Generate structured query information for the target query statement based on the semantic features of the target query statement, the entity, and the entity category; Determine a degree of match between the structured query information of the target query statement and the structured query information in the second candidate query combination.
4. The method according to claim 1, characterized in that: The method further comprises: When the similarity between the target query statement and the preset query statement in the first candidate query combination does not meet the similarity condition, generating merged structured query information from the structured query information in the first candidate query combination; Information query is performed according to the combined structured query information to obtain query results for the target query statement.
5. The method according to claim 4, characterized in that The performing information query according to the combined structured query information to obtain a query result for the target query statement includes: When the similarity between the target query statement and the preset query statement in the first candidate query combination does not meet the similarity condition, extracting entities from the target query statement; Filtering structured query information containing the entity from the structured query information in the first candidate query combination; The structured query information existing in the entity is merged to obtain merged structured query information for the target query statement.
6. The method according to claim 1, characterized in that The method further comprises: When the similarity between the target query statement and the preset query statement in the first candidate query combination does not meet the similarity condition, extracting entities from the target query statement; Determine the entity category to which the entity belongs, and determine the query intent of the target query statement; Based on the query intent and the entity category, generating structured query information for the target query statement; An information query is performed according to the structured query information of the target query statement to obtain a query result for the target query statement.
7. The method according to claim 1, characterized in that The step of obtaining the first candidate query combination and the unstructured target query statement includes: Acquire an unstructured target query statement, and determine the target domain to which the target query statement belongs; Determine a first knowledge base corresponding to the target field, and obtain a first candidate query combination from the first knowledge base; The performing of information query according to the target query combination to obtain a query result for the target query statement includes: According to the target query combination, information query is performed in the second knowledge base corresponding to the target field to obtain a query result for the target query statement.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: Acquire a structured data set, wherein the structured data set includes a plurality of preset entities; Combining the preset entities respectively to obtain multiple structured query information; Acquire multiple unstructured query templates, and fill the multiple structured query information into each of the unstructured query templates to obtain multiple unstructured preset query statements; Each of the preset query statements and the structured query information filled in the preset query statement are combined to obtain multiple query combinations.
9. A method for processing an information query model, characterized in that: The method comprises: Acquire a first candidate query combination sample and an unstructured target query statement sample, wherein the first candidate query combination sample includes an unstructured preset query statement sample and a structured query information sample of the preset query statement sample; When the similarity between the target query sentence sample and the preset query sentence sample in the first candidate query combination sample satisfies the sample similarity condition, combining the target query sentence sample with the structured query information sample of the preset query sentence sample that satisfies the sample similarity condition to obtain a second candidate query combination sample; Determining a sample matching degree between a target query statement sample and a structured query information sample in the second candidate query combination sample; According to the sample matching degree, selecting a target query combination sample from the second candidate query combination samples; Performing information query according to the target query combination sample to obtain a predicted query result for the target query statement sample; An expected query result for the target query statement sample is obtained, and model training is performed based on the predicted query result and the expected query result to obtain an information query model.
10. The method according to claim 9, characterized in that The method further comprises: Acquire expected structured query information for the target query sentence sample, and determine the structured loss between the expected structured query information and the structured query information sample in the target query combination sample; The performing model training based on the predicted query result and the expected query result to obtain the information query model includes: determining a query loss between the predicted query result and the expected query result; Model training is performed based on the structured loss and the query loss to obtain an information query model.
11. An information query device, characterized in that: The device comprises: An acquisition module, configured to acquire a first candidate query combination and an unstructured target query statement, wherein the first candidate query combination includes an unstructured preset query statement and structured query information of the preset query statement; a combining module, configured to combine the target query statement with the structured query information of the preset query statement satisfying the similarity condition to obtain a second candidate query combination when the similarity between the target query statement and the preset query statement in the first candidate query combination satisfies a similarity condition; A determination module, used to determine the matching degree between the target query statement and the structured query information in the second candidate query combination; A screening module, configured to screen a target query combination from the second candidate query combination according to the matching degree; The query module is used to perform information query according to the target query combination to obtain query results for the target query statement.
12. An information query model processing device, characterized in that: The device comprises: A sample acquisition module, used to acquire a first candidate query combination sample and an unstructured target query statement sample, wherein the first candidate query combination sample includes an unstructured preset query statement sample and a structured query information sample of the preset query statement sample; A sample combination module, configured to combine the target query statement sample with the structured query information sample of the preset query statement sample that meets the sample similarity condition to obtain a second candidate query combination sample when the similarity between the target query statement sample and the preset query statement sample in the first candidate query combination sample meets the sample similarity condition; A sample determination module, used to determine a sample matching degree between a target query statement sample and a structured query information sample in the second candidate query combination sample; A sample screening module, used for screening a target query combination sample from the second candidate query combination samples according to the sample matching degree; A sample query module, used to perform information query according to the target query combination sample to obtain a predicted query result for the target query statement sample; The training module is used to obtain the expected query result for the target query statement sample, perform model training based on the predicted query result and the expected query result, and obtain an information query model.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
Citation Information
Cited By
Method and system for realizing data question and answer and computer readable medium
CN119961401A
