Question set generation method and device, and electronic device
By obtaining a candidate question set from search engine logs and calculating relevance, target question texts associated with reference texts are filtered out, solving the problem of insufficient question collection in intelligent question answering systems and improving the accuracy and comprehensiveness of the question set.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING BAIDU NETCOM SCI & TECH CO LTD
- Filing Date
- 2023-02-13
- Publication Date
- 2026-07-21
AI Technical Summary
Existing intelligent question-answering systems lack sufficient and accurate collection of user questions when building their FAQ databases, resulting in insufficient validity of the answers.
By retrieving a candidate question set from search engine logs, segmenting the reference text, and calculating the relevance between the candidate question text and the segment text, the target question text associated with the reference text is selected, thereby improving the accuracy and comprehensiveness of the question set.
By using a relevance-based screening method, a more accurate and comprehensive question set was generated, improving the effectiveness of the intelligent question-answering system.
Smart Images

Figure CN116226345B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, particularly to the fields of intelligent question answering, natural language processing, and big data, and specifically to methods, apparatuses, and electronic devices for generating question sets. Background Technology
[0002] Intelligent question-answering systems typically determine the answer quickly by querying a pre-built FAQ database based on the user's question. Therefore, the accuracy and comprehensiveness of the FAQ database directly impacts the effectiveness of the intelligent question-answering system. Thus, to improve the effectiveness of an intelligent question-answering system, it is essential to collect a sufficient and accurate list of potential user questions before building the FAQ database. Summary of the Invention
[0003] This disclosure provides a method, apparatus, and electronic device for generating a problem set.
[0004] According to one aspect of this disclosure, a method for generating a problem set is provided, comprising:
[0005] Obtain a candidate question set from search engine logs, where the candidate question set includes multiple candidate question texts;
[0006] The preset reference text is segmented to obtain multiple paragraph texts;
[0007] Determine the relevance between each candidate question text and each paragraph text;
[0008] Based on each relevance score, the target question text that is associated with the reference text is selected from multiple candidate question texts.
[0009] According to another aspect of this disclosure, a problem set generation apparatus is provided, comprising:
[0010] The acquisition module is used to retrieve a set of candidate questions from search engine logs, wherein the set of candidate questions includes multiple candidate question texts;
[0011] The segmentation module is used to segment the preset reference text into multiple paragraphs.
[0012] The determination module is used to determine the relevance between each candidate question text and each paragraph text;
[0013] The filtering module is used to filter out the target question text that is associated with the reference text from multiple candidate question texts based on each relevance.
[0014] According to another aspect of this disclosure, an electronic device is provided, comprising:
[0015] At least one processor; and
[0016] A memory that is communicatively connected to at least one processor; wherein,
[0017] The memory stores instructions that can be executed by at least one processor, which enables the at least one processor to perform the methods of the above embodiments.
[0018] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause a computer to perform the method according to the above embodiments.
[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0020] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0021] Figure 1 A flowchart illustrating a method for generating a problem set according to an embodiment of this disclosure;
[0022] Figure 2 A flowchart illustrating another method for generating a problem set provided in this embodiment of the disclosure;
[0023] Figure 3 A flowchart illustrating another method for generating a problem set provided in this embodiment of the disclosure;
[0024] Figure 4 A flowchart illustrating another method for generating a problem set provided in this embodiment of the disclosure;
[0025] Figure 5 A schematic diagram of the structure of another problem set generation apparatus provided in an embodiment of this disclosure;
[0026] Figure 6 This is a block diagram of an electronic device used to generate a problem set for implementing embodiments of the present disclosure. Detailed Implementation
[0027] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0028] Artificial intelligence (AI) is the study of using computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, and big data processing. AI software technologies include computer vision, speech recognition, natural language processing, deep learning, big data processing, and knowledge graph technologies.
[0029] Natural Language Processing (NLP) is an important field in computer science and artificial intelligence. NLP research includes, but is not limited to, the following subfields: text classification, information extraction, automatic summarization, intelligent question answering, topic recommendation, machine translation, topic word recognition, knowledge base construction, deep text representation, named entity recognition, text generation, text analysis (lexical, syntactic, and grammatical functions), speech recognition and synthesis, etc.
[0030] Big data, or massive data, refers to information that is so large that it cannot be captured, managed, processed, and organized into a more proactive business decision-making process using current mainstream software tools within a reasonable timeframe.
[0031] Typically, candidate questions are filtered based on whether they contain domain-specific terms. This method only considers a portion of the information in the question text, neglecting the overall semantics, thus resulting in low accuracy in the selected questions.
[0032] In this disclosure, the target question text associated with the reference text is selected from multiple candidate question texts based on the relevance between each candidate question text obtained from the search engine logs and each paragraph in the reference text, thereby improving the accuracy and comprehensiveness of the generated question set.
[0033] The method, apparatus, electronic device, and storage medium for generating problem sets according to embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings.
[0034] It should be noted that the problem set generation method of this disclosure is illustrated by being configured in a problem set generation device (hereinafter referred to as the generation device). The generation device can be applied to any electronic device so that the electronic device can perform the function of generating a problem set.
[0035] Among them, electronic devices can be any device with computing capabilities, such as personal computers (PCs), mobile terminals, etc. Mobile terminals can be hardware devices with various operating systems, touch screens and / or displays, such as tablet computers, personal digital assistants, wearable devices, etc.
[0036] Figure 1 This is a flowchart illustrating a method for generating a problem set according to an embodiment of the present disclosure.
[0037] like Figure 1 As shown, the method includes:
[0038] Step 101: Obtain a candidate question set from the search engine logs, wherein the candidate question set includes multiple candidate question texts.
[0039] In this disclosure, to collect more question texts, logs from general search engines or domain-specific search engines can be parsed and filtered using preset rules to obtain a set of candidate questions and tags corresponding to each candidate question text. The tags can include the domain corresponding to the candidate question text, etc., and this disclosure does not impose any restrictions on this.
[0040] Understandably, when requesting the generation of a question set, the applicant lacks user search history logs for a new product. However, general search engine logs contain numerous questions related to similar products. Therefore, candidate question sets can be obtained from these logs. This serves two purposes: firstly, it quickly meets the needs of applicants lacking historical search logs; secondly, it improves the comprehensiveness of the generated question set.
[0041] Step 102: Divide the preset reference text into segments to obtain multiple paragraph texts.
[0042] The reference text can be explanatory text that answers each question in the question set to be generated. For example, when generating a question set for a specific car model, the reference text could be the instruction manual for that model. When generating a question set for a specific website, the reference text could be the user guide for that website.
[0043] In this disclosure, segmentation rules can be set based on the writing format of the reference text. Then, based on these rules, the reference text is segmented according to the reading order, resulting in multiple paragraphs. This allows for accurate selection of the target question text from the candidate question set based on each of the multiple paragraphs.
[0044] Optionally, the reference text can be segmented into sentences, paragraphs, or other units as needed. This disclosure does not impose any restrictions on this.
[0045] Step 103: Determine the relevance between each candidate question text and each paragraph text.
[0046] In this disclosure, vector transformation can be performed on each candidate question text and each paragraph text to determine the vector corresponding to each candidate question text and each paragraph text. Then, the relevance between each candidate question text and each paragraph text is determined based on the distance between the vectors corresponding to each candidate question text and each paragraph text.
[0047] Step 104: Based on each relevance, select the target question text that is associated with the reference text from multiple candidate question texts.
[0048] In this disclosure, when the relevance between any candidate question text and any paragraph text is greater than a threshold, it indicates that the candidate question text is a question that might be asked in relation to that paragraph text. At this point, the candidate question text can be identified as the target question text associated with the reference text, thereby obtaining the question set corresponding to the reference text.
[0049] Understandably, since the reference document contains explanatory texts for answering each question in the question set to be generated, the target question texts that are associated with the reference text can be accurately selected from multiple candidate question texts based on the relevance between each candidate question text and each paragraph in the reference text, in order to generate a question set targeting that reference text.
[0050] In this disclosure, since the target question texts in the question set are selected based on reference texts, and the reference texts correspond to fixed domains, the question set should contain a large number of target question texts in the same domain. When the number of target question texts in a certain domain in the question set is small, it indicates that the selection of target question texts corresponding to that domain in the question set is incorrect.
[0051] Therefore, the target question texts can be categorized based on their corresponding tags, and the number of target question texts of each type can be determined. If the number of target question texts corresponding to a certain type is less than a third threshold, that target question text is deleted. This further improves the accuracy of the generated question set.
[0052] In this disclosure, after obtaining a candidate question set including multiple candidate question texts from search engine logs, a pre-defined reference text is segmented to obtain multiple paragraph texts. Then, the relevance between each candidate question text and each paragraph text is determined, and based on each relevance, target question texts associated with the reference text are selected from the multiple candidate question texts. Therefore, by selecting target question texts associated with the reference text based on the relevance between each candidate question text obtained from the search engine logs and each paragraph in the reference text, the accuracy and comprehensiveness of the generated question set are improved.
[0053] Figure 2 This is a flowchart illustrating a method for generating a problem set according to an embodiment of the present disclosure.
[0054] like Figure 2 As shown, the method includes:
[0055] Step 201: Obtain a candidate question set from the search engine logs, wherein the candidate question set includes multiple candidate question texts.
[0056] Step 202: Divide the preset reference text into segments to obtain multiple paragraph texts.
[0057] The specific implementation process of steps 201-202 in this disclosure can be found in the detailed description of any embodiment of this disclosure, and will not be repeated here.
[0058] Step 203: Perform vector transformation on each candidate question text and each paragraph text to determine the first semantic vector corresponding to each candidate question text and the second semantic vector corresponding to each paragraph text.
[0059] The first semantic vector and the second semantic vector have the same dimension.
[0060] In this disclosure, vector transformations can be performed on each candidate question text and each paragraph text using any two pre-trained natural language processing models to determine the first semantic vector corresponding to each candidate question text and the second semantic vector corresponding to each paragraph text.
[0061] Alternatively, the same natural language processing model can be used to perform vector transformation on each candidate question text and each paragraph text. This natural language processing model is a matching model (such as the matching twin-tower model) that is jointly trained on the question text and paragraph text.
[0062] Step 204: Based on multiple first semantic vectors and multiple second semantic vectors, construct multiple first matrices and multiple second matrices, wherein each first matrix includes multiple first semantic vectors and each second matrix includes multiple second semantic vectors.
[0063] When there are many candidate question texts or paragraph texts, calculating the distance between each first semantic vector and each second semantic vector sequentially is inefficient.
[0064] In this disclosure, multiple first matrices containing multiple first semantic vectors can be constructed based on multiple first semantic vectors, and multiple second matrices containing multiple second semantic vectors can be constructed based on multiple second semantic vectors. Then, the distance between each first semantic vector and each second semantic vector is calculated based on the first and second matrices, which can improve the efficiency of determining the distance between each first semantic vector and each second semantic vector.
[0065] Step 205: Calculate the product between each first matrix and each second matrix to determine the first distance between each first semantic vector constituting the first matrix and each second semantic vector constituting the second matrix.
[0066] In this disclosure, each first matrix is multiplied by each second matrix to determine a first distance between each first semantic vector constituting the first matrix and each second semantic vector constituting the second matrix.
[0067] Understandably, a single matrix multiplication can simultaneously obtain the first distances between the multiple first semantic vectors constituting the first matrix and the multiple second semantic vectors constituting the second matrix. This improves the efficiency of determining the distance between each first semantic vector and each second semantic vector, further contributing to improved efficiency in generating the problem set.
[0068] Step 206: Determine the relevance between each candidate question text and each paragraph text based on each first distance.
[0069] In this disclosure, a larger first distance indicates a lower correlation between the corresponding candidate question text and the paragraph text. Conversely, a smaller first distance indicates a higher correlation between the corresponding candidate question text and the paragraph text.
[0070] Step 207: Based on each relevance, select the target question text that is associated with the reference text from multiple candidate question texts.
[0071] The specific implementation process of step 207 in this disclosure can be found in the detailed description of any embodiment of this disclosure, and will not be repeated here.
[0072] In this disclosure, after obtaining multiple candidate question texts and multiple paragraph texts corresponding to the reference text from search engine logs, vector transformation is performed on each candidate question text and each paragraph text to determine a first semantic vector corresponding to each candidate question text and a second semantic vector corresponding to each paragraph text. Based on the multiple first semantic vectors and multiple second semantic vectors, multiple first matrices and multiple second matrices are constructed, wherein each first matrix includes multiple first semantic vectors and each second matrix includes multiple second semantic vectors. The product between each first matrix and each second matrix is calculated to determine a first distance between each first semantic vector constituting the first matrix and each second semantic vector constituting the second matrix. Based on each first distance, the relevance between each candidate question text and each paragraph text is determined. Based on each relevance, target question texts associated with the reference text are selected from the multiple candidate question texts. Thus, by calculating the product between each first matrix and each second matrix, the relevance between each first semantic vector and each second semantic vector can be quickly and accurately determined, and target question texts associated with the reference text can be selected from the multiple candidate question texts based on each relevance. This improves the accuracy and efficiency of determining the generated question set.
[0073] Figure 3 This is a flowchart illustrating a method for generating a problem set according to an embodiment of the present disclosure.
[0074] like Figure 3 As shown, the method includes:
[0075] Step 301: Obtain a candidate question set from the search engine logs, wherein the candidate question set includes multiple candidate question texts.
[0076] Step 302: Divide the preset reference text into segments to obtain multiple paragraph texts.
[0077] Step 303: Determine the relevance between each candidate question text and each paragraph text.
[0078] Step 304: Based on each relevance, select the target question text that is associated with the reference text from multiple candidate question texts.
[0079] The specific implementation process of steps 301-304 in this disclosure can be found in the detailed description of any embodiment of this disclosure, and will not be repeated here.
[0080] Step 305: Perform vector transformation on each target question text in the question set to determine the third semantic vector corresponding to each target question text.
[0081] In this disclosure, due to differences in language expression, a single question may correspond to multiple different question texts, but the answers to these multiple different question texts are the same. Therefore, in order to avoid the repeated mining of synonymous question-answer pairs during the process of generating question-answer pairs based on a question set, multiple target question texts can be grouped to identify target question texts corresponding to the same question as a group.
[0082] In this disclosure, to improve the accuracy of identifying question groups, a pre-trained natural language processing model (such as a matching dual-tower model) can be used to perform vector transformation on each target question text in the question set to determine the third semantic vector corresponding to each target question text. Then, based on the third semantic vector corresponding to each target question text, the question group corresponding to each target question text is determined.
[0083] Step 306: Construct multiple third matrices based on multiple third semantic vectors, wherein each third matrix includes multiple third semantic vectors.
[0084] When there are many third semantic vectors, calculating the pairwise distances between multiple third semantic vectors sequentially is inefficient. Furthermore, loading all third semantic vectors into memory results in significant memory consumption and may pose a risk of memory corruption.
[0085] In this disclosure, multiple third matrices comprising multiple third semantic vectors can be constructed based on multiple third semantic vectors. Then, second distances between each pair of the multiple third semantic vectors can be calculated based on the third matrices, thereby simultaneously determining the pairwise distances between the multiple third semantic vectors.
[0086] Step 307: Calculate the pairwise product of the multiple third matrices to determine the second distance between the pairwise third semantic vectors.
[0087] In this disclosure, two third matrices are sequentially read into memory, and the pairwise products of multiple third matrices are calculated to obtain the second distance between each pair of multiple third semantic vectors. This improves the efficiency and reliability of determining the second distance between each pair of multiple third semantic vectors, thereby improving the efficiency, accuracy, and reliability of determining the problem set.
[0088] Step 308: Determine the similarity between multiple target question texts based on each second distance.
[0089] In this disclosure, a larger second distance indicates a lower similarity between the two corresponding target question texts. Conversely, a smaller second distance indicates a higher similarity between the two corresponding target question texts.
[0090] Step 309: Group each target question text according to similarity and determine the question group to which each target question text belongs.
[0091] In this disclosure, target question texts can be grouped according to similarity using a preset clustering algorithm to determine the question group to which each target question text belongs. The higher the similarity between two target question texts, the greater the likelihood that they belong to the same question group.
[0092] It is understandable that, since the third semantic vector contains the semantic information of the target question text, determining the similarity between each target question text based on the third semantic vector, and grouping each target question text according to the similarity, to determine the question group to which each target question text belongs, is beneficial to improving the accuracy of determining the question group.
[0093] In this disclosure, after determining the target question texts, a vector transformation is performed on each target question text in the question set to determine the corresponding third semantic vector. Based on these third semantic vectors, multiple third matrices are constructed, each containing multiple third semantic vectors. Then, the pairwise products of these third matrices are calculated to determine the pairwise second distances between the third semantic vectors. Based on each second distance, the similarity between the target question texts is determined. Finally, the target question texts are grouped according to their similarity to determine the question group to which each target question text belongs. Therefore, by calculating the pairwise products of multiple third matrices, the similarity between multiple target question texts can be determined quickly and accurately, and the texts can be grouped according to their similarity. This improves the efficiency and accuracy of determining question groups.
[0094] Figure 4 This is a flowchart illustrating a method for generating a problem set according to an embodiment of the present disclosure.
[0095] like Figure 4 As shown, the method includes:
[0096] Steps 401 and 301: Obtain a candidate question set from the search engine logs, wherein the candidate question set includes multiple candidate question texts.
[0097] Step 402: Divide the preset reference text into segments to obtain multiple paragraph texts.
[0098] Step 403: Determine the relevance between each candidate question text and each paragraph text.
[0099] Step 404: Based on each relevance, select the target question text that is associated with the reference text from multiple candidate question texts.
[0100] Step 405: Perform vector transformation on each target question text in the question set to determine the third semantic vector corresponding to each target question text.
[0101] Step 406: Construct multiple third matrices based on multiple third semantic vectors, wherein each third matrix includes multiple third semantic vectors.
[0102] Step 407: Calculate the pairwise product of the multiple third matrices to determine the second distance between the pairwise third semantic vectors.
[0103] Step 408: Determine the similarity between multiple target question texts based on each second distance.
[0104] The specific implementation process of steps 401-408 in this disclosure can be found in the detailed description of any embodiment of this disclosure, and will not be repeated here.
[0105] Step 409: Randomly select a preset number of target question texts with similarity less than a first threshold from multiple target question texts as the center question text.
[0106] In this disclosure, a predetermined number of target question texts with a similarity less than a first threshold can be randomly selected from multiple target question texts as central question texts. Then, the target question texts are grouped using the central question texts as a reference to determine the question group to which each target question belongs.
[0107] Step 410: If the similarity between any target question text and any central question text is greater than the second threshold, determine that any target question text and any central question text belong to the same question group.
[0108] In this disclosure, if the similarity between a target question text and a central question text is greater than a second threshold, it indicates that the target question text and the central question text correspond to the same question, and it can be determined that the target question text and the central question text belong to the same question group. For example, if the similarity between target question text b and central question text a is greater than the second threshold, it can be determined that target question text b and central question text a belong to the same question group.
[0109] Step 411: If the similarity between any target question text and each central question text is less than or equal to the second threshold, determine the question group to which any target question text belongs based on the similarity between any target question text and each target question text in each question group, until the question group to which each target question text belongs is determined.
[0110] In this disclosure, there may be target question texts whose similarity to each central question text is less than or equal to a second threshold. In this case, the question group to which the target question text belongs can be determined based on the similarity between the target question text and each target question text in each question group, until the question group to which each target question text belongs is determined.
[0111] For example, suppose there are two central question texts, a and d. Target question text b belongs to the same question group as central question text a, and target question text c belongs to the same question group as central question text d. The similarity between target question text e and both central question text a and d is less than a second threshold. In this case, the question group to which target question text e belongs can be determined based on the similarity between target question text e and both target question text b and target question text c. When the similarity between target question text e and target question text b is greater than the second threshold, it can be determined that target question text e belongs to the same question group as central question text a. Alternatively, when the similarity between target question text e and target question text b is greater than the similarity between target question text e and target question text c, it can be determined that target question text e belongs to the same question group as central question text a. This process is continued outwards until the question group to which each target question text belongs is determined.
[0112] Therefore, by simply comparing the similarity between the target question texts, the question group to which each target question text belongs can be determined without complex calculations, thus improving the efficiency of determining the question group.
[0113] Optionally, if a target question text belongs to multiple question groups, the target question text can be deleted to ensure the accuracy of the question groups.
[0114] Optionally, if the similarity between a target question text and each central question text is less than or equal to a second threshold, it can be determined whether the similarity between the target question text and each target question text in each question group is greater than the threshold. If the similarity between the target question text and any target question text in a question group is greater than the threshold, the target question text is determined to belong to that question group. If the similarity between the target question text and any target question text in multiple question groups is greater than the threshold, the target question text is deleted to ensure the accuracy of the question groups.
[0115] In this disclosure, target question texts associated with reference texts are selected from multiple candidate question texts. After determining the similarity between the multiple target question texts, a predetermined number of target question texts with similarity less than a first threshold are randomly selected as center question texts. Then, if the similarity between any target question text and any center question text is greater than a second threshold, it is determined that any target question text and any center question text belong to the same question group. Then, if the similarity between any target question text and each center question text is less than or equal to the second threshold, the question group to which any target question text belongs is determined based on the similarity between any target question text and each target question text in each question group, until the question group to which each target question text belongs is determined. Thus, by comparing the similarity between each target question text, the question group to which each target question text belongs is determined, reducing the complexity of determining the question group and thereby improving the accuracy and efficiency of determining the question group.
[0116] To implement the above embodiments, this disclosure also proposes a problem set generation apparatus.
[0117] Figure 5 This is a schematic diagram of a problem set generation apparatus provided in an embodiment of the present disclosure.
[0118] like Figure 5 As shown, the problem set generation device 500 includes: an acquisition module 510, a segmentation module 520, a determination module 530, and a filtering module 540.
[0119] The acquisition module 510 is used to acquire a candidate question set from the search engine logs, wherein the candidate question set includes multiple candidate question texts;
[0120] The segmentation module 520 is used to segment the preset reference text and obtain multiple paragraph texts;
[0121] Module 530 is used to determine the relevance between each candidate question text and each paragraph text;
[0122] The filtering module 540 is used to filter out the target question text that is associated with the reference text from multiple candidate question texts based on each relevance.
[0123] In one possible implementation of this disclosure, the determining module 530 is used to:
[0124] Perform vector transformation on each candidate question text and each paragraph text to determine the first semantic vector corresponding to each candidate question text and the second semantic vector corresponding to each paragraph text;
[0125] Based on multiple first semantic vectors and multiple second semantic vectors, multiple first matrices and multiple second matrices are constructed, wherein each first matrix includes multiple first semantic vectors and each second matrix includes multiple second semantic vectors;
[0126] Calculate the product between each first matrix and each second matrix to determine the first distance between each first semantic vector constituting the first matrix and each second semantic vector constituting the second matrix;
[0127] Based on each first distance, determine the relevance between each candidate question text and each paragraph text.
[0128] In one possible implementation of this disclosure, a grouping module is further included, used for:
[0129] Perform vector transformation on each target question text in the question set to determine the third semantic vector corresponding to each target question text;
[0130] Multiple third-semantic vectors are used to construct multiple third-matrixes, where each third-matrix contains multiple third-semantic vectors.
[0131] Calculate the pairwise product of multiple third matrices to determine the second distance between pairwise multiple third semantic vectors;
[0132] Based on each second distance, the similarity between multiple target question texts is determined;
[0133] The target question texts are grouped according to their similarity to determine the question group to which each target question text belongs.
[0134] In one possible implementation of this disclosure, the grouping module is used for:
[0135] A predetermined number of target question texts with similarity less than a first threshold are randomly selected from multiple target question texts and used as the center question text;
[0136] If the similarity between any target question text and any central question text is greater than the second threshold, then any target question text and any central question text belong to the same question group.
[0137] If the similarity between any target question text and each central question text is less than or equal to the second threshold, the question group to which any target question text belongs is determined based on the similarity between any target question text and each target question text in each question group, until the question group to which each target question text belongs is determined.
[0138] In one possible implementation of this disclosure, the grouping module is further configured to:
[0139] If any target question text belongs to multiple question groups, delete any target question text.
[0140] In one possible implementation of this disclosure, the candidate question set further includes a tag corresponding to each candidate question text, and the filtering module 540 is further configured to:
[0141] The target question texts are categorized based on their corresponding tags, and the number of target question texts of each type is determined.
[0142] If the number of corresponding target question texts is less than the third threshold, delete any target question text.
[0143] It should be noted that the explanation of the aforementioned problem set generation method embodiment also applies to the apparatus of this embodiment, and therefore will not be repeated here.
[0144] In this disclosure, after obtaining a candidate question set including multiple candidate question texts from search engine logs, a pre-defined reference text is segmented to obtain multiple paragraph texts. Then, the relevance between each candidate question text and each paragraph text is determined, and based on each relevance, target question texts associated with the reference text are selected from the multiple candidate question texts. Therefore, by selecting target question texts associated with the reference text based on the relevance between each candidate question text obtained from the search engine logs and each paragraph in the reference text, the accuracy and comprehensiveness of the generated question set are improved.
[0145] According to embodiments of this disclosure, this disclosure also provides an electronic device and a readable storage medium.
[0146] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0147] like Figure 6As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in ROM (Read-Only Memory) 602 or a computer program loaded from storage unit 608 into RAM (Random Access Memory) 603. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. I / O (Input / Output) interface 605 is also connected to bus 604.
[0148] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of monitors, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0149] The computing unit 601 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, CPUs (Central Processing Units), GPUs (Graphics Processing Units), various special-purpose AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, DSPs (Digital Signal Processors), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as the problem set generation method. For example, in some embodiments, the problem set generation method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the problem set generation method described above can be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform a method for generating a problem set by any other suitable means (e.g., by means of firmware).
[0150] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application-Specific Standard Products), SOCs (System-on-Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0151] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0152] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0153] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0154] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include LANs (Local Area Networks), WANs (Wide Area Networks), the Internet, and blockchain networks.
[0155] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service system that addresses the shortcomings of traditional physical hosts and VPS (Virtual Private Server) services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers integrated with blockchain technology.
[0156] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0157] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for generating a problem set, comprising: Obtain a candidate question set from search engine logs, wherein the candidate question set includes multiple candidate question texts; The preset reference text is segmented to obtain multiple paragraph texts. The reference text is the explanatory text for answering each question in the set of questions to be generated. Determine the relevance between each candidate question text and each paragraph text; Based on each relevance score, a target question text associated with the reference text is selected from a plurality of candidate question texts; Perform vector transformation on each target question text to determine the third semantic vector corresponding to each target question text; Based on the multiple third semantic vectors, multiple third matrices are constructed, wherein each third matrix includes multiple third semantic vectors; Calculate the pairwise product of the plurality of third matrices to determine the second distance between the pairwise of the plurality of third semantic vectors; Based on each of the second distances, the similarity between the multiple target question texts is determined; A predetermined number of target question texts with similarity less than a first threshold are randomly selected from a plurality of target question texts and used as the center question text; If the similarity between any target question text and any central question text is greater than a second threshold, then the target question text and the central question text are determined to belong to the same question group. If the similarity between any target question text and each of the central question texts is less than or equal to the second threshold, the question group to which the target question text belongs is determined based on the similarity between the target question text and each target question text in each question group, until the question group to which each target question text belongs is determined.
2. The method as described in claim 1, wherein, Determining the relevance between each candidate question text and each paragraph text includes: Perform vector transformation on each candidate question text and each paragraph text to determine the first semantic vector corresponding to each candidate question text and the second semantic vector corresponding to each paragraph text; Based on multiple first semantic vectors and multiple second semantic vectors, multiple first matrices and multiple second matrices are constructed, wherein each first matrix includes multiple first semantic vectors and each second matrix includes multiple second semantic vectors; Calculate the product between each of the first matrix and each of the second matrix to determine the first distance between each of the first semantic vectors constituting the first matrix and each of the second semantic vectors constituting the second matrix; Based on each of the first distances, the relevance between each candidate question text and each paragraph text is determined.
3. The method as described in claim 1, wherein, Also includes: If any target question text belongs to multiple question groups, delete that target question text.
4. The method of claim 1, wherein, The candidate question set also includes a tag corresponding to each candidate question text, and the method further includes: The target question texts are classified according to the tags corresponding to each target question text, and the number of target question texts of each type is determined; If the number of any target question texts is less than a third threshold, then delete the target question text.
5. A problem set generation apparatus, comprising: The acquisition module is used to acquire a set of candidate questions from search engine logs, wherein the set of candidate questions includes multiple candidate question texts; The segmentation module is used to segment the preset reference text and obtain multiple paragraph texts. The reference text is the explanatory text that answers each question in the set of questions to be generated. The determination module is used to determine the relevance between each candidate question text and each paragraph text; A filtering module is used to filter out target question texts associated with the reference text from a plurality of candidate question texts based on each relevance score; The grouping module is used to perform vector transformation on each target question text to determine the third semantic vector corresponding to each target question text; construct multiple third matrices based on multiple third semantic vectors, wherein each third matrix includes multiple third semantic vectors; calculate the product between each pair of the multiple third matrices to determine the second distance between each pair of the multiple third semantic vectors; Based on each of the second distances, the similarity between the multiple target question texts is determined; a preset number of target question texts with similarity less than a first threshold are randomly selected from the multiple target question texts as center question texts; if the similarity between any target question text and any center question text is greater than a second threshold, it is determined that the target question text and the center question text belong to the same question group; if the similarity between any target question text and each of the center question texts is less than or equal to the second threshold, the question group to which the target question text belongs is determined based on the similarity between the target question text and each target question text in each question group, until the question group to which each target question text belongs is determined.
6. The apparatus of claim 5, wherein, The determining module is used for: Perform vector transformation on each candidate question text and each paragraph text to determine the first semantic vector corresponding to each candidate question text and the second semantic vector corresponding to each paragraph text; Based on multiple first semantic vectors and multiple second semantic vectors, multiple first matrices and multiple second matrices are constructed, wherein each first matrix includes multiple first semantic vectors and each second matrix includes multiple second semantic vectors; Calculate the product between each of the first matrix and each of the second matrix to determine the first distance between each of the first semantic vectors constituting the first matrix and each of the second semantic vectors constituting the second matrix; Based on each of the first distances, the relevance between each candidate question text and each paragraph text is determined.
7. The apparatus of claim 5, wherein, The grouping module is also used for: If any target question text belongs to multiple question groups, delete that target question text.
8. The apparatus of claim 5, wherein, The candidate question set also includes a tag corresponding to each candidate question text, and the filtering module is further used for: The target question texts are classified according to the tags corresponding to each target question text, and the number of target question texts of each type is determined; If the number of any target question texts is less than a third threshold, then delete the target question text.
9. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-4.
11. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-4.