Text-based judgment question generation method, device, electronic device and storage medium

By constructing and training part-of-speech annotation and word segmentation models, the problems of poor readability and low accuracy of judging questions are solved, and a higher quality judging questions are achieved.

CN112507663BActive Publication Date: 2024-11-01PING AN BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011486652.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-16
Publication Date
2024-11-01
Estimated Expiration
2040-12-16

AI Technical Summary

Technical Problem

The existing text-based judgment questions generated by the judgment questions generated by the existing text-based judgment questions have poor readability and low accuracy, and the analysis accuracy of syntactic structure analytical algorithms such as greedy decision-making action assembly syntax trees and PCFG are not high.

Method used

Construct and train part-of-speech marking and word segmentation models, including feature transformation layer, part-of-speech marking layer and word segmentation layer, and generate judgment questions through feature transformation, part-of-speech marking, word segmentation probability calculation, weight division and partial masking operations.

Benefits of technology

The readability and accuracy of the judging questions are improved. By using part-of-speech annotation and word segmentation models trained by a large number of data sets, the importance of words is distinguished and judgment questions that are more in line with human reading habits are generated.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112507663B_ABST
    Figure CN112507663B_ABST
Patent Text Reader

Abstract

The present invention relates to artificial intelligence technology, and discloses a method for generating judgment questions based on text, comprising: constructing and training a part-of-speech tagging and word segmentation model including a feature conversion layer, a part-of-speech tagging layer and a word segmentation layer, using the feature conversion layer to convert an original text set into a text feature set, using the part-of-speech tagging layer to perform part-of-speech tagging on the text feature set to obtain a part-of-speech feature set, using the word segmentation layer to perform word segmentation on the part-of-speech feature set to obtain a word feature set, performing weight division on the word feature set to obtain a word weight set, performing a partial masking operation on the word weight set to obtain a masked word set, and inputting the masked word set into a pre-constructed judgment question generation model to generate a judgment question set. The present invention also proposes a text-based judgment question generation device, an electronic device and a computer-readable storage medium. The present invention can solve the problems of poor readability and low accuracy of the generated judgment questions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a text-based judgment question generation method, device, electronic device and computer-readable storage medium. Background Art

[0002] The current method for automatically generating judgment questions based on text mainly involves: first, parsing the syntactic structure of the text to obtain the syntactic structure, then splitting the sentences according to the syntactic structure to obtain split words, and generating judgment questions by replacing and concatenating the split words.

[0003] Although the above method can realize the automatic generation of judgment questions, the generated judgment questions are relatively stiff and have poor readability through the replacement and re-joining of split words. Secondly, since the syntactic structure parsing generally uses the currently available greedy decision action assembly syntax tree, PCFG and Lexical PCFG algorithms, the parsing accuracy is not high, which will greatly affect the quality of the generated judgment questions. Summary of the invention

[0004] The present invention provides a text-based judgment question generation method, device, electronic device and computer-readable storage medium, the main purpose of which is to solve the problem of poor readability and low accuracy of the generated judgment questions.

[0005] To achieve the above object, the present invention provides a text-based judgment question generation method, comprising:

[0006] Constructing and training a part-of-speech tagging and word segmentation model, wherein the part-of-speech tagging and word segmentation model includes a feature conversion layer, a part-of-speech tagging layer, and a word segmentation layer;

[0007] Receiving an original text set, and converting the original text set into a text feature set using the feature conversion layer;

[0008] Using the part-of-speech tagging layer to perform part-of-speech tagging on the text feature set to obtain a part-of-speech feature set;

[0009] Calculating a word segmentation probability set of the part-of-speech feature set using the word segmentation layer, and performing a word segmentation operation on the part-of-speech feature set according to the word segmentation probability set to obtain a word feature set;

[0010] Performing weight division on the word feature set to obtain a word weight set;

[0011] Performing a partial masking operation on the word weight set to obtain a masked word set;

[0012] The masked word set is input into a pre-built judgment question generation model to generate a judgment question set.

