Method and system for prompting answers by randomly displaying characters
By using the method of randomly displaying character prompts in the question-based system and using the transfer probability matrix to determine the prompt information, the problem of time-consuming manual setting of prompt information in the existing system is solved, efficient and dynamic answering prompts are achieved, and learning efficiency and work efficiency are improved.
Patent Information
- Application Number
- CN202110505033.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-10
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2041-05-10
AI Technical Summary
The existing question-based system requires manual preset of answering tips, which leads to large workload, low efficiency, and depends on the staff's knowledge and experience level.
By randomly displaying character prompt answers, students' current input information is obtained, preset character units with the highest similarity are found, and random prompt information is determined using the transfer probability matrix.
It reduces the need to manually set prompt information, saves the workload of staff, improves work efficiency, and stimulates students' interest in learning through dynamic random prompts and improves learning efficiency.
Smart Images

Figure CN113139616B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent learning, and particularly to a method and system for randomly displaying character prompts for answering questions. Background Art
[0002] With the development of computer technology, many students will answer questions on computer devices. During the process of answering questions, the computer question-solving system will prompt the answers in a certain way. However, the existing answer prompt methods generally require manually setting the key points of answer prompts for each question in advance. Therefore, the method of manually setting prompt information has many deficiencies, such as a huge workload, very low efficiency, and a high dependence on the knowledge and experience level of the staff. Summary of the Invention
[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a method and system for randomly displaying character prompts for answering questions.
[0004] The method for randomly displaying character prompts for answering questions provided by the present invention includes:
[0005] Obtain the current input information of the student on the question-solving interface and determine the corresponding input character unit;
[0006] According to the input character unit, find a preset number of first character units with the highest similarity in the set of character unit sequences; wherein, the set of character unit sequences is a set formed by the character unit sequences corresponding to each step in all the answers of all the questions on the question-solving interface, and each character unit sequence includes a plurality of character units;
[0007] According to the transition probability matrix corresponding to the set of character unit sequences, determine the second character units corresponding one by one to the preset number of first character units;
[0008] Select one of the preset number of second character units as the third character unit and display the third character unit as a random prompt message on the question-solving interface.
[0009] In an alternative embodiment, the determining the corresponding input character unit includes: performing a segmentation process on the string sequence corresponding to the current input information to obtain a plurality of character units, and using the last character unit as the input character unit.
[0010] In an alternative embodiment, the finding a preset number of first character units with the highest similarity in the set of character unit sequences according to the input character unit includes:
[0011] Calculate the similarity between the input character unit and each character unit in the set of character unit sequences, and sort each character unit in the set of character unit sequences from high to low according to the similarity.
[0012] According to the sorting result, select the preset number of first character units with the highest similarity to the input character unit from the set of character unit sequences.
[0013] In an alternative embodiment, the similarity between the input character unit and the i-th character unit in the set of character unit sequences is calculated using a first formula, and the first formula includes:
[0014]
[0015] wherein, v is the vector corresponding to the input character unit, and z i is the vector corresponding to the i-th character unit, and sim(v, z i ) is the similarity between the input character unit and the i-th character unit.
[0016] In an alternative embodiment, the formation process of the transition probability matrix includes:
[0017] Calculate the frequency that the j-th character unit and the k-th character unit in the i-th character unit sequence in the set of character unit sequences appear in the same answer, and record this frequency as the first frequency; and calculate the frequency that the k-th character unit appears in the set of character unit sequences, and record this frequency as the second frequency;
[0018] According to the first frequency and the second frequency, calculate the probability that the j-th character unit transitions to the k-th character unit;
[0019] According to the probabilities that the j-th character unit in the i-th character unit sequence transitions to the remaining each character unit in the i-th character unit sequence, form the transition probability set of the j-th character unit;
[0020] According to the transition probability sets of each character unit in each character unit sequence in the set of character unit sequences, construct the transition probability matrix corresponding to the preset character unit sequence.
[0021] In an alternative embodiment, the probability that the j-th character unit transitions to the k-th character unit is calculated using a second formula, and the second formula includes:
[0022]
[0023] wherein, tf(z ij , z ik|A) is the first frequency, tf(z ik |A) is the second frequency, P(z ij |z ik ; A) is the probability that the j-th character unit transfers to the k-th character unit, A is the set of character unit sequences, k is different from j, z ij is the j-th character unit in the i-th character unit sequence, z ik is the k-th character unit in the i-th character unit sequence.
[0024] In an alternative embodiment, determining the second character units corresponding one-to-one to the preset number of first character units according to the transition probability matrix corresponding to the set of character unit sequences includes:
[0025] Selecting second character units that meet preset conditions from the set of character unit sequences according to the set of transition probabilities corresponding to each character unit in the set of character unit sequences; the preset conditions include: the transition probability between each first character unit and the corresponding second character unit is the highest.
[0026] In an alternative embodiment, selecting one second character unit from the preset number of second character units as the third character unit includes:
[0027] Selecting one second character unit from the preset number of second character units as the third character unit by using the random sampling method.
[0028] In an alternative embodiment, it further includes:
[0029] Calculating the transition probability corresponding to the character unit sequence corresponding to each step in each answer;
[0030] Determining the maximum value among the transition probabilities corresponding to each step in the answer to the question that the student is currently answering, and displaying the step corresponding to the maximum value as a hint message on the question-solving interface.
[0031] The system for prompting answers by randomly displaying characters provided by the present invention includes:
[0032] An input acquisition module, configured to acquire the current input information of the student on the question-solving interface and determine the corresponding input character unit;
[0033] A character search module, configured to search for a preset number of first character units with the highest similarity in the set of character unit sequences according to the input character unit; wherein, the set of character unit sequences is a set formed by the character unit sequences corresponding to each step in all answers corresponding to all questions on the question-solving interface, and each character unit sequence includes multiple character units;
[0034] A character determination module, configured to determine second character units corresponding one by one to the preset number of first character units according to the transition probability matrix corresponding to the set of character unit sequences;
[0035] A character display module, configured to select one second character unit from the preset number of second character units as a third character unit, and display the third character unit on the question answering interface as random prompt information.
[0036] The method and system for randomly displaying character prompts for answering questions provided by the present application first searches for the preset number of first character units with the highest similarity in the set of character unit sequences, then determines the corresponding second character units according to the transition probability matrix, and selects the third character unit from the second character units for prompting. Since the information prompting method provided by the present application does not require manual pre-setting of prompt information, it saves labor, greatly reduces the workload of staff, and also greatly improves work efficiency, and does not depend on the knowledge and experience level of staff. Moreover, since the present application uses a transition probability matrix for random answer prompting, since the answer prompts are random and the prompt information will change as the student inputs, that is, in a dynamic prompting manner, it can bring some possible answering ideas to the student, and is very interesting, bringing convenience and fun to the student's answering, stimulating the student's learning interest, and improving learning efficiency. Description of the Drawings
[0037] The drawings are used to provide a further understanding of the present invention, and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention, and do not constitute a limitation to the present invention. In the drawings:
[0038] Figure 1 is a schematic flowchart of the method for randomly displaying character prompts for answering questions in an embodiment of the present invention;
[0039] Figure 2 is a structural block diagram of the system for randomly displaying character prompts for answering questions in an embodiment of the present invention. Detailed Embodiments
[0040] The following describes the preferred embodiments of the present invention with reference to the drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0041] In a first aspect, the present application provides a method for randomly displaying character prompts for answering questions, as Figure 1 shown, the method includes S110 - S140:
[0042] S110. Obtain the current input information of the student on the question answering interface, and determine the corresponding input character units;
[0043] For example, when a student is doing exercises on an intelligent device (such as a mobile phone, a tablet computer, a personal computer), the prompt characters generated by the method provided in this application can be used as possible answer prompts, and such possible answer prompts change as the student's input changes.
[0044] Suppose there are m questions on a question-solving interface of a student, and the corresponding question set is Q = {Q1, Q2,..., Q m}, and each question corresponds to an answer. The answer set corresponding to the question set Q is A = {A1, A2,..., A m}. Since each answer may include multiple steps, and these steps have a certain order relationship. For example, the step sequence set A i of the i-th answer A i in the set A is {s i1 , s i2 ,..., s in}, where n represents that the answer A i has n steps. In fact, each step is a string sequence. For example, s i1 is the string sequence corresponding to the first step of the answer A i . For the string sequence corresponding to each step, a certain text segmentation method can be used for text segmentation (for example, segmentation is performed according to basic natural language processing methods such as punctuation marks and phrase structures, including word segmentation processing). After segmentation, multiple character units are obtained, forming a character unit sequence, that is, one step corresponds to a character unit sequence, and each character unit sequence can contain multiple character units. Among them, each character unit is the smallest and indivisible unit. Suppose the j-th step of the answer A i is s ij , and the character unit sequence obtained after segmentation is s ij = {t ij1 , t ij2 ,..., t ijk}, where k represents the number of character units in s ij . In this way, the character unit sequences corresponding to all steps of all answers can form a set, that is, the character unit sequence set.
[0045] In specific implementation, S110 may specifically include the following steps:
[0046] S111. Perform segmentation processing on the string sequence corresponding to the current input information to obtain multiple character units, and use the last character unit as the input character unit.
[0047] For example, when a student answers a certain question and inputs a step or multiple characters within a step, then this step or the multiple characters within this step are used as the current input information. Then, the current input information is segmented to obtain multiple character units, and at this time, only the last character unit is used as the basis for subsequent selection prompt information. Therefore, the last character unit is used as the input character unit. It can be understood that as the student inputs, the corresponding input character unit changes, and thus the generated prompt information also changes. It can be seen that the answer prompt is a dynamic process.
[0048] S120. According to the input character unit, find a preset number of first character units with the highest similarity in the character unit sequence set.
[0049] Wherein, the character unit sequence set is a set formed by the character unit sequences corresponding to each step in all the answers corresponding to all the questions on the question-solving interface, and each character unit sequence includes multiple character units.
[0050] It can be understood that the preset number of first character units found in the character unit sequence set have the highest similarity with the input character unit.
[0051] In specific implementation, S120 may include the following steps S121 - S122:
[0052] S121. Calculate the similarity between the input character unit and each character unit in the character unit sequence set, and sort the character units in the character unit sequence set from high to low according to the similarity.
[0053] In specific implementation, the cosine similarity calculation method may be adopted in S120. For example, use the first formula to calculate the similarity between the input character unit and the i-th character unit in the character unit sequence set. The first formula includes:
[0054]
[0055] In the formula, v is the vector corresponding to the input character unit, z i is the vector corresponding to the i-th character unit, and sim(v, z i ) is the similarity between the input character unit and the i-th character unit.
[0056] It can be understood that before calculating the similarity using the first formula, vectorization processing needs to be performed first, that is, vectorize the input character unit and each character unit in the character unit sequence set, and use vectors to represent the meanings of the corresponding character units.
[0057] S122. Select the preset number of first character units with the highest similarity to the input character unit from the set of character unit sequences according to the sorting result.
[0058] Among them, the preset number can be selected according to requirements. For example, the preset number R is 5.
[0059] S130. Determine the second character units corresponding one by one to the preset number of first character units according to the transition probability matrix corresponding to the set of character unit sequences;
[0060] In specific implementation, the formation process of the transition probability matrix may include the following steps S131 to S134:
[0061] S131. Calculate the frequency of the j-th character unit and the k-th character unit in the i-th character unit sequence in the set of character unit sequences appearing in the same answer, and record this frequency as the first frequency; and calculate the frequency of the k-th character unit appearing in the set of character unit sequences, and record this frequency as the second frequency;
[0062] It can be understood that appearing in the same answer can be appearing in the same sub-step of the same answer, or appearing in different sub-steps of the same answer.
[0063] S132. Calculate the probability of the j-th character unit transitioning to the k-th character unit according to the first frequency and the second frequency;
[0064] It can be understood that here it is assumed that the transition probability of a character unit is only related to each character unit in its step.
[0065] In specific implementation, S132 can use the second formula to calculate the probability of the j-th character unit transitioning to the k-th character unit, and the second formula includes:
[0066]
[0067] In the formula, tf(z ij , z ik |A) is the first frequency, tf(z ik |A) is the second frequency, P(z ij |z ik ; A) is the probability of the j-th character unit transitioning to the k-th character unit, A is the set of character unit sequences, k is different from j, z ij is the j-th character unit in the i-th character unit sequence, z ik is the k-th character unit in the i-th character unit sequence.
[0068] S133. Based on the probabilities of the j-th character unit in the i-th character unit sequence transferring to each character unit in the i-th character unit sequence, form the transfer probability set of the j-th character unit;
[0069] For example, if there are f character units in the i-th character unit sequence, then there are f - 1 transfer probabilities in the transfer probability set of the j-th character unit in the i-th character unit sequence.
[0070] S134. Based on the transfer probability sets of each character unit in each character unit sequence in the character unit sequence set, construct the transfer probability matrix corresponding to the preset character unit sequence;
[0071] Among them, the transfer probability matrix is used to represent the probabilities of each character unit in the character unit sequence set transferring. Each character unit in the character unit sequence set can be arranged in a matrix in a certain way, and each character unit corresponds to a transfer probability set. Therefore, the transfer probability sets of all character units form a transfer probability matrix.
[0072] In specific implementation, determining the second character unit corresponding one by one to the preset number of first character units according to the transfer probability matrix corresponding to the character unit sequence set in S130 may include the following steps:
[0073] S135. Based on the transfer probability sets corresponding to each character unit in the character unit sequence set, select the second character unit that meets the preset conditions from the character unit sequence set. The preset conditions include: the transfer probability between each first character unit and the corresponding second character unit is the highest.
[0074] It can be understood that the number of second character units is the same as the number of first character units.
[0075] Among them, the preset conditions can also be expressed as:
[0076]
[0077] In the formula, w i is the first character unit, and Z j is the second character unit.
[0078] It can be understood that the first character unit and the second character unit come from the same character unit sequence, that is, from the same step of the same answer. For each first character unit, select the character unit corresponding to the maximum transfer probability from the transfer probability set corresponding to this first character unit as the second character unit.
[0079] S140. Select one second character unit from the preset number of second character units as the third character unit, and display the third character unit as random prompt information on the question answering interface.
[0080] In specific implementation, a random sampling method can be used to select one second character unit from the preset number of second character units as the third character unit.
[0081] For example, if 5 second character units are selected in step S130, then select one from these 5 second character units as the third character unit.
[0082] In specific implementation, in addition to character unit prompts, the prompting method can also have the way of whole step prompts, that is, determine a character unit sequence for display.
[0083] Assume that the transition probability of each character unit is only related to the previous character unit. For the i-th character unit sequence Z i ={z i1 ,z i2 ,...,z it} in the character unit sequence set, the transition probability of the i-th character unit sequence is:
[0084]
[0085] For example, when a student answers a certain question on the question answering interface, determine the maximum value among the transition probabilities corresponding to each step in the answer corresponding to the question, and then display the steps of the character unit sequence corresponding to the maximum value on the interface for prompting, providing more prompts for the student.
[0086] That is to say, the method provided by the present application may further include: calculating the transition probability corresponding to the character unit sequence corresponding to each step in each answer; determining the maximum value among the transition probabilities corresponding to each step in the answer to the question currently answered by the student, and displaying the step corresponding to the maximum value as prompt information on the question answering interface.
[0087] For the method of randomly displaying character prompts for answering questions provided by the present application, since the information prompting method provided by the present application does not require manual pre-setting of prompt information, it saves labor, greatly reduces the workload of staff, and also greatly improves work efficiency, and does not depend on the knowledge and experience level of staff. Moreover, since a transition probability matrix is used for random answer prompts, since the answer prompts are random and the prompt information will change with the student's input, that is, a dynamic prompting method, it can bring some possible answering ideas to the student, and is very interesting, bringing convenience and fun to the student's answering.
[0088] In a second aspect, the present application provides a system for prompting answers by randomly displaying characters, as Figure 2 shown. The system includes:
[0089] An input acquisition module 210, configured to acquire the current input information of a student on a question answering interface and determine the corresponding input character unit;
[0090] A character search module 220, configured to search for a preset number of first character units with the highest similarity in a character unit sequence set according to the input character unit; wherein, the character unit sequence set is a set formed by character unit sequences corresponding to each step in all answers corresponding to all questions on the question answering interface, and each character unit sequence includes multiple character units;
[0091] A character determination module 230, configured to determine a second character unit corresponding one-to-one to the preset number of first character units according to a transition probability matrix corresponding to the character unit sequence set;
[0092] A character display module 240, configured to select a second character unit as a third character unit from the preset number of second character units and display the third character unit as a random prompt message on the question answering interface.
[0093] It can be understood that for the system provided in the embodiments of the present application, parts such as explanations, examples, and beneficial effects of related content can refer to the corresponding parts of the first aspect, and will not be elaborated here.
[0094] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories and optical memories, etc.) containing computer-usable program codes.
[0095] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to generate a machine, such that the instructions executed by the processors of the computer or other programmable data processing devices generate for implementing in the process Figure 1 one process or multiple processes and / or blocks Figure 1A device for the functions specified in one or more boxes.
[0096] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction device that implements the functions specified in one Figure 1 process or more processes and / or boxes Figure 1 or more boxes.
[0097] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one Figure 1 process or more processes and / or boxes Figure 1 or more boxes.
[0098] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.
Claims
1. A method for prompting answers by randomly displaying characters, characterized in that, The method includes: Obtaining the current input information of the student on the question-solving interface and determining the corresponding input character unit; Searching for a preset number of first character units with the highest similarity in the character unit sequence set according to the input character unit; wherein, the character unit sequence set is a set formed by the character unit sequences corresponding to each step in all the answers corresponding to all the questions on the question-solving interface, and each character unit sequence includes multiple character units; Determining second character units corresponding one-to-one to the preset number of first character units according to the transition probability matrix corresponding to the character unit sequence set; Selecting one second character unit from the preset number of second character units as the third character unit and displaying the third character unit on the question-solving interface as random hint information; Wherein, the formation process of the transition probability matrix includes: Calculating the frequency of the j-th character unit and the k-th character unit in the i-th character unit sequence in the character unit sequence set appearing in the same answer, and recording this frequency as the first frequency; and calculating the frequency of the k-th character unit appearing in the character unit sequence set, and recording this frequency as the second frequency; Calculating the probability of the j-th character unit transitioning to the k-th character unit according to the first frequency and the second frequency; Forming a transition probability set of the j-th character unit according to the probabilities of the j-th character unit in the i-th character unit sequence transitioning to the remaining respective character units in the i-th character unit sequence; Constructing a transition probability matrix corresponding to the character unit sequence according to the transition probability sets of each character unit in each character unit sequence in the character unit sequence set; Wherein, the selecting one second character unit from the preset number of second character units as the third character unit includes: Selecting one second character unit from the preset number of second character units as the third character unit by using the random sampling method.
2. The method according to claim 1, wherein The determining the corresponding input character unit includes: performing a segmentation process on the string sequence corresponding to the current input information to obtain multiple character units, and using the last character unit as the input character unit.
3. The method according to claim 1, wherein The searching for a preset number of first character units with the highest similarity in the character unit sequence set according to the input character unit includes: Calculating the similarity between the input character unit and each character unit in the character unit sequence set, and sorting each character unit in the character unit sequence set from high to low according to the similarity; Selecting the preset number of first character units with the highest similarity to the input character unit from the character unit sequence set according to the sorting result.
4. The method according to claim 3, characterized in that, Calculating the similarity between the input character unit and the i-th character unit in the character unit sequence set by using a first formula, and the first formula includes: where \(v\) is the vector corresponding to the input character unit, is the vector corresponding to the \(i\)-th character unit, is the similarity between the input character unit and the \(i\)-th character unit.
5. The method according to claim 1, wherein Calculating the probability of the j-th character unit transitioning to the k-th character unit by using a second formula, and the second formula includes: In the formula, is the first frequency, is the second frequency, is the probability that the j-th character unit is transferred to the k-th character unit, A is the set of character unit sequences, and k is different from j, is the j-th character unit in the i-th character unit sequence, is the k-th character unit in the i-th character unit sequence.
6. The method according to claim 1, wherein Determining the second character units corresponding one by one to the preset number of first character units according to the transition probability matrix corresponding to the set of character unit sequences includes: Selecting, from the set of character unit sequences, second character units that meet preset conditions according to the set of transition probabilities corresponding to each character unit in the set of character unit sequences; the preset conditions include: the transition probability between each first character unit and the corresponding second character unit is the highest.
7. The method according to claim 1, characterized in that, It further includes: Calculating the transition probability corresponding to the character unit sequence corresponding to each step in each answer. Determining the maximum value among the transition probabilities corresponding to each step in the answer to the question currently being answered by the student, and displaying the step corresponding to the maximum value on the question-solving interface as a prompt message.
8. A system for prompting answers by randomly displaying characters, characterized in that, It includes: An input acquisition module, configured to acquire the current input information of the student on the question-solving interface and determine the corresponding input character units. A character search module, configured to search, in the set of character unit sequences, for a preset number of first character units with the highest similarity according to the input character units; wherein, the set of character unit sequences is a set formed by the character unit sequences corresponding to each step in all answers to all questions on the question-solving interface, and each character unit sequence includes multiple character units. A character determination module, configured to determine the second character units corresponding one by one to the preset number of first character units according to the transition probability matrix corresponding to the set of character unit sequences. A character display module, configured to select one second character unit from the preset number of second character units as a third character unit, and display the third character unit on the question-solving interface as a random prompt message. Wherein, the formation process of the transition probability matrix includes: Calculating the frequency of the j-th character unit and the k-th character unit in the i-th character unit sequence in the set of character unit sequences appearing together in the same answer, and recording this frequency as the first frequency; and calculating the frequency of the k-th character unit appearing in the set of character unit sequences, and recording this frequency as the second frequency. Calculating the probability of the j-th character unit transitioning to the k-th character unit according to the first frequency and the second frequency. Forming a set of transition probabilities of the j-th character unit according to the probabilities of the j-th character unit in the i-th character unit sequence transitioning to the remaining respective character units in the i-th character unit sequence. Constructing the transition probability matrix corresponding to the character unit sequence according to the sets of transition probabilities of each character unit in each character unit sequence in the set of character unit sequences. Wherein, selecting one second character unit from the preset number of second character units as a third character unit includes: Selecting one second character unit from the preset number of second character units as a third character unit by using the random sampling method.
Citation Information
Patent Citations
A question-solving auxiliary method and a question-solving auxiliary client
CN109446315A
Push information generation method and device
CN110263147A