A data post-processing method, system and device for business data query
By determining the business query intention and slot based on the upstream language model in the ERP system, and performing matching and format conversion, the problem of low efficiency and accuracy of user input natural language data query is solved, efficient and accurate data query is achieved, and the efficiency is improved User experience.
Patent Information
- Application Number
- CN202410917140.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-10
AI Technical Summary
In the ERP system, the query efficiency and accuracy of natural language data input by users are low, resulting in cumbersome user operations and poor usability, which affects the efficiency of data query.
By determining business query intentions and query slots based on the upstream language model, intent matching and format conversion are performed, and standard query slots and post-processing information are generated for input to downstream tasks.
Efficient and accurate natural language data query is achieved, reducing user operations and improving user experience and accuracy of query results.
Smart Images

Figure CN118467570B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic digital data processing, and in particular to a data post-processing method, system and device for business data query. Background Art
[0002] The development of AI (Artificial Intelligence) technology has greatly improved the level of industrial intelligence and digitalization. By building an AI assistant and introducing AI technology into ERP (Enterprise Resource Planning), it can better help enterprises realize automated office in decision-making, finance, business and other fields, while optimizing processes and improving efficiency, thereby enhancing the core competitiveness and market adaptability of enterprises and realizing industrial intelligence upgrades.
[0003] As the frequency and scope of use of AI assistants in ERP systems increase, the inventors have found that the use of AI assistants often requires users to follow certain usage rules in order to provide users with efficient data search services. If the natural language input by the user cannot be accurately and timely adapted to the prescribed usage rules, it may cause unnecessary operations for the user, making data search more cumbersome and less user-friendly. Summary of the invention
[0004] The embodiments of the present application provide a data post-processing method, system and device for business data query, which are used to solve the problem that the data query efficiency and accuracy in the current ERP system are easily affected by the user input data, which brings cumbersome operations to the user and leads to poor user friendliness.
[0005] On the one hand, an embodiment of the present application provides a data post-processing method for business data query, the method comprising:
[0006] Based on the business query information from the upstream language model, determine the corresponding business query intent and query slot;
[0007] Matching the business query intent with a preset query intent set to determine a corresponding query intent category according to the matching result;
[0008] According to the query intent category and the preset slot filtering condition, determine the slot category corresponding to the query slot; wherein the preset slot filtering condition is used to filter the slot category corresponding to the query intent category from the preset slot category list; there is a mapping relationship between the slot category and the preset format mapping rule;
[0009] When it is determined that the slot category meets the format conversion condition, the query slot is format converted to obtain a standard query slot after format conversion;
[0010] Based on the standard query slot and the business query intent, post-processing information corresponding to the business query information is generated and used as input information of a downstream task, so as to execute the corresponding downstream task according to the input information.
[0011] In one implementation of the present application, based on the business query information from the upstream language model, the corresponding business query intention and query slot are determined, specifically including:
[0012] Convert the business query information into first JSON format data;
[0013] According to the key-value pairs corresponding to each intent attribute and the key-value pairs corresponding to each slot attribute in the first JSON format data, the business query intent and the query slots corresponding to the business query intent are determined; one business query intent corresponds to at least one query slot.
[0014] In one implementation of the present application, before matching the business query intent with a preset query intent set to determine a corresponding query intent category according to the matching result, the method further includes:
[0015] Acquire a number of historical query intent text information; wherein the historical query intent text information includes a query short text group corresponding to the marked query intent; the query short text group includes one or more query short text subgroups corresponding to the same marked query intent;
[0016] Adding the annotated query intent corresponding to each of the historical query intent text information to the preset query intent set as the query intent category;
[0017] Before determining the slot category corresponding to the query slot according to the query intent category and the preset slot filtering condition, the method further includes:
[0018] Based on the user's marking operations on each of the query short text groups in the same query intent category, the marked slot category corresponding to each of the query short text groups is determined, so as to generate the preset slot category list according to each of the marked slot categories and the corresponding query intent category; wherein, there is a mapping relationship between the marked slot category and the preset format mapping rule; the preset format mapping rule at least includes: the slot category is the standard query slot, the slot category is the slot to be converted to the standard, and the slot category is the slot to be completed for conversion.
[0019] In one implementation of the present application, the business query intent is matched with a preset query intent set to determine a corresponding query intent category according to the matching result, specifically including:
[0020] Encode the business query intent and the corresponding query slot to generate an intent matching vector;
[0021] Calculate the similarity between the intent matching vector and the to-be-matched vectors corresponding to each of the query intent categories in the preset query intent set to obtain each intent matching similarity;
[0022] A similarity sequence corresponding to each of the intention matching similarities is generated through a bubble sort algorithm, the intention matching similarity corresponding to the largest element in the similarity sequence is used as the selected similarity, and the selected similarity is added to the matching result to determine the query intention category corresponding to the selected similarity.
[0023] In one implementation of the present application, when it is determined that the slot category meets the format conversion condition, the query slot is format converted to obtain a standard query slot after the format conversion, specifically including:
[0024] In the case where the slot category is the slot to be converted to standard, determining that the slot category satisfies the format conversion condition, and determining the standard data format corresponding to the query slot according to the query intent category, so as to perform format conversion on the query slot according to the standard data format to obtain the standard query slot;
[0025] In the case where the slot category is the to-be-filled conversion slot, determining that the slot category meets the format conversion condition, and determining the corresponding multi-level filling slot based on the query slot and the preset natural language understanding model, so as to perform format conversion on the multi-level filling slot according to the multi-level filling slot and the corresponding standard data format to obtain the standard query slot;
[0026] The method further comprises:
[0027] When the slot category is the standard query slot, the query slot is determined to be the standard query slot.
[0028] In one implementation of the present application, based on the query slot and the preset natural language understanding model, the corresponding multi-level filling slot is determined, specifically including:
[0029] Inputting the query short text in each query slot into the preset natural language understanding model to determine whether there is an associated query short text; the association means that at least two query short texts are in the same business query dimension and constitute a complete query condition of the business query dimension; the business query dimension at least includes: business query intention, query time, and query quantity;
[0030] If so, determining the corresponding query slots as the multi-level completion slots according to the associated query short text;
[0031] If it does not exist, based on the preset natural language understanding model and the business query dimension corresponding to the query short text, multiple filling slots corresponding to the business query dimension contained in the query short text are determined to generate the corresponding multi-level filling slots.
[0032] In one implementation of the present application, based on the standard query slot and the business query intent, generating post-processing information corresponding to the business query information specifically includes:
[0033] Sorting the standard query slots according to a preset data query sequence corresponding to the business query intent;
[0034] The sorted standard query slots and the business query intent are converted into second JSON format data to obtain the post-processing information.
[0035] In one implementation of the present application, the method further includes:
[0036] Obtaining service query feedback information from user terminals;
[0037] According to the business query feedback information, corresponding update information for the preset query intention set is generated.
[0038] On the other hand, an embodiment of the present application further provides a data post-processing system for business data query, the system comprising:
[0039] A first determination module, used to determine corresponding business query intentions and query slots based on business query information from an upstream language model;
[0040] A matching module, used to match the business query intent with a preset query intent set to determine a corresponding query intent category according to the matching result;
[0041] The second determination module is used to determine the slot category corresponding to the query slot according to the query intent category and the preset slot filtering condition; wherein the preset slot filtering condition is used to filter the slot category corresponding to the query intent category from the preset slot category list; there is a mapping relationship between the slot category and the preset format mapping rule;
[0042] A format conversion module, configured to convert the query slot into a format when it is determined that the slot category meets the format conversion condition, so as to obtain a standard query slot after the format conversion;
[0043] A generation module is used to generate post-processing information corresponding to the business query information based on the standard query slot and the business query intention, and use it as input information of the downstream task to execute the corresponding downstream task according to the input information.
[0044] On the other hand, the embodiment of the present application further provides a data post-processing device for business data query, the device comprising:
[0045] at least one processor; and a memory in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0046] Based on the business query information from the upstream language model, determine the corresponding business query intent and query slot;
[0047] Matching the business query intent with a preset query intent set to determine a corresponding query intent category according to the matching result;
[0048] According to the query intent category and the preset slot filtering condition, determine the slot category corresponding to the query slot; wherein the preset slot filtering condition is used to filter the slot category corresponding to the query intent category from the preset slot category list; there is a mapping relationship between the slot category and the preset format mapping rule;
[0049] When it is determined that the slot category meets the format conversion condition, the query slot is format converted to obtain a standard query slot after format conversion;
[0050] Based on the standard query slot and the business query intent, post-processing information corresponding to the business query information is generated and used as input information of a downstream task, so as to execute the corresponding downstream task according to the input information.
[0051] Compared with the prior art, the present invention has the following significant effects:
[0052] Through the above technical solution, the present application provides a data post-processing technical solution after the upstream language model of the business data query, and further matches and processes the business query intention and the identified query slot, so that it can be directly applied to downstream tasks. For the business query information obtained from various natural languages input by the user, all can be uniformly formatted, and the user does not need to consider the restrictions of the usage rules. The data query function of inputting natural language in the ERP system can be realized efficiently and accurately, which reduces user operations, is more user-friendly, and improves the user experience.
[0053] This application uses a preset query intent set to classify query intents, which can divide business query intents with special requirements into finer dimensions, does not provide unified business query processing for several business query intents, and more flexibly converts the format of the corresponding query slot for a single business query intent, making it convenient for users to expand and distinguish some business query intents in demand, and the obtained business query results are more in line with user requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0055] Figure 1 A flowchart of a data post-processing method for business data query in an embodiment of the present application;
[0056] Figure 2 Another flowchart of a data post-processing method for business data query in an embodiment of the present application;
[0057] Figure 3 This is a structural diagram of a data post-processing system for business data query in an embodiment of the present application;
[0058] Figure 4 This is a structural diagram of a data post-processing device for business data query in an embodiment of the present application. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0060] When artificial intelligence (AI) assistants built based on models such as BERT are performing human-computer interaction, the underlying model can only perform extractive slot filling on the input text. That is, when users use such AI assistants for human-computer interaction, they can only extract key information from the natural language input by the user for similarity matching and generate answers. However, for the same query content, users may express it in a variety of different ways, which makes it impossible for the AI model to accurately identify information with the same meaning but different expressions, hindering the smooth execution of downstream tasks and causing users to have redundant operations such as re-input or supplementary input. Some existing technologies establish prompt word engineering, use the generation capabilities of large language models, normalize the format of information in the input module or output module, and then recognize it by the AI assistant. However, since this type of method calls large model resources, it has high requirements on computer computing power, and the large model has poor interpretability. There is no quantitative indicator to determine whether the prompt word engineering meets the requirements, and the conversion stability is not high.
[0061] Based on this, the embodiments of the present application provide a data post-processing method, system and device for business data query, which is used to solve the problem that the data query efficiency and accuracy in the current ERP system are easily affected by user input data, which brings cumbersome operations to users and leads to poor user friendliness.
[0062] The following describes in detail various embodiments of the present application in conjunction with the accompanying drawings.
[0063] The present application embodiment provides a data post-processing method for business data query, which is applied after the AI assistant processes the natural language and before executing the corresponding business data query operation from the database. Figure 1 As shown, the method may include steps S101-S105:
[0064] S101, the server determines the corresponding business query intention and query slot based on the business query information from the upstream language model.
[0065] It should be noted that the server, as the executor of the data post-processing method for business data query, is only an example, and the executor is not limited to the server, and this application does not make any specific limitations on this.
[0066] The upstream language model can be understood as a pre-trained language model, such as the BERT model, which is trained with a pre-set data set so that it can extract domain knowledge, identify questions raised by users in these fields, and output business query information. For example, if the business query natural language input by the user is "Please help me check last year's VAT electronic invoice", the business query information may include: invoice query, last year, VAT electronic invoice.
[0067] In the embodiment of the present application, based on the business query information from the upstream language model, the corresponding business query intention and query slot are determined, specifically including:
[0068] The server converts the business query information into the first JSON format data. According to the key-value pairs corresponding to each intent attribute and the key-value pairs corresponding to each slot attribute in the first JSON format data, the business query intent and each query slot corresponding to the business query intent are determined. One business query intent corresponds to at least one query slot.
[0069] In other words, the server can organize the business query information into JSON format data for unified formatting. It includes business query intent and query slots. The first JSON format data is as follows: { "intent": "Invoice Query", "slots":{"date": "Last Year", "type": "VAT Electronic Invoice"}}, "intent": "Invoice Query" represents the key-value pair corresponding to the business query intent, "intent" is the intent attribute, "date" and "type" are slot attributes, "date": "Last Year", "type": "VAT Electronic Invoice" represents the key-value pair corresponding to the two query slots.
[0070] S102, the server matches the business query intent with a preset query intent set to determine a corresponding query intent category according to the matching result.
[0071] In the embodiment of the present application, before matching the business query intent with the preset query intent set to determine the corresponding query intent category according to the matching result, the following is also included:
[0072] The server obtains a number of historical query intent text information. The historical query intent text information includes a query short text group corresponding to the annotated query intent. The query short text group includes one or more query short text groups corresponding to the same annotated query intent. The annotated query intent corresponding to each historical query intent text information is added to the preset query intent set as a query intent category.
[0073] In other words, the server can obtain the annotated query intents pre-annotated by the user and establish a preset query intent set. In actual use, the business query intent will not be further classified. This application categorizes the business query intent to obtain the query intent category, which is convenient for obtaining the corresponding slot category for different query intent categories in the future. The historical query intent text information carrying the annotated query intent may contain multiple query short text groups, such as {(amount query, 20,000 yuan), (amount query, 20,000 yuan), (amount query, 20,000 yuan)...}, that is, multiple query short text groups in a historical query intent text information are short text groups expressing the same query intent category, and the short text group contains short texts in the form of amount query, 20,000 yuan, etc., among which the amount query is the query intent category.
[0074] In one embodiment of the present application, the business query information may include multiple business query intents and query slots corresponding to each business query intent. The server can obtain multiple query intent categories corresponding to the multiple business query intents, that is, one business query intent may cover multiple query intent categories. At this time, the business query intent description may be relatively broad and can cover multiple query intent categories that can be used for business data query. For example, the first business query intent may include the first query intent category and the second query intent category in the above-mentioned annotated query intent, so the server can obtain multiple query intent categories.
[0075] In the embodiment of the present application, the business query intent is matched with the preset query intent set to determine the corresponding query intent category according to the matching result, specifically including:
[0076] The server encodes the business query intent and the corresponding query slot to generate an intent matching vector. The intent matching vector is similar to the to-be-matched vector corresponding to each query intent category in the preset query intent set to obtain each intent matching similarity. A similarity sequence corresponding to each intent matching similarity is generated through a bubble sort algorithm, and the intent matching similarity corresponding to the largest element in the similarity sequence is used as the selected similarity, and the selected similarity is added to the matching result to determine the query intent category corresponding to the selected similarity.
[0077] In other words, the server can encode the intent matching vector, such as encoding {A, B, C...}, the first position is the encoding of the business query intent, the second position and thereafter are the encodings of the slot value corresponding to the query slot, and at the same time, each query short text group in the preset query intent set is vector-encoded to obtain one or more vectors to be matched corresponding to a marked query intent. The server can obtain the intent matching similarity between the intent matching vector and the vector to be matched by calculating the inverse of the Euclidean distance or the cosine similarity. The larger the value of the intent matching similarity, the higher the degree of similarity between the two vectors. The obtained intent matching similarities are sorted by the bubble sort algorithm to obtain a similarity sequence. The similarity sequence can be arranged in order from large to small. The server takes the maximum value in the similarity sequence as the selected similarity, and obtains the corresponding query intent category according to the query short text group corresponding to the selected similarity.
[0078] If there are multiple query intent categories, the server can perform multi-threaded calculations on the intent matching similarities between the business query intent and each query intent in the preset query intent set, and determine that the intent matching similarity is greater than a set threshold. If there are multiple intent matching similarities greater than the set threshold, there are multiple query intent categories, and the server determines the query intent categories corresponding to the multiple intent matching similarities.
[0079] S103, the server determines the slot category corresponding to the query slot according to the query intention category and the preset slot filtering condition.
[0080] The preset slot filtering condition is used to filter the slot categories corresponding to the query intent category from the preset slot category list. There is a mapping relationship between the slot category and the preset format mapping rule.
[0081] In the embodiment of the present application, before determining the slot category corresponding to the query slot according to the query intent category and the preset slot filtering condition, the method further includes:
[0082] Based on the user's annotation operations on each query short text group in the same query intent category, the annotation slot category corresponding to each query short text group is determined, so as to generate a preset slot category list according to each annotation slot category and the corresponding query intent category. Among them, there is a mapping relationship between the annotation slot category and the preset format mapping rule. The preset format mapping rule includes at least: the slot category is a standard query slot, the slot category is a slot to be converted to a standard, and the slot category is a slot to be completed for conversion.
[0083] That is to say, in the present application, each query short text group is marked with a marked slot category to generate a preset slot category list, and different slot categories correspond to different preset format mapping rules. The preset format mapping rule corresponds to the method used to convert the format of the slot value (that is, the short text) in the query slot. There are three preset format mapping rules in the present application, corresponding to the three situations where the slot category is a standard query slot, the slot category is a slot to be converted to a standard, and the slot category is a slot to be completed for conversion.
[0084] S104, when the server determines that the slot category meets the format conversion condition, the server performs format conversion on the query slot to obtain a standard query slot after format conversion.
[0085] In the embodiment of the present application, when it is determined that the slot category meets the format conversion condition, the query slot is format converted to obtain a standard query slot after the format conversion, specifically including:
[0086] In the case where the slot category is a slot to be converted to a standard, it is determined that the slot category meets the format conversion conditions, and the standard data format corresponding to the query slot is determined according to the query intent category, so that the query slot is format-converted according to the standard data format to obtain a standard query slot. In the case where the slot category is a slot to be completed and converted, it is determined that the slot category meets the format conversion conditions, and based on the query slot and the preset natural language understanding model, the corresponding multi-level completion slots are determined, so that the multi-level completion slots are format-converted according to the multi-level completion slots and the corresponding standard data format to obtain a standard query slot. In addition, in the case where the slot category is a standard query slot category, it is determined that the slot category does not meet the format conversion conditions, and the query slot is determined to be a standard query slot.
[0087] In other words, the slot category is a standard query slot, which indicates that the slot value in the current query slot can be directly used for subsequent downstream tasks, and the server directly uses the query slot as a standard query slot. When the slot category is not a standard query slot, the server identifies the slot value in the query slot to determine whether it belongs to a slot to be converted to a standard or a slot to be completed. Specifically, a pre-trained natural language understanding model can be used to identify whether the slot category corresponding to the query slot belongs to a pre-set conversion slot to be completed. In actual use, users can specify some slot categories as conversion slots to be completed. For example, query slots used to query time and query slots used to query quantity are both conversion slots to be completed.
[0088] If it does not belong to the conversion slot to be completed, and it is not a standard query slot, the slot category is a slot to be converted to a standard. At this time, the server will determine the standard data format corresponding to the query slot in the pre-set standard data format comparison table through the query intent category. For example, the first query intent category corresponds to the first standard data format comparison table, and the standard data format corresponding to the query slot in the first standard data format comparison table is the ISO 8601 format. The server converts the slot value in the query slot to the standard data format, thereby obtaining a standard query slot.
[0089] When it is determined that the slot category is a conversion slot to be completed, the server will use the query slot and the preset natural language understanding model to determine the multi-level completion slots, and then perform format conversion. The multi-level completion slot can be understood as a slot group consisting of multiple associated query slots. For example, a query slot "last year" belongs to the conversion slot to be completed, and the corresponding multi-level completion slots are "January 1, xxxx" and "December 31, xxxx". The server will determine the standard data format of the multi-level completion slots such as the above-mentioned ISO 8601 format, perform format conversion, and generate a standard query slot.
[0090] In the embodiment of the present application, based on the query slot and the preset natural language understanding model, the corresponding multi-level filling slot is determined, specifically including:
[0091] The server inputs the query short text in each query slot into a preset natural language understanding model to determine whether there is an associated query short text. Association means that at least two query short texts are in the same business query dimension and constitute a complete query condition of the business query dimension. The business query dimension includes at least: business query intent, query time, and query quantity. In the case where it is determined that there are associated query short texts, the corresponding query slots are determined to be multi-level completion slots based on the associated query short texts. In the case where it is determined that there are no associated query short texts, multiple completion slots of the corresponding business query dimension contained in the query short text are determined based on the preset natural language understanding model and the business query dimension corresponding to the query short text to generate the corresponding multi-level completion slots.
[0092] The preset natural language understanding model can be a recurrent neural network model, which can determine the slot category, whether multiple query slots are associated, output the completion slots, etc. For example, a business query intention is: personal bill query, there are two query slots: 10,000 and 100,000, the business query dimension corresponds to the query quantity, and the two query slots can constitute a complete query condition corresponding to the business query dimension of the query quantity, such as a personal bill query between 10,000 and 100,000. The server generates multi-level completion slots for each associated query slot. If there is no associated query short text, that is, there is no associated query slot, the server will output the completion slot of the query short text corresponding to the business query dimension through the preset natural language understanding model. For example, if the query short text is "last year", the completion slots are "January 1, xxxx" and "December 31, xxxx", thereby generating multi-level completion slots.
[0093] Through the above technical solution, different natural languages input by users to express the same business query intention can be processed in a targeted manner to obtain standard query slots that meet downstream tasks without the need for users to perform additional operations, thus saving business data query time.
[0094] S105, the server generates post-processing information corresponding to the business query information based on the standard query slot and the business query intent, and uses it as input information of the downstream task to execute the corresponding downstream task according to the input information.
[0095] In the embodiment of the present application, the post-processing information corresponding to the business query information is generated based on the standard query slot and the business query intent, specifically including:
[0096] The server sorts each standard query slot according to the preset data query sequence corresponding to the business query intent, and converts the sorted standard query slots and business query intent into second JSON format data to obtain post-processing information.
[0097] In other words, the server can store preset data query sequences corresponding to different business query intents, and each standard query slot can be arranged through the preset data query sequence. Then, an ordered second JSON format data is generated. The second JSON format data is as follows: { "intent": "Invoice query", "slots":{"date1": "2023-01-01", "date2": "2023-12-31", "type": "VAT electronic invoice"}}.
[0098] In one embodiment of the present application, there are some special business query intentions that are not included in the preset query intention set, so the present application also provides the following embodiments:
[0099] The server obtains the service query feedback information from the user terminal and generates corresponding update information for the preset query intention set according to the service query feedback information.
[0100] That is, the user can view the business query results provided by the downstream task after entering the business query natural language through the user terminal, and send business query feedback information to the server, such as whether the business query results meet the requirements, or which business query results do not meet the business query intent, etc. The server can determine whether to generate update information based on the business query feedback information to prompt the corresponding user to update the preset query intent set.
[0101] Figure 2 Another flowchart of a data post-processing method for business data query provided in an embodiment of the present application is as follows: Figure 2 As shown, including:
[0102] S201, upstream task; S202, organize into JSON format data; S203, preset intent and slot list; S204, identify user intent and classify; S205, slot check; S206, judge as general slot (that is, slot category is standard query slot or slot category is slot to be converted to standard); S207, judge as special slot (that is, slot category is slot to be completed for conversion); S208, set secondary slot; S209, slot check; S2010, judge as implicit inclusion slot (that is, there is no associated query short text); S2011, judge or convert to explicit inclusion slot; S2012, establish mapping relationship between standard data format and natural language (business query intent, query slot); S2013, format according to mapping relationship; S2014, organize into JSON format data and data; S2015, downstream task.
[0103] Through the above technical solution, the present application provides a data post-processing technical solution after the upstream language model of the business data query, and further matches and processes the business query intention and the identified query slot, so that it can be directly applied to downstream tasks. For the business query information obtained from various natural languages input by the user, all can be uniformly formatted, and the user does not need to consider the restrictions of the usage rules. The data query function of inputting natural language in the ERP system can be realized efficiently and accurately, which reduces user operations and is more user-friendly.
[0104] This application uses a preset query intent set to classify query intents, which can divide business query intents with special requirements into finer dimensions, does not provide unified business query processing for several business query intents, and more flexibly converts the format of the corresponding query slot for a single business query intent, making it convenient for users to expand and distinguish some business query intents in demand, and the obtained business query results are more in line with user requirements.
[0105] Figure 3 A structural diagram of a data post-processing system 300 for business data query provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the system includes:
[0106] The first determination module 301 is used to determine the corresponding business query intention and query slot based on the business query information from the upstream language model. The matching module 302 is used to match the business query intention with the preset query intention set to determine the corresponding query intention category according to the matching result. The second determination module 303 is used to determine the slot category corresponding to the query slot according to the query intention category and the preset slot filtering condition. Among them, the preset slot filtering condition is used to filter the slot category corresponding to the query intention category from the preset slot category list. There is a mapping relationship between the slot category and the preset format mapping rule. The format conversion module 304 is used to convert the query slot into a format when it is determined that the slot category meets the format conversion condition to obtain a standard query slot after the format conversion. The generation module 305 is used to generate post-processing information corresponding to the business query information based on the standard query slot and the business query intention, and use it as input information for the downstream task to execute the corresponding downstream task according to the input information.
[0107] In the embodiment of the present application, the first determining module 301 is specifically configured to:
[0108] The business query information is converted into the first JSON format data. According to the key-value pairs corresponding to the intent attributes and the key-value pairs corresponding to the slot attributes in the first JSON format data, the business query intent and the query slots corresponding to the business query intent are determined. One business query intent corresponds to at least one query slot.
[0109] In the embodiment of the present application, the system can also:
[0110] Obtain some historical query intent text information. The historical query intent text information includes a query short text group corresponding to the annotated query intent. The query short text group includes one or more query short text groups corresponding to the same annotated query intent. Add the annotated query intent corresponding to each historical query intent text information to the preset query intent set as a query intent category.
[0111] The system can also:
[0112] Based on the user's annotation operations on each query short text group in the same query intent category, the annotation slot category corresponding to each query short text group is determined, so as to generate a preset slot category list according to each annotation slot category and the corresponding query intent category. Among them, there is a mapping relationship between the annotation slot category and the preset format mapping rule. The preset format mapping rule includes at least: the slot category is a standard query slot, the slot category is a slot to be converted to a standard, and the slot category is a slot to be completed for conversion.
[0113] In the embodiment of the present application, the matching module 302 is specifically used for:
[0114] Encode the business query intent and the corresponding query slot to generate an intent matching vector. Calculate the similarity between the intent matching vector and the to-be-matched vector corresponding to each query intent category in the preset query intent set to obtain each intent matching similarity. Generate a similarity sequence corresponding to each intent matching similarity through the bubble sort algorithm, take the intent matching similarity corresponding to the largest element in the similarity sequence as the selected similarity, and add the selected similarity to the matching result to determine the query intent category corresponding to the selected similarity.
[0115] In the embodiment of the present application, the second determining module 303 can specifically:
[0116] In the case where the slot category is a slot to be converted to a standard, it is determined that the slot category meets the format conversion conditions, and the standard data format corresponding to the query slot is determined according to the query intent category, so that the query slot is format-converted according to the standard data format to obtain a standard query slot. In the case where the slot category is a slot to be completed and converted, it is determined that the slot category meets the format conversion conditions, and based on the query slot and the preset natural language understanding model, the corresponding multi-level completion slots are determined, so that the multi-level completion slots are format-converted according to the multi-level completion slots and the corresponding standard data format to obtain a standard query slot. The system can also: in the case where the slot category is a standard query slot, determine that the slot category does not meet the format conversion conditions, and determine that the query slot is a standard query slot.
[0117] The second determining module 303 may further specifically:
[0118] The query short text in each query slot is input into the preset natural language understanding model to determine whether there is an associated query short text. Association means that at least two query short texts are in the same business query dimension and constitute a complete query condition of the business query dimension. The business query dimension includes at least: business query intent, query time, and query quantity. If it exists, according to the associated query short text, determine that each corresponding query slot is a multi-level completion slot. If it does not exist, according to the preset natural language understanding model and the business query dimension corresponding to the query short text, determine the multiple completion slots of the corresponding business query dimension contained in the query short text to generate the corresponding multi-level completion slots.
[0119] The generation module 305 can specifically:
[0120] According to the preset data query sequence corresponding to the business query intent, the standard query slots are sorted. The sorted standard query slots and business query intent are converted into second JSON format data to obtain post-processing information.
[0121] In the embodiment of the present application, the system can also:
[0122] Obtain business query feedback information from the user terminal. Generate corresponding update information for the preset query intention set according to the business query feedback information.
[0123] Figure 4 A structural diagram of a data post-processing device for business data query provided in an embodiment of the present application, such as Figure 4 As shown, the device includes:
[0124] At least one processor; and a memory in communication with the at least one processor. The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:
[0125] Based on the business query information from the upstream language model, determine the corresponding business query intent and query slot. Match the business query intent with the preset query intent set to determine the corresponding query intent category based on the matching result. Determine the slot category corresponding to the query slot based on the query intent category and the preset slot filtering condition. Among them, the preset slot filtering condition is used to filter the slot category corresponding to the query intent category from the preset slot category list. There is a mapping relationship between the slot category and the preset format mapping rule. When it is determined that the slot category meets the format conversion condition, the query slot is format converted to obtain a standard query slot after the format conversion. Based on the standard query slot and business query intent, generate post-processing information corresponding to the business query information, and use it as input information for downstream tasks to execute corresponding downstream tasks based on the input information.
[0126] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system and device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0127] The system and equipment provided in the embodiments of the present application correspond one-to-one to the method. Therefore, the system and equipment also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the system and equipment will not be repeated here.
[0128] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0129] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A data post-processing method for business data query, characterized in that: The method is applied after the AI assistant in the ERP system processes the natural language; the method comprises: Based on the business query information from the upstream language model, determine the corresponding business query intent and query slot; Matching the business query intent with a preset query intent set to determine a corresponding query intent category according to the matching result; According to the query intent category and the preset slot filtering condition, determine the slot category corresponding to the query slot; wherein the preset slot filtering condition is used to filter the slot category corresponding to the query intent category from the preset slot category list; there is a mapping relationship between the slot category and the preset format mapping rule; When it is determined that the slot category meets the format conversion condition, the query slot is format converted to obtain a standard query slot after format conversion; Based on the standard query slot and the business query intent, generate post-processing information corresponding to the business query information and use it as input information of a downstream task, so as to execute the corresponding downstream task according to the input information; Wherein, before matching the business query intent with a preset query intent set to determine a corresponding query intent category according to the matching result, the method further includes: Acquire a number of historical query intent text information; wherein the historical query intent text information includes a query short text group corresponding to the marked query intent; the query short text group includes one or more query short text subgroups corresponding to the same marked query intent; Adding the annotated query intent corresponding to each of the historical query intent text information to the preset query intent set as the query intent category; Before determining the slot category corresponding to the query slot according to the query intent category and the preset slot filtering condition, the method further includes: Based on the user's respective marking operations on each of the query short text groups in the same query intent category, the marked slot category corresponding to each of the query short text groups is determined, so as to generate the preset slot category list according to each of the marked slot categories and the corresponding query intent category; wherein the marked slot category has the mapping relationship with the preset format mapping rule; the preset format mapping rule at least includes: the slot category is the standard query slot, the slot category is the slot to be converted to the standard, and the slot category is the slot to be completed for conversion; When it is determined that the slot category meets the format conversion condition, the query slot is format converted to obtain a standard query slot after the format conversion, specifically including: In the case where the slot category is the slot to be converted to standard, determining that the slot category satisfies the format conversion condition, and determining the standard data format corresponding to the query slot according to the query intent category, so as to perform format conversion on the query slot according to the standard data format to obtain the standard query slot; In the case where the slot category is the to-be-filled conversion slot, determining that the slot category meets the format conversion condition, and determining the corresponding multi-level filling slot based on the query slot and the preset natural language understanding model, so as to perform format conversion on the multi-level filling slot according to the multi-level filling slot and the corresponding standard data format to obtain the standard query slot; The method further comprises: In the case where the slot category is the standard query slot, determining that the slot category does not satisfy the format conversion condition, and determining that the query slot is the standard query slot; Wherein, based on the query slot and the preset natural language understanding model, the corresponding multi-level filling slot is determined, specifically including: Inputting the query short text in each query slot into the preset natural language understanding model to determine whether there is an associated query short text; the association means that at least two query short texts are in the same business query dimension and constitute a complete query condition of the business query dimension; the business query dimension at least includes: business query intention, query time, and query quantity; the multi-level completion slot is a slot group consisting of multiple associated query slots; If so, determining the corresponding query slots as the multi-level completion slots according to the associated query short text; If it does not exist, based on the preset natural language understanding model and the business query dimension corresponding to the query short text, multiple filling slots corresponding to the business query dimension contained in the query short text are determined to generate the corresponding multi-level filling slots.
2. A data post-processing method for business data query according to claim 1, characterized in that: Based on the business query information from the upstream language model, the corresponding business query intent and query slot are determined, including: Convert the business query information into first JSON format data; According to the key-value pairs corresponding to each intent attribute and the key-value pairs corresponding to each slot attribute in the first JSON format data, the business query intent and the query slots corresponding to the business query intent are determined; one business query intent corresponds to at least one query slot.
3. A data post-processing method for business data query according to claim 1, characterized in that: The business query intent is matched with a preset query intent set to determine a corresponding query intent category according to the matching result, specifically including: Encode the business query intent and the corresponding query slot to generate an intent matching vector; Calculate the similarity between the intent matching vector and the to-be-matched vectors corresponding to each of the query intent categories in the preset query intent set to obtain each intent matching similarity; A similarity sequence corresponding to each of the intention matching similarities is generated through a bubble sort algorithm, the intention matching similarity corresponding to the largest element in the similarity sequence is used as the selected similarity, and the selected similarity is added to the matching result to determine the query intention category corresponding to the selected similarity.
4. A data post-processing method for business data query according to claim 1, characterized in that: Based on the standard query slot and the business query intent, post-processing information corresponding to the business query information is generated, specifically including: Sorting the standard query slots according to a preset data query sequence corresponding to the business query intent; The sorted standard query slots and the business query intent are converted into second JSON format data to obtain the post-processing information.
5. The data post-processing method for business data query according to claim 1, characterized in that: The method further comprises: Obtaining service query feedback information from user terminals; According to the business query feedback information, corresponding update information for the preset query intention set is generated.
6. A data post-processing system for business data query, characterized in that: The system comprises: A first determination module, used to determine corresponding business query intentions and query slots based on business query information from an upstream language model; A matching module, used to match the business query intent with a preset query intent set to determine a corresponding query intent category according to the matching result; The second determination module is used to determine the slot category corresponding to the query slot according to the query intent category and the preset slot filtering condition; wherein the preset slot filtering condition is used to filter the slot category corresponding to the query intent category from the preset slot category list; there is a mapping relationship between the slot category and the preset format mapping rule; A format conversion module, configured to convert the query slot into a format when it is determined that the slot category meets the format conversion condition, so as to obtain a standard query slot after the format conversion; A generation module, used to generate post-processing information corresponding to the business query information based on the standard query slot and the business query intent, and use the post-processing information as input information of the downstream task, so as to execute the corresponding downstream task according to the input information; Among other things, the system can also: Acquire a number of historical query intent text information; wherein the historical query intent text information includes a query short text group corresponding to the marked query intent; the query short text group includes one or more query short text subgroups corresponding to the same marked query intent; Adding the annotated query intent corresponding to each of the historical query intent text information to the preset query intent set as the query intent category; The system is also capable of: Based on the user's respective marking operations on each of the query short text groups in the same query intent category, the marked slot category corresponding to each of the query short text groups is determined, so as to generate the preset slot category list according to each of the marked slot categories and the corresponding query intent category; wherein the marked slot category has the mapping relationship with the preset format mapping rule; the preset format mapping rule at least includes: the slot category is the standard query slot, the slot category is the slot to be converted to the standard, and the slot category is the slot to be completed for conversion; The second determination module can specifically: In the case where the slot category is the slot to be converted to standard, determining that the slot category satisfies the format conversion condition, and determining the standard data format corresponding to the query slot according to the query intent category, so as to perform format conversion on the query slot according to the standard data format to obtain the standard query slot; In the case where the slot category is the to-be-filled conversion slot, determining that the slot category meets the format conversion condition, and determining the corresponding multi-level filling slot based on the query slot and the preset natural language understanding model, so as to perform format conversion on the multi-level filling slot according to the multi-level filling slot and the corresponding standard data format to obtain the standard query slot; The system is also capable of: In the case where the slot category is the standard query slot, determining that the slot category does not satisfy the format conversion condition, and determining that the query slot is the standard query slot; The second determination module can specifically further: Inputting the query short text in each query slot into the preset natural language understanding model to determine whether there is an associated query short text; the association means that at least two query short texts are in the same business query dimension and constitute a complete query condition of the business query dimension; the business query dimension at least includes: business query intention, query time, and query quantity; the multi-level completion slot is a slot group consisting of multiple associated query slots; If so, determining the corresponding query slots as the multi-level completion slots according to the associated query short text; If it does not exist, based on the preset natural language understanding model and the business query dimension corresponding to the query short text, multiple filling slots corresponding to the business query dimension contained in the query short text are determined to generate the corresponding multi-level filling slots.
7. A data post-processing device for business data query, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a data post-processing method for business data query as described in any one of claims 1 to 5 above.
