Method and device for improving recognition and query of valid data by artificial intelligence model
Through context recognition and rewriting to generate standardization problems, the misunderstanding and misjudgment of the artificial intelligence model when identifying the natural language of the user, and increase the accuracy of the answer to the answer output.
Patent Information
- Application Number
- CN202411866433.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-12-18
AI Technical Summary
In the prior art, artificial intelligence models are prone to misunderstandings, misjudgments and incomprehensions when identifying user's natural language problems, resulting in low accuracy of question-and-answer output.
By obtaining the current natural language problems and historical natural language issues entered by the user, context recognition, and select the target historical natural language issues from the same context from the current natural language problem in the same context. The problem rewrite the current natural language problems, generate standardized problems, and enter the artificial intelligence model to get the answer.
By providing high -correlation context information, rewrite the current natural language problems, generate more clear standardization problems, reduce the misunderstanding and misjudgment risks of artificial intelligence models when identifying user problems, and improve the accuracy of the answers to Q & A output.
Smart Images

Figure CN119336875A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method and device for improving artificial intelligence model recognition and query effective data. Background Art
[0002] Artificial intelligence models are generally trained using a large amount of vectorized data, which can generate natural language text or understand the meaning of natural language text. This allows users to interact with data in a more intuitive way, simplifying the process of obtaining information. However, the natural language questions input by users contain a large number of expressions with complex business logic, strong professional attributes, and colloquial language. These expressions can cause misunderstandings, misjudgments, and misunderstandings when the artificial intelligence model identifies user questions, which in turn leads to a low accuracy rate in the output of answers by the artificial intelligence model when answering questions. Summary of the invention
[0003] The present invention provides a method and device for improving the ability of an artificial intelligence model to identify and query valid data, so as to solve the defects of misunderstanding, misjudgment and misunderstanding of the artificial intelligence model in the prior art when identifying user questions, and to improve the accuracy of the artificial intelligence model's output of answers when conducting question-answering.
[0004] The present invention provides a method for improving the ability of an artificial intelligence model to identify valid query data, comprising: Get the current natural language question entered by the user; In the case of determining a historical natural language question input by the user, performing context recognition on the current natural language question and the historical natural language question, and obtaining a target historical natural language question in the same context as the current natural language question from the historical natural language question; Rewrite the current natural language question based on the target historical natural language question to obtain a standardized question; The standardized question is input into the artificial intelligence model to obtain the answer output by the artificial intelligence model.
[0005] According to a method for improving the recognition of effective query data by an artificial intelligence model provided by the present invention, a target historical natural language question in the same context as the current natural language question is obtained from the historical natural language question, specifically comprising: Acquire multiple historical natural language questions in the same context as the current natural language question from the historical natural language questions, obtain the time length rankings between the multiple historical natural language questions and the current natural language question in the time dimension, and select the top k historical natural language questions ranked in time length as target historical natural language questions.
[0006] According to a method for improving the effective data of query recognition by an artificial intelligence model provided by the present invention, the current natural language question is rewritten based on the target historical natural language question, specifically comprising: Determine a reference relationship between the target historical natural language question and the current natural language question, and perform reference replacement and rewriting processing on the current natural language question based on the reference relationship; and / or An omission relationship between the target historical natural language question and the current natural language question is determined, and an omission completion and rewriting process is performed on the current natural language question based on the omission relationship.
[0007] According to a method for improving effective data recognition of an artificial intelligence model provided by the present invention, after obtaining the current natural language question input by the user, the method further includes: In the case where the historical natural language question input by the user is not determined, the current natural language question is subjected to reference replacement and rewriting processing based on preset rules to obtain a standardized question.
[0008] According to a method for improving effective data for querying artificial intelligence model recognition provided by the present invention, after obtaining the standardized question, the method further includes: Performing part-of-speech analysis on the standardized question to obtain a part-of-speech analysis result, and marking the nouns in the standardized question based on the part-of-speech analysis result; Inputting the annotated standardized questions into the NER model to obtain entity labels of nouns output by the NER model; the NER model is trained based on sample standardized questions carrying noun entity labels; Performing element recognition processing on the standardization problem based on the entity tag of the noun to obtain an element extraction problem; Obtaining a preset keyword list, performing matching processing on the element extraction question based on the preset keyword list, and generating an element parameter pair of the standardization question; the element parameter pair includes an entity, an entity name, and an entity code; The entity encoding is used to replace the entity in the standardized question to generate an encoded question.
[0009] According to a method for improving effective data recognition of an artificial intelligence model provided by the present invention, after obtaining the current natural language question input by the user, the method further includes: Inputting the current natural language question into a question classification model to obtain a question category output by the question classification model; the question classification model is trained based on sample natural language questions carrying question category labels; Inputting the standardized question into the artificial intelligence model specifically includes: The question category and the standardized question are input into the artificial intelligence model.
[0010] According to a method for improving the recognition of effective query data by an artificial intelligence model provided by the present invention, after marking the nouns in the standardized question based on the part-of-speech analysis result, the method further includes: In the case where the entity in the standardized question includes a name entity and a company entity, obtaining a name corresponding to the name entity, matching the name in a corporate name database corresponding to the company entity, and obtaining a natural person code of the name entity; In the case where the entity in the standardized problem includes the name entity but does not include the company entity, a name corresponding to the name entity is obtained, the name is matched in a preset well-known person name database, and a natural person code of the name entity is obtained.
[0011] According to a method for improving effective data recognition of an artificial intelligence model provided by the present invention, after generating a coded question, the method further includes: Input the coded problem into a table parameter acquisition model to obtain data table column parameters output by the table parameter acquisition model; the table parameter acquisition model is trained based on sample coded problems and sample data table column parameters; Generate a structured query statement based on the data table column parameters and the coded question; The structured query statement, the encoded question and the element parameter pair are input into the artificial intelligence model to obtain the answer output by the artificial intelligence model.
[0012] According to a method for improving the recognition of effective query data by an artificial intelligence model provided by the present invention, the table column parameter acquisition model includes a data table selection unit and a field selection unit; the data table column parameter includes a data table name parameter and a corresponding field parameter; Inputting the coded problem into a table parameter acquisition model, and acquiring the data table parameters output by the table parameter acquisition model, specifically includes: Input the coding problem into the data table selection unit to obtain the data table name parameter output by the data table selection unit based on a preset multidimensional matrix; the preset multidimensional matrix includes a plurality of matrices, each matrix includes a plurality of business domains, each business domain includes a plurality of data tables, each data table corresponds to a data table name parameter and a plurality of field parameters; The encoding problem and the data table name parameter are input into the field selection unit, and the data table name parameter and the corresponding field parameter output by the field selection unit are obtained.
[0013] The present invention also provides a device for improving the ability of an artificial intelligence model to identify and query valid data, comprising: The current question acquisition module is used to obtain the current natural language question input by the user; A historical question acquisition module is used to, when determining a historical natural language question input by a user, perform context recognition on the current natural language question and the historical natural language question, and acquire a target historical natural language question in the same context as the current natural language question from the historical natural language question; A standardized question acquisition module, configured to rewrite the current natural language question based on the target historical natural language question to obtain a standardized question; The answer acquisition module is used to input the standardized question into the artificial intelligence model to obtain the answer output by the artificial intelligence model.
[0014] The method and device for improving the ability of an artificial intelligence model to recognize and query effective data provided by the present invention obtain the current natural language question and historical natural language question input by the user, select the target historical natural language question from the historical natural language questions according to the same context, rewrite the current natural language question based on the target historical natural language question to obtain a standardized question, and can rewrite the current natural language question to obtain a standardized question with clearer meaning through the contextual information with relatively high relevance provided by the target historical natural language question, thereby reducing the risk of misunderstanding, misjudgment and misunderstanding of the artificial intelligence model when recognizing user questions, and improving the accuracy of the answers output by the artificial intelligence model when answering questions. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 It is a flow chart of the method for improving the artificial intelligence model recognition and query effective data provided by the present invention.
[0017] Figure 2 It is one of the framework schematic diagrams of the method for improving the artificial intelligence model recognition and query effective data provided by the present invention.
[0018] Figure 3 This is the second framework diagram of the method for improving the artificial intelligence model recognition and query effective data provided by the present invention.
[0019] Figure 4This is the third framework diagram of the method for improving the artificial intelligence model recognition and query effective data provided by the present invention.
[0020] Figure 5 This is the fourth framework diagram of the method for improving the artificial intelligence model recognition and query effective data provided by the present invention.
[0021] Figure 6 It is a structural schematic diagram of a device for improving artificial intelligence model recognition and querying effective data provided by the present invention.
[0022] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below with reference to the drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] According to the following Figure 1-Figure 6 The present invention describes a method and device for improving the ability of an artificial intelligence model to identify and query valid data.
[0025] Figure 1 : is a flow chart of a method for improving the recognition and querying of effective data by an artificial intelligence model provided by the present invention, such as Figure 1 As shown, the method includes: Step 101: Obtain the current natural language question input by the user.
[0026] The current natural language question refers to the latest specific query request raised by the user during the interaction with the dialogue system such as the artificial intelligence model. The content of the current natural language question may include ambiguous information such as unclear reference or incomplete information. For example, the current natural language question can be which companies have been recently established nearby, or which companies he has invested in, etc.
[0027] For example, the question text input by the user to the artificial intelligence model at the current moment can be obtained through input devices such as a keyboard or a touch screen.
[0028] Step 102: When determining a historical natural language question input by the user, context recognition is performed on the current natural language question and the historical natural language questions, and a target historical natural language question in the same context as the current natural language question is obtained from the historical natural language questions.
[0029] Historical natural language questions refer to specific query requests raised before the current natural language question during the interaction with a dialogue system such as an artificial intelligence model.
[0030] Context refers to the surrounding environment or background of the natural language question input by the user. Context recognition refers to identifying the context of the natural language question input by the user, such as the context of the current natural language question and the context of a certain historical natural language question, to determine whether the context of the current natural language question and the context of a certain historical natural language question are the same.
[0031] For example, when the current natural language question input by the user is not the first question, it is determined that there are historical natural language questions input by the user and the historical natural language questions input by the user can be obtained according to a preset method. For example, a retrieval process can be preset, and when the current natural language question input by the user is received and it is determined that there are historical natural language questions, the historical natural language questions are retrieved from a specified area.
[0032] After obtaining the historical natural language question input by the user, context recognition may be performed on the current natural language question and the obtained historical natural language questions to select a target historical natural language question in the same context as the current natural language question from the historical natural language questions.
[0033] Step 103: rewrite the current natural language question based on the target historical natural language question to obtain a standardized question.
[0034] Standardized questions are questions that reduce the number of possible understandings of the question text or eliminate the ambiguity of the question text in understanding. The number of possible understandings refers to the number of possible understandings.
[0035] The target historical natural language questions in the same context can provide contextual information that is highly relevant to the current natural language question. Based on the highly relevant contextual information, the meaning of the current natural language question can be more clearly understood, and the accuracy and coherence of question understanding can be improved. On this basis, the current natural language question can be rewritten to obtain a standardized question with clearer meaning.
[0036] For example, when the current natural language question is: "Is it raining heavily?", the current natural language question itself has multiple possible meanings, and answering on this basis has a high probability of getting a wrong answer. When the target historical natural language question in the same context is obtained, it can be: "Will it rain in Haidian today?", the current natural language question can be rewritten to obtain a standardized question: "Will it rain heavily in Haidian today?" This can make the meaning of the standardized question clearer and reduce the probability of getting a wrong answer.
[0037] Step 104: input the standardized question into the artificial intelligence model to obtain the answer output by the artificial intelligence model.
[0038] The artificial intelligence model is any trained question-answering model. In this embodiment, there is no specific limitation on the type of artificial intelligence model. It can be a general artificial intelligence question-answering model, or an artificial intelligence question-answering model for a specific business aspect after fine-tuning.
[0039] The method for improving the ability of an artificial intelligence model to recognize and query valid data provided by an embodiment of the present invention obtains a current natural language question and a historical natural language question input by a user, selects a target historical natural language question from the historical natural language questions according to the same context, and rewrites the current natural language question based on the target historical natural language question to obtain a standardized question. The method can rewrite the current natural language question to obtain a standardized question with clearer meaning through contextual information with relatively high relevance provided by the target historical natural language question, thereby reducing the risk of misunderstanding, misjudgment and misunderstanding of the artificial intelligence model when identifying user questions, and improving the accuracy of the answers output by the artificial intelligence model when answering questions.
[0040] Based on the above embodiment, obtaining a target historical natural language question in the same context as the current natural language question from the historical natural language question specifically includes: Acquire multiple historical natural language questions in the same context as the current natural language question from the historical natural language questions, obtain the time length rankings between the multiple historical natural language questions and the current natural language question in the time dimension, and select the top k historical natural language questions ranked in time length as target historical natural language questions.
[0041] Time length refers to the time difference between two moments, for example, the time length between 12:05 and 12:10 is 300 seconds. Time length ranking refers to the ranking of the time difference between the corresponding moment of each historical natural language question and the corresponding moment of the current natural language question in the same context.
[0042] Selecting the top k historical natural language questions in terms of time length may be selecting the k historical natural language questions including the first one in the case of ranking in ascending order, or selecting the k historical natural language questions including the last one in the case of ranking in descending order. The top k historical natural language questions in terms of time length are the k historical natural language questions including the historical natural language question with the smallest time difference between the corresponding time of the historical natural language question and the corresponding time of the current natural language question.
[0043] Among them, k in the top k time length ranking can be determined according to the actual application scenario, and the specific value of k is not limited in detail in this embodiment. For example, the specific value of k can be 9 to obtain more context information; the specific value of k can also be 5 to reduce the computing resources required in subsequent processing.
[0044] In this embodiment, when rewriting the current natural language question, not all historical natural language questions in the same context are used. Instead, k target historical natural language questions are selected to reduce the risk of reasoning confusion caused by an excessive number of target historical natural language questions and to enhance the clarity of the meaning of the obtained standardized question.
[0045] In order to obtain a standardized question that is more in line with natural semantics, based on any of the above embodiments, the current natural language question is rewritten based on the target historical natural language question, specifically including: determining the reference relationship between the target historical natural language question and the current natural language question, and performing reference replacement rewriting on the current natural language question based on the reference relationship.
[0046] The reference relationship refers to a word or phrase in the current natural language question that refers to another word or phrase in a target historical natural language question. In other words, the relationship between a word in the current natural language question and another corresponding word in the target historical natural language question is the reference relationship. Therefore, identifying the reference relationship between the target historical natural language question and the current natural language question and replacing the pronouns in the current natural language question can generate standardized questions that are more in line with natural semantics.
[0047] For example, the current natural language question is which companies he has invested in. The target historical natural language question includes who is the legal representative of Vision XX Company. The current natural language question and the target historical natural language question can be input into the pre-trained qwen-max model. After obtaining the specific reference relationship through the qwen-max model combined with Few-shot-Cot line reasoning, the reference replacement rewriting processing is performed based on the specific reference relationship, and the processed standardized question is output. The standardized question can be which companies the legal representative of Vision XX Company has invested in.
[0048] In order to obtain a standardized question that is more in line with natural semantics, in another embodiment, the current natural language question is rewritten based on the target historical natural language question, which specifically also includes: determining the omission relationship between the target historical natural language question and the current natural language question, and performing omission completion and rewriting processing on the current natural language question based on the omission relationship.
[0049] The omitted relationship refers to the information that is omitted or not directly expressed in the current natural language question. This omitted or not directly expressed information can be obtained in the target historical natural language question, so as to fully understand the meaning expressed by the text of the current natural language question. Therefore, identifying the omitted relationship between the target historical natural language question and the current natural language question, and completing the omitted part in the current natural language question can generate a standardized question that is more in line with natural semantics.
[0050] For example, the current natural language question is which ones are in Beijing. The target historical natural language questions include who is the legal representative of Vision XX Company, which companies he has invested in, etc. The current natural language question and the target historical natural language question can be input into a pre-trained large language model, and after the large language model is used to infer the specific omitted relationship, the omission completion and rewriting processing is performed based on the specific omitted relationship, and the processed standardized question is output. The standardized question can be which companies in Beijing are invested by the legal representative of Vision XX Company.
[0051] Furthermore, in one embodiment, after obtaining the current natural language question, the current natural language question is sent to the designated area and stored in association with the historical language question according to a preset method. In this way, when determining the historical natural language question input by the user to obtain the target historical natural language question, the question after the rewriting process can be used as the target historical natural language question, thereby reducing the number of target historical natural language questions while determining the richness of the situational information provided by the target historical natural language question.
[0052] For example, the current natural language question is which of them are engaged in real estate and which enterprises they have invested in. The target historical natural language question includes who is the legal person of the vision XX company, which enterprises they have invested in and which are in Beijing.
[0053] In this way, the current natural language question and the target historical natural language question can be input into the pre-trained qwen-max model, and after the specific reference relationship is obtained through reasoning with the qwen-max model combined with Few-shot-Cot, the reference replacement rewriting processing is performed based on the specific reference relationship, and the processed standardized question is output. The standardized question can be which real estate companies in Beijing are invested by the legal representative of Vision XX Company. Compared with which real estate companies he invested in, the standardized question in this embodiment can provide richer contextual information.
[0054] Exemplarily, prompt words can be constructed based on pre-constructed prompt word templates, reference relationships and / or omission relationships, current natural language questions, and target historical natural language questions, and the prompt words can be input into a general artificial intelligence model to obtain standardized questions output by the general artificial intelligence model.
[0055] The following shows a prompt word template: You are a language analysis expert, good at dealing with reference elimination and omission completion in human conversations. You obtain interrogative sentences from the historical records provided by users to infer the reference relationship and omitted content in the user's new questions and complete them. Do not answer the user's questions, do not add fabricated elements, and only rewrite the questions; Task Description: Given a series of historical conversation records, your task is to analyze the user's questions and perform reference resolution and omission completion when necessary. Please analyze the historical records step by step; The reference relationship in the user's question needs to be completed to ensure that the new question can express more complete semantic information; Historical conversation records: %s; User question: %s; Task requirements: The returned results must not contain explanatory information, and the most accurate inference results must be extracted from them. The returned data starts with # and ends with #; Do not analyze non-question sentences in the history records. If the user's question is a non-question sentence, the user's question must be returned. Otherwise, the result returned must be a question sentence. If there is no contextual relationship between the user question and the history record, no processing is required and the user question is returned directly; If the user's question contains parallel conjunctions such as "at the same time" and "and", the user's question needs to be revised and completed based on the historical conversation records; If the user's question is a question and contains references or ellipsis, replace it with specific information to make the sentence more complete; If the user question is not a question or does not contain reference or omission, the user question must be returned; Make sure the revised questions can be understood independently, and their meaning can be understood even without reading the historical dialogue; The following are sample examples: Example 1: xxxxx ? Return: #xxxxx#; Example 2: xxxxx ? Returns: #xxxxx#.
[0056] In the above prompt word template, %s is a specific related text in actual application.
[0057] In the process of interacting with dialogue systems such as artificial intelligence models, the questions input by users are generally short, and it is difficult for artificial intelligence models to guess the user's intention through the questions input by users. For example, the question input by the user is which companies have been established recently nearby. In the absence of historical questions, the specific meanings of nearby and recent are difficult to determine.
[0058] To solve the above technical problem, based on any of the above embodiments, after obtaining the current natural language question input by the user, the method further includes: In the case where the historical natural language question input by the user is not determined, the current natural language question is subjected to reference replacement and rewriting processing based on preset rules to obtain a standardized question.
[0059] Exemplarily, the location-related information in the user's question can be replaced according to the geographic location coordinates of the user's device, for example, the "nearby" in the above example can be replaced with the geographic location coordinates of the user's device. Some word mappings can also be replaced with specified meanings according to business definitions, such as replacing "recently" with "recent three months". In this way, the question text input by the user in Haidian District, Beijing on 2024-10-01 to the large language model in the above example: What are the companies that have been established recently nearby? After processing, it can be standardized into the question: What are the companies established after 2024-07-01 in Haidian District, Beijing.
[0060] Exemplarily, prompt words can be constructed based on the current natural language question and a prompt word template pre-constructed according to preset rules, and the prompt words can be input into the general artificial intelligence model to obtain a standardized question output by the general artificial intelligence model.
[0061] The following shows a prompt word template: Please extract all dates, including words representing dates, based on the user's question; For example: related words such as this year, the year before last, and the past three years. The phrase must be converted into the standard date format YYYY-MM-DD according to the current time, and the date must include the first day of the date to the last day of the date instead of taking a random time point. Note that the current date is: [2024-09-25]; The following is an example: Example 1: What is the production volume of civil drones in Guangdong Province in the past two years? Return to 2022-01-01, 2023-12-31; Example 2: What companies were established in 2023? Return 2023-01-01, 2023-12-31; Example 3: What is the latest stock price of XX Company? Return to 2024-09-25; Example 4: What is the revenue of XX Company in the last three years? Return 2021, 2022, and 2023; Require: (1) If the user's question does not contain any information about date or time, return "None"; (2) Return only the extracted standard date without any other unnecessary explanation; (3) The default recent date is three months ago based on the current date; (3) If the date in the user's question is up to today, the latest date should be included; (4) If the user's question only contains year and month, the result is in YYYY-MM format. (5) If there is only year, return in YYYY format; (6) If the user's question contains a quarter, return the end month of the quarter; The current natural language question is: What companies have been recently established in Haidian District, Beijing? During the interaction with dialogue systems such as artificial intelligence models, since company names, industry names, etc. may be relatively long or subject to change, users generally use their aliases, abbreviations, former names or APP names when entering questions. If the artificial intelligence model directly performs subsequent reasoning and query based on the input questions, it may only be able to obtain information that matches the aliases or abbreviations, increasing the risk of giving incorrect answers.
[0062] In order to solve the above technical problem, based on any of the above embodiments, after obtaining the standardization problem, the method further includes: Performing part-of-speech analysis on the standardized question to obtain a part-of-speech analysis result, and marking the nouns in the standardized question based on the part-of-speech analysis result; Inputting the annotated standardized questions into the NER model to obtain entity labels of nouns output by the NER model; the NER model is trained based on sample standardized questions carrying noun entity labels; Performing element recognition processing on the standardization problem based on the entity tag of the noun to obtain an element extraction problem; Obtaining a preset keyword list, performing matching processing on the element extraction question based on the preset keyword list, and generating an element parameter pair of the standardization question; the element parameter pair includes an entity, an entity name, and an entity code; The entity encoding is used to replace the entity in the standardized question to generate an encoded question.
[0063] Part-of-speech analysis refers to analyzing multiple words obtained by segmenting the standardized questions to determine the part-of-speech analysis result of each word, and the part-of-speech analysis result refers to whether the word is a noun, a verb, or an adjective, etc. For example, after obtaining the part-of-speech analysis result of each word, a position tag can be added to the noun in the standardized question to mark the noun in the standardized question, so as to facilitate determining the noun in the standardized question through the position tag.
[0064] The sample standardization questions refer to questions that include keywords in the preset keyword list. According to the context of the sample standardization questions, some nouns in the sample standardization questions are entities, some nouns in the sample standardization questions are not entities, or at least some nouns are not entities.
[0065] The following table is an example of analysis of whether the noun online game is an industry entity.
[0066]
[0067] It is understandable that the sample standardization problem including some nouns that are not entities is essential. The sample element extraction problem is the problem after deleting the entities from the sample standardization problem.
[0068] The entity tags may include NLB and YLB; NLB may indicate that the noun in the standardization question is not an entity, and YLB may indicate that the noun in the standardization question is an entity, and vice versa, which is not specifically limited in this embodiment.
[0069] In one embodiment, the preset keyword list refers to a pre-made list including keywords, keyword names and keyword codes. The preset keyword list may be a list pre-made by industry experts. The keywords are all nouns.
[0070] Exemplarily, all data in a preset keyword list can be loaded and obtained, and the obtained data can be regularized to obtain a legal regular expression, and the element extraction problem can be matched based on the legal regular expression to obtain successfully matched keywords, keyword names and keyword codes, so as to generate element parameter pairs of standardized questions based on these successfully matched keywords, keyword names and keyword codes, and the entities, entity names and entity codes in an element parameter pair correspond to a set of keywords, keyword names and keyword codes.
[0071] It is understandable that the nouns marked in the standardization questions include entities and non-entities. For example, Figure 2 As shown, entities may include enterprises, industries, products and services, natural persons, regions, and time, etc. The NER model can be used to identify whether the nouns in the standardization question are entities in the context of the standardization question. For example, which companies in Beijing have obtained online game licenses? Among them, Beijing is related to the region in the context, and Beijing is an entity; online games are not related to the industry in the context, and online games are non-entities. On this basis, the Beijing code can be used to replace the Beijing in the standardization question, and the companies with the province code 11 that have obtained online game licenses can be obtained.
[0072] In this embodiment, entities in standardized questions are identified through the NER model and a preset keyword list, and the entity codes are used to replace the entities in the standardized questions to generate encoded questions. The entity codes are unique, so it is convenient for the artificial intelligence model to identify the correct entity information and improve the efficiency of subsequent database queries.
[0073] The NER model can be used to determine the nouns in the standardized question according to the position tags in the standardized question, identify the nouns to obtain the entity tags of the nouns, and output the entities or standardized questions carrying the position tags and entity tags.
[0074] The element recognition processing means that when it is determined that the noun in the standardized question after annotation is an entity, the noun is not processed; when it is determined that the noun in the standardized question after annotation is not an entity, the noun is deleted.
[0075] For example, after obtaining the sample standardization problem, it can be imported into the doccano platform for data annotation (also known as data labeling), and the annotated JSON file can be exported. The UIE model is trained based on the annotated JSON file to obtain the NER model. For example, the annotated JSON file is input into the UIE model, and the predicted position and predicted label of the noun output by the UIE model in the sample standardization problem can be obtained. The predicted position and predicted label in the sample standardization problem can be compared with the actual position and actual label in the sample standardization problem to adjust the parameters of the UIE model and obtain a trained NER model.
[0076] In one embodiment, the preset keyword list includes multiple ones, such as an enterprise keyword list, an industry keyword list, an industry chain keyword list, and a product and service keyword list.
[0077] The following table shows examples of keyword lists for some industries.
[0078]
[0079] The following table is an example of a keyword list for some industry chains.
[0080]
[0081] The following table shows some examples of keyword lists for products and services.
[0082]
[0083] In another embodiment, the preset keyword list refers to a pre-made list including entities and entity names; matching processing is performed on the element extraction question based on the preset keyword list to generate the element parameter pairs of the standardization question, specifically including: Perform matching processing on the element extraction question based on the preset keyword list to obtain entity names corresponding to entities in the element extraction question; Execute a pull request according to the entity name to obtain an entity code corresponding to the entity name; An element parameter pair of the standardized question is generated based on the entity, the entity name and the entity code.
[0084] Through data preprocessing, a unique entity name and corresponding entity code can be established for the existing entities such as enterprises, industries, products and services, natural persons, regions and time in the historical database, and the entity name and the corresponding entity code are associated and stored in the designated database. For example, the entity name corresponding to Douyin is Douyin Co., Ltd.
[0085] The pull request refers to sending an entity name to a designated database to obtain an entity code corresponding to the entity name returned by the designated database. In this embodiment, an element parameter pair includes a set of entity, entity name and entity code.
[0086] In one embodiment, when the query result of the specified database is empty, the entity code corresponding to the entity name is created and stored. For example, the current maximum entity code (Max(Id)) can be stored in Redis. When creating an entity code corresponding to a new entity name, the maximum entity code is obtained from Redis and added. For example, the newly added entity code is Max(Id)+1.
[0087] Compared to loading and obtaining all the data in a preset keyword list, regularizing the obtained data to obtain a legal regular expression, matching the feature extraction problem based on the legal regular expression, and obtaining the successfully matched keywords, keyword names and keyword codes, in this embodiment, the entity name corresponding to the entity in the feature extraction problem is obtained through the preset keyword list, and a pull-through request is executed according to the entity name to obtain the entity code corresponding to the entity in the feature extraction problem, which can reduce the components of the legal regular expression and reduce the risk of errors in matching the feature extraction problem based on the legal regular expression.
[0088] like Figure 3 As shown, further, in one embodiment, a pull-through request is executed according to the entity name to obtain the entity code corresponding to the entity name, specifically including: synchronizing the entity name to Open Search, performing text retrieval based on the entity name to obtain the entity code corresponding to the entity name.
[0089] In another embodiment, a pull-through request is executed according to the entity name to obtain the entity code corresponding to the entity name, which specifically includes: synchronizing the entity name to a MySQL database, and obtaining the entity code corresponding to the entity name based on a preset pull-through function in the MySQL database.
[0090] Among them, the preset pull-through function is used to query the corresponding entity code in the MySQL database according to the entity name, and encapsulates the query result into JSON format data and returns it, so that the interface layer can parse the JSON format data to obtain the entity code corresponding to the entity name.
[0091] like Figure 4 As shown, based on any of the above embodiments, after the nouns in the standardized question are marked based on the part-of-speech analysis results, the method further includes: when the entity in the standardized question includes a name entity and a company entity, obtaining the name corresponding to the name entity, matching the name in the corporate name database corresponding to the company entity, and obtaining the natural person code of the name entity. Exemplarily, when the standardized question involves personnel information with the company as an attributive, such as "help me check the profile of Yu X of Wan XX Company", it can be determined that the entity in the standardized question includes the name entity and the company entity, otherwise it is considered that the entity in the standardized question includes the name entity.
[0092] In this embodiment, the name entity is different from the name, and the name entity can be a nickname, alias, etc. For example, in the standardized question "What is the theme of Luo A's New Year's Eve speech", Luo A is a name entity, but Luo A is not a name. Exemplarily, after obtaining the name corresponding to the name entity Luo A as Luo Yi, it can be obtained according to the company entity corresponding to Luo Yi, and the natural person code of Luo A can be obtained by querying in the corresponding corporate name database. The corresponding element parameter pair can be: Luo A, Luo Yi, 1786788XXXX.
[0093] In another embodiment, after marking the nouns in the standardized question based on the part-of-speech analysis result, the method further includes: when the entity in the standardized question includes the name entity but does not include the company entity, obtaining the name corresponding to the name entity, matching the name in a preset celebrity name library, and obtaining the natural person code of the name entity.
[0094] For example, in the standardized question "Which dynasty did Li Si belong to?", the name Li Si corresponding to the name entity can be obtained, and Li Si is matched in the preset database of well-known names to obtain the natural person code of Li Si. The corresponding element parameter pair can be: Li Si, Li Si, 1786782XXXX.
[0095] Based on any of the above embodiments, after obtaining the current natural language question input by the user, the method further includes: Inputting the current natural language question into a question classification model to obtain a question category output by the question classification model; the question classification model is trained based on sample natural language questions carrying question category labels; Inputting the standardized question into the artificial intelligence model specifically includes: The question category and the standardized question are input into the artificial intelligence model.
[0096] The sample natural language question carrying the question category label means that the question category label indicates the real question category of the sample natural language question. In this way, during the training process, after obtaining the predicted question category output by the question classification model, the predicted question category and the real question category can be compared to adjust the parameters of the question classification model to obtain a trained question classification model.
[0097] Sample natural language questions with question category labels can be written by experts or filled in sample templates written by experts through artificial intelligence models.
[0098] Exemplarily, the sample template written by an expert may include a sample natural language question with a slot and its question category label. The sample template is input into a pre-trained artificial intelligence model to obtain a sample natural language question with a question category label output by the pre-trained artificial intelligence model. The pre-trained artificial intelligence model can be used to obtain the corresponding information of the slot from a specified database and fill the corresponding information into the slot as the slot value.
[0099] In this embodiment, the question category is determined by a question classification model, and the question category and standardized question are input into the artificial intelligence model, which can provide more information related to the standardized question, thereby improving the accuracy of the answer output by the artificial intelligence model.
[0100] In the fields of finance, research, and enterprise information data query, a large amount of data with direct value and high business value is organized and stored as structured data in a fixed format. Large language models cannot directly query, retrieve, sort, and filter structured data, and it is unrealistic to fully vectorize large-scale structured data in all scenarios, resulting in low accuracy of the output of answers by large language models when answering questions.
[0101] To solve the above technical problem, based on any of the above embodiments, after generating the coding question, the method further includes: Input the coded problem into a table parameter acquisition model to obtain data table column parameters output by the table parameter acquisition model; the table parameter acquisition model is trained based on sample coded problems and sample data table column parameters; Generate a structured query statement based on the data table column parameters and the coded question; The structured query statement, the encoded question and the element parameter pair are input into the artificial intelligence model to obtain the answer output by the artificial intelligence model.
[0102] The data table column parameters are data table information including data table name and data table fields, etc. The data table name may include the table English name and the table Chinese name, etc., and the data table fields may include the column English name, column Chinese name, constant mapping and field type, etc.
[0103] A structured query statement refers to a query statement applicable to structured data. For example, a structured query statement may be an SQL query statement that complies with the MySQL specification.
[0104] Exemplarily, a prompt word may be generated based on the data table column parameters and the encoded question in combination with a prompt word (Prompt) template, and the prompt word is sent to the artificial intelligence model to obtain a generated structured query statement.
[0105] The following is a prompt word template: You are a database expert who can generate high-performance SQL statements that comply with MySQL specifications based on user needs; Table information: - Table name: ${table English table name} (${table Chinese table name}); - Field: - ${column English name} (${column Chinese name} ${constant mapping}, type: ${field type}}); - Table name: ${table English table name} (${table Chinese table name}); - Field: - ${column English name} (${column Chinese name} ${constant mapping}, type: ${field type}}); Table association: - ${table association method}; User requirements: - ${user needs}; Require: - The output SQL statement should only contain tables related to user requirements; - SQL statements must start and end with #; - All tables need to add dataStatus != 3; - No need for SQL analysis process, directly provide query statements; Please write a SQL query that meets the above requirements.
[0106] The following is an example of a prompt word generated based on the prompt word template: You are a database expert who can generate high-performance SQL statements that comply with MySQL specifications based on user needs; Table information: - Table name: sy_cs_ms_base_entity (entity wide table); - Field: - compCode (company code); - compName (company name); - creditCode (unified social credit code); - industryName (industry name); - regStatusNm (registration status, active / inactive); - estiblishDate (establishment date, type: date); - provinceName (province name); - Table name: sy_cd_ms_cn_comp_innocom_zsyx (high-tech enterprise table); - Field: - compCode (company code); - compName (company name); - provinceCode (province code); Table association: - Table sy_cs_ms_base_entity and table sy_cd_ms_cn_comp_innocom_zsyx are linked through the compCode field; User requirements: - Query the list of high-tech enterprises established in 2020 with province code 11; Require: - The output SQL statement should only contain tables related to user requirements; - SQL statements must start and end with #; - All tables need to add dataStatus != 3; - No need for SQL analysis process, directly provide query statements; Please write a SQL query that meets the above requirements.
[0107] Furthermore, after generating a structured query statement based on the data table column parameters and the coded question, the structured query statement can be parsed to obtain the first table column information, and the first table column information can be compared with the data table name parameter obtained by RAG retrieval; the comparison result is fed back to the table column parameter acquisition model to fine-tune the table column parameter acquisition model. It is also possible to perform a search in a preset database based on the structured query statement, feed back the search result to the table column parameter acquisition model, and fine-tune the table column parameter acquisition model.
[0108] In this embodiment, the data table column parameters corresponding to the coded question are obtained through the table column parameter acquisition model, and a structured query statement is generated based on the data table column parameters and the coded question, which can increase the accuracy of query, retrieval, sorting and filtering processes on structured data.
[0109] In addition, in this embodiment, by inputting the encoding problem and the element parameter pair into the artificial intelligence model, it is possible for the artificial intelligence model to correctly understand the meaning of the encoding problem.
[0110] like Figure 5 As shown, based on any of the above embodiments, the table column parameter acquisition model includes a data table selection unit and a field selection unit; the data table column parameter includes a data table name parameter and a corresponding field parameter; Inputting the coded problem into a table parameter acquisition model, and acquiring the data table parameters output by the table parameter acquisition model, specifically includes: Input the coding problem into the data table selection unit to obtain the data table name parameter output by the data table selection unit based on a preset multidimensional matrix; the preset multidimensional matrix includes a plurality of matrices, each matrix includes a plurality of business domains, each business domain includes a plurality of data tables, each data table corresponds to a data table name parameter and a plurality of field parameters; The encoding problem and the data table name parameter are input into the field selection unit, and the data table name parameter and the corresponding field parameter output by the field selection unit are obtained.
[0111] Exemplarily, the business domain may be the patent field and the copyright field, etc., the matrix may be intellectual property rights and civil litigation, etc., and the multidimensional matrix may be legal affairs.
[0112] The sample coding problem comes from the manually annotated data (pattern knowledge) of a single business domain. In this way, after the coding problem is input into the data table selection unit, the trained data table selection unit can perform RAG (Retrieval Augmented Generation) in the preset vector library, and successively determine the multidimensional matrix, matrix and business domain to which the sample coding problem belongs, and then determine the data table name parameter corresponding to the sample coding problem in the business domain to which the sample coding problem belongs. The data table name parameter can be a data table name or multiple data table names. Exemplarily, the preset vector library can be a lindorm library, which can store data table information and data column information.
[0113] The following table is an example of some data table information.
[0114]
[0115] The following table is an example of some data column information.
[0116]
[0117] After determining the data table name parameter, the preset vector library may be searched based on the corresponding data column information to obtain the field parameter corresponding to the sample encoding problem.
[0118] In this embodiment, when selecting the data table name parameter of the coding problem, the multidimensional matrix, matrix and business domain to which the data table name parameter of the coding problem belongs can be determined, thereby narrowing the data query scope when determining the data table name parameter, further narrowing the data query scope when determining the field parameter, and improving the accuracy of structured data query.
[0119] In order to specifically illustrate the function of the method provided by this embodiment to improve the artificial intelligence model's recognition of effective query data, a specific example is provided below.
[0120] A method for improving the recognition of effective query data by an artificial intelligence model, comprising: obtaining a current natural language question input by a user, and in the case of determining a historical natural language question input by the user, performing context recognition on the current natural language question and the historical natural language question; obtaining a plurality of historical natural language questions in the same context as the current natural language question from the historical natural language questions, obtaining a time length ranking between the plurality of historical natural language questions and the current natural language question in a time dimension, and selecting k historical natural language questions ranked top k in time length as target historical natural language questions; Determine the reference relationship between the target historical natural language question and the current natural language question, and perform reference replacement rewriting processing on the current natural language question based on the reference relationship to obtain a standardized question; and / or determine the omission relationship between the target historical natural language question and the current natural language question, and perform omission completion rewriting processing on the current natural language question based on the omission relationship to obtain a standardized question; Performing part-of-speech analysis on the standardized question to obtain a part-of-speech analysis result, and annotating the nouns in the standardized question based on the part-of-speech analysis result; inputting the annotated standardized question into a NER model to obtain an entity tag of the noun output by the NER model; the NER model is trained based on sample standardized questions with noun entity tags; performing element recognition processing on the standardized question based on the entity tags of the noun to obtain an element extraction question; obtaining a preset keyword list, performing matching processing on the element extraction question based on the preset keyword list, and generating an element parameter pair of the standardized question; the element parameter pair includes an entity, an entity name, and an entity code; using the entity code to replace the entity in the standardized question to generate an encoded question; The coded question is input into a tabular parameter acquisition model to obtain data table column parameters output by the tabular parameter acquisition model; the tabular parameter acquisition model is trained based on sample coded questions and sample data table column parameters; a structured query statement is generated based on the data table column parameters and the coded question; the structured query statement, the coded question and the element parameter pair are input into an artificial intelligence model to obtain an answer output by the artificial intelligence model.
[0121] The method for improving the effective data of artificial intelligence model recognition query provided by the embodiment of the present invention provides high-quality pre-processing for artificial intelligence large models and NL2SQL, etc. to generate SQL query statements with high executable accuracy after optimizing, processing and refining natural language business problems, and pre-processes a large number of colloquial natural language business problems that are not easy for large models or machines and systems to understand, and refines and processes more data outputs that are more accurate and precise for subsequent business problem answers and structured data queries. In addition, by combining with large models and databases, many natural language questions related to data queries can be answered and queried accurately, and according to the technology and method of the invention, the accuracy rate can reach more than 85%, reaching a reliable and usable level.
[0122] The following is a description of the device for improving the artificial intelligence model recognition and query effective data provided by the present invention. The device for improving the artificial intelligence model recognition and query effective data described below and the method for improving the artificial intelligence model recognition and query effective data described above can be referenced to each other.
[0123] Figure 6 is a schematic diagram of the structure of the device for improving the recognition and query of effective data by an artificial intelligence model provided by the present invention, such as Figure 6 As shown, the device comprises: The current question acquisition module 601 is used to acquire the current natural language question input by the user; The historical question acquisition module 602 is used to perform context recognition on the current natural language question and the historical natural language question when determining the historical natural language question input by the user, and acquire a target historical natural language question in the same context as the current natural language question from the historical natural language question; A standardized question acquisition module 603 is used to rewrite the current natural language question based on the target historical natural language question to obtain a standardized question; The answer acquisition module 604 is used to input the standardized question into the artificial intelligence model to obtain the answer output by the artificial intelligence model.
[0124] Figure 7 An example of a structural diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute a method for improving the recognition of effective query data by an artificial intelligence model, the method comprising: obtaining a current natural language question input by a user; in the case of determining a historical natural language question input by the user, performing context recognition on the current natural language question and the historical natural language question, obtaining a target historical natural language question in the same context as the current natural language question from the historical natural language question; rewriting the current natural language question based on the target historical natural language question to obtain a standardized question; inputting the standardized question into the artificial intelligence model to obtain the answer output by the artificial intelligence model.
[0125] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0126] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the method provided by the above-mentioned methods to improve the artificial intelligence model's recognition of effective query data, the method including: obtaining a current natural language question input by a user; when determining a historical natural language question input by the user, performing context recognition on the current natural language question and the historical natural language question, and obtaining a target historical natural language question in the same context as the current natural language question from the historical natural language questions; rewriting the current natural language question based on the target historical natural language question to obtain a standardized question; and inputting the standardized question into the artificial intelligence model to obtain an answer output by the artificial intelligence model.
[0127] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the method provided by the above-mentioned methods for improving the recognition of effective query data by an artificial intelligence model, the method comprising: obtaining a current natural language question input by a user; when determining a historical natural language question input by the user, performing context recognition on the current natural language question and the historical natural language question, and obtaining a target historical natural language question in the same context as the current natural language question from the historical natural language questions; rewriting the current natural language question based on the target historical natural language question to obtain a standardized question; and inputting the standardized question into the artificial intelligence model to obtain an answer output by the artificial intelligence model.
[0128] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0129] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for improving the ability of artificial intelligence models to identify valid query data, characterized in that: include: Get the current natural language question entered by the user; In the case of determining a historical natural language question input by the user, performing context recognition on the current natural language question and the historical natural language question, and obtaining a target historical natural language question in the same context as the current natural language question from the historical natural language question; Rewrite the current natural language question based on the target historical natural language question to obtain a standardized question; The standardized question is input into the artificial intelligence model to obtain the answer output by the artificial intelligence model.
2. The method for improving the ability of artificial intelligence model to identify valid query data according to claim 1, characterized in that: Acquiring a target historical natural language question in the same context as the current natural language question from the historical natural language question, specifically comprising: Acquire multiple historical natural language questions in the same context as the current natural language question from the historical natural language questions, obtain the time length rankings between the multiple historical natural language questions and the current natural language question in the time dimension, and select the top k historical natural language questions ranked in time length as target historical natural language questions.
3. The method for improving the ability of artificial intelligence model to identify valid query data according to claim 1, characterized in that: Rewriting the current natural language question based on the target historical natural language question specifically includes: Determine a reference relationship between the target historical natural language question and the current natural language question, and perform reference replacement and rewriting processing on the current natural language question based on the reference relationship; and / or An omission relationship between the target historical natural language question and the current natural language question is determined, and an omission completion and rewriting process is performed on the current natural language question based on the omission relationship.
4. The method for improving the ability of artificial intelligence model to identify effective query data according to claim 1 or 3, characterized in that: After obtaining the current natural language question input by the user, the method further includes: In the case where the historical natural language question input by the user is not determined, the current natural language question is subjected to reference replacement and rewriting processing based on preset rules to obtain a standardized question.
5. The method for improving the ability of artificial intelligence model to identify valid query data according to claim 1, characterized in that: After obtaining the standardized question, the method further includes: Performing part-of-speech analysis on the standardized question to obtain a part-of-speech analysis result, and marking the nouns in the standardized question based on the part-of-speech analysis result; Inputting the annotated standardized questions into the NER model to obtain entity labels of nouns output by the NER model; the NER model is trained based on sample standardized questions carrying noun entity labels; Performing element recognition processing on the standardization problem based on the entity tag of the noun to obtain an element extraction problem; Obtaining a preset keyword list, performing matching processing on the element extraction question based on the preset keyword list, and generating an element parameter pair of the standardization question; the element parameter pair includes an entity, an entity name, and an entity code; The entity encoding is used to replace the entity in the standardized question to generate an encoded question.
6. The method for improving the ability of artificial intelligence model to identify valid query data according to claim 5, characterized in that: After obtaining the current natural language question input by the user, the method further includes: Inputting the current natural language question into a question classification model to obtain a question category output by the question classification model; the question classification model is trained based on sample natural language questions carrying question category labels; Inputting the standardized question into the artificial intelligence model specifically includes: The question category and the standardized question are input into the artificial intelligence model.
7. The method for improving the ability of artificial intelligence model to identify valid query data according to claim 5, characterized in that: After marking the nouns in the standardized question based on the part-of-speech analysis result, the method further includes: In the case where the entity in the standardized question includes a name entity and a company entity, obtaining a name corresponding to the name entity, matching the name in a corporate name database corresponding to the company entity, and obtaining a natural person code of the name entity; In the case where the entity in the standardized problem includes the name entity but does not include the company entity, a name corresponding to the name entity is obtained, the name is matched in a preset well-known person name database, and a natural person code of the name entity is obtained.
8. The method for improving the ability of artificial intelligence model to identify valid query data according to claim 5 or 7, characterized in that: After generating the encoded question, the method further includes: Input the coded problem into a table parameter acquisition model to obtain data table column parameters output by the table parameter acquisition model; the table parameter acquisition model is trained based on sample coded problems and sample data table column parameters; Generate a structured query statement based on the data table column parameters and the coded question; The structured query statement, the encoded question and the element parameter pair are input into the artificial intelligence model to obtain the answer output by the artificial intelligence model.
9. The method for improving the ability of artificial intelligence model to identify valid query data according to claim 8, characterized in that: The table column parameter acquisition model includes a data table selection unit and a field selection unit; the data table column parameters include a data table name parameter and a corresponding field parameter; Inputting the coded problem into a table parameter acquisition model, and acquiring the data table parameters output by the table parameter acquisition model, specifically includes: Input the coding problem into the data table selection unit to obtain the data table name parameter output by the data table selection unit based on a preset multidimensional matrix; the preset multidimensional matrix includes a plurality of matrices, each matrix includes a plurality of business domains, each business domain includes a plurality of data tables, each data table corresponds to a data table name parameter and a plurality of field parameters; The encoding problem and the data table name parameter are input into the field selection unit, and the data table name parameter and the corresponding field parameter output by the field selection unit are obtained.
10. A device for improving the ability of artificial intelligence models to identify and query valid data, characterized in that: include: The current question acquisition module is used to obtain the current natural language question input by the user; A historical question acquisition module is used to, when determining a historical natural language question input by a user, perform context recognition on the current natural language question and the historical natural language question, and acquire a target historical natural language question in the same context as the current natural language question from the historical natural language question; A standardized question acquisition module, configured to rewrite the current natural language question based on the target historical natural language question to obtain a standardized question; The answer acquisition module is used to input the standardized question into the artificial intelligence model to obtain the answer output by the artificial intelligence model.
Citation Information
Patent Citations
Question statement rewriting method and device, equipment and storage medium
CN110263330A
Intelligent auxiliary decision-making method and device based on enterprise pollution public opinion extraction
CN114386422A
Interactive intelligent question and answer method based on power grid practical training question and answer knowledge base
CN114417880A
Knowledge extraction method for wide-area geographic information knowledge graph construction
CN115965020A
Data query method and device, equipment and storage medium
CN116737756A
Cited By
Structured information extraction method based on artificial intelligence, intelligent agent and device
CN120747526A
Data processing method and device and intelligent system
CN120804248A
Artificial intelligence-based query statement reconstruction method and device, equipment and medium
CN121166854A