User question and answer verification method, electronic equipment and storage medium

By integrating and validating SQL index conditions on user queries, correcting abnormal index conditions, and generating response statements that match user intent, the problem of confusing responses in intelligent question-and-answer systems when semantics are insufficient or incorrect has been solved, thus improving response accuracy and user satisfaction.

CN119271699APending Publication Date: 2025-01-07MOBILE TECH COMPANY CHINA TRAVELSKY HLDG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411390529.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-08
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

Existing intelligent question-answering systems cannot perform anomaly checks when user-submitted questions have insufficient or incorrect semantics, resulting in confusing responses that fail to accurately answer user questions.

Method used

The process involves converting user queries into languages ​​to generate SQL index conditions, integrating these conditions to create an initial SQL index statement, verifying the index results, deleting abnormal index conditions, correcting the index results, and inputting them into a general language model to generate a response statement.

Benefits of technology

It improved the accuracy of user Q&A and user satisfaction, ensuring that the response results matched the user's intent.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271699A_ABST
    Figure CN119271699A_ABST
Patent Text Reader

Abstract

The invention provides a user question and answer verification method, electronic equipment and a storage medium, and the method comprises the steps: carrying out the language conversion of a user question statement, so as to obtain an initial sql index statement; determining an initial index result from an information database according to the initial sql index statement; if the initial index result comprises a question and answer abnormal identifier, determining an abnormal index condition; deleting the abnormal index conditions, and integrating the rest sql index conditions to obtain a corrected sql index statement; according to the corrected sql index statement, determining a corrected index result from the information database; and inputting the corrected index result and the question statement of the user into the universal language model to obtain and output the target reply statement, so that an error natural language question proposed by the user can be effectively corrected, and the obtained reply result is more in line with the question proposed by the user, thereby improving the question answering accuracy of the user and the satisfaction degree of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] The current intelligent question-answering system for users analyzes the questions raised by users, finds the corresponding information data from the database based on the index words obtained from the analysis, and finally generates a reply statement and returns it to the user. When the semantics of the questions raised by users are too few or the questions raised by users are incorrect, since the question-answering system only performs direct semantic conversion on the questions and cannot perform abnormality check on the questions raised by users, the analysis of the questions raised by users by the question-answering system will be abnormal, resulting in confusion in the meaning of the generated reply statement, and failure to accurately answer the questions raised by users. Summary of the invention

[0003] In view of the above technical problems, the technical solution adopted by the present invention is:

[0004] According to one aspect of the present application, a user question and answer verification method is provided, comprising the following steps:

[0005] Step S100: in response to receiving a user question statement, convert the user question statement into a language to obtain a number of SQL index conditions corresponding to the user question statement; each SQL index condition corresponds to an index identifier, and the index identifier indicates an index type of the corresponding SQL index condition;

[0006] Step S200: According to the index identifier corresponding to each SQL index condition, several SQL index conditions are integrated to generate an initial SQL index statement;

[0007] Step S300: Determine the initial index result from the information database according to the initial SQL index statement;

[0008] Step S400: If the initial index result includes a question-answer abnormality identifier, an abnormal index condition is determined from a plurality of SQL index conditions according to the question-answer abnormality identifier; the abnormal index condition is the SQL index condition corresponding to the question-answer abnormality identifier;

[0009] Step S500: Delete the abnormal index condition and integrate the remaining SQL index conditions to obtain a corrected SQL index statement;

[0010] Step S600, determining a revised index result from the information database according to the revised SQL index statement;

[0011] Step S700: input the modified index result and the user's question sentence into a preset general language model to obtain a target answer sentence and output it.

[0012] In an exemplary embodiment of the present application, step S100 includes:

[0013] Step S110, performing multiple rounds of rewriting processing on the user's question sentence to obtain a corresponding target question sentence;

[0014] Step S120: semantically analyze the target question sentence to obtain a semantic identifier corresponding to each target question word included in the target question sentence;

[0015] Step S130, traversing each target question word, if the semantic identifier corresponding to the target question word is a preset key semantic identifier, then determining the target question word as the user's question keyword;

[0016] Step S140: according to the semantic identifier corresponding to each user's question keyword, determine the index identifier corresponding to each user's question keyword from a preset semantic identifier mapping table; the semantic identifier mapping table stores mapping relationships between a plurality of semantic identifiers and index identifiers corresponding to the semantic identifiers;