[0013] Optionally, the constructing and training of part-of-speech tagging and word segmentation models includes:

[0014] Receiving a training text set and a part-of-speech tag set corresponding to the training text set, performing replacement and masking operations on the training text set to obtain a semi-masked text set;

[0015] Constructing a part-of-speech tagging and word segmentation model, and using the part-of-speech tagging and word segmentation model to calculate a part-of-speech prediction set for the semi-masked text set;

[0016] The difference between the part-of-speech prediction set and the part-of-speech tag set is calculated. When the difference is greater than or equal to a preset threshold, the internal parameters of the part-of-speech tagging and word segmentation model are adjusted until the difference is less than the preset threshold, thereby obtaining a trained part-of-speech tagging and word segmentation model.

[0017] Optionally, the calculating the part-of-speech prediction set of the semi-obscured text set by using the part-of-speech tagging and word segmentation model includes:

[0018] Using the feature conversion layer to convert the semi-obscured text set into a semi-obscured vector set;

[0019] The part-of-speech tagging layer is used to perform part-of-speech prediction on the semi-masked vector set to obtain the part-of-speech prediction set.

[0020] Optionally, the calculating the word segmentation probability set of the part-of-speech feature set by using the word segmentation layer includes:

[0021] Converting the part-of-speech feature set into a part-of-speech vector set of fixed dimension;

[0022] The word segmentation probability of each part-of-speech vector in the part-of-speech vector set is calculated, and the word segmentation probability of each part-of-speech vector is summarized to obtain the word segmentation probability set.

[0023] Optionally, performing weight division on the word feature set to obtain a word weight set includes:

[0024] According to the part of speech of the word feature set, the word feature set is divided into an adjective feature set, a verb feature set and a noun feature set;

[0025] According to the pre-constructed weight ratios of adjectives, verbs and nouns, the adjective feature set, verb feature set and noun feature set are weighted to obtain the word weight set.

[0026] Optionally, performing a partial masking operation on the word weight set to obtain a masked word set includes:

[0027] According to the weight of each part of speech in the word weight set, a specified number of words are extracted from the word weight set to obtain a word combination set;

[0028] The masking operation and the replacing operation are performed on the word combination set according to a preset ratio to obtain the masked word set.

[0029] Optionally, inputting the masked word set into a pre-built judgment question generation model to generate a judgment question set includes:

[0030] Performing feature extraction on the masked word set to obtain a masked feature set;

[0031] Converting the mask feature set into a mask vector set;

[0032] Utilizing a softmax function to perform calculations based on the masking vector set to obtain a word prediction probability set of masked words in the masking word set;

[0033] The word prediction probability set is used to replace the original text set to generate the judgment question set.

[0034] In order to solve the above problems, the present invention also provides a text-based judgment question generation device, the device comprising:

[0035] A part-of-speech tagging and word segmentation model construction module is used to construct and train a part-of-speech tagging and word segmentation model, wherein the part-of-speech tagging and word segmentation model includes a feature conversion layer, a part-of-speech tagging layer and a word segmentation layer;

[0036] A word feature calculation module is used to receive an original text set, convert the original text set into a text feature set using the feature conversion layer, perform part-of-speech tagging on the text feature set using the part-of-speech tagging layer to obtain a part-of-speech feature set, calculate a word segmentation probability set of the part-of-speech feature set using the word segmentation layer, and perform a word segmentation operation on the part-of-speech feature set according to the word segmentation probability set to obtain a word feature set;

[0037] A masked word generation module, used to perform weight division on the word feature set to obtain a word weight set, and perform a partial masking operation on the word weight set to obtain a masked word set;

[0038] The judgment question generation module is used to input the masked word set into a pre-built judgment question generation model to generate a judgment question set.

[0039] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0040] a memory storing at least one instruction; and

[0041] A processor executes instructions stored in the memory to implement any one of the above-mentioned text-based judgment question generation methods.

[0042] In order to solve the above problems, the present invention also provides a computer-readable storage medium, including a data storage area and a program storage area, the data storage area stores created data, and the program storage area stores a computer program; wherein, when the computer program is executed by a processor, any one of the above-mentioned text-based judgment question generation methods is implemented.

