Query intention determination method and device, equipment, storage medium and program product
By obtaining data table fields for naming entity recognition, extracting keywords and determining query intent based on the correlation of data table fields, the problem of inaccurate user query intent determination in the prior art is solved, and the accuracy of data query is improved.
Patent Information
- Application Number
- CN202411629362.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-07
AI Technical Summary
The prior art is difficult to accurately determine the user's query intention, especially when facing semantic uncertainties such as polysense and grammatical errors of word fragments, which affects the accuracy of data query.
By obtaining the data table fields, naming entity recognition is performed, keywords of the information to be queryed are extracted, and the target query intention of the information to be queryed is determined based on the correlation between the keywords and the data table fields.
The real query intention of the data to be queried is clarified, the accuracy of data query is improved, and the difficulty of understanding high-complexity query information is reduced.
Smart Images

Figure CN119576974A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data retrieval technology, and in particular to a method, device, equipment, storage medium and program product for determining query intent. Background Art
[0002] At present, natural language processing technology is used to semantically understand the query requirements initiated by users to determine the user's query intention and return the corresponding query results. However, the query requirements initiated by users will inevitably have semantic uncertainties such as polysemy of word fragments and grammatical errors, which makes it difficult to clarify the true query intention of the query requirements, thus affecting the accuracy of data query. Summary of the invention
[0003] In view of this, the present disclosure provides a method, apparatus, device, storage medium and program product for determining query intent to solve the problem that it is difficult to determine the true query intent of a query requirement.
[0004] In a first aspect, the present disclosure provides a method for determining query intent, including: obtaining data table fields and information to be queried; performing named entity recognition on the information to be queried according to the data table fields to obtain keywords corresponding to the information to be queried; and determining a target query intent corresponding to the information to be queried based on the correlation between the keywords and the data table fields.
[0005] In the second aspect, the present disclosure provides a device for determining a query intent, including: an acquisition module for acquiring data table fields and information to be queried; a keyword determination module for performing named entity recognition on the information to be queried according to the data table fields to obtain keywords corresponding to the information to be queried; and an intent determination module for determining a target query intent corresponding to the information to be queried based on the correlation between the keywords and the data table fields.
[0006] In a third aspect, the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the method for determining the query intent of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0007] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for determining the query intent of the above-mentioned first aspect or any corresponding embodiment thereof.
[0008] In a fifth aspect, the present disclosure provides a computer program product, including computer instructions, which are used to enable a computer to execute the method for determining the query intent of the above-mentioned first aspect or any corresponding embodiment thereof.
[0009] The query intent determination method, device, equipment, storage medium and program product provided by the present disclosure obtains data table fields to perform named entity recognition on the query information according to the data table fields, so that the keywords of the query information can be dynamically changed according to the data table fields, thereby ensuring the accuracy of keyword extraction. Combined with the correlation between the keywords and the data table fields, the target query intent of the query information is determined, so that the real query intent of the query data can be clarified, which is convenient for data query combined with actual business query needs, and improves the accuracy of data query. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0011] Figure 1 is a flowchart of a method for determining query intent according to an embodiment of the present disclosure;
[0012] Figure 2 is a schematic diagram of a training process of an intent understanding model according to an embodiment of the present disclosure;
[0013] Figure 3 is another schematic diagram of a training process of an intent understanding model according to an embodiment of the present disclosure;
[0014] Figure 4 is a schematic diagram of constructing training data according to an embodiment of the present disclosure;
[0015] Figure 5 is a schematic diagram of model training according to an embodiment of the present disclosure;
[0016] Figure 6 is a flowchart of another method for determining query intent according to an embodiment of the present disclosure;
[0017] Figure 7 is a structural block diagram of a device for determining query intent according to an embodiment of the present disclosure;
[0018] Figure 8 It is a schematic diagram of the hardware structure of the computer device of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0020] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0021] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0022] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0023] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0024] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0025] When querying database information, the query information entered by the user is usually converted into a structured query statement (SQL) and the database is queried through SQL. At present, NL2SQL technology is usually used to convert the user's natural language into executable SQL statements. This technology greatly reduces the threshold for users to use the database, improves data analysis efficiency, and expands the user coverage of data products.
[0026] With the development of large language models, the reliability of NL2SQL technology using large language models has been greatly improved, but there are still many technical challenges that make the effect of NL2SQL not so perfect. The semantic uncertainty of user query information is one of them. Semantic uncertainty is mainly manifested in the polysemy of word fragments and grammatical errors. In addition, large language models pre-trained in general fields often cannot understand the specific field professional terms that appear in user query information. Moreover, for some user query information with large amount of information and high complexity, large language models are likely to ignore some fine-grained semantic information. These problems make it difficult for NL2SQL to accurately understand user intentions and generate accurate SQL statements.
[0027] Based on this, the disclosed technical solution, by training the intent understanding model to identify the keywords in the query information, extracts the association relationship between the keywords and the data table information, and combines the correlation between the keywords and the data table fields to determine the target query intent of the information to be queried. In this way, the real query intent of the data to be queried can be clarified, which facilitates data query in combination with actual business query needs and reduces the difficulty of understanding highly complex query information. At the same time, it can analyze ambiguous and polysemous fragments and domain professional terms, which facilitates the supplementation of corresponding information from the outside as the input of NL2SQL to improve the accuracy of SQL statement generation, thereby improving the accuracy of data query.
[0028] According to an embodiment of the present disclosure, an embodiment of a method for determining query intent is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0029] In this embodiment, a method for determining query intent is provided, which can be used in a computer device, such as a computer, Figure 1 is a flowchart of a method for determining query intent according to an embodiment of the present disclosure, such as Figure 1 As shown, the process includes the following steps:
[0030] Step S101, obtaining data table fields and information to be queried.
[0031] The data table fields are the fields that make up the data table, which can include indicator fields (such as daily active users, user retention, total transaction amount, etc.), calculation method fields (such as maximum, minimum, sum, average, year-on-year, month-on-month, etc.), dimension fields (such as store name, operating city, channel source, etc.), dimension value fields (such as operating city can have AA city, BB city, etc., channel source can have XX channel, YY platform, etc.) and professional terminology fields (such as delivery effect, revenue data, professional field abbreviations, etc.). The data table field information can be all field information without filtering, or it can be a subset of fields that are highly relevant to the information to be queried and recalled through semantic retrieval.
[0032] The information to be queried is generated based on the query operation of the user's needs. Specifically, an information query function is deployed in the computer device, and the information query function provides an interactive interface, and the information to be queried is input into the computer device by the user through the interactive interface.
[0033] Accordingly, when receiving the information to be queried, the computer device may access the database corresponding to the information to be queried, and extract data table fields related to the information to be queried from the database.
[0034] Step S102: performing named entity recognition on the information to be queried according to the fields of the data table to obtain keywords corresponding to the information to be queried.
[0035] Use natural language processing technology to perform named entity recognition on the query information, identify entities related to the data table fields from the query information, and obtain keywords corresponding to each entity, such as keywords related to fields such as time, dimension, indicator, dimension value, professional terminology, and calculation method.
[0036] In a specific example, if the information to be queried is "What is the live broadcast GMV of xx store", when "live broadcast GMV" exists in the data table field, the keyword "live broadcast GMV" as the indicator type should be extracted from the information to be queried. When there are two fields "whether live broadcast" and "GMV" in the data set, the two entities "live broadcast" and "GMV" should be extracted as keywords from the information to be queried respectively.
[0037] Step S103, based on the correlation between the keywords and the data table fields, determine the target query intent corresponding to the information to be queried.
[0038] Relevance is used to characterize the association between keywords and data table fields, which can be determined by combining the context of the information to be queried and the semantic information of the data table fields. Target query intent is used to characterize the content that the user actually wants to query.
[0039] Specifically, the keywords extracted from the information to be queried are associated with the data table fields in combination with semantic analysis to determine the correlation between the keywords and the data table fields, and the real query intent of the information to be queried is determined based on the correlation.
[0040] The method for determining the query intent provided in this embodiment obtains data table fields to perform named entity recognition on the information to be queried based on the data table fields, so that the keywords of the information to be queried can be dynamically changed according to the data table fields, thereby ensuring the accuracy of keyword extraction. Combined with the correlation between the keywords and the data table fields, the target query intent of the information to be queried is determined, so that the real query intent of the data to be queried can be clarified, which facilitates data query in combination with actual business query needs and improves the accuracy of data query.
[0041] As described above, after obtaining the data table fields and the information to be queried, named entity recognition can be performed on the information to be queried according to the data table fields to obtain the keywords corresponding to the information to be queried. Then, based on the correlation between the keywords and the data table fields, the target query intent corresponding to the information to be queried is determined. The above determination of the keywords corresponding to the information to be queried and the target query intent corresponding to the information to be queried can be achieved through a pre-trained intent understanding model.
[0042] In this embodiment, a method for training an intent understanding model is provided, which can be used in a computer device, such as a computer. Figure 2 is a flowchart of a method for training an intent understanding model according to an embodiment of the present disclosure, such as Figure 2 As shown, the process includes the following steps:
[0043] Step S201, obtaining real query data, data table information corresponding to the real query data, and a first query intent corresponding to the real query data.
[0044] The real query data is the data that the user initiates the query in the actual scenario. Specifically, the real query data can be collected from various authorized data sources. The following table 1 shows a specific real query data.
[0045] The data table is constructed based on the indicators and dimensions of the business functions corresponding to the real query data, and the data table information is the field information contained in the data table. The data table information can be obtained by accessing the database corresponding to the business function, as shown in Table 1 below.
[0046] The first query intent is the content actually required to be queried by the real query data. Specifically, the first query intent can be determined by the user through annotation according to the actual query requirements, as shown in Table 1 below, which corresponds to the first query intent of the real query data.
[0047]
[0048] Step S202: perform data enhancement using the first query intent and data table information to obtain query enhancement data and a second query intent corresponding to the query enhancement data.
[0049] The real query data collected from various data sources can be close to the actual scenario, but the amount of data is small. In order to ensure the effect of model training, data enhancement is required to ensure the diversity and amount of training data.
[0050] Specifically, the content to be queried by the real query data can be determined in combination with the first query intent, and the business function matched by the real query data can be determined in combination with the data table information. The first query intent and the data table information are input into a pre-trained data processing model (such as a deep learning model, a neural network model, a machine learning model, a large language model, etc.) for data enhancement, and the data processing model outputs query enhancement data that meets the first query intent and can be answered based on the data table field information.
[0051] The second query intent is a query intent generated by understanding the query enhancement data. Specifically, a data processing model is used to construct an understanding task for the query enhancement data, and the query enhancement data is automatically annotated with the query intent through the constructed understanding task to obtain the corresponding second query intent.
[0052] In some optional embodiments, such as Figure 3 As shown, the above step S202 may include:
[0053] Step S2021, select data sub-table information from the data table information, and select test point intention from the first query intention, and construct query prompt information using the data sub-table information and test point intention.
[0054] The data sub-table information is a part of the field information randomly extracted from the data table information; the test point intention is to randomly select a query intention from the first query intention, and the test point intention is used to represent the purpose of the user's query; the query prompt information is used to provide enhancement direction for data enhancement.
[0055] like Figure 4 As shown, the data sub-table information is analyzed to determine the fields contained in the data sub-table, the data types of each field, and the data content under each field. Then, the field information in the data sub-table is associated or merged with the test point intent, and the query prompt information is constructed using the association result or the merge result of the field information and the test point intent, so as to accurately construct the query data through the query prompt information.
[0056] Step S2022: perform data enhancement based on the query prompt information to obtain query enhanced data.
[0057] The query prompt information is used to indicate the data enhancement task of the data processing model, so that the data processing model performs the data enhancement task according to the query prompt information, generates a variety of query enhancement data that meet the query prompt information, and uses the query enhancement data and the real query data as training samples for the intent understanding model.
[0058] Step S2023: perform semantic analysis on the query enhancement data to determine the second query intent corresponding to the query enhancement data.
[0059] The query enhancement data is subjected to semantic analysis, key information of the query enhancement data is determined in combination with the semantic analysis result, and the query enhancement data is automatically annotated with the query intent using the key information to obtain a corresponding second query intent.
[0060] By constructing query hint information to enhance data, the correlation between query enhancement data and real query data is ensured, which increases the diversity and volume of query data. At the same time, semantic analysis is performed on query enhancement data to determine the second query intent, ensuring the match between the second query intent and query enhancement data.
[0061] In some optional implementations, the above step S2023 includes:
[0062] Step a1: constructing intent prompt information based on query enhancement data.
[0063] Step a2: perform semantic analysis on the query enhancement data using the intention prompt information to generate a second query intention corresponding to the query enhancement data.
[0064] Intent hint information is hint information constructed for query understanding tasks. Figure 4 As shown, by extracting key information from the query enhancement data, the key information is used to assemble the intention prompt information of the understanding task. The intention prompt information is input into the data processing model, so that the data processing model is used to perform semantic analysis on the query enhancement data, and the query enhancement data is automatically annotated with the query intent based on the semantic analysis result to obtain the second query intent corresponding to the query enhancement data.
[0065] By using the intent prompt information constructed by the query enhancement data to generate the second query intent, it is ensured that the second query intent can accurately express the query requirements of the query enhancement data.
[0066] Step S203, using the query enhancement data and the second query intent, fine-tune the initial intent understanding model to generate an intermediate model.
[0067] The initial intent understanding model is a pre-trained model that can understand the semantic expression of query data. The initial intent understanding model has the ability to understand general knowledge, such as a large language model, a deep learning model, a machine learning model, etc. The intermediate model is a model that combines the general knowledge of the initial intent understanding model with query enhancement data for specific understanding tasks.
[0068] Specifically, Figure 5 As shown in the figure, since query enhancement data has certain advantages in diversity and data volume, it can improve the generalization of the intent understanding model to a certain extent. Therefore, after generating query enhancement data, the initial intent understanding model is pre-trained on the query enhancement data to allow the initial intent understanding model to learn the characteristics of the query enhancement data, and the initial intent model is fine-tuned using the labeled second query intent to generate an intermediate model that combines the general knowledge of the initial intent understanding model with the enhanced data for the specific understanding task. During the fine-tuning process, the optimizer and loss function of the pre-defined understanding task are used to adjust the training parameters and training weights of the initial intent model so that the fine-tuned intermediate model can adapt to the query data understanding task and have a certain query understanding ability on a wide range of data sets and query data with diverse styles.
[0069] Step S204, using the real query data and the first query intent, fine-tune the intermediate model to generate an intent understanding model.
[0070] Since the style of the query enhancement data is somewhat different from the real query data collected online, and the second query intent is completed by using a model, its accuracy is also somewhat different from the manually labeled first query intent. Therefore, it will have a certain negative impact on the query understanding effect of the intermediate model.
[0071] In order to ensure the query understanding effect, it is necessary to use high-quality real query data and the first query intent to fine-tune the intermediate model again, so that the fine-tuned model can be aligned with the actual situation, filter out the noise learned by the intermediate model, and obtain a more accurate intent understanding model, such as Figure 5 shown.
[0072] The training method of the intent understanding model provided in this embodiment uses query enhancement data and the second query intent as training samples to preliminarily fine-tune the initial intent understanding model to obtain a corresponding intermediate model, so that the intermediate model can have a certain understanding ability on a wide range of data sets and query data with diverse styles. The intermediate model is fine-tuned again using real query data and the first query intent as training samples to obtain the final intent understanding model, so as to align the intermediate model with the real query situation and improve the model's understanding accuracy of the query data.
[0073] In this embodiment, a method for determining query intent is provided, which can be used in a computer device, such as a computer, Figure 6 is a flowchart of a method for determining query intent according to an embodiment of the present disclosure, such as Figure 6 As shown, the process includes the following steps:
[0074] Step S301, obtain the data table fields and the information to be queried. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0075] Step S302: performing named entity recognition on the information to be queried according to the fields of the data table to obtain keywords corresponding to the information to be queried.
[0076] Specifically, the above step S302 includes:
[0077] Step S3021, obtaining multiple candidate keywords generated by performing named entity recognition on the information to be queried.
[0078] The candidate keywords are keywords that are identified from the information to be queried and are relevant to the data table fields. The intent understanding model described above is used to perform named entity recognition on the text of the information to be queried, and multiple candidate keywords related to the data table fields are generated.
[0079] For example, the data set fields include mall GMV, live broadcast GMV and search GMV, and the query data is "what is the GMV", and the three fields in the data set are all related to GMV. At this time, the three keywords of mall GMV, live broadcast GMV and search GMV can be generated based on the query data.
[0080] Step S3022: In response to the selection operation on the plurality of candidate keywords, determine the keywords corresponding to the information to be queried.
[0081] The selection operation is an operation initiated by the user for selecting a candidate keyword, and the selection operation can be completed based on the interactive interface provided by the computer device. Specifically, after the generation of the candidate keywords is completed, multiple candidate keywords are displayed on the interactive interface, and the user can use input devices such as a keyboard and a mouse to select the candidate keywords on the interactive interface. Accordingly, the computer device can respond to the selection operation initiated by the user for the candidate keywords and determine the keywords actually corresponding to the information to be queried.
[0082] Step S303: determining the target query intent corresponding to the information to be queried based on the correlation between the keywords and the data table fields.
[0083] Specifically, the above step S303 includes:
[0084] Step S3031: Based on the correlation between the keyword and the data table field, determine the first keyword associated with the data table field and the type of the first keyword.
[0085] The type of the first keyword is the data table field type to which the first keyword belongs, such as indicator, dimension, dimension value, calculation method, and professional terminology.
[0086] The keywords extracted from the information to be queried are associated with each data table field in the data table to determine the correlation between the keywords and the data table fields. Specifically, if the keyword and the data table field name are exactly the same, they are directly associated; if the keyword and the data table field name are not exactly the same, but have similarities, a text similarity algorithm can be used to determine the data table field closest to the keyword; the keyword can also be associated with the data table field that may contain the same or related information in combination with the context of the keyword in the text of the information to be queried.
[0087] A first keyword associated with the data table field is extracted from the keywords based on the correlation, and the type of the first keyword is determined in combination with the data table field type.
[0088] Step S3032, using the association result of the first keyword, type and data table field, determine the target query intent corresponding to the information to be queried.
[0089] According to the association results between the first keyword, the type of the first keyword and the data table fields, the information to be queried is semantically understood, so that the target query intent of the information to be queried can be determined in combination with the association results. Specifically, if a certain type of keyword is directly associated with a data table field, the target query intent is to obtain the information of the data table field; if a certain type of keyword is associated with multiple data table fields, the target query intent can be determined by combining the information of multiple data table fields. Of course, the target query intent of the information to be queried can also be determined according to other methods, which are not specifically limited here.
[0090] Step S3033: Based on the correlation between the keyword and the data table field, determine a second keyword that is not associated with the data table field.
[0091] The correlation between the keyword and the data table fields is used to determine whether the keyword and the information represented by each data table field are the same or similar. If the keyword and the information represented by each data table field are neither the same nor similar, the keyword can be determined as a second keyword without a related data table field, that is, the keyword has no association with the data table field.
[0092] Step S3034, using the second keyword to perform retrieval and recall, to determine the target query intent corresponding to the information to be queried.
[0093] In order to avoid missing information due to retrieval defects, a second keyword can be used for secondary retrieval and recall to determine the target query intention based on the secondary retrieval and recall results.
[0094] It should be noted that if the second keyword is a professional term in a certain field, the second keyword can be collected for manual review to determine the target query intent based on the manual review results, thereby realizing the ability to mine domain knowledge based on the target query intent.
[0095] In some optional implementations, the above method further includes:
[0096] Step b1, determining the target data table field based on the association relationship between the keyword and the data table field.
[0097] Step b2: Generate a structured query statement according to the target data table fields.
[0098] Combined with the relationship between the keyword and the data table field, the target data table field with the highest correlation with the keyword is selected from the data table fields. Combined with the information of the target data table field, the query condition is determined, and the structured query statement is automatically generated according to the query condition.
[0099] By establishing an association between keywords and data table fields, it is helpful to select more appropriate data table fields as target data table fields for generating structured query statements, which is beneficial to improving the accuracy of data queries.
[0100] The method for determining the query intent provided in this embodiment combines the first keyword, the type of the first keyword, and the association result of the data table field to determine the target query intent of the information to be queried, so as to clarify the real query intent of the information to be queried, avoid semantic understanding deviation, and avoid the difficulty in understanding the semantic information due to the high complexity of the information to be queried, which greatly improves the accuracy of semantic understanding. For keywords that are not associated with the data table fields, a search recall is performed to determine the target query intent based on the search recall results to avoid search omissions, and at the same time, unrelated field professional terms can be supplemented to improve the query capability of field professional terms.
[0101] In this embodiment, a device for determining query intent is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0102] This embodiment provides a device for determining query intent, such as Figure 7As shown, including:
[0103] The acquisition module 401 is used to acquire data table fields and information to be queried.
[0104] The keyword determination module 402 is used to perform named entity recognition on the information to be queried according to the fields of the data table to obtain keywords corresponding to the information to be queried.
[0105] The intention determination module 403 is used to determine the target query intention corresponding to the information to be queried based on the correlation between the keywords and the data table fields.
[0106] In some optional implementations, the intention determination module 403 includes:
[0107] The first keyword determining unit is used to determine the first keyword associated with the data table field and the type of the first keyword based on the correlation between the keyword and the data table field.
[0108] The first intention determination unit is used to determine the target query intention corresponding to the information to be queried by using the association result of the first keyword, type and data table field.
[0109] In some optional implementations, the intention determination module 403 further includes:
[0110] The second keyword determining unit is used to determine the second keyword that is not associated with the data table field based on the correlation between the keyword and the data table field.
[0111] The second intention determination unit is used to perform retrieval and recall using the second keyword to determine the target query intention corresponding to the information to be queried.
[0112] In some optional implementations, the keyword determination module 402 includes:
[0113] The candidate keyword determination unit is used to obtain multiple candidate keywords generated by performing named entity recognition on the information to be queried.
[0114] The selection unit is used to determine the keywords corresponding to the information to be queried in response to the selection operation on the plurality of candidate keywords.
[0115] In some optional embodiments, the above device further includes:
[0116] The training module is used to train the intent understanding model. The training module specifically includes:
[0117] The information acquisition unit is used to acquire real query data, data table information corresponding to the real query data, and a first query intention corresponding to the real query data.
[0118] The data enhancement unit is used to perform data enhancement using the first query intent and data table information to obtain query enhancement data and a second query intent corresponding to the query enhancement data.
[0119] The first fine-tuning unit is used to fine-tune the initial intent understanding model by using the query enhancement data and the second query intent to generate an intermediate model.
[0120] The second fine-tuning unit is used to fine-tune the intermediate model using real query data and the first query intent to generate an intent understanding model.
[0121] In some optional implementations, the data enhancement unit includes:
[0122] The prompt information construction subunit is used to select data sub-table information from the data table information, select test point intention from the first query intention, and construct query prompt information using the data sub-table information and test point intention.
[0123] The enhancement subunit is used to perform data enhancement based on the query prompt information to obtain query enhanced data.
[0124] The analysis subunit is used to perform semantic analysis on the query enhancement data to determine the second query intent corresponding to the query enhancement data.
[0125] In some optional implementations, the above-mentioned analysis subunit is specifically used to construct intention prompt information based on the query enhancement data; use the intention prompt information to perform semantic analysis on the query enhancement data to generate a second query intention corresponding to the query enhancement data.
[0126] In some optional embodiments, the above device further includes:
[0127] The field determination module is used to determine the target data table field based on the association relationship between the keyword and the data table field.
[0128] The query statement generation module is used to generate structured query statements according to the target data table fields.
[0129] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0130] The query intent determination device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0131] The query intent determination device provided by the present disclosure obtains data table fields to perform named entity recognition on the query information according to the data table fields, so that the keywords of the query information can be dynamically changed according to the data table fields, thereby ensuring the accuracy of keyword extraction. Combined with the correlation between the keywords and the data table fields, the target query intent of the query information can be determined, so that the real query intent of the query data can be clarified, which is convenient for data query combined with actual business query needs, and greatly improves the accuracy of data query.
[0132] The present disclosure also provides a computer device having the above Figure 7 The device for determining the query intent is shown.
[0133] See also Figure 8 , Figure 8 is a schematic diagram of a computer device provided by an optional embodiment of the present disclosure, such as Figure 8 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 10 is taken as an example.
[0134] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0135] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0136] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0137] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0138] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 8 The example of connecting through bus is taken in the following.
[0139] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0140] The computer device also includes a communication interface, which is used for the computer device to communicate with other devices or a communication network.
[0141] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0142] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0143] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for determining query intent, characterized in that: The method comprises: Get the data table fields and information to be queried; Performing named entity recognition on the information to be queried according to the data table fields to obtain keywords corresponding to the information to be queried; Based on the correlation between the keywords and the data table fields, the target query intent corresponding to the information to be queried is determined.
2. The method according to claim 1, characterized in that The determining, based on the correlation between the keyword and the data table field, the target query intent corresponding to the information to be queried includes: Based on the correlation between the keyword and the data table field, determining a first keyword associated with the data table field and a type of the first keyword; The target query intent corresponding to the information to be queried is determined by using the association result of the first keyword, the type and the data table field.
3. The method according to claim 2, characterized in that Determining the target query intent corresponding to the information to be queried based on the correlation between the keyword and the data table field, further comprising: Based on the correlation between the keyword and the data table field, determining a second keyword that is not associated with the data table field; The second keyword is used to perform retrieval and recall to determine the target query intent corresponding to the information to be queried.
4. The method according to claim 1, characterized in that: According to the data table fields, named entity recognition is performed on the information to be queried to obtain keywords corresponding to the information to be queried; and based on the correlation between the keywords and the data table fields, the target query intent corresponding to the information to be queried is determined to be realized through a pre-trained intent understanding model; wherein the training method of the intent understanding model includes: Acquire real query data, data table information corresponding to the real query data, and a first query intent corresponding to the real query data; Performing data enhancement using the first query intent and the data table information to obtain query enhancement data and a second query intent corresponding to the query enhancement data; Using the query enhancement data and the second query intent, fine-tuning the initial intent understanding model to generate an intermediate model; The intermediate model is fine-tuned using the real query data and the first query intent to generate the intent understanding model.
5. The method according to claim 4, characterized in that The step of performing data enhancement by using the first query intent and the data table information to obtain query enhancement data and a second query intent corresponding to the query enhancement data includes: Selecting data sub-table information from the data table information, and selecting test point intention from the first query intention, and constructing query prompt information using the data sub-table information and the test point intention; Performing data enhancement based on the query prompt information to obtain the query enhanced data; Perform semantic analysis on the query enhancement data to determine the second query intent corresponding to the query enhancement data.
6. The method according to claim 5, characterized in that The performing semantic analysis on the query enhancement data to determine the second query intent corresponding to the query enhancement data includes: Constructing intention prompt information based on the query enhancement data; The query enhancement data is semantically analyzed using the intent prompt information to generate the second query intent corresponding to the query enhancement data.
7. The method according to claim 1, characterized in that The performing named entity recognition on the information to be queried according to the data table fields to obtain keywords corresponding to the information to be queried includes: Acquire multiple candidate keywords generated by performing named entity recognition on the information to be queried; In response to a selection operation on the plurality of candidate keywords, keywords corresponding to the information to be queried are determined.
8. The method according to claim 1 or 7, characterized in that: Also includes: Determine the target data table field based on the association relationship between the keyword and the data table field; Generate a structured query statement according to the target data table fields.
9. A device for determining query intent, characterized in that: The device comprises: The acquisition module is used to obtain data table fields and information to be queried; A keyword determination module, used to perform named entity recognition on the information to be queried according to the fields of the data table to obtain keywords corresponding to the information to be queried; The intention determination module is used to determine the target query intention corresponding to the information to be queried based on the correlation between the keywords and the data table fields.
10. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for determining the query intent described in any one of claims 1 to 8 by executing the computer instructions.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for determining the query intention according to any one of claims 1 to 8.
12. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method for determining the query intention according to any one of claims 1 to 8.