[0017] Step S150: convert several user question keywords into SQL language to obtain SQL index conditions corresponding to each user question keyword.

[0018] In an exemplary embodiment of the present application, step S200 includes:

[0019] Step S210: sort the index identifiers corresponding to the plurality of SQL index conditions according to the preset index statement composition rule; the index statement composition rule includes the composition order of the index types in the index statement;

[0020] Step S220: According to the order of the plurality of index identifiers, the SQL index conditions corresponding to each index identifier are integrated to obtain an initial SQL index statement.

[0021] In an exemplary embodiment of the present application, step S300 includes:

[0022] Step S310: Obtain the index identifier corresponding to each SQL index condition in the initial SQL index statement, and obtain an index identifier list T = (T1, T2, ..., T m ,...,T q ), where m = 1, 2, ..., q, q is the number of SQL index conditions, T m The index identifier corresponding to the mth SQL index condition in the initial SQL index statement;

[0023] Step S320: traverse the index identifier list T, through T m Corresponding to the index type, a number of response data having the same data type as the index type are determined from the information database;

[0024] Step S330: According to T mThe corresponding sql index condition is traversed through each response data. If there is response data corresponding to the sql index condition, the response data is determined as the index data corresponding to the mth sql index condition, and step S340 is executed; otherwise, a question-answering abnormality flag is generated, and T m and the question-answer anomaly flag are determined as the initial index results;

[0025] Step S340: Integrate a plurality of index data according to a plurality of SQL index conditions in the initial SQL index statement to obtain an integration result;

[0026] Step S350: If an abnormality occurs in the integration result, a question-answer abnormality mark is generated, and the abnormal index data and the question-answer abnormality mark corresponding to the integration result are determined as the initial index result; otherwise, the integration result is determined as the initial index result.

[0027] In an exemplary embodiment of the present application, step S400 includes:

[0028] Step S411: If the initial index result includes a question-answer anomaly indicator, determine whether the initial index result includes index data. If the initial index result includes index data, execute step S412; otherwise, execute step S413;

[0029] Step S412: determining the SQL index conditions corresponding to the plurality of index data included in the initial index result as abnormal index conditions;

[0030] Step S413: Determine, among the plurality of SQL index conditions, the SQL index conditions that have no corresponding relationship with any response data as abnormal index conditions.

[0031] In an exemplary embodiment of the present application, step S600 includes:

[0032] Step S610: According to each sql index condition in the modified sql index statement, the modified index data corresponding to each sql index condition is determined from the information database;

[0033] Step S620: Integrate a plurality of modified index data to obtain a modified index result.

[0034] In an exemplary embodiment of the present application, step S400 further includes:

[0035] Step S421: If the initial index result does not include a question-answer anomaly indicator, the initial index result and the user's question statement are input into a preset general language model to obtain a target answer statement and output it.

[0036] In an exemplary embodiment of the present application, step S150 includes:

[0037] Step S151, performing SQL language conversion on a number of user question keywords to obtain the SQL language keyword corresponding to each user question keyword;

[0038] Step S152, obtaining the character length of each SQL language keyword and the information entropy of each user's question keyword;

[0039] Step S153: If the character length of any SQL language keyword is greater than a preset character length threshold, and the information entropy of the user question keyword corresponding to the SQL language keyword is less than a preset information entropy threshold, then execute step S154; otherwise, determine the SQL language keyword as the SQL index condition of the user question keyword corresponding to the SQL language keyword;

[0040] Step S154, rewrite the sql language keyword according to the preset statement rewriting rule to obtain a rewritten sql keyword corresponding to the sql language keyword; the character length of the rewritten sql keyword is shorter than the character length of the sql language keyword corresponding to the rewritten sql keyword, and the difference between the information entropy corresponding to the rewritten sql keyword and the information entropy of the user question keyword corresponding to the rewritten sql keyword is less than a preset information entropy difference threshold;

[0041] Step S155: determine the rewritten SQL keyword as the SQL index condition of the user question keyword corresponding to the rewritten SQL keyword.

[0042] According to one aspect of the present application, a non-transitory computer-readable storage medium is provided, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the aforementioned user question and answer verification method.

[0043] According to one aspect of the present application, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0044] The present invention has at least the following beneficial effects:

[0045] The user question and answer verification method of the present invention performs language conversion on user question statements to obtain a plurality of sql index conditions, and then integrates the plurality of sql index conditions according to the index identifier corresponding to each sql index condition to generate an initial sql index statement, determines an initial index result according to the initial sql index statement, and verifies the initial index result. If the initial index result includes a question and answer abnormality identifier, it indicates that the initial index result is abnormal and needs to be corrected. Therefore, the abnormal index condition is determined from the plurality of sql index conditions, and the abnormal index condition is deleted. The remaining sql index conditions are integrated again to obtain a corrected sql index statement, and then a corrected index result is determined according to the corrected sql index statement. Finally, the corrected index result and the user question statement are input into a universal language model to obtain a target reply statement output by the universal language model. By verifying the SQL index conditions corresponding to the user's question statement, the abnormal index conditions where the index results may be abnormal are determined, and the corrected index results obtained by the corrected SQL index statement composed of the remaining SQL index conditions except the abnormal index conditions and the user's question statement are input into the common language model for natural language conversion. Incorrect natural language questions raised by users can be effectively corrected, so that the answer results obtained are more in line with the questions raised by users, thereby improving the accuracy of user questions and answers and user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0047] Figure 1 A flowchart of a user question and answer verification method provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0049] like Figure 1 As shown, the user question and answer verification method described in this application includes the following steps:

[0050] Step S100: in response to receiving a user question statement, convert the user question statement into a language to obtain a number of SQL index conditions corresponding to the user question statement;

[0051] User question statements are statements written in natural language proposed by users. Since the data stored in the information database is in computer language, if you want to index it in the information database, you need to convert the natural language. Currently, most of the data in the information database is stored in SQL language. Therefore, it is necessary to convert the natural language user question statements into SQL language statements, and then parse the SQL language statements to obtain SQL index conditions. SQL index conditions are conditional statements for information indexing in the information database. Through the SQL index conditions, you can know the type and location of the information data that needs to be indexed in the information database.

[0052] Each sql index condition corresponds to an index identifier, which indicates the index type of the corresponding sql index condition. The index type may be a user's personal information type, a flight information type, a historical flight information type, etc. When traversing and indexing a number of information data in an information database, first find the corresponding index type of information data through the index identifier, and then find the information data that meets the sql index condition from the information data of the index type, without having to traverse all the information data in the information database one by one. This allows the information data corresponding to the sql index condition to be found more quickly in the information database, thereby improving the indexing speed.

[0053] Further, step S100 includes steps S110 to S150:

[0054] Step S110, performing multiple rounds of rewriting processing on the user's question sentence to obtain a corresponding target question sentence;

[0055] Multiple rounds of rewriting can adopt existing processing methods. Multiple rounds of rewriting are used to semantically supplement user question sentences. If the user question sentence is too simple, such as lacking a subject, if the user question sentence is directly converted into SQL language, the converted SQL statement will also lack corresponding keywords, which will cause abnormalities in subsequent indexes. Therefore, the user question sentence is first rewritten for multiple rounds, and the user question sentence is semantically expanded by connecting the upper and lower sentences of the user's question, and then SQL language conversion is performed, which can improve the accuracy of the user's reply.

[0056] Step S120: semantically analyze the target question sentence to obtain a semantic identifier corresponding to each target question word included in the target question sentence;

[0057] After obtaining the target question sentence, a semantic analysis is performed on the target question sentence, that is, the target question sentence is split into keywords to obtain the target question words included in the target question sentence, wherein the semantic analysis and keyword splitting can adopt the existing analysis methods, and the target question words correspond to semantic identifiers, and the semantic identifiers indicate the semantic type of the corresponding target question words, such as whether the target question word is the subject, predicate, or object of the target question sentence. Through the semantic identifier, it can be determined whether the target question word plays a key role in information indexing.

[0058] Step S130, traversing each target question word, if the semantic identifier corresponding to the target question word is a preset key semantic identifier, then determining the target question word as the user's question keyword;

[0059] The preset key semantic identifier is the semantic identifier of the indispensable semantic type when indexing information. The key semantic identifier can be obtained by performing keyword splitting statistics on several historical natural languages.

[0060] Step S140: According to the semantic identifier corresponding to each keyword in the user's question, determine the index identifier corresponding to each keyword in the user's question from a preset semantic identifier mapping table;

