Method and system for generating quick answer options based on question analysis
By identifying and matching the question text entered by users and generating shortcut answer option groups, the problem of low efficiency of traditional question-and-answer systems is solved, efficient and accurate answer generation is achieved, and interactive efficiency and user experience is improved.
Patent Information
- Application Number
- CN202411946180.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-18
AI Technical Summary
Traditional Q&A systems are inefficient in handling user questions, especially in medical consultation scenarios, lack efficient and accurate methods to automatically extract and generate shortcut answer options.
By obtaining the question text entered by the user, identifying and cleaning the text, using the pre-built regular expression library for matching, generating shortcut answer option groups, and using preset two fixed option groups for the second match when the match fails.
It enables quick answer options for users, improves interaction efficiency and user experience, and is able to handle multiple types of questions, including questions with obvious option groups and common right and wrong questions.
Smart Images

Figure CN119848311A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent information processing, and in particular to a method and system for generating quick answer options based on question analysis. Background Art
[0002] With the rapid development of artificial intelligence, various intelligent question-and-answer products have emerged. In the process of intelligent question-and-answer information interaction, whether it is online customer service, question-and-answer systems or various information collection scenarios, users often need to enter questions to obtain relevant information or feedback, especially intelligent online consultation. However, the traditional question-and-answer system is essentially based on databases and search engines. In this mode, users are often required to elaborate on the problem in detail, and then the system performs complex analysis and processing to provide answers. This process is relatively cumbersome and inefficient, especially when users go to the doctor for consultation, which will delay the user's consultation time. In addition, when the answer to the question is relatively simple and has a fixed pattern, such as some simple yes-or-no judgment questions or questions with a limited number of optional answers, there is no need for complex analysis and processing. However, there is currently a lack of an efficient, accurate and universal method to automatically extract and generate suitable quick answer options from various questions raised by users. Therefore, the present invention provides a method and system for generating quick answer options based on question parsing, which can quickly provide answer options for users and greatly improve interaction efficiency and user experience. Summary of the invention
[0003] The main purpose of the present invention is to disclose a method and system for generating quick answer options based on question analysis, which can provide answer options to users efficiently and accurately, greatly improving interaction efficiency and user experience.
[0004] In a first aspect, a method for generating quick answer options based on question parsing is provided.
[0005] A method for generating quick answer options based on question analysis according to the present invention includes:
[0006] Obtaining a question text input by a user, identifying the question text, and searching and matching the question text in a pre-built regular expression library according to a preset priority order;
[0007] If the match is successful, the corresponding expression and option group text information are extracted to generate a first answer option group, the first answer option group and the preset additional options are processed according to a preset format, and the processed first answer option group and the preset additional options are displayed together;
[0008] If the match fails, a second match is performed in the preset two types of fixed option groups. After the second match is successful, a second answer option group is generated, and the second answer option group and the preset additional options are processed according to a preset format and displayed together after processing;
[0009] Determine the answer option finally selected by the user and respond.
[0010] Preferably, the identifying of the question text further comprises: cleaning the question text, retaining character information of the question text content and grammatical structure, and identifying keywords and words, grammatical structures and punctuation marks in the question text.
[0011] Preferably, the retrieving and matching the question text in a pre-built regular expression library also includes: performing semantic analysis on the question text, extracting key information and intent of the question text, and performing rapid retrieval in the regular expression library based on the semantic understanding result.
[0012] Preferably, generating the first answer option group further comprises sorting the first answer option group.
[0013] Preferably, the processing includes: performing grammar correction, spelling check, and formatting processing.
[0014] Secondly, a system for generating quick answer options based on question analysis is provided.
[0015] According to a system for generating quick answer options based on question analysis of the present invention, the system comprises:
[0016] An acquisition module is used to acquire a question text input by a user, identify the question text, and search and match the question text in a pre-built regular expression library according to a preset priority order;
[0017] A first generating module is used to extract the corresponding expression and option group text information and generate a first answer option group if the match is successful;
[0018] A second generating module is used to perform a second matching in two preset fixed option groups if the matching fails, and generate a second answer option group after the second matching succeeds;
[0019] A processing module, used for processing the first answer option group, the second answer option group, and the preset additional options according to a preset format;
[0020] A display module, used to display the processed first answer option group, the second answer option group and the preset additional options on the interface of the setting platform;
[0021] The response module is used to determine the answer option finally selected by the user and respond.
[0022] Preferably, the acquisition module is also used to: clean the question text, retain the character information of the question text content and grammatical structure, and identify keywords and words, grammatical structures and punctuation marks in the question text.
[0023] Preferably, the acquisition module is also used to perform semantic analysis on the question text, extract key information and intent of the question text, and perform rapid retrieval in the regular expression library based on the semantic understanding result.
[0024] Preferably, the first generating module is further used to sort the first answer option groups.
[0025] Preferably, the processing module is also used for grammar correction, spelling check, and formatting. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a flow chart of a method for generating quick answer options based on question analysis according to an embodiment of the present invention.
[0027] Figure 2 It is a structural diagram of a system for generating quick answer options based on question analysis according to an embodiment of the present invention; DETAILED DESCRIPTION
[0028] In order to make the objectives, technical solutions and advantages of the embodiments of the present invention more clearly understood, the spirit of the contents disclosed by the present invention will be clearly explained with the accompanying drawings and detailed descriptions below. After understanding the embodiments of the contents of the present invention, any technician in the relevant technical field can change and modify the techniques taught by the contents of the present invention without departing from the spirit and scope of the contents of the present invention.
[0029] Figure 1 A flowchart of a method for generating quick answer options based on question analysis provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes:
[0030] S1, obtaining a question text input by a user, identifying the question text, and searching and matching the question text in a pre-built regular expression library according to a preset priority order.
[0031] In this embodiment, obtaining the question text input by the user includes: first, the user inputs relevant descriptive words according to his / her own situation, such as gender, age, where he / she feels uncomfortable, etc., and automatically generates the question text according to the descriptive words input or selected by the user, and the question text is a question sentence generated for the description input by the user. After obtaining the question text input by the user, the text is recognized, including cleaning the question text, retaining the character information of the content and grammatical structure of the question text, and recognizing the keywords and words, grammatical structure and punctuation marks in the question text, such as recognizing conjunctions (such as "and", "or", "or", etc.), commas and other grammatical structures or punctuation marks that may represent parallel relations, which will serve as key clues for finding option groups. At the same time, a regular expression library is pre-built, and the regular expression library contains various regular expression rules for matching common option group formats, such as matching expressions of multiple nouns separated by commas, matching expressions of options in the "is...or..." structure, etc.
[0032] For example, the question text "Have you had a cold, fever or other symptoms of infection recently?" is retrieved and matched in the pre-built regular expression library. During the matching, the question text is semantically analyzed to extract the key information and intention of the question text. According to the semantic understanding results, a quick search is performed in the regular expression library. In addition, the search and matching priority order of the regular expression library is pre-set, and the expressions in the regular expression library are used to match the cleaned question text in turn. For example, a complex multi-option structure expression is matched first, and the option group is extracted if the match is successful. During the matching process, if key elements such as conjunctions or commas are found, the possible option boundaries are determined in combination with their context, so as to accurately extract the option content. In the above question text, the target words "cold", "fever", and "other infection symptoms" are obtained after matching, so that the extracted option group answers are: "yes, cold", "yes, fever", "yes, other infection symptoms", and "no".
[0033] S2. If the match is successful, the corresponding expression and option group text information are extracted to generate a first answer option group. The first answer option group and the preset additional options are processed according to a preset format, and the processed first answer option group is displayed together with the preset additional options.
[0034] In this embodiment, after the expressions in the regular expression library are matched successfully in sequence according to the preset priority order, the first answer option group is extracted, and the extracted first answer option group and the preset additional options are processed, including being sorted according to the predetermined interface design specification or data format requirements, and the processing includes grammar correction, spelling check, formatting, etc. In addition, after the first answer option group is generated, it also includes sorting the first answer option group, and then adding an additional "uncertain" option, that is, the preset additional option, on this basis, to ensure that the user can accurately select answers in a wide range.
[0035] Finally, all the options are displayed. For example, in a graphical interface, the option groups are arranged in the form of buttons; in text interaction, they are output in a specific format (such as "1. Option 1\n, 2. Option 2\n..."). By passing the determined first answer option group and the preset additional options to the corresponding interactive scene through the output interface for the user to select, the relevant business processing or information feedback can be further performed according to the user's choice. For example, the question text obtained is "Is your pain dull, tingling, or burning?" Through the analysis of the comma and "or", "dull pain", "tingling", and "burning" can be extracted as target words, thereby generating the first answer option group, and then adding the preset additional option "uncertain" for display.
[0036] S3, if the match fails, a second match is performed in the preset two types of fixed option groups. After the second match is successful, a second answer option group is generated, and the second answer option group and the preset additional options are processed according to a preset format and displayed together after processing.
[0037] In this embodiment, the two preset fixed option groups are "yes" and "no", "yes" and "no". If the option group cannot be successfully parsed in the preset regular expression library, it is determined whether the question text contains a simple yes or no question of the special characters "yes" and "yes or no". If yes, it is determined and matched to which type of fixed option group it belongs, and then a second answer option group is generated. As in step S2, the generated second answer selection group and the preset additional options are processed, and finally the processed second answer option group and the preset additional option "uncertain" are displayed. For example, for the question text "Do you have a headache?", according to the judgment that the question text contains "yes", the second option group is matched as "yes" and "no". For example, for the question text "Do you have a headache?", according to the judgment that the question text contains "yes or no", the second option group is matched as "yes" and "no". After the second option group is generated, the preset additional option "uncertain" is added and displayed together.
[0038] S4, determining the answer option finally selected by the user and responding.
[0039] In this embodiment, after a quick answer option group is generated for the user to directly select, it will be displayed to the user on a relevant interactive platform (such as a mobile application, web page interface, etc.), and the user can further select an answer option that suits his or her own situation, and further related business processing or information feedback will be performed based on the user's final selection.
[0040] According to an embodiment of the present invention, a system for generating quick answer options based on question analysis is also provided. Figure 2 As shown, the system includes:
[0041] The acquisition module 110 is used to acquire the question text input by the user, identify the question text, and search and match the question text in a pre-built regular expression library according to a preset priority order.
[0042] In this embodiment, the acquisition module 110 is also used to clean the question text, retain the character information of the question text content and grammatical structure, and identify the keywords and words, grammatical structure and punctuation marks in the question text. The acquisition module 110 is also used to perform semantic analysis on the question text, extract the key information and intention of the question text, and perform a quick search in the regular expression library based on the semantic understanding result.
[0043] The first generating module 120 is used to extract the corresponding expression and option group text information and generate a first answer option group if the match is successful.
[0044] During implementation, the first generating module 120 is further configured to sort the first answer option groups.
[0045] The second generating module 130 is used to perform a second matching in two preset fixed option groups if the matching fails, and generate a second answer option group after the second matching succeeds.
[0046] The processing module 140 is used to process the first answer option group, the second answer option group, and the preset additional options according to a preset format.
[0047] In this embodiment, the processing module 140 processes the first answer option group, the second answer option group and the preset additional options, and also performs grammar correction, spelling check and formatting processing on them.
[0048] The display module 150 is used to display the processed first answer option group, the second answer option group and the preset additional options on the interface of the setting platform.
[0049] The response module 160 is used to determine the answer option finally selected by the user and respond.
[0050] In summary, with the help of the above-mentioned implementation methods provided by the present invention, firstly, by automatically generating quick answer options, the time for user input and waiting for answers is reduced, which is particularly suitable for the quick processing of some simple and common problems, thereby improving interaction efficiency; secondly, the question-answering process is made smoother and more intuitive, and users do not need to conceive complete answers by themselves, but only need to choose from the provided options, thereby enhancing the user experience; thirdly, it is able to handle various types of question sentences, whether it is a question with an obvious option group or an ordinary yes or no question, and can effectively generate appropriate answer options, with strong versatility.
[0051] So far, the technical solutions of the present invention have been described in conjunction with the embodiments shown in the accompanying drawings, but it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
[0052] The above descriptions are only several specific embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for generating quick answer options based on question analysis, characterized in that: include: Obtaining a question text input by a user, identifying the question text, and searching and matching the question text in a pre-built regular expression library according to a preset priority order; If the match is successful, the corresponding expression and option group text information are extracted to generate a first answer option group, the first answer option group and the preset additional options are processed according to a preset format, and the processed first answer option group and the preset additional options are displayed together; If the match fails, a second match is performed in the preset two types of fixed option groups. After the second match is successful, a second answer option group is generated, and the second answer option group and the preset additional options are processed according to a preset format and displayed together after processing; Determine the answer option finally selected by the user and respond.
2. The method for generating quick answer options based on question analysis according to claim 1, characterized in that: The identifying of the question text also includes: cleaning the question text, retaining the character information of the question text content and grammatical structure, and identifying keywords and words, grammatical structures and punctuation marks in the question text.
3. The method for generating quick answer options based on question analysis according to claim 1, characterized in that: The retrieving and matching the question text in a pre-built regular expression library also includes: performing semantic analysis on the question text, extracting key information and intent of the question text, and performing rapid retrieval in the regular expression library based on the semantic understanding result.
4. The method for generating quick answer options based on question analysis according to claim 1, characterized in that: The generating the first answer option group further includes sorting the first answer option group.
5. The method for generating quick answer options based on question analysis according to claim 1, characterized in that: The processing includes: grammar correction, spelling check, and formatting.
6. A system for generating quick answer options based on question analysis, characterized in that: The method comprises: An acquisition module is used to acquire a question text input by a user, identify the question text, and search and match the question text in a pre-built regular expression library according to a preset priority order; A first generating module is used to extract the corresponding expression and option group text information and generate a first answer option group if the match is successful; A second generating module is used to perform a second matching in two preset fixed option groups if the matching fails, and generate a second answer option group after the second matching succeeds; A processing module, used for processing the first answer option group, the second answer option group, and the preset additional options according to a preset format; A display module, used to display the processed first answer option group, the second answer option group and the preset additional options on the interface of the setting platform; The response module is used to determine the answer option finally selected by the user and respond.
7. The system for generating quick answer options based on question analysis according to claim 6, characterized in that: The acquisition module is also used to: clean the question text, retain the character information of the question text content and grammatical structure, and identify the keywords and words, grammatical structure and punctuation marks in the question text.
8. The system for generating quick answer options based on question analysis according to claim 6, characterized in that: The acquisition module is also used to perform semantic analysis on the question text, extract key information and intent of the question text, and perform rapid retrieval in the regular expression library based on the semantic understanding result.
9. The system for generating quick answer options based on question analysis according to claim 6, characterized in that: The first generating module is further used to sort the first answer option groups.
10. The system for generating quick answer options based on question analysis according to claim 6, characterized in that: The processing module is also used for grammar correction, spelling check, and formatting.