[0043] The embodiment of the present invention first constructs and trains a part-of-speech tagging and word segmentation model, and uses the feature conversion layer and the part-of-speech tagging layer in the part-of-speech tagging and word segmentation model to perform feature conversion and part-of-speech tagging on the original text set. Compared with algorithms such as PCFG in the background technology, the part-of-speech tagging and word segmentation model described in the embodiment of the present invention can use a large number of data sets during the training process, which can improve the part-of-speech tagging and word segmentation capabilities, and provide a better data basis for the subsequent generation of judgment questions. In addition, in the embodiment of the present invention, combined with weight division and partial masking, the importance of each word in the text is distinguished, which facilitates the subsequent judgment question generation model to generate judgment questions that are more in line with human reading habits. Therefore, the text-based judgment question generation method, device and computer-readable storage medium proposed in the embodiment of the present invention can solve the problems of poor readability and low accuracy of the generated judgment questions. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A flowchart of a text-based judgment question generation method provided by an embodiment of the present invention;

[0045] Figure 2 For the present invention Figure 1 A detailed flow chart of S1 in the text-based judgment question generation method provided;

[0046] Figure 3 For the present invention Figure 1 A detailed flow chart of S5 in the text-based judgment question generation method provided;

[0047] Figure 4 A schematic diagram of modules of a text-based judgment question generating device provided by an embodiment of the present invention;

[0048] Figure 5 A schematic diagram of the internal structure of an electronic device for implementing a text-based judgment question generation method provided by an embodiment of the present invention;

[0049] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0050] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0051] The embodiment of the present application provides a text-based judgment question generation method. The execution subject of the text-based judgment question generation method includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the text-based judgment question generation method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.

[0052] Reference Figure 1 FIG. 1 is a flow chart of a text-based judgment question generation method provided by an embodiment of the present invention. In this embodiment, the text-based judgment question generation method includes:

[0053] S1. Construct and train a part-of-speech tagging and word segmentation model, wherein the part-of-speech tagging and word segmentation model includes a feature conversion layer, a part-of-speech tagging layer and a word segmentation layer.

[0054] In an embodiment of the present invention, the part-of-speech tagging and word segmentation model can realize the function of performing word segmentation and part-of-speech tagging operations on text, and mainly includes a feature conversion layer, a part-of-speech tagging layer and a word segmentation layer. The feature conversion layer includes a BERT model (Bidirectional Encoder Representations from Transformers), the part-of-speech tagging layer includes a CRF (Conditional Random Field) model, and the word segmentation layer includes a fully connected layer and a probability calculation layer.

[0055] Further, see Figure 2 As shown, the construction and training of part-of-speech tagging and word segmentation models includes:

[0056] S11, receiving a training text set and a part-of-speech tag set corresponding to the training text set, performing random replacement and masking operations on the training text set to obtain a semi-masked text set;

[0057] S12, constructing a part-of-speech tagging and word segmentation model, and using the part-of-speech tagging and word segmentation model to calculate a part-of-speech prediction set for the semi-masked text set;

[0058] S13, calculating the difference between the part-of-speech prediction set and the part-of-speech tag set;

[0059] S14, determining whether the difference value is greater than a preset threshold;

[0060] When the difference value is greater than or equal to the preset threshold, execute S15 to adjust the internal parameters of the part-of-speech tagging and word segmentation model, and return to S12 until the difference value is less than the preset threshold, execute S16 to obtain the trained part-of-speech tagging and word segmentation model.

[0061] In an embodiment of the present invention, the training text set is a text data obtained by crawling from the network in advance and manually cleaning it by means of crawlers, etc., which can realize the training function of the part-of-speech tagging and word segmentation model. The part-of-speech tag set records the part-of-speech tag of each word in the training text set. For example, the training text set includes training text A: "The user waits for his number to be called, and the counter staff logs into the bank system to open an account and register", and the part-of-speech tag set records the part-of-speech of each word in the training text A: "User (noun) waits (verb) number to be called (verb)..."