[0061] The semantic identifier mapping table stores mapping relationships between a number of semantic identifiers and index identifiers corresponding to the semantic identifiers. By viewing the semantic identifier mapping table, the mapping relationship between the semantic identifier and the index identifier can be known.

[0062] For example, if the target question sentence is "What time does my flight take off tomorrow?", after semantic analysis of the target question sentence, one of the target question words obtained is "flight", and the semantic identifier corresponding to the target question word is represented as the predicate, and its corresponding index identifier is represented as the flight information type.

[0063] Step S150: converting several user question keywords into SQL language to obtain SQL index conditions corresponding to each user question keyword;

[0064] The sql index condition is a conditional statement with an sql index function obtained after sql language conversion based on the keywords in the user's question.

[0065] Further, step S150 includes steps S151 to S155:

[0066] Step S151, performing SQL language conversion on a number of user question keywords to obtain the SQL language keyword corresponding to each user question keyword;

[0067] The sql language conversion converts the user's question keywords in natural language into sql language keywords in sql language.

[0068] Step S152, obtaining the character length of each SQL language keyword and the information entropy of each user's question keyword;

[0069] The information entropy of a user's question keyword indicates the amount of information contained in the user's question keyword. The larger the information entropy, the more information is contained in the corresponding user's question keyword, that is, the more important the user's question keyword is when indexing information.

[0070] Step S153: If the character length of any SQL language keyword is greater than a preset character length threshold, and the information entropy of the user question keyword corresponding to the SQL language keyword is less than a preset information entropy threshold, then execute step S154; otherwise, determine the SQL language keyword as the SQL index condition of the user question keyword corresponding to the SQL language keyword;

[0071] The character length of the index condition is directly proportional to the index time and the computing power occupied by the index. When indexing information, the longer the character length of the index condition, the greater the computing power occupied by the index and the longer the index time. Therefore, the character length of the index condition becomes a key factor in reducing the index time.

[0072] When the character length of the SQL language keyword is too long and the corresponding information entropy is too low, it means that the amount of information contained in the SQL language keyword is too little and the indexing time is too long. Therefore, in order to reduce the processing volume of information indexing, it is necessary to rewrite the SQL language keyword and shorten its character length.

[0073] Step S154: rewrite the SQL language keyword according to the preset statement rewriting rule to obtain a rewritten SQL keyword corresponding to the SQL language keyword;

[0074] Among them, the character length of the rewritten sql keyword is shorter than the character length of the sql language keyword corresponding to the rewritten sql keyword, and the difference between the information entropy corresponding to the rewritten sql keyword and the information entropy of the user question keyword corresponding to the rewritten sql keyword is less than a preset information entropy difference threshold.

[0075] The sentence rewriting rules are user-defined or system-preset character shortening and rewriting rules. By counting several historical characters, the characters are shortened without losing information, so as to improve data processing efficiency.

[0076] Step S155: determine the rewritten SQL keyword as the SQL index condition of the user question keyword corresponding to the rewritten SQL keyword.

[0077] Step S200: According to the index identifier corresponding to each SQL index condition, several SQL index conditions are integrated to generate an initial SQL index statement;

[0078] By integrating several sql index conditions, an initial sql index statement is obtained. The initial sql index statement is an index statement used for information indexing. Since each sql index condition is looking for different data information, such as the sql index conditions are "flight", "tomorrow", and "take-off time", it is impossible to know the original intention of the user's question by only looking at a single sql index condition. Therefore, all sql index conditions are integrated to obtain the initial sql index statement "flight tomorrow's take-off time" (this statement should be written in sql language, and natural language is used for ease of understanding). The original intention of the user's question can be known through the initial sql index statement.

[0079] Further, step S200 includes steps S210 to S220:

[0080] Step S210: sort the index identifiers corresponding to the plurality of SQL index conditions according to the preset index statement composition rule;

[0081] The index statement composition rule includes the composition order of the index types in the index statement, such as the composition order of the index types is "query time", "flight", and "take-off time".

[0082] Step S220: According to the order of the plurality of index identifiers, the SQL index conditions corresponding to each index identifier are integrated to obtain an initial SQL index statement.

[0083] The integration method of sql index conditions adopts existing sql language writing rules.

[0084] Step S300: Determine the initial index result from the information database according to the initial SQL index statement;

[0085] The initial index result is the result obtained by indexing the information database through the initial SQL index statement.

