Data question and answer processing method and device, electronic equipment and storage medium
The multi-level question matcher handles the problem string input by the user, and uses the regular matching library, keyword library and multi-level domain tag library to match patterns, which solves the problem that accurate answers cannot be output in the existing technology, and realizes accurate answers and efficient question-and-answer services for unknown questions.
Patent Information
- Application Number
- CN202411738345.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-21
AI Technical Summary
In the prior art, AI-based large language models cannot output accurate answers when dealing with untrained questions, resulting in users not being able to obtain satisfactory Q&A services.
A multi-level question matcher is used to process the problem strings entered by the user, and pattern matching is performed through the regular matching library, keyword library and multi-level domain tag library to generate corresponding answer templates. The multi-level question matcher includes a first-level regular matcher, a second-level keyword matcher, and a third-level domain tag matcher, which can return different answer templates in multi-level and multi-mean pattern matching.
It realizes accurate answers to unknown, complex and puzzled questions, and can output answer templates that best match user questions, improving the response speed and user experience of the question-and-answer system.
Smart Images

Figure CN119669415A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data question and answer processing method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of AI large language models, AI-based question-answering models have emerged rapidly, and these models perform well in answering general questions. However, due to the high requirements of scientific computing devices such as GPU and NPU for training large language models, some small and medium-sized enterprises are reluctant to do so.
[0003] Since the large language model is trained with massive data, the trained large language model can find the answer corresponding to the question according to the question input by the user and output it. However, through the above processing, many questions are not in the training set, so there is no corresponding answer, which makes it impossible to output accurate answers. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a data question and answer processing method, device, electronic device and storage medium to solve the problem that accurate answers cannot be output in the prior art.
[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] A first aspect of an embodiment of the present invention shows a data question and answer processing method, the method comprising:
[0007] Get user input data;
[0008] Converting the input data into a question string;
[0009] The question string is processed by a multi-level question matcher to output a target answer template corresponding to the question string. The multi-level question matcher includes a first-level question matcher constructed by a regular matching library, a second-level question matcher constructed by a keyword library, and a third-level question matcher constructed by a multi-level domain tag library of multiple fields.
[0010] Optionally, the question character string is processed by a multi-level question matcher to output a target answer template corresponding to the question character string, including:
[0011] Determine whether there is a question matching the question string in the first-level question matcher;
[0012] If it exists, the answer corresponding to the question matching the question string is taken as the first answer template corresponding to the question string and output, wherein the first answer template belongs to the target answer template.
[0013] Optionally, also include:
[0014] If there is no question matching the question string in the first-level question matcher, determining whether there is a keyword matching the keyword in the question string according to the second-level question matcher;
[0015] If it exists, the answer corresponding to the keyword matching the question character string is used as the first answer template corresponding to the question character string and output, wherein the first answer template belongs to the target answer template.
[0016] Optionally, also include:
[0017] If it is determined according to the second-level question matcher that there is no keyword matching the keyword in the question string, obtaining the knowledge field to which the question string belongs;
[0018] Calling the third-level question matcher to obtain a multi-level domain tag library corresponding to the knowledge domain, and using it as a target domain tag library;
[0019] If it is determined that the question character string does not match any level of the tag library in the target domain tag library, the second answer template is used as the target answer template and output.
[0020] Optionally, also include:
[0021] If it is determined that the question string matches a certain level of tag library in the target domain tag library, the certain level of tag library is used as the current tag library;
[0022] If it is determined that the question character string matches multiple current-level tags in the current tag library, the third answer template is used as the target answer template and output.
[0023] Optionally, also include:
[0024] If it is determined that the question string matches a current level tag in the current tag library, determining whether the question string matches a next level tag library in the target domain tag library;
[0025] If it is determined that the question string does not match the tag in the next-level tag library, determine whether there is an answer to the question associated with it based on the current-level tag and the tags of the level before the current level;
[0026] If there is no answer to the question associated with the current level label and the label of the level before the current level, the fourth answer template is used as the target answer template and output;
[0027] If there is a question answer associated with the current level label and the label of the level before the current level, the question answer is used as the fifth answer template and output, wherein the first answer template belongs to the target answer template.
[0028] Optionally, also include:
[0029] If it is determined that the question string matches the next-level tag library in the target domain tag library, the next-level tag library will be changed to the current tag library, and the execution will return to the step of using the third answer template as the target answer template and outputting it if it is determined that the question string matches multiple current-level tags in the current tag library.
[0030] A second aspect of an embodiment of the present invention shows a data question and answer processing device, the device comprising:
[0031] An acquisition unit, used for acquiring input data from a user;
[0032] A conversion unit, used for converting the input data into a question character string;
[0033] A processing unit is used to process the question string using a multi-level question matcher and output a target answer template corresponding to the question string, wherein the multi-level question matcher includes a first-level question matcher constructed by a regular matching library, a second-level question matcher constructed by a keyword library, and a third-level question matcher constructed by a multi-level domain tag library of multiple fields.
[0034] A third aspect of an embodiment of the present invention shows an electronic device, which is used to run a program, wherein the program, when running, executes the data question and answer processing method shown in the first aspect of the embodiment of the present invention.
[0035] A storage medium is shown in the fourth aspect of an embodiment of the present invention, and the storage medium includes a storage program, wherein when the program is running, the device where the storage medium is located is controlled to execute the data question and answer processing method shown in the first aspect of the embodiment of the present invention.
[0036] Based on the above-mentioned embodiment of the present invention, a data question and answer processing method, device, electronic device and storage medium are provided, the method includes: obtaining user input data; converting the input data into a question string; processing the question string using a multi-level question matcher, and outputting a target answer template corresponding to the question string, the multi-level question matcher includes a first-level question matcher constructed by a regular matching library, a second-level question matcher constructed by a keyword library, and a third-level question matcher constructed by a multi-level domain tag library of multiple fields. In an embodiment of the present invention, a multi-level question matcher is used to parse the question string, and a multi-level and multi-means pattern matching method such as regular precise hit, keyword indirect hit, or domain tag association hit is used. In combination with the hit effect, different general answer templates can be returned, and unknown questions, complex questions and doubtful questions can be interpreted and associated to output answers corresponding to the question string, thereby accurately outputting accurate answers. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0038] Figure 1 A flowchart of a data question and answer processing method shown in an embodiment of the present invention;
[0039] Figure 2 A schematic diagram of the architecture of a multi-level question matcher according to an embodiment of the present invention;
[0040] Figure 3 This is a diagram showing an example of data question and answer processing according to an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of the architecture of data question and answer processing shown in an embodiment of the present invention;
[0042] Figure 5 A schematic diagram of the structure of a data question and answer processing device shown in an embodiment of the present invention. DETAILED DESCRIPTION
[0043] 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0045] It should be noted that the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0046] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0047] See also Figure 1 , is a flow chart of a data question and answer processing method shown in an embodiment of the present invention, the method comprising:
[0048] Step S101: Obtain user input data.
[0049] It should be noted that the input data may be text input data or language input data;
[0050] Step S102: converting the input data into a question character string.
[0051] In the specific implementation of step S102, if the input data is voice input data, the voice input data needs to be converted into text through a pre-built speech recognition model, and then the text is converted into a question string. If the input data is text input, the text input data is directly converted into a question string.
[0052] The question string refers to a string of characters that express the question.
[0053] Step S103: Process the question string using a multi-level question matcher, and output a target answer template corresponding to the question string.
[0054] The multi-level question matcher includes a first-level question matcher constructed by a regular matching library, a second-level question matcher constructed by a keyword library, and a third-level question matcher constructed by a multi-level domain tag library of multiple domains, such as Figure 2 shown.
[0055] Among them, the regular matching rules of various grammars of questions in the knowledge base are collected, and one question corresponds to multiple regular matching rules, which are then used to form a regular matching library. In the matching process, the inaccurately matched questions are automatically recorded to continuously improve and expand the regular matching library. Then the regular matching library is used as the first-level question matcher.
[0056] It should be noted that the regular matching library includes the regular matching library for problem one, the regular matching library for problem two, ..., the regular matching library for problem N.
[0057] The keyword library refers to the representation of the absolute meaning of each question. For example, the keyword "recharge" can directly correspond to the knowledge of "jump to the recharge page", and "reimbursement" can directly correspond to the knowledge of "jump to the invoice reimbursement page". The keywords used in this method must be unambiguous and can be compared with a certain piece of knowledge. The keyword library constructed by this application is used as a second-level question matcher.
[0058] It should be noted that the keyword library includes the keyword library for question one, the keyword library for question two, ..., the keyword library for question N.
[0059] The levels of the multi-level domain tag library are summarized according to the application scenarios of the specific system. That is to say, the number of tag libraries in different fields is different, and the tag levels are also different.
[0060] Each domain tag maintains multiple tag keywords, and the question text is matched by the tag keywords to achieve domain tag matching of the question.
[0061] The multi-level domain tag library includes a first-level tag library, a second-level tag library, ..., an N-level tag library, and each level of the tag library has a corresponding tag keyword library.
[0062] The target answer templates include a first answer template A1, a second answer template A2, a third answer template A3, a fourth answer template A4 and a fifth answer template A5, and their formats may be in the form of a main answer + a secondary answer, as shown in Table (1).
[0063] Table (1):
[0064]
[0065]
[0066] The multi-level question matcher and answer generator designed in this application can obtain question tags based on multi-level tag matching, and then recommend other questions based on tag association, thereby improving user-friendliness.
[0067] The specific implementation of step S103 includes the following steps:
[0068] Step S11: Determine whether there is a question matching the question string in the first-level question matcher. If so, execute step S12; if not, execute step S13.
[0069] In the process of implementing step S11, the question string is matched according to the first-level question matcher, that is, the question one regular matching library to the question N regular matching library in the regular matching library, to determine whether the question string can accurately hit the question in the regular matching library. If it can hit, execute step S12; if it cannot hit, execute step S13.
[0070] Step S12: The answer corresponding to the question matching the question character string is used as a first answer template corresponding to the question character string, and outputted.
[0071] Among them, the first answer template belongs to the target answer template.
[0072] In the specific implementation of step S12, the answer to the question corresponding to the accurately-hit question is used as the first answer template A1 and outputted.
[0073] Step S13: judging whether there is a keyword matching the keyword in the question string according to the second-level question matcher;
[0074] In the process of implementing step S13, the question string is matched according to the second-level question matcher, that is, the question one keyword library to the question N keyword library in the keyword library, to determine whether the question string can indirectly match the keywords in the keyword library. If it can indirectly match the keywords in the keyword library, execute step S14; if it cannot indirectly match the keywords in the keyword library, execute step S15.
[0075] Step S14: taking the answer corresponding to the keyword matching the question character string as the first answer template corresponding to the question character string, and outputting it.
[0076] Among them, the first answer template belongs to the target answer template.
[0077] In the specific implementation of step S14, the answer corresponding to the indirect matching keyword is used as the first answer template A1 and outputted.
[0078] Step S15: obtaining the knowledge field to which the question character string belongs;
[0079] Step S16: calling the third-level question matcher to obtain a multi-level domain tag library corresponding to the knowledge domain, and using it as a target domain tag library;
[0080] In the specific implementation of step S15 and step S16, a multi-level domain tag library with the same domain is searched according to the keywords in the question character string, and the multi-level domain tag library is used as the target domain tag library.
[0081] It should be noted that the present application sets multiple fields, each field corresponds to a multi-level field tag library, and the corresponding relationship between each field and the keyword is preset.
[0082] Step S17: Determine whether the question string matches each level of the target domain tag library. If it is determined that the question string does not match each level of the target domain tag library, execute step S18. If the question string matches a certain level of the target domain tag library, execute step S19.
[0083] In the process of implementing step S17, it is determined in turn whether there is a tag library that matches the problem string in each level of the target domain tag library. For example, it is first determined whether the problem string matches the first-level tag library. If it matches, step S19 is executed. If it does not match, it is determined whether the problem string matches the second-level tag. If it matches, step S19 is executed. If it does not match, the judgment is continued until it is determined whether the problem string matches the N-level tag library. If it does not match, step S18 is executed.
[0084] Step S18: The second answer template is used as the target answer template and outputted.
[0085] In the process of implementing step S18, the main answer of the second answer template is set to no relevant answer found, the knowledge base is still being improved, and the secondary answer returns questions and answers with higher click rates for users to view.
[0086] Step S19: taking the certain level of tag library as the current tag library;
[0087] In the process of implementing step S19, if the question string matches the first-level tag library, the first-level tag library is used as the current tag library; if the question string matches the second-level tag library, the second-level tag library is used as the current tag library; and so on, if the question string matches the N-level tag library, the N-level tag library is used as the current tag library.
[0088] Step S20: Determine whether the question character string matches multiple current-level tags in the current tag library. If so, execute step S21; if not, execute step S22.
[0089] In the process of implementing step S20, if the problem string matches a first-level tag library, it is determined whether the problem string matches multiple first-level tags in the first-level tag library. If so, step S21 is executed, if not, step S22 is executed; and so on, if the problem string matches an N-level tag library, it is determined whether the problem string matches multiple N-level tags in the N-level tag library. If so, step S21 is executed, if not, step S22 is executed;
[0090] Step S21: The third answer template is used as the target answer template and outputted.
[0091] In the process of implementing step S21, the tag keyword library corresponding to the current tag library is traversed based on the multiple current-level tags in the matched current tag library to find keywords corresponding to the multiple current-level tags. Then, the answers corresponding to the keywords corresponding to the multiple current-level tags are used as the third answer template and output.
[0092] Step S22: Determine whether the question string matches the next level tag library in the target domain tag library. If it matches, execute step S23; if it does not match, execute step S24.
[0093] In the process of implementing step S22, if the current tag library is a first-level tag library, the next-level tag library is a second-level tag library; if the current tag library is an N-1-level tag library, the next-level tag library is an N-level tag library; determine whether the problem string matches the next-level tag in the next-level tag library. If it matches, execute step S23; if it does not match, execute step S24.
[0094] Step S23: the next level tag library is the current tag library, and returns to execute step S20.
[0095] Step S24: Based on the current level label and the labels of the levels before the current level, determine whether there is an answer to the question associated with it. If not, execute step S25; if so, execute step S26.
[0096] In the process of implementing step S24, the matched current level label and the label of the level before the current level are traversed through the knowledge base, that is, the question library managed by labels, to determine whether there are questions associated with both the current level label and the label of the level before the current level. If not, execute step S25; if so, obtain the answer to the associated question and execute step S26.
[0097] For example, if the current tag is a third-level tag, and the tags of the level before the current level include a second-level tag and a first-level tag, the matching unique first-level tag, second-level tag, and third-level tag are used to retrieve questions in the knowledge base.
[0098] Step S25: Take the fourth answer template as the target answer template and output it.
[0099] In the process of implementing step S25, the main answer of the fourth answer template is set to the relevant knowledge base of the xx field, which has not been completed yet. Please stay tuned. The secondary answer outputs the hit label name for users to view.
[0100] Step S26: Use the answer to the question as a fifth answer template and output it, wherein the first answer template belongs to the target answer template.
[0101] In the specific implementation process of step S26, the answer to the question associated with the hit level label is used as the fifth answer template and output.
[0102] For example, the bank's logistics management system can be summarized into two label levels. The first-level label is the problem type, including: function consultation, tutorial consultation, page jump, process query, etc. The second-level label is the specific application module, including: foreign exchange trading, questionnaire survey, asset management, attendance management, etc.
[0103] For example, the question string "How to apply for banking services" corresponds to the first-level tag tutorial consultation tag and the second-level tag specific transaction tag. Each domain tag maintains multiple tag keywords, and the question text is matched by the tag keywords to achieve domain tag matching of the question.
[0104] In order to better understand the multi-level question matcher shown in the above embodiment of the present invention, an example is given below for illustration. Figure 3 shown.
[0105] It is assumed that the target domain tag library is a two-layer tag library, which specifically includes a primary tag library and a secondary tag library.
[0106] First, match the question string according to the regular matching library to determine whether it can accurately match the knowledge and return the answer. If it can match, it will be returned through the answer template A1;
[0107] If the regular expression matching library does not match the question string, the question string is matched according to the keyword library to determine whether the keyword can be matched. If it can be matched, it is returned through the answer template A1;
[0108] If it is determined that the keyword library does not match the problem string, the keyword library corresponding to the first-level tag library is used to match and determine whether the problem string can match the first-level tag;
[0109] If the question string can match the first-level tag, determine whether it matches multiple first-level tags. If it matches multiple first-level tags, return it through the answer template A3;
[0110] If the question string only matches one first-level tag, continue to use the keyword library corresponding to the second-level tag library to determine whether the question string can match the second-level tag;
[0111] If the question string can match the second-level tag, determine whether it matches multiple second-level tags. If it matches multiple second-level tags, return it through the answer template A3;
[0112] If the question string cannot match the secondary tag, then search for questions in the knowledge base based on the matching unique primary tag. If the question associated with the primary tag can be retrieved, it is returned through answer template A5. If it cannot be retrieved, it is returned through answer template A4.
[0113] If the question string can only match one secondary tag, the question in the knowledge base is searched according to the matched unique primary tag and secondary tag. If the answer to the question associated with the primary and secondary tags can be retrieved, it is returned through the answer generator A5. If not, it is returned through the answer template A4.
[0114] If the question string cannot match the first-level tag, use the keyword library of the second-level tag to match and determine whether the question string can match the second-level tag; if the question string can match the second-level tag, determine whether the question string matches multiple second-level tags. If it matches multiple second-level tags, return through answer template A3; if only one second-level tag is matched, search for questions in the knowledge base based on the matched unique second-level tag. If the question can be retrieved, return through answer template A5. If the question is not retrieved, return through answer template A4.
[0115] Optionally, the language recognition model converts the input data of the user's language output into a question string, or converts the user's text data into a question string; then uses a multi-level question matcher to process the question string, and uses an answer generator to output a target answer template corresponding to the question string, such as Figure 4 shown.
[0116] The present invention can realize the rapid application development and deployment of the question-answering system, support the knowledge base to be expanded at any time, question association, knowledge recommendation and other functions, and has faster response, more friendly answers, and supports multi-modality such as text and voice in interaction. The method can be widely used in the fields of customer service question-answering, assistant question-answering and digital human question-answering, and has high practicality.
[0117] In an embodiment of the present invention, a multi-level question matcher is used to parse the question string, and through multi-level and multi-means pattern matching methods such as regular precise hits, keyword indirect hits, or field label association hits, different general answer templates can be returned in combination with the hit effects. Unknown questions, complex questions and confusing questions can be interpreted and associated to output answers corresponding to the question string, thereby accurately outputting accurate answers.
[0118] Based on the data question and answer processing method shown in the above embodiment of the present invention, correspondingly, the embodiment of the present invention also discloses a data question and answer processing device, such as Figure 5 As shown, the device comprises:
[0119] The acquisition unit 501 is used to acquire the input data of the user;
[0120] A conversion unit 502, used for converting the input data into a question character string;
[0121] The processing unit 503 is used to process the question string using a multi-level question matcher and output a target answer template corresponding to the question string. The multi-level question matcher includes a first-level question matcher constructed by a regular matching library, a second-level question matcher constructed by a keyword library, and a third-level question matcher constructed by a multi-level domain tag library of multiple fields.
[0122] The specific principles and execution processes of each unit in the data question and answer processing device disclosed in the above embodiment of the present invention are the same as the corresponding contents in the data question and answer processing method provided in the above embodiment of the present invention. Please refer to the corresponding parts of the data question and answer processing method disclosed in the above embodiment of the present invention, and will not be repeated here.
[0123] In an embodiment of the present invention, a multi-level question matcher is used to parse the question string, and through multi-level and multi-means pattern matching methods such as regular precise hits, keyword indirect hits, or field label association hits, different general answer templates can be returned in combination with the hit effects. Unknown questions, complex questions and confusing questions can be interpreted and associated to output answers corresponding to the question string, thereby accurately outputting accurate answers.
[0124] Optionally, based on the data question and answer processing device shown in the above embodiment of the present invention, the processing unit 503 is specifically configured to:
[0125] The question string is processed by a multi-level question matcher to output a target answer template corresponding to the question string, including:
[0126] Determine whether there is a question matching the question string in the first-level question matcher;
[0127] If it exists, the answer corresponding to the question matching the question string is taken as the first answer template corresponding to the question string and output, wherein the first answer template belongs to the target answer template.
[0128] Optionally, based on the data question and answer processing device shown in the above embodiment of the present invention, the processing unit 503 is further used to:
[0129] If there is no question matching the question string in the first-level question matcher, determining whether there is a keyword matching the keyword in the question string according to the second-level question matcher;
[0130] If it exists, the answer corresponding to the keyword matching the question character string is used as the first answer template corresponding to the question character string and output, wherein the first answer template belongs to the target answer template.
[0131] Optionally, based on the data question and answer processing device shown in the above embodiment of the present invention, the processing unit 503 is further used to:
[0132] If it is determined according to the second-level question matcher that there is no keyword matching the keyword in the question string, obtaining the knowledge field to which the question string belongs;
[0133] Calling the third-level question matcher to obtain a multi-level domain tag library corresponding to the knowledge domain, and using it as a target domain tag library;
[0134] If it is determined that the question character string does not match any level of the tag library in the target domain tag library, the second answer template is used as the target answer template and output.
[0135] Optionally, based on the data question and answer processing device shown in the above embodiment of the present invention, the processing unit 503 is further used to:
[0136] If it is determined that the question string matches a certain level of tag library in the target domain tag library, the certain level of tag library is used as the current tag library;
[0137] If it is determined that the question character string matches multiple current-level tags in the current tag library, the third answer template is used as the target answer template and output.
[0138] Optionally, based on the data question and answer processing device shown in the above embodiment of the present invention, the processing unit 503 is further used to:
[0139] If it is determined that the question string matches a current level tag in the current tag library, determining whether the question string matches a next level tag library in the target domain tag library;
[0140] If it is determined that the question string does not match the tag in the next-level tag library, determine whether there is an answer to the question associated with it based on the current-level tag and the tags of the level before the current level;
[0141] If there is no answer to the question associated with the current level label and the label of the level before the current level, the fourth answer template is used as the target answer template and output;
[0142] If there is a question answer associated with the current level label and the label of the level before the current level, the question answer is used as the fifth answer template and output, wherein the first answer template belongs to the target answer template.
[0143] Optionally, based on the data question and answer processing device shown in the above embodiment of the present invention, the processing unit 503 is further used to:
[0144] If it is determined that the question string matches the next-level tag library in the target domain tag library, the next-level tag library will be changed to the current tag library, and the execution will return to the step of using the third answer template as the target answer template and outputting it if it is determined that the question string matches multiple current-level tags in the current tag library.
[0145] An embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory is used to store program codes and data for data question and answer processing, and the processor is used to call program instructions in the memory to execute the steps shown in the data question and answer processing method in the above embodiment.
[0146] An embodiment of the present invention provides a storage medium, and a vehicle includes the electronic device provided by the above-mentioned embodiment of the present application, and the electronic device is used to execute the data question and answer processing method disclosed in the embodiment of the present application.
[0147] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, 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 creative work.
[0148] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0149] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data question-answering processing method, characterized in that: The method comprises: Get user input data; Converting the input data into a question string; The question string is processed by a multi-level question matcher to output a target answer template corresponding to the question string. The multi-level question matcher includes a first-level question matcher constructed by a regular matching library, a second-level question matcher constructed by a keyword library, and a third-level question matcher constructed by a multi-level domain tag library of multiple fields.
2. The method according to claim 1, characterized in that The question string is processed by a multi-level question matcher to output a target answer template corresponding to the question string, including: Determine whether there is a question matching the question string in the first-level question matcher; If it exists, the answer corresponding to the question matching the question string is taken as the first answer template corresponding to the question string and output, wherein the first answer template belongs to the target answer template.
3. The method according to claim 2, characterized in that Also includes: If there is no question matching the question string in the first-level question matcher, determining whether there is a keyword matching the keyword in the question string according to the second-level question matcher; If it exists, the answer corresponding to the keyword matching the question character string is used as the first answer template corresponding to the question character string and output, wherein the first answer template belongs to the target answer template.
4. The method according to claim 3, characterized in that Also includes: If it is determined according to the second-level question matcher that there is no keyword matching the keyword in the question string, obtaining the knowledge domain to which the question string belongs; Calling the third-level question matcher to obtain a multi-level domain tag library corresponding to the knowledge domain, and using it as a target domain tag library; If it is determined that the question character string does not match any level of the tag library in the target domain tag library, the second answer template is used as the target answer template and output.
5. The method according to claim 4, characterized in that Also includes: If it is determined that the question string matches a certain level of tag library in the target domain tag library, the certain level of tag library is used as the current tag library; If it is determined that the question character string matches multiple current-level tags in the current tag library, the third answer template is used as the target answer template and output.
6. The method according to claim 5, characterized in that Also includes: If it is determined that the question string matches a current level tag in the current tag library, determining whether the question string matches a next level tag library in the target domain tag library; If it is determined that the question string does not match the tag in the next-level tag library, determine whether there is an answer to the question associated with it based on the current-level tag and the tags of the level before the current level; If there is no answer to the question associated with the current level label and the label of the level before the current level, the fourth answer template is used as the target answer template and outputted; If there is a question answer associated with the current level label and the label of the level before the current level, the question answer is used as the fifth answer template and output, wherein the first answer template belongs to the target answer template.
7. The method according to claim 6, characterized in that Also includes: If it is determined that the question string matches the next-level tag library in the target domain tag library, the next-level tag library will be changed to the current tag library, and the execution will return to the step of using the third answer template as the target answer template and outputting it if it is determined that the question string matches multiple current-level tags in the current tag library.
8. A data question and answer processing device, characterized in that: The device comprises: An acquisition unit, used for acquiring input data from a user; A conversion unit, used for converting the input data into a question character string; A processing unit is used to process the question string using a multi-level question matcher and output a target answer template corresponding to the question string, wherein the multi-level question matcher includes a first-level question matcher constructed by a regular matching library, a second-level question matcher constructed by a keyword library, and a third-level question matcher constructed by a multi-level domain tag library of multiple fields.
9. An electronic device, characterized in that: The electronic device is used to run a program, wherein the program, when running, executes the data question and answer processing method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium includes a storage program, wherein when the program is running, the device where the storage medium is located is controlled to execute the data question and answer processing method as described in any one of claims 1-7.
Citation Information
Cited By
Industry question and answer enhancement method and system based on multi-dimensional label automatic extraction
CN120578746A
Industry question-answering enhancement method and system based on automatic extraction of multi-dimensional tags
CN120578746B
