Method, device, equipment and storage medium for processing cloze test questions
By filling in the candidate answers of the cloze fill-in-the-blank questions into the blanks separately and using the network model to determine the score vector, the inaccurate answer problem caused by ignoring the continuity of spaces in the prior art is solved, and higher processing accuracy and reliability are achieved.
Patent Information
- Application Number
- CN202111308448.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-05
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2041-11-05
AI Technical Summary
When dealing with cloze-filling questions, the prior art ignores the content continuity between each space, resulting in inaccurate prediction of the answer.
By obtaining M candidate answers for the cloze fill-in-the-blank questions, filling them into N blanks, using the preset network model to determine the score vector for each question to be checked, determining the optimal answer for each blank is based on the score vector, and determining the target answer when the optimal answer corresponding to the blanks is different.
The accuracy and reliability of the processing of cloze-filling questions is improved, the correlation between each answer is taken into account, and the accuracy and reliability of answer prediction is enhanced.
Smart Images

Figure CN116090437B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for processing cloze questions. Background Art
[0002] Cloze test is a common question type in examinations. In it, the question setter purposefully removes some content from a semantically coherent article to form blanks. Students are required to select a correct or best answer from the corresponding alternative answers to make the article complete.
[0003] Related techniques typically treat each blank as a sub-question, then compare the similarities between the question stem and the options to select the most probable answer. However, if cloze questions in which each blank selects an answer from a common set of candidate answers are handled in this way, the continuity of the content will be neglected, resulting in poor results. Therefore, how to effectively process cloze questions to obtain accurate answers is a pressing issue. Summary of the Invention
[0004] The present invention provides a method, apparatus, device and storage medium for processing cloze test questions.
[0005] According to one aspect of the present disclosure, a method for processing a cloze test question is provided, comprising:
[0006] Obtaining a cloze question to be processed and M candidate answers corresponding to the question, wherein the cloze question contains N blanks, and M is a positive integer greater than or equal to N;
[0007] Filling the N blanks with multiple groups of N candidate answers from the M candidate answers to obtain multiple questions to be verified;
[0008] Inputting each of the questions to be verified into a preset network model to determine a score vector corresponding to each of the questions to be verified, wherein the score vector includes a degree of matching between each of the N blanks and the currently filled-in answer;
[0009] Determining the optimal answer corresponding to each blank according to the plurality of score vectors;
[0010] In the case that the optimal answers corresponding to the N blanks are all different, the optimal answers corresponding to the N blanks are determined as the target answers corresponding to the question.
[0011] According to another aspect of the present disclosure, a device for processing a cloze test question is provided, comprising:
[0012] A first acquisition module is configured to acquire a cloze question to be processed and M candidate answers corresponding to the question, wherein the cloze question contains N blanks, and M is a positive integer greater than or equal to N;
[0013] A second acquisition module is configured to fill in the N blanks with multiple groups of N candidate answers from the M candidate answers to obtain multiple questions to be verified;
[0014] A first determination module is configured to input each of the to-be-verified questions into a preset network model to determine a score vector corresponding to each of the to-be-verified questions, wherein the score vector includes a degree of matching between each of the N blanks and a currently filled-in answer;
[0015] A second determination module is configured to determine the optimal answer corresponding to each blank according to the plurality of score vectors;
[0016] The third determination module is used to determine the best answers corresponding to the N blanks as the target answer corresponding to the question when the best answers corresponding to the N blanks are all different.
[0017] The third aspect embodiment of the present disclosure proposes a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the method proposed in the first aspect embodiment of the present application.
[0018] The fourth aspect embodiment of the present disclosure proposes a non-temporary computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method proposed in the first aspect embodiment of the present application.
[0019] The fifth embodiment of the present disclosure provides a computer program product. When an instruction processor in the computer program product executes the method provided in the first embodiment of the present disclosure, the method provided in the first embodiment of the present disclosure is executed.
[0020] In the disclosed embodiment, first, a cloze question to be processed and M candidate answers corresponding to the question are obtained, wherein the cloze question contains N blanks, M is a positive integer greater than or equal to N, and then multiple groups of N candidate answers from the M candidate answers are filled into the N blanks respectively to obtain multiple questions to be verified, and each question to be verified is input into a preset network model to determine a score vector corresponding to each question to be verified, wherein the score vector includes the matching degree of the N blanks with the currently filled-in answers, and then the optimal answer corresponding to each blank is determined based on the multiple score vectors. Finally, when the optimal answers corresponding to the N blanks are different, the optimal answers corresponding to the N blanks are determined as the target answers corresponding to the question. Therefore, when processing cloze questions with shared candidate answers, various combinations of candidate answers are filled into the blanks to generate questions to be verified, and then the optimal answer corresponding to each blank is determined based on the score vector predicted by the model for each question to be verified. In this way, the answer prediction process can not only predict the answer in combination with semantics, but also consider the correlation between each answer, thereby improving the accuracy and reliability of processing this type of cloze questions.
[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings are used to better understand the present invention and do not constitute a limitation of the present invention.
[0023] Figure 1 A flowchart of a method for processing a cloze test question provided by an embodiment of the present disclosure;
[0024] Figure 2 A flowchart of another method for processing cloze questions provided by an embodiment of the present disclosure;
[0025] Figure 3 A flowchart of another method for processing a cloze test question provided by an embodiment of the present disclosure;
[0026] Figure 4 A structural block diagram of a device for processing cloze questions provided in one embodiment of the present disclosure;
[0027] Figure 5 The block diagram is a block diagram of an electronic device for implementing the method for processing cloze questions according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0029] The present disclosure provides a method for processing cloze test questions. The method can be executed by a cloze test question processing device provided by the present disclosure, or can be executed by an electronic device provided by the present disclosure, wherein the electronic device can be a terminal device, such as a user device, a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant, a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc., which is not limited here, and can also be a server.
[0030] The following describes in detail the method, device, computer equipment and storage medium for processing cloze questions provided by the present disclosure with reference to the accompanying drawings.
[0031] Figure 1 It is a flowchart of a method for processing a cloze test question according to an embodiment of the present disclosure.
[0032] like Figure 1 As shown, the method for processing the cloze test question may include the following steps:
[0033] Step 101 : Obtain a cloze question to be processed and M candidate answers corresponding to the question, wherein the cloze question contains N blanks, and M is a positive integer greater than or equal to N.
[0034] It should be noted that the cloze question currently being processed can correspond to the "choose five from seven" type of English test questions, or other cloze questions with multiple blanks corresponding to the same candidate answers. This type of cloze question contains the main text, also known as the question stem, and a unified set of candidate answers to be selected.
[0035] Among them, if M=N, then the M candidate answers are the correct answers corresponding to the blanks in the cloze test question, or, if M>N, then the M candidate answers can include N correct answers and (MN) interference answers that have a certain relevance to the question, which is not limited here.
[0036] For example, if there are 5 blanks corresponding to the current cloze test question, the candidate answers can be 5, 6, 7, or any other integer greater than 5, without limitation.
[0037] In the present disclosure, the cloze questions to be processed can be obtained by identifying the taken photos, or by identifying any electronic documents, which is not limited in the present disclosure.
[0038] Step 102 , fill in N blanks with multiple groups of N candidate answers from the M candidate answers to obtain multiple questions to be verified.
[0039] Among them, the question to be verified can be a complete question that integrates candidate answers and question stems. By filling in the blanks with candidate answers respectively, the answer and question stem can be spliced together to obtain the question to be verified, which makes it easier to analyze and calculate based on the complete semantics of the question.
[0040] It is understandable that the multiple groups of N candidate answers may be combinations of N candidate answers selected from M candidate answers in various combinations, thereby ensuring that the correct answer is included in the question to be verified.
[0041] For example, if M=4 and N=3, the options corresponding to the four candidate answers are A, B, C, and D respectively. Therefore, the multiple groups of three candidate answers can be [A, B, C], [A, B, D], [A, C, B], [A, D, B], [A, D, C], [A, C, D], [B, C, D], [B, A, C], [B, A, D], [B, D, A], [B, C, A], [B, D, C], [C, A, B], [C, B, A], [C, B, D], [C, D, B], [C, A, D], [C, D, A], [D, A, C], [D, C, A], [D, A, B], [D, B, A], [D, C, B], [D, B, C], and then fill in the blanks with the above 24 groups of candidate answers to obtain 24 questions to be verified.
[0042] It should be noted that the above examples are merely illustrative of the present disclosure and do not constitute limitations on the present disclosure.
[0043] Step 103 : Input each question to be verified into a preset network model to determine a score vector corresponding to each question to be verified, wherein the score vector includes the matching degree of each of the N blanks with the currently filled-in answer.
[0044] The preset network model can be a pre-trained network model, such as a RoBERT model. By inputting each question to be verified into the preset network model, a score vector corresponding to each question to be verified can be determined based on the semantics of the question to be verified. Each element in the score vector can represent the degree of match between the current filled-in answer and the corresponding blank, that is, the confidence level that the current filled-in answer is the answer corresponding to each of the N blanks.
[0045] It's understandable that a higher degree of match indicates a better fit between the currently entered answer and the blank, meaning the answer is more reliable. Furthermore, the degree of match between each blank and the currently entered answer may be the same or different, meaning that the answers currently entered in N blanks may have a higher or lower degree of match for some or all of the N blanks.
[0046] For example, if the score vector corresponding to the current question to be verified is [0.2, 0.5, 0.3], and the candidate answers filled in the current question to be verified are A, B, and C, respectively, and the three blanks in the question are a, b, and c, respectively, then the score vector [0.2, 0.5, 0.3] indicates that the current candidate answers A, B, and C match the blanks a, b, and c with a degree of 0.2, 0.5, and 0.3, respectively. Since the matching degree corresponding to candidate answer B is 0.5, which is greater than 0.2 and 0.3, it means that B has the highest degree of fit with b in the set of questions to be verified, and no limitation is imposed here.
[0047] Step 104: Determine the optimal answer corresponding to each blank based on the multiple score vectors.
[0048] Among them, the optimal answer is the answer that best fits the contextual semantics of the blank after filling in the blank, that is, the candidate answer that is most suitable for the blank.
[0049] Optionally, the degree of match between each blank and each candidate answer may be first determined based on multiple score vectors, and then the candidate answer with the highest degree of match with each blank may be determined as the optimal answer corresponding to each blank.
[0050] For example, if the current three score vectors are A1, B1, and C1, A1 = [0.2, 0.5, 0.3], B1 = [0.8, 0.4, 0.3], and C1 = [0.3, 0.11, 0.6], it can be seen from the three score vectors that the highest matching degree corresponding to the blank a1 is 0.8 in B1, so the candidate answer corresponding to 0.8 can be used as the optimal answer corresponding to a1, the highest matching degree corresponding to the blank b1 is 0.5 in A1, so the candidate answer corresponding to 0.5 can be used as the optimal answer corresponding to b1, and the highest matching degree corresponding to the blank c1 is 0.6 in C1, so the candidate answer corresponding to 0.6 can be used as the optimal answer corresponding to c1. There is no limitation here.
[0051] Step 105: When the optimal answers corresponding to the N blanks are all different, the optimal answers corresponding to the N blanks are determined as the target answer corresponding to the question.
[0052] The target answer may be the correct answer corresponding to the question, which may be an answer formed by arranging the correct answers corresponding to N blanks in the order of the blanks.
[0053] It should be noted that if the optimal answers corresponding to the current N blanks are all different, then the optimal answers corresponding to the current N blanks can be used as the target answers corresponding to the N blanks in the question.
[0054] For example, if there are currently 5 blank spaces, their corresponding serial numbers are 1, 2, 3, 4, and 5, and the current candidate answers are A, B, C, D, E, F, and G, and the optimal answers corresponding to the blank spaces currently numbered 1, 2, 3, 4, and 5 are B, C, D, E, and F, respectively, then "B, C, D, E, F" can be used as the target answers corresponding to the question, without any limitation here.
[0055] In the disclosed embodiment, first, a cloze question to be processed and M candidate answers corresponding to the question are obtained, wherein the cloze question contains N blanks, M is a positive integer greater than or equal to N, and then multiple groups of N candidate answers from the M candidate answers are filled into the N blanks respectively to obtain multiple questions to be verified, and each question to be verified is input into a preset network model to determine a score vector corresponding to each question to be verified, wherein the score vector includes the matching degree of the N blanks with the currently filled-in answers, and then the optimal answer corresponding to each blank is determined based on the multiple score vectors. Finally, when the optimal answers corresponding to the N blanks are different, the optimal answers corresponding to the N blanks are determined as the target answers corresponding to the question. Therefore, when processing cloze questions with shared candidate answers, various combinations of candidate answers are filled into the blanks to generate questions to be verified, and then the optimal answer corresponding to each blank is determined based on the score vector predicted by the model for each question to be verified. In this way, the answer prediction process can not only predict the answer in combination with semantics, but also consider the correlation between each answer, thereby improving the accuracy and reliability of processing this type of cloze questions.
[0056] Figure 2 It is a flowchart of another method for processing cloze questions according to an embodiment of the present disclosure.
[0057] like Figure 2 As shown, the method for processing the cloze test question may include the following steps:
[0058] Step 201 : Obtain a cloze question to be processed and M candidate answers corresponding to the question, wherein the cloze question contains N blanks, and M is a positive integer greater than or equal to N.
[0059] In step 202, multiple groups of N candidate answers from the M candidate answers are filled into N blanks respectively to obtain multiple questions to be verified.
[0060] In step 203, each question to be verified is input into a preset network model to determine a score vector corresponding to each question to be verified, wherein the score vector includes the matching degree of each of the N blanks with the currently filled-in answer.
[0061] Step 204: Determine the optimal answer corresponding to each blank based on the multiple score vectors.
[0062] It should be noted that the specific implementation of steps 201, 202, 203, and 204 can refer to the above embodiment and will not be described in detail here.
[0063] Step 205: When the optimal answers corresponding to the K blanks are the same, calculate the first matching degree difference between the optimal answer and the suboptimal answer corresponding to the K blanks, where K is a positive integer greater than 1 and less than or equal to N.
[0064] Among them, the optimal answer is the candidate answer with the highest matching score predicted by the model after filling in the blank.
[0065] The suboptimal answer may be a candidate answer whose matching degree is lower than the optimal answer but higher than other candidate answers. It is understandable that the suboptimal answer is a candidate answer whose reliability is second only to the optimal answer.
[0066] The first matching degree difference may be the difference between the matching degree of the optimal answer corresponding to each of the K blanks and the matching degree corresponding to the suboptimal answer.
[0067] It should be noted that, when the optimal answers corresponding to K blanks are the same, the embodiment of the present disclosure can select the blank that is uniquely adapted to the current optimal answer by calculating the first matching degree difference, so that the answers to other blanks can be determined later.
[0068] For example, if the current question has three blanks, namely M1, M2, and M3, among which the optimal answers corresponding to M1 and M2 are both U, and the matching degrees are both 0.8. The matching degree of the suboptimal answer corresponding to M1 is 0.6, and the matching degree of the suboptimal answer corresponding to M2 is 0.1. Through calculation, it can be obtained that the first matching degree difference corresponding to M1 is 0.2, and the first matching degree difference corresponding to M2 is 0.7, which is not limited here.
[0069] Step 206 : When the K first matching degree differences are all different, the optimal answer is determined as the target answer for the blank corresponding to the largest first matching degree difference.
[0070] For ease of understanding, the present disclosure provides the following examples for illustration, but not as a limitation of the present disclosure.
[0071] For example, if the current question has three blanks, namely M1, M2, and M3, among which the optimal answers corresponding to M1 and M2 are both U, with a matching degree of 0.8, the matching degree of the suboptimal answer corresponding to M1 is 0.6, and the matching degree of the suboptimal answer corresponding to M2 is 0.1. Through calculation, it can be obtained that the first matching degree difference corresponding to M1 is 0.2, and the first matching degree difference corresponding to M2 is 0.7. Since the first matching degree difference corresponding to M2 is large, that is, the matching degree between the suboptimal answer of M2 and M2 is very low, that is, the probability that the answer is the correct answer is extremely low. Therefore, when it is used as the target answer of M2, the probability of error is very high, and the matching degree between M1 and the suboptimal answer is much greater than the matching degree between M2 and the suboptimal answer, so the optimal answer U can be used as the target answer corresponding to M2, without limitation here.
[0072] Step 207 : When the suboptimal answers corresponding to the remaining K-1 blanks are all different, the suboptimal answers corresponding to the K-1 blanks are determined as the target answers corresponding to the K-1 blanks.
[0073] For ease of understanding, the present disclosure provides the following examples for illustration, but not as a limitation of the present disclosure.
[0074] For example, if K=3, the current question has four blanks, namely M1, M2, M3, and M4. Among them, the optimal answers corresponding to M1, M2, and M4 are all U, with a matching degree of 0.8. The matching degree of the suboptimal answer m1 corresponding to M1 is 0.6, the matching degree of the suboptimal answer m2 corresponding to M2 is 0.1, and the matching degree of the suboptimal answer m3 corresponding to M4 is 0.3. Through calculation, it can be obtained that the first matching degree difference corresponding to M1 is 0.2, the first matching degree difference corresponding to M2 is 0.7, and the first matching degree difference corresponding to M4 is 0.5. Since the first matching degree difference corresponding to M2 is larger, and the suboptimal answers corresponding to the other two blanks are different, m1 can be used as the target answer corresponding to M1, and m3 can be used as the target answer corresponding to M4, without limitation here.
[0075] Optionally, if the suboptimal answers corresponding to L of the remaining K-1 blanks are the same, the second matching degree differences between the suboptimal answers corresponding to the L blanks and the third optimal answer can be calculated, where L is a positive integer greater than 1 and less than or equal to K-1. Then, when the L second matching degree differences are all different, the suboptimal answer is determined as the target answer for the blank corresponding to the largest second matching degree difference.
[0076] The third best answer may be a candidate answer whose matching degree is lower than that of the second best answer, but higher than or equal to that of other candidate answers.
[0077] The second matching degree difference may be the difference between the matching degrees of the second-best answer and the matching degrees of the third-best answer corresponding to the L blank spaces.
[0078] For example, if K=5, L=3, and the suboptimal answers corresponding to three of the remaining four blanks, P1, P2, and P3, are the same, all U. Therefore, the second matching degree differences between the suboptimal answers corresponding to the three blanks and the third optimal answer can be calculated. Then, when the second matching degree differences are all different, the suboptimal answer can be determined as the target answer for the blank corresponding to the largest second matching degree difference.
[0079] The disclosed embodiment first obtains a cloze question to be processed and M candidate answers corresponding to the question, wherein the cloze question contains N blanks, M is a positive integer greater than or equal to N, and then fills in the N blanks with multiple groups of N candidate answers from the M candidate answers to obtain multiple questions to be verified, and inputs each question to be verified into a preset network model to determine a score vector corresponding to each question to be verified, wherein the score vector includes the matching degree of each of the N blanks and the currently filled-in answer, and then determines the optimal answer corresponding to each blank based on the multiple score vectors, and then Then, if the optimal answers corresponding to the K blanks are the same, the first matching degree difference between the optimal answer and the suboptimal answer corresponding to the K blanks is calculated, where K is a positive integer greater than 1 and less than or equal to N. Then, if the K first matching degree differences are all different, the optimal answer is determined as the target answer for the blank corresponding to the largest first matching degree difference. Finally, if the suboptimal answers corresponding to the remaining K-1 blanks are all different, the suboptimal answers corresponding to the K-1 blanks are determined as the target answers corresponding to the K-1 blanks. Thus, by combining the first matching degree differences between the optimal answer and the suboptimal answer, a connection is established between the options, so that when the optimal answers corresponding to multiple blanks are the same, the target answer for each position can be determined, and the deep learning model is used to combine semantics to predict the answer to the question, thereby making the answer to the current cloze question more accurate and reliable.
[0080] Figure 3 It is a flowchart of another method for processing cloze questions according to an embodiment of the present disclosure.
[0081] like Figure 3 As shown, the method for processing the cloze test question may include the following steps:
[0082] Step 301 : Obtain a cloze question to be processed and M candidate answers corresponding to the question, wherein the cloze question contains N blanks, and M is a positive integer greater than or equal to N.
[0083] In step 302, multiple groups of N candidate answers from the M candidate answers are filled into N blanks respectively to obtain multiple questions to be verified.
[0084] In step 303, each question to be verified is input into a preset network model to determine a score vector corresponding to each question to be verified, wherein the score vector includes the matching degree of each of the N blanks with the currently filled-in answer.
[0085] Step 304: Determine the optimal answer corresponding to each blank based on the multiple score vectors.
[0086] Step 305: When the optimal answers corresponding to the K blanks are the same, calculate the first matching degree difference between the optimal answer and the suboptimal answer corresponding to the K blanks, where K is a positive integer greater than 1 and less than or equal to N.
[0087] It should be noted that the specific implementation of steps 301 , 302 , 303 , 304 , and 305 may refer to the above embodiment and will not be described in detail here.
[0088] Step 306: When the first matching degree differences corresponding to F blanks among the K blanks are the largest and the same, determine the second matching degree differences between the second-best answer and the third-best answer corresponding to the F blanks, where F is a positive integer greater than 1 and less than or equal to K-1.
[0089] For ease of understanding, the present disclosure provides the following examples for illustration, but not as a limitation of the present disclosure.
[0090] For example, if K=4, F=3, the current question has 4 blanks, namely M1, M2, M3, and M4. Among them, the optimal answers corresponding to M1, M2, and M4 are all U, and the first matching degree difference is 0.75. The matching degree of the second-best answer corresponding to M1 is 0.6, and the matching degree of the third-best answer is 0.5. The matching degree of the second-best answer corresponding to M2 is 0.5, and the matching degree of the third-best answer is 0.42. The matching degree of the second-best answer corresponding to M4 is 0.3, and the matching degree of the third-best answer is 0.27. Through calculation, it can be obtained that the second matching degree difference corresponding to M1 is 0.1, the second matching degree difference corresponding to M2 is 0.08, and the second matching degree difference corresponding to M4 is 0.03.
[0091] Step 307 : When the F second matching degree differences are all different, the optimal answer is determined as the target answer for the blank corresponding to the maximum second matching degree difference.
[0092] Combined with the example of step 306 above, since the three second matching degree differences are all different, and the second matching degree difference corresponding to M1 is larger, which is 0.1, the optimal answer corresponding to M1 can be used as the target answer corresponding to M1, without limitation here.
[0093] Step 308: When the suboptimal answers corresponding to the remaining K-1 blanks are all different, the suboptimal answers corresponding to the K-1 blanks are determined as the target answers corresponding to the K-1 blanks.
[0094] It should be noted that the specific implementation of step 308 can refer to the above embodiment and will not be described in detail here.
[0095] In the embodiment of the present disclosure, first, a cloze test question to be processed and M candidate answers corresponding to the question are obtained, wherein the cloze test question contains N blanks, M is a positive integer greater than or equal to N, and then multiple groups of N candidate answers from the M candidate answers are filled into the N blanks respectively to obtain multiple questions to be verified, and each question to be verified is input into a preset network model to determine a score vector corresponding to each question to be verified, wherein the score vector includes the matching degree of the N blanks and the currently filled-in answers respectively, and then the optimal answer corresponding to each blank is determined based on the multiple score vectors, and then the optimal answer corresponding to the blank is determined in the network model. When the first matching degree differences corresponding to F of the K blanks are the largest and the same, the second matching degree differences between the second-best answers and the third-best answers corresponding to the F blanks are determined, where F is a positive integer greater than 1 and less than or equal to K-1. Finally, when the F second matching degree differences are all different, the optimal answer is determined as the target answer for the blank corresponding to the largest second matching degree difference. Then, when the second-best answers corresponding to the remaining K-1 blanks are all different, the second-best answers corresponding to the K-1 blanks are determined as the target answers corresponding to the K-1 blanks. In this way, the matching degree of each candidate answer and the first and second matching degree differences can be combined to determine the target answer corresponding to each blank. This takes into account the correlation between the various options. Since the result prediction is based on the deep learning model combined with semantics, the answer to the current cloze test question is more accurate and reliable.
[0096] In order to implement the above embodiment, the present disclosure also proposes a processing device for cloze questions.
[0097] Figure 4 A schematic diagram of the structure of a device for processing cloze questions provided by an embodiment of the present disclosure.
[0098] like Figure 4As shown, the apparatus 400 for processing the cloze test question includes a first acquisition module 410 , a second acquisition module 420 , a first determination module 430 , a second determination module 440 , and a third determination module 450 .
[0099] A first acquisition module 410 is configured to acquire a cloze question to be processed and M candidate answers corresponding to the question, wherein the cloze question contains N blanks, and M is a positive integer greater than or equal to N;
[0100] A second obtaining module 420 is configured to fill in the N blanks with multiple groups of N candidate answers from the M candidate answers to obtain multiple questions to be verified;
[0101] A first determination module 430 is configured to input each of the to-be-verified questions into a preset network model to determine a score vector corresponding to each of the to-be-verified questions, wherein the score vector includes a degree of matching between each of the N blanks and a currently filled-in answer;
[0102] A second determination module 440 is configured to determine the optimal answer corresponding to each blank according to the plurality of score vectors;
[0103] The third determination module 450 is configured to determine the best answers corresponding to the N blanks as the target answer corresponding to the question when the best answers corresponding to the N blanks are all different.
[0104] Optionally, the second determining module is specifically configured to:
[0105] Determining a matching degree between each blank and each candidate answer based on the plurality of score vectors;
[0106] The candidate answer with the highest matching degree with each blank is determined as the optimal answer corresponding to each blank.
[0107] Optionally, the third determining module further includes:
[0108] a calculation unit, configured to calculate, when the optimal answers corresponding to the K blanks are the same, first matching degree differences between the optimal answers and the suboptimal answers corresponding to the K blanks, respectively, where K is a positive integer greater than 1 and less than or equal to N;
[0109] a first determining unit configured to, when the K first matching degree differences are all different, determine the optimal answer as the target answer for the blank corresponding to the largest first matching degree difference;
[0110] The second determining unit is configured to determine the suboptimal answers corresponding to the K-1 blanks as the target answers corresponding to the K-1 blanks when the suboptimal answers corresponding to the remaining K-1 blanks are all different.
[0111] Optionally, the computing unit is further configured to:
[0112] When the first matching degree differences corresponding to F blanks among the K blanks are the largest and the same, determining the second matching degree differences between the second-best answer and the third-best answer respectively corresponding to the F blanks, where F is a positive integer greater than 1 and less than or equal to K-1;
[0113] When the F second matching degree differences are all different, determining the optimal answer as the target answer for the blank corresponding to the largest second matching degree difference;
[0114] In a case where the suboptimal answers corresponding to the remaining K-1 blanks are all different, the suboptimal answers corresponding to the K-1 blanks are determined as the target answers corresponding to the K-1 blanks.
[0115] Optionally, the first determining unit is further configured to:
[0116] If the suboptimal answers corresponding to L of the remaining K-1 blanks are the same, calculate the second matching degree differences between the suboptimal answers corresponding to the L blanks and the third optimal answer, where L is a positive integer greater than 1 and less than or equal to K-1;
[0117] When the L second matching degree differences are all different, the suboptimal answer is determined as the target answer for the blank corresponding to the maximum second matching degree difference.
[0118] In the disclosed embodiment, first, a cloze question to be processed and M candidate answers corresponding to the question are obtained, wherein the cloze question contains N blanks, M is a positive integer greater than or equal to N, and then multiple groups of N candidate answers from the M candidate answers are filled into the N blanks respectively to obtain multiple questions to be verified, and each question to be verified is input into a preset network model to determine a score vector corresponding to each question to be verified, wherein the score vector includes the matching degree of the N blanks with the currently filled-in answers, and then the optimal answer corresponding to each blank is determined based on the multiple score vectors. Finally, when the optimal answers corresponding to the N blanks are different, the optimal answers corresponding to the N blanks are determined as the target answers corresponding to the question. Therefore, when processing cloze questions with shared candidate answers, various combinations of candidate answers are filled into the blanks to generate questions to be verified, and then the optimal answer corresponding to each blank is determined based on the score vector predicted by the model for each question to be verified. In this way, the answer prediction process can not only predict the answer in combination with semantics, but also consider the correlation between each answer, thereby improving the accuracy and reliability of processing this type of cloze questions.
[0119] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0120] Figure 5 A schematic block diagram of an example electronic device 500 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 can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0121] like Figure 5 As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the device 500 can also be stored in the RAM 503. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 505.
[0122] Various components in device 500 are connected to I / O interface 505, including: an input unit 506, such as a keyboard, mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, optical disk, etc.; and a communication unit 509, such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows device 500 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0123] The computing unit 501 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as the method for processing cloze test questions. For example, in some embodiments, the method for processing cloze test questions can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the method for processing cloze test questions described above can be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to execute the method for processing cloze questions in any other appropriate manner (for example, by means of firmware).
[0124] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0125] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0126] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0127] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the 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 acoustic input, voice input, or tactile input).
[0128] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0129] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. This client-server relationship is established by computer programs running on the respective computers, establishing a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosts and VPS services ("Virtual Private Servers" or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.
[0130] In the disclosed embodiment, first, a cloze question to be processed and M candidate answers corresponding to the question are obtained, wherein the cloze question contains N blanks, M is a positive integer greater than or equal to N, and then multiple groups of N candidate answers from the M candidate answers are filled into the N blanks respectively to obtain multiple questions to be verified, and each question to be verified is input into a preset network model to determine a score vector corresponding to each question to be verified, wherein the score vector includes the matching degree of the N blanks with the currently filled-in answers, and then the optimal answer corresponding to each blank is determined based on the multiple score vectors. Finally, when the optimal answers corresponding to the N blanks are different, the optimal answers corresponding to the N blanks are determined as the target answers corresponding to the question. Therefore, when processing cloze questions with shared candidate answers, various combinations of candidate answers are filled into the blanks to generate questions to be verified, and then the optimal answer corresponding to each blank is determined based on the score vector predicted by the model for each question to be verified. In this way, the answer prediction process can not only predict the answer in combination with semantics, but also consider the correlation between each answer, thereby improving the accuracy and reliability of processing this type of cloze questions.
[0131] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.
[0132] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A method for processing cloze questions, characterized in that: include: Obtaining a cloze question to be processed and M candidate answers corresponding to the question, wherein the cloze question contains N blanks, and M is a positive integer greater than or equal to N; Filling the N blanks with multiple groups of N candidate answers from the M candidate answers to obtain multiple questions to be verified; Inputting each of the questions to be verified into a preset network model to determine a score vector corresponding to each of the questions to be verified, wherein the score vector includes a degree of matching between each of the N blanks and the currently filled-in answer; Determining the optimal answer corresponding to each blank according to the plurality of score vectors; If the optimal answers corresponding to the N blanks are all different, the optimal answers corresponding to the N blanks are determined as the target answer corresponding to the question; After determining the optimal answer corresponding to each blank, the method further includes: When the optimal answers corresponding to the K blanks are the same, calculate the first matching degree difference between the optimal answer and the suboptimal answer corresponding to the K blanks, where K is a positive integer greater than 1 and less than or equal to N; When the K first matching degree differences are all different, determining the optimal answer as the target answer for the blank corresponding to the largest first matching degree difference; If the suboptimal answers corresponding to the remaining K-1 blanks are all different, the suboptimal answers corresponding to the K-1 blanks are determined as the target answers corresponding to the K-1 blanks; After calculating the first matching degree differences between the optimal answers and the suboptimal answers corresponding to the K blanks, the method further includes: When the first matching degree differences corresponding to F blanks among the K blanks are the largest and the same, determining the second matching degree differences between the second-best answer and the third-best answer respectively corresponding to the F blanks, where F is a positive integer greater than 1 and less than or equal to K-1; When the F second matching degree differences are all different, determining the optimal answer as the target answer for the blank corresponding to the largest second matching degree difference; If the suboptimal answers corresponding to the remaining K-1 blanks are all different, the suboptimal answers corresponding to the K-1 blanks are determined as the target answers corresponding to the K-1 blanks; After determining the optimal answer as the target answer for the blank corresponding to the maximum first matching degree difference, the method further includes: If the suboptimal answers corresponding to L of the remaining K-1 blanks are the same, calculate the second matching degree differences between the suboptimal answers corresponding to the L blanks and the third optimal answer, where L is a positive integer greater than 1 and less than or equal to K-1; When the L second matching degree differences are all different, the suboptimal answer is determined as the target answer for the blank corresponding to the maximum second matching degree difference.
2. The method according to claim 1, wherein Determining the optimal answer corresponding to each blank space according to the plurality of score vectors includes: Determining a matching degree between each blank and each candidate answer based on the plurality of score vectors; The candidate answer with the highest matching degree with each blank is determined as the optimal answer corresponding to each blank.
3. A cloze-type question processing device, characterized in that: include: A first acquisition module is configured to acquire a cloze question to be processed and M candidate answers corresponding to the question, wherein the cloze question contains N blanks, and M is a positive integer greater than or equal to N; A second acquisition module is configured to fill in the N blanks with multiple groups of N candidate answers from the M candidate answers to obtain multiple questions to be verified; A first determination module is configured to input each of the to-be-verified questions into a preset network model to determine a score vector corresponding to each of the to-be-verified questions, wherein the score vector includes a degree of matching between each of the N blanks and a currently filled-in answer; A second determination module is configured to determine the optimal answer corresponding to each blank according to the plurality of score vectors; A third determining module is configured to, when the optimal answers corresponding to the N blanks are all different, determine the optimal answers corresponding to the N blanks as the target answer corresponding to the question; The third determination module includes: a calculation unit, configured to calculate, when the optimal answers corresponding to the K blanks are the same, first matching degree differences between the optimal answers and the suboptimal answers corresponding to the K blanks, respectively, where K is a positive integer greater than 1 and less than or equal to N; a first determining unit configured to, when the K first matching degree differences are all different, determine the optimal answer as the target answer for the blank corresponding to the largest first matching degree difference; a second determining unit configured to, when the suboptimal answers corresponding to the remaining K-1 blanks are all different, determine the suboptimal answers corresponding to the K-1 blanks as target answers corresponding to the K-1 blanks; The computing unit is further configured to: When the first matching degree differences corresponding to F blanks among the K blanks are the largest and the same, determining the second matching degree differences between the second-best answer and the third-best answer respectively corresponding to the F blanks, where F is a positive integer greater than 1 and less than or equal to K-1; When the F second matching degree differences are all different, determining the optimal answer as the target answer for the blank corresponding to the largest second matching degree difference; If the suboptimal answers corresponding to the remaining K-1 blanks are all different, the suboptimal answers corresponding to the K-1 blanks are determined as the target answers corresponding to the K-1 blanks; The first determining unit is further configured to: If the suboptimal answers corresponding to L of the remaining K-1 blanks are the same, calculate the second matching degree differences between the suboptimal answers corresponding to the L blanks and the third optimal answer, where L is a positive integer greater than 1 and less than or equal to K-1; When the L second matching degree differences are all different, the suboptimal answer is determined as the target answer for the blank corresponding to the maximum second matching degree difference.
4. The device according to claim 3, characterized in that The second determining module is specifically configured to: Determining a matching degree between each blank and each candidate answer based on the plurality of score vectors; The candidate answer with the highest matching degree with each blank is determined as the optimal answer corresponding to each blank.
5. 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, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 2.
6. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-2.
7. A computer program product comprising computer instructions, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 2.
Citation Information
Patent Citations
Blank filling question standard answer determination method and device, electronic equipment and storage medium
CN111402659A
Answer selection method and device for idiom blank-filling questions and computer equipment
CN112069815A