[0062] A preferred embodiment of the present invention masks 70% of the words in the training text set with preset symbols (masked token), randomly replaces 10% of the words in the training text set, and keeps the remaining 20% ​​of the words in the training text set unchanged, to obtain the semi-masked text set.

[0063] Furthermore, the replacement words of the random replacement operation are generally randomly obtained from a replacement word set pre-constructed by the user.

[0064] For example, the training text A is as follows: "The user waits for his number to be called, while the counter staff logs into the bank system to register for account opening". If "counter staff" is selected and masked, the training text A becomes: "The user waits for his number to be called, while [mask] logs into the bank system to register for account opening"; if "counter staff" in the training text A is replaced with "user" or "approval staff", the transformed training text A is: "The user waits for his number to be called, while the user logs into the bank system to register for account opening" or "The user waits for his number to be called, while the approval staff logs into the bank system to register for account opening".

[0065] Furthermore, the calculating of the part-of-speech prediction set of the semi-masked text set by using the part-of-speech tagging and word segmentation model includes:

[0066] Using the feature conversion layer to convert the semi-obscured text set into a semi-obscured vector set;

[0067] The part-of-speech tagging layer is used to perform part-of-speech prediction on the semi-masked vector set to obtain the part-of-speech prediction set.

[0068] In a preferred embodiment of the present invention, the feature conversion layer includes a BERT model, wherein the BERT model uses a 12-layer bidirectional encoder (encoder-decoder) as a feature conversion layer to convert the semi-masked text set into a semi-masked vector set. The bidirectional encoder can be a publicly available feature extraction neural network.

[0069] Furthermore, the embodiment of the present invention uses the CRF model as the part-of-speech tagging layer to complete part-of-speech prediction and obtain the part-of-speech prediction set. The CRF model calculates the part-of-speech probability values ​​of different parts of speech corresponding to each word and selects the part of speech corresponding to the largest part-of-speech probability value to achieve the purpose of word prediction.

[0070] The embodiment of the present invention can use the Euclidean distance calculation method and the Chebyshev calculation method to calculate the difference value between the part-of-speech prediction set and the part-of-speech tag set. When the difference value is less than the preset threshold, the trained part-of-speech tagging and word segmentation model is obtained.

[0071] S2. Receive an original text set, and use the feature conversion layer to convert the original text set into a text feature set.

[0072] In an embodiment of the present invention, the original text set is the basis text for the judgment questions, which is generally compiled by the user. For example, the user compiles a set of common sense training texts for bank new employees in advance and uses the common sense training texts as the original text set.

[0073] The embodiment of the present invention utilizes the feature conversion layer to convert the original text set into a text feature set in vector form. The method for converting the original text set into a text feature set in vector form is the same as the forwarding method for converting the semi-masked text set into a semi-masked vector set when training the part-of-speech tagging and word segmentation model in step S1 above, and will not be repeated here.

[0074] S3. Use the part-of-speech tagging layer to perform part-of-speech tagging on the text feature set to obtain a part-of-speech feature set.

[0075] A preferred embodiment of the present invention utilizes the part-of-speech tagging layer to perform part-of-speech prediction on the text feature set to obtain the part-of-speech of each word, and combines the part-of-speech of each word with the corresponding text feature to obtain the part-of-speech feature set.

[0076] For example, in the above common sense training text, there is an original text B: "Individuals can decide to stop interest, reduce interest and waive interest". Through the feature conversion layer, the original text B is converted into a text feature B in the form of a vector: The part-of-speech tagging layer predicts the part-of-speech of each word in the text feature B, and combines the prediction result of the part-of-speech with the text feature B to obtain the part-of-speech feature: in, Represents text feature B, and each row of the vector represents a word in the text feature B. Indicates the prediction result of part of speech, such as 1 means [23 ...12] represents a noun, 3 means [14 ... 51] is a verb, etc.