[0086] Further, step S300 includes steps S310 to S350:

[0087] Step S310: Obtain the index identifier corresponding to each SQL index condition in the initial SQL index statement, and obtain an index identifier list T = (T1, T2, ..., T m ,...,T q ), where m = 1, 2, ..., q, q is the number of SQL index conditions, T mThe index identifier corresponding to the mth SQL index condition in the initial SQL index statement;

[0088] Step S320: traverse the index identifier list T, through T m Corresponding to the index type, a number of response data having the same data type as the index type are determined from the information database;

[0089] When information data in the information database is stored in the information database, it will carry the corresponding data type identifier to indicate the data type to which the information data belongs. Therefore, when it is necessary to traverse the information data in the information database, directly according to the index type of each SQL index condition, several information data of the same data type as the index type are found in the information database without traversing each information data in the information database. Therefore, the index processing amount of the information data is reduced and the indexing time is shortened.

[0090] Step S330: According to T m The corresponding sql index condition is traversed through each response data. If there is response data corresponding to the sql index condition, the response data is determined as the index data corresponding to the mth sql index condition, and step S340 is executed; otherwise, a question-answering abnormality flag is generated, and T m and the question-answer anomaly flag are determined as the initial index results;

[0091] After finding the response data with the same index type as the sql index condition, find the index data corresponding to the sql index condition from several response data according to the specific information of the sql index condition. For example, if the index type of the sql index condition is "flight", then the data type of all the response data found is "flight" type. There are flights of all airlines in this batch of response data. If the sql index condition is "flights of Airline A", then find the response data of "Airline A" from all the response data with the data type of "flight" and determine it as the index data.

[0092] If no response data of "Airline A" is found from all response data with data type "flight", it means that Airline A may not exist, that is, Airline A may be erroneous information entered by the user, then a question and answer exception identifier is generated, and the index identifier and question and answer exception identifier corresponding to the SQL index condition are determined as the initial index result.

[0093] By verifying the initial index results, it is possible to check whether the questions raised by the user are correct. If so, the questions will be corrected instead of directly returning abnormal error information to the user, so as to meet user needs to the greatest extent possible.

[0094] Step S340: Integrate a plurality of index data according to a plurality of SQL index conditions in the initial SQL index statement to obtain an integration result;

[0095] After obtaining the index data corresponding to each SQL index condition, it is necessary to integrate them so that several index data can be combined with each other to achieve the purpose of screening. For example, the SQL index conditions are "Airline A", "Tomorrow", and "Departure Time". However, among all the index data found, when all the index data are integrated, there is no flight information of Airline A taking off tomorrow. Therefore, the integration result is abnormal and needs to be corrected.

[0096] Step S350: If an abnormality occurs in the integration result, a question-answer abnormality mark is generated, and the abnormal index data and the question-answer abnormality mark corresponding to the integration result are determined as the initial index result; otherwise, the integration result is determined as the initial index result.

[0097] Step S400: If the initial index result includes a question-answer abnormality flag, an abnormal index condition is determined from a plurality of SQL index conditions according to the question-answer abnormality flag;

[0098] The abnormal index condition is the SQL index condition corresponding to the question and answer abnormal identification, that is, the SQL index condition where the abnormality occurs or the input is incorrect.

[0099] Further, step S400 includes step S411-step S413:

[0100] Step S411: If the initial index result includes a question-answer anomaly indicator, determine whether the initial index result includes index data. If the initial index result includes index data, execute step S412; otherwise, execute step S413;

[0101] If the initial index result does not include the question and answer anomaly mark, the initial index result and the user's question sentence are input into the preset general language model to obtain the target answer sentence and output it.

[0102] Step S412: determining the SQL index conditions corresponding to the plurality of index data included in the initial index result as abnormal index conditions;

[0103] Step S413: Determine, among the plurality of SQL index conditions, the SQL index conditions that have no corresponding relationship with any response data as abnormal index conditions.

[0104] Step S500: Delete the abnormal index condition and integrate the remaining SQL index conditions to obtain a corrected SQL index statement;

[0105] The incorrect abnormal index conditions are deleted, and the remaining SQL index conditions are integrated again to obtain a revised SQL index statement. The integration method is the same as the integration method of the initial SQL index statement.

[0106] Step S600, determining a revised index result from the information database according to the revised SQL index statement;