[0077] S4. Calculate the word segmentation probability set of the part-of-speech feature set using the word segmentation layer, and perform a word segmentation operation on the part-of-speech feature set according to the word segmentation probability set to obtain a word feature set.

[0078] In detail, the method of using the word segmentation layer to calculate the word segmentation probability set of the part-of-speech feature set includes: converting the part-of-speech feature set into a part-of-speech vector set of fixed dimension; calculating the word segmentation probability of each part-of-speech vector in the part-of-speech vector set, and summarizing the word segmentation probability of each part-of-speech vector to obtain the word segmentation probability set.

[0079] In a preferred embodiment of the present invention, the fixed dimension is generally determined in advance by the user. If the user determines that the fixed dimension is 1, the above-mentioned part-of-speech feature B is: In is transformed into [23 … 12 …14 … 51].

[0080] Furthermore, the embodiment of the present invention sequentially inputs the [23 ... 12 ... 14 ... 51] into the softmax function in the word segmentation layer to calculate the word segmentation probability [0.23 ... 0.21 ... 0.12 ... 0.98],

[0081] Furthermore, the word segmentation operation on the part-of-speech feature set using the word segmentation probability set means, for example, the word segmentation probability [0.23 … 0.21 …0.12 … 0.98] corresponding to the original text B: "Individuals can decide to stop interest, reduce interest and waive interest" means that the probability of segmenting the individual into "individual" and "person" is 0.23, so the individual does not need to perform a word segmentation operation, and so on. After the word segmentation operation is completed, a word feature set is obtained, where the word feature set includes the words and parts of speech after word segmentation, such as the parts of speech corresponding to the original text B

[0082] S5. Perform weight division on the word feature set to obtain a word weight set.

[0083] Since words of different parts of speech play different roles in a sentence, for example, adjectives generally modify nouns or verbs, so the role of adjectives is generally not more important than nouns or verbs. Therefore, in an embodiment of the present invention, weight division is performed on the word feature set according to the different parts of speech in the word feature set.

[0084] For details, see Figure 3As shown, the S5 includes:

[0085] S51, dividing the word feature set into an adjective feature set, a verb feature set and a noun feature set according to the part of speech corresponding to the word feature set;

[0086] S52. According to the pre-constructed weight ratios of adjectives, verbs and names, the adjective feature set, the verb feature set and the noun feature set are weighted to obtain the word weight set.

[0087] In one embodiment of the present invention, the weight ratio of the adjective, verb and noun is 1:3:6. For example, the part of speech of the original text B is According to the weight ratio of 1:3:6, the weight of each adjective feature in the adjective feature set in the original text B is marked as 0.1, the weight of each verb feature in the verb feature set in the original text B is marked as 0.3, and the weight of each noun feature in the noun feature set in the original text B is marked as 0.6. The marked adjective feature set, verb feature set and noun feature set are summarized to obtain the word weight set: in It is obtained by the weight ratio of 1:3:6, such as The number 0.6 in means that the word [14 ... 78] is a noun and has a weight of 0.6.

[0088] S6. Perform a partial masking operation on the word weight set to obtain a masked word set.

[0089] The embodiment of the present invention extracts a specified number of words from the word weight set according to the weight of each part of speech in the word weight set to obtain a word combination set; masks and replaces the word combination set according to a preset ratio to obtain the masked word set.

[0090] If the original text set includes the original text: "The user may be anxiously waiting for the number to be called, and the account manager needs to politely comfort the user", and the weight ratio of adjectives, verbs and nouns recorded in the word weight set is 1:3:6, then from the original text: "The user may be anxiously waiting for the number to be called, and the account manager needs to politely comfort the user", adjectives, verbs and nouns are extracted in sequence without changing the order of the text description, and the number ratio of the extracted adjectives, verbs and nouns is 1:3:6, thereby obtaining the word combination set. The present invention randomly selects words of a preset ratio from the above word combination set, such as randomly selecting words of a preset ratio of 15%, and performs a masking operation on the selected words. The masking operation includes replacing 80% of the selected words with a preset symbol [mask], replacing 10% of the words with random words, and maintaining the remaining 10% of the words unchanged, summarizing the 15% of the words that have been replaced by symbols and random words, and the remaining 75% of the words, to obtain the masked word set.