[0107] Further, step S600 includes step S610-step S620:

[0108] Step S610: According to each sql index condition in the modified sql index statement, the modified index data corresponding to each sql index condition is determined from the information database;

[0109] Step S620: Integrate a plurality of modified index data to obtain a modified index result.

[0110] Step S700: input the modified index result and the user's question sentence into a preset general language model to obtain a target answer sentence and output it.

[0111] The general language model can adopt the existing language model (general language model), which is used to generate a target answer sentence in natural language from the modified index result of the SQL language according to the user's question sentence, and return the target answer sentence to the user for the user to view.

[0112] The user question and answer verification method of the present invention performs language conversion on user question statements to obtain a plurality of sql index conditions, and then integrates the plurality of sql index conditions according to the index identifier corresponding to each sql index condition to generate an initial sql index statement, determines an initial index result according to the initial sql index statement, and verifies the initial index result. If the initial index result includes a question and answer abnormality identifier, it indicates that the initial index result is abnormal and needs to be corrected. Therefore, the abnormal index condition is determined from the plurality of sql index conditions, and the abnormal index condition is deleted. The remaining sql index conditions are integrated again to obtain a corrected sql index statement, and then a corrected index result is determined according to the corrected sql index statement. Finally, the corrected index result and the user question statement are input into a universal language model to obtain a target reply statement output by the universal language model. By verifying the SQL index conditions corresponding to the user's question statement, the abnormal index conditions where the index results may be abnormal are determined, and the corrected index results obtained by the corrected SQL index statement composed of the remaining SQL index conditions except the abnormal index conditions and the user's question statement are input into the common language model for natural language conversion. Incorrect natural language questions raised by users can be effectively corrected, so that the answer results obtained are more in line with the questions raised by users, thereby improving the accuracy of user questions and answers and user satisfaction.

[0113] An embodiment of the present invention further provides a computer program product, which includes program code. When the program product is run on an electronic device, the program code is used to enable the electronic device to execute the steps of the method according to various exemplary embodiments of the present invention described above in this specification.

[0114] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0115] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0116] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.

[0117] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".

[0118] The electronic device according to this embodiment of the present invention is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0119] The electronic device is presented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: the at least one processor mentioned above, the at least one storage device mentioned above, and a bus connecting different system components (including storage devices and processors).

[0120] The storage stores program codes, which can be executed by the processor, so that the processor executes the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification.

[0121] The memory may include readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory, and may further include read only memory (ROM).

[0122] The storage may also include a program / utility having a set (at least one) of program modules, such program modules including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.

[0123] The bus may represent one or more of several types of bus structures including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.

[0124] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface. Furthermore, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter.

[0125] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0126] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.

[0127] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0128] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0129] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0130] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0131] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0132] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0133] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A user question and answer verification method, characterized in that: The method comprises the following steps: Step S100: in response to receiving a user question statement, convert the user question statement into a language to obtain a plurality of SQL index conditions corresponding to the user question statement; each of the SQL index conditions corresponds to an index identifier, and the index identifier indicates an index type of the corresponding SQL index condition; Step S200: According to the index identifier corresponding to each of the sql index conditions, a plurality of the sql index conditions are integrated to generate an initial sql index statement; Step S300: determining an initial index result from an information database according to the initial SQL index statement; Step S400: If the initial index result includes a question-answer abnormality identifier, an abnormal index condition is determined from a plurality of SQL index conditions according to the question-answer abnormality identifier; the abnormal index condition is the SQL index condition corresponding to the question-answer abnormality identifier; Step S500: Delete the abnormal index condition and integrate the remaining SQL index conditions to obtain a corrected SQL index statement; Step S600: Determine a modified index result from the information database according to the modified SQL index statement; Step S700: input the modified index result and the user question sentence into a preset general language model to obtain a target answer sentence and output it.

2. The method according to claim 1, characterized in that The step S100 includes: Step S110, performing multiple rounds of rewriting processing on the user question sentence to obtain a corresponding target question sentence; Step S120: semantically analyze the target question sentence to obtain a semantic identifier corresponding to each target question word included in the target question sentence; Step S130, traversing each of the target question words, if the semantic identifier corresponding to the target question word is a preset key semantic identifier, determining the target question word as a user question keyword; Step S140: according to the semantic identifier corresponding to each keyword in the user's question, determine the index identifier corresponding to each keyword in the user's question from a preset semantic identifier mapping table; the semantic identifier mapping table stores mapping relationships between a plurality of semantic identifiers and index identifiers corresponding to the semantic identifiers; Step S150: performing SQL language conversion on a number of the user question keywords to obtain a SQL index condition corresponding to each of the user question keywords.

3. The method according to claim 2, characterized in that The step S200 includes: Step S210: sort the index identifiers corresponding to the plurality of SQL index conditions according to a preset index statement composition rule; the index statement composition rule includes a composition order of index types in the index statement; Step S220: According to the order of the plurality of index identifiers, the SQL index conditions corresponding to each index identifier are integrated to obtain an initial SQL index statement.

4. The method according to claim 3, characterized in that The step S300 includes: Step S310: Obtain the index identifier corresponding to each of the SQL index conditions in the initial SQL index statement, and obtain an index identifier list T = (T1, T2, ..., T m ,...,T q ); where m = 1, 2, ..., q; q is the number of the sql index conditions; T m is the index identifier corresponding to the mth SQL index condition in the initial SQL index statement; Step S320: traverse the index identifier list T, and m Corresponding to the index type, a number of response data having the same data type as the index type are determined from the information database; Step S330: According to T m The corresponding sql index condition is traversed through each of the response data. If there is response data corresponding to the sql index condition, the response data is determined as the index data corresponding to the mth sql index condition, and step S340 is executed; otherwise, a question-answering abnormality flag is generated, and T m and the question-answer anomaly identifier is determined as an initial index result; Step S340: integrating the plurality of index data according to the plurality of SQL index conditions in the initial SQL index statement to obtain an integration result; Step S350: If an exception occurs in the integration result, a question-and-answer exception mark is generated, and the several index data with exceptions corresponding to the integration result and the question-and-answer exception mark are determined as the initial index result; otherwise, the integration result is determined as the initial index result.

5. The method according to claim 4, characterized in that The step S400 includes: Step S411: If the initial index result includes a question-answer anomaly indicator, determine whether the initial index result includes index data. If the initial index result includes index data, execute step S412; otherwise, execute step S413; Step S412: determining the SQL index conditions corresponding to the plurality of index data included in the initial index result as abnormal index conditions; Step S413: Determine, among the plurality of SQL index conditions, the SQL index condition that has no corresponding relationship with any of the response data as an abnormal index condition.

6. The method according to claim 5, characterized in that The step S600 includes: Step S610: According to each sql index condition in the modified sql index statement, determine the modified index data corresponding to each sql index condition from the information database; Step S620: Integrate the plurality of modified index data to obtain a modified index result.

7. The method according to claim 6, characterized in that The step S400 further includes: Step S421: If the initial index result does not include a question and answer anomaly mark, the initial index result and the user question sentence are input into a preset general language model to obtain a target answer sentence and output it.

8. The method according to claim 2, characterized in that: The step S150 includes: Step S151, performing SQL language conversion on a number of the user question keywords to obtain a SQL language keyword corresponding to each of the user question keywords; Step S152, obtaining the character length of each of the SQL language keywords and the information entropy of each of the user's question keywords; Step S153: If the character length of any of the sql language keywords is greater than a preset character length threshold, and the information entropy of the user question keyword corresponding to the sql language keyword is less than a preset information entropy threshold, then execute step S154; otherwise, determine the sql language keyword as the sql index condition of the user question keyword corresponding to the sql language keyword; Step S154, rewrite the sql language keyword according to the preset statement rewriting rule to obtain a rewritten sql keyword corresponding to the sql language keyword; the character length of the rewritten sql keyword is shorter than the character length of the sql language keyword corresponding to the rewritten sql keyword, and the difference between the information entropy corresponding to the rewritten sql keyword and the information entropy of the user question keyword corresponding to the rewritten sql keyword is less than a preset information entropy difference threshold; Step S155: determine the rewritten SQL keyword as the SQL index condition of the user question keyword corresponding to the rewritten SQL keyword.

9. A non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the storage medium, characterized in that: The at least one instruction or the at least one program is loaded and executed by the processor to implement the user question and answer verification method as described in any one of claims 1-8.

10. An electronic device, characterized in that: The invention comprises a processor and the non-transitory computer-readable storage medium as claimed in claim 9.