[0091] S7. Input the masked word set into a pre-built judgment question generation model to generate a judgment question set.

[0092] In detail, the judgment question generation model includes a BERT model, a fully connected layer and a softmax function trained using the Chinese full-word coverage method.

[0093] Furthermore, the step of inputting the masked word set into a pre-built judgment question generation model to generate a judgment question set includes: using the BERT full-word coverage model to perform feature extraction on the masked word set to obtain a masked feature set, using the fully connected layer to convert the masked feature set into a masked vector set, using the masked vector set as an input value of the softmax function, calculating a word prediction probability set of the masked words in the masked word set, using the word prediction probability set to replace the original text set, and generating the judgment question set.

[0094] In detail, the BERT model trained by the Chinese full-word coverage method is different from the BERT model in the part-of-speech tagging and word segmentation model in that the output value of the BERT model is changed, and the original output form of the BERT model that only outputs the text features of non-masked words is changed to an output form that simultaneously outputs the text features of masked words and the text features of non-masked words, and the masked words are predicted through the fully connected layer and the softmax function, thereby satisfying the proposition rules of the judgment question.

[0095] For example, in the original text B mentioned above: "Individuals can decide to suspend, reduce or waive interest", it is calculated that in one of the masked texts in the original text B is: "*** can decide to suspend, reduce or waive interest", the BERT full-word coverage model is used to perform feature processing on the "*** can decide to suspend, reduce or waive interest", and the result is: Among them, [32 ... 17] represents the text features of the words masked by ***, and by inputting [32 ... 17] into the softmax function, it is calculated that *** represents the highest probability of "individual", followed by "bank" and then "government". Then, according to [individual, bank, government], the original text B is transformed into a judgment question: the government can decide to suspend, reduce or waive interest rates, or individuals can decide to suspend, reduce or waive interest rates, or banks can decide to suspend, reduce or waive interest rates.

[0096] The embodiment of the present invention first constructs and trains a part-of-speech tagging and word segmentation model, and uses the feature conversion layer and the part-of-speech tagging layer in the part-of-speech tagging and word segmentation model to perform feature conversion and part-of-speech tagging on the original text set. Compared with the PCFG and other algorithms in the background technology, which only use a simple decision tree to perform word segmentation and part-of-speech tagging, the part-of-speech tagging and word segmentation model uses a large number of data sets in the training process, further improving the part-of-speech tagging and word segmentation capabilities of the model, and providing a better data basis for the subsequent generation of judgment questions. In addition, in the embodiment of the present invention, combined with weight division and partial masking, the importance of each word in the text is distinguished, which facilitates the subsequent judgment question generation model to generate judgment questions that are more in line with human reading habits. The text-based judgment question generation method, device and computer-readable storage medium proposed in the present invention can solve the problems of poor readability and low accuracy of the generated judgment questions.

[0097] like Figure 4 The figure shows a module diagram of the text-based judgment question generating device of the present invention.

[0098] The text-based judgment question generation device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the text-based judgment question generation device can include a part-of-speech tagging and word segmentation model construction module 101, a word feature calculation module 102, a masked word generation module 103 and a judgment question generation module 104. The module described in the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0099] In this embodiment, the functions of each module / unit are as follows:

[0100] The part-of-speech tagging and word segmentation model construction module 101 is used to construct and train a part-of-speech tagging and word segmentation model, wherein the part-of-speech tagging and word segmentation model includes a feature conversion layer, a part-of-speech tagging layer and a word segmentation layer;

[0101] The word feature calculation module 102 is used to receive an original text set, convert the original text set into a text feature set using the feature conversion layer, perform part-of-speech tagging on the text feature set using the part-of-speech tagging layer to obtain a part-of-speech feature set, calculate a word segmentation probability set of the part-of-speech feature set using the word segmentation layer, and perform a word segmentation operation on the part-of-speech feature set according to the word segmentation probability set to obtain a word feature set;

[0102] The masked word generation module 103 is used to perform weight division on the word feature set to obtain a word weight set, and perform a partial masking operation on the word weight set to obtain a masked word set;

[0103] The judgment question generation module 104 is used to input the masked word set into a pre-built judgment question generation model to generate a judgment question set.

[0104] The module in the device provided in the present application can be used based on the above-mentioned text-based judgment question generation method to solve the problems of poor readability and low accuracy of the generated judgment questions.

[0105] like Figure 5 The figure is a schematic diagram of the structure of an electronic device for implementing the text-based judgment question generation method of the present invention.

[0106] The electronic device 1 may include a processor 10 , a memory 11 , and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10 , such as a text-based judgment question generation program 12 .

[0107] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 may not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the text-based judgment question generation program 12, but also be used to temporarily store data that has been output or is to be output.

[0108] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, executing a text-based judgment question generation program, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device 1 and process data.

[0109] The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0110] Figure 5 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 5The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0111] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0112] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.

[0113] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.

[0114] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0115] The text-based judgment question generation program 12 stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:

[0116] Constructing and training a part-of-speech tagging and word segmentation model, wherein the part-of-speech tagging and word segmentation model includes a feature conversion layer, a part-of-speech tagging layer, and a word segmentation layer;

[0117] Receiving an original text set, and converting the original text set into a text feature set using the feature conversion layer;

[0118] Using the part-of-speech tagging layer to perform part-of-speech tagging on the text feature set to obtain a part-of-speech feature set;

[0119] Calculating a word segmentation probability set of the part-of-speech feature set using the word segmentation layer, and performing a word segmentation operation on the part-of-speech feature set according to the word segmentation probability set to obtain a word feature set;

[0120] Performing weight division on the word feature set to obtain a word weight set;

[0121] Performing a partial masking operation on the word weight set to obtain a masked word set;

[0122] The masked word set is input into a pre-built judgment question generation model to generate a judgment question set.

[0123] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to Figures 1 to 3 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0124] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0125] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:

[0126] Constructing and training a part-of-speech tagging and word segmentation model, wherein the part-of-speech tagging and word segmentation model includes a feature conversion layer, a part-of-speech tagging layer, and a word segmentation layer;

[0127] Receiving an original text set, and converting the original text set into a text feature set using the feature conversion layer;

[0128] Using the part-of-speech tagging layer to perform part-of-speech tagging on the text feature set to obtain a part-of-speech feature set;

[0129] Calculating a word segmentation probability set of the part-of-speech feature set using the word segmentation layer, and performing a word segmentation operation on the part-of-speech feature set according to the word segmentation probability set to obtain a word feature set;

[0130] Performing weight division on the word feature set to obtain a word weight set;

[0131] Performing a partial masking operation on the word weight set to obtain a masked word set;

[0132] The masked word set is input into a pre-built judgment question generation model to generate a judgment question set.

[0133] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0134] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0135] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0136] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0137] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0138] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0139] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.

[0140] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A method for generating judgment questions based on text, It is characterized in that The method comprises: Constructing and training a part-of-speech tagging and word segmentation model, wherein the part-of-speech tagging and word segmentation model includes a feature conversion layer, a part-of-speech tagging layer, and a word segmentation layer; Receiving an original text set, and converting the original text set into a text feature set using the feature conversion layer; Using the part-of-speech tagging layer to perform part-of-speech tagging on the text feature set to obtain a part-of-speech feature set; Calculating a word segmentation probability set of the part-of-speech feature set using the word segmentation layer, and performing a word segmentation operation on the part-of-speech feature set according to the word segmentation probability set to obtain a word feature set; Performing weight division on the word feature set to obtain a word weight set; Performing a partial masking operation on the word weight set to obtain a masked word set; Inputting the masked word set into a pre-built judgment question generation model to generate a judgment question set; The performing weight division on the word feature set to obtain the word weight set includes: dividing the word feature set into an adjective feature set, a verb feature set and a noun feature set according to the part of speech of the word feature set; performing weight division on the adjective feature set, the verb feature set and the noun feature set according to the pre-constructed weight ratio of adjectives, verbs and nouns to obtain the word weight set; The performing of a partial masking operation on the word weight set to obtain a masked word set includes: extracting a specified number of words from the word weight set according to the weight of each part of speech in the word weight set to obtain a word combination set; performing a masking operation and a replacement operation on the word combination set according to a preset ratio to obtain the masked word set.

2. The text-based judgment question generation method according to claim 1, It is characterized in that The construction and training of part-of-speech tagging and word segmentation models include: Receiving a training text set and a part-of-speech tag set corresponding to the training text set, performing replacement and masking operations on the training text set to obtain a semi-masked text set; Constructing a part-of-speech tagging and word segmentation model, and using the part-of-speech tagging and word segmentation model to calculate a part-of-speech prediction set for the semi-masked text set; The difference between the part-of-speech prediction set and the part-of-speech tag set is calculated. When the difference is greater than or equal to a preset threshold, the internal parameters of the part-of-speech tagging and word segmentation model are adjusted until the difference is less than the preset threshold, thereby obtaining a trained part-of-speech tagging and word segmentation model.

3. The text-based judgment question generation method according to claim 2, It is characterized in that The method of calculating the part-of-speech prediction set of the semi-masked text set by using the part-of-speech tagging and word segmentation model includes: Using the feature conversion layer to convert the semi-obscured text set into a semi-obscured vector set; The part-of-speech tagging layer is used to perform part-of-speech prediction on the semi-masked vector set to obtain the part-of-speech prediction set.

4. The text-based judgment question generation method according to claim 1, It is characterized in that The calculating the word segmentation probability set of the part-of-speech feature set by using the word segmentation layer includes: Converting the part-of-speech feature set into a part-of-speech vector set of fixed dimension; The word segmentation probability of each part-of-speech vector in the part-of-speech vector set is calculated, and the word segmentation probability of each part-of-speech vector is summarized to obtain the word segmentation probability set.

5. The text-based judgment question generation method according to any one of claims 1 to 4, It is characterized in that The step of inputting the masked word set into a pre-built judgment question generation model to generate a judgment question set includes: Performing feature extraction on the masked word set to obtain a masked feature set; Converting the mask feature set into a mask vector set; Utilizing a softmax function to perform calculations based on the masking vector set to obtain a word prediction probability set of masked words in the masking word set; The word prediction probability set is used to replace the original text set to generate the judgment question set.

6. A text-based judgment question generation device, used to implement the text-based judgment question generation method according to any one of claims 1 to 5, It is characterized in that The device comprises: A part-of-speech tagging and word segmentation model construction module is used to construct and train a part-of-speech tagging and word segmentation model, wherein the part-of-speech tagging and word segmentation model includes a feature conversion layer, a part-of-speech tagging layer and a word segmentation layer; A word feature calculation module is used to receive an original text set, convert the original text set into a text feature set using the feature conversion layer, perform part-of-speech tagging on the text feature set using the part-of-speech tagging layer to obtain a part-of-speech feature set, calculate a word segmentation probability set of the part-of-speech feature set using the word segmentation layer, and perform a word segmentation operation on the part-of-speech feature set according to the word segmentation probability set to obtain a word feature set; A masked word generation module, used to perform weight division on the word feature set to obtain a word weight set, and perform a partial masking operation on the word weight set to obtain a masked word set; The judgment question generation module is used to input the masked word set into a pre-built judgment question generation model to generate a judgment question set.

7. An electronic device, It is characterized in that The electronic device comprises: at least one processor; and, 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 execute the text-based judgment question generation method as described in any one of claims 1 to 5.

8. A computer-readable storage medium comprising a data storage area and a program storage area, It is characterized in that The data storage area stores created data, and the program storage area stores a computer program; wherein, when the computer program is executed by a processor, the text-based judgment question generation method as described in any one of claims 1 to 5 is implemented.