A questionnaire recognition method and device based on a deep neural network
By combining deep neural networks and the IQL language, an abstract syntax tree was constructed, which solved the problems of expression and proofreading in the process of electronic questionnaires, realized the structured expression and automated recognition of questionnaires, and improved the efficiency and accuracy of electronic questionnaires.
Patent Information
- Application Number
- CN202411694456.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2044-11-25
AI Technical Summary
The current process of digitizing questionnaires presents challenges in both expression and proofreading, resulting in cumbersome questionnaire distribution and organization. Furthermore, existing methods struggle to balance both expression and proofreading.
A questionnaire recognition method based on deep neural networks is adopted. By editing and constructing an abstract syntax tree using the IQL language, the structured expression and automated recognition of questionnaires are realized, including text reconstruction, type classification, information extraction and logical statement generation.
It has achieved user-friendly and convenient electronic questionnaires, improved the efficiency of digitizing long questionnaires, reduced manual operations, and improved recognition accuracy and efficiency.
Smart Images

Figure CN119761353B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of questionnaire recognition, and particularly relates to a questionnaire recognition method and device based on a deep neural network. BACKGROUND
[0002] At present, social research is one of important means to understand society and economy. For research institutions and enterprises, social research by questionnaire and answer is the most direct and popular form. Through setting different types of questions and setting corresponding type question scores according to certain rules, the current research results can be well reflected through statistical scoring after the survey objects complete the questionnaire.
[0003] Although the form of questionnaire and answer has good expression ability, due to the large base of survey objects, a large number of questionnaires need to be distributed, so the process of distributing and sorting the questionnaires is very cumbersome. In order to avoid the massive questionnaire distribution and sorting work, it is particularly important to make the questionnaire electronic and automatic recognition. In addition, there are expression and proofreading difficulties in the process of making the questionnaire electronic into IQL language. For example, it is difficult to find the correct regular expression to set a question to only input Chinese and numbers; or it is difficult to find the correct syntax to realize the verification of the result of a question after the question is asked, so the questionnaire electronic method considering expression and proofreading is urgently needed. SUMMARY
[0004] The main purpose of the application is to overcome the shortcomings and deficiencies of the prior art, provide a questionnaire recognition method and device based on a deep neural network, edit the questionnaire content by IQL language and perform multi-task learning, structure the expression of each question of the questionnaire, and output the structured prediction by the abstract syntax tree based on the IQL language, to realize automatic recognition of the questionnaire.
[0005] In order to achieve the above purpose, the application adopts the following technical scheme:
[0006] In the first aspect, the application provides a questionnaire recognition method based on a deep neural network, including the following steps:
[0007] In the IQL questionnaire editing environment, the user questionnaire is formatted, each question is divided into paragraphs, each sentence in the paragraph is modeled, the modeled sentence is reconstructed, and the reconstructed text is obtained;
[0008] The reconstructed text is classified by type, and adaptive weight calculation is performed to obtain the type of each question;
[0009] According to the question type, information extraction is performed on the reconstructed text to obtain question information;
[0010] An abstract syntax tree based on the IQL language is constructed, the question information is sequentially input to the abstract syntax tree based on the IQL language, the abstract syntax tree based on the IQL language is traversed, the question information is combined through a preset grammar rule, a logical sentence is generated, the abstract syntax tree based on the IQL language includes a grammar rule and an execution unit, the grammar rule is used to define the rule of question generation, and the execution unit is used to generate a currently recognized question according to the grammar rule and the question information.
[0011] As a preferred technical solution, the user questionnaire is formatted in the IQL questionnaire editing environment, each question is divided into a paragraph, each sentence in the paragraph is modeled, the reconstructed text is obtained, and the method comprises the following steps:
[0012] The user questionnaire is converted into an html format, and the user questionnaire has multiple lines of sentences, each line of sentence is labeled by using a minimum p tag;
[0013] A question in the user questionnaire is divided into a paragraph, semantic recognition and classification training of the minimum p tag of each sentence are performed by using a deep neural network, a paragraph structure representation is obtained, and each question is modeled according to the paragraph structure representation; the deep neural network comprises a maximum pooling layer, an average pooling layer and a full connection layer, and the paragraph structure representation comprises a beginning part, a middle part and other parts;
[0014] The sentence is reconstructed according to the paragraph structure representation, and the reconstructed text is obtained.
[0015] As a preferred technical solution, the classification training is specifically as follows:
[0016] The minimum p tags of each sentence of each question are input into the deep neural network in the order of the sentences in the question, the hidden states of each token of the sentence are pooled by using the maximum pooling layer and the average pooling layer, and the full connection layer outputs the paragraph structure representation.
[0017] As a preferred technical solution, the reconstructed text is classified by type and adaptive weight calculation is performed, and the method comprises the following steps:
[0018] The structure of the reconstructed text is classified to obtain a classification label;
[0019] The sample frequency of each classification label is calculated, and the classification training weight is adjusted according to the sample frequency;
[0020] The classification label is gradient trained by using a cross-entropy loss function, and after the training is completed, the final classification label of each question is obtained.
[0021] As a preferred technical solution, the information of the reconstructed text is extracted according to the question type, and the method comprises the following steps:
[0022] The multi-task learning is used to predict multiple question information in the same question, including the following cases:
[0023] When the question is a selection question, the extracted question information includes a question number, a title, an option number, an option content, and a logically related sentence; the logically related sentence is used to limit the appearance logic of the question or the verification logic of the answer of the question;
[0024] When the question is a question and answer question, the extracted question information includes a question number, a title, and a logically related sentence;
[0025] When the question is a judgment question, the extracted question information includes a question number, a title, and a logically related sentence;
[0026] After the question information extraction of each type of question is completed, the question information is combined.
[0027] As a preferred technical solution, the syntax rule has multiple execution units, the first execution unit outputs the corresponding field or symbol according to the type of the current syntax rule, and the other execution units are set according to the type of the current syntax rule.
[0028] As a preferred technical solution, the type of the current question is predicted according to the input question information, the generation rule of the current question is defined by using the syntax rule, and the type of the syntax rule is output; the other execution units are set according to the syntax rule, the field or symbol of the type of the syntax rule is output by using the first execution unit, the other execution units are sequentially output by using the other execution units, and the cycle is executed until all questions are output.
[0029] In a second aspect, the present application further provides a questionnaire recognition system based on a deep neural network, which is applied to the questionnaire recognition method based on the deep neural network, and includes a text reconstruction module, a type recognition module, an information extraction module, and a recognition output module.
[0030] The text reconstruction module is used for formatting the user questionnaire in the IQL questionnaire editing environment, dividing each question into a paragraph, modeling each sentence in the paragraph, reconstructing the modeled sentence, and obtaining a reconstructed text.
[0031] The type recognition module is used for classifying the types of the reconstructed text, calculating adaptive weights, and obtaining the type of each question.
[0032] The information extraction module is used for extracting information from the reconstructed text according to the type of the question, and obtaining the question information.
[0033] The recognition output module is configured to construct an abstract syntax tree based on an IQL language, input question information into the abstract syntax tree in sequence, traverse the abstract syntax tree, combine the question information according to preset syntax rules, and generate a logic sentence.
[0034] In a third aspect, the present application provides an electronic device, comprising:
[0035] at least one processor; and
[0036] a memory connected to the at least one processor in communication; wherein
[0037] The memory stores computer program instructions executable by the at least one processor, and the computer program instructions are executed by the at least one processor to enable the at least one processor to execute the deep neural network-based questionnaire recognition method.
[0038] In a fourth aspect, the present application provides a computer readable storage medium storing a program, and the program is executed by a processor to implement the deep neural network-based questionnaire recognition method.
[0039] Compared with the prior art, the present application has the following advantages and beneficial effects:
[0040] (1) The present application can structure the expression of each question in a questionnaire by using multi-task learning on the content of the questionnaire, and finally output natural language to express a questionnaire, so as to realize user-friendly and convenient questionnaire electronicization.
[0041] (2) The present application can automatically recognize and structure the output of a questionnaire based on the abstract syntax tree of the IQL language, so that users no longer need to repeatedly copy and paste the text content of a word questionnaire or a pdf questionnaire into an IQL questionnaire editor, and the efficiency of long questionnaire electronicization is improved. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0043] Figure 1 The flowchart of the questionnaire recognition method based on the deep neural network of the embodiment of the present application;
[0044] Figure 2 The schematic diagram of information extraction of the embodiment of the present application;
[0045] Figure 3 Structure diagram of a conventional abstract syntax tree for an embodiment of the present application;
[0046] Figure 4 Structure diagram of an abstract syntax tree based on an IQL language for an embodiment of the present application;
[0047] Figure 5 Structure diagram of a questionnaire recognition system based on a deep neural network for an embodiment of the present application;
[0048] Figure 6 Structure diagram of an electronic device for an embodiment of the present application. DETAILED DESCRIPTION
[0049] In order for those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0050] In the present application, the phrase "embodiment" means that the specific features, structures or characteristics described in connection with the embodiment can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor is it an independent or alternative embodiment to other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in the present application can be combined with other embodiments.
[0051] IQL (Iesr-Questionnaire-Language) is a self-developed questionnaire programming language, which is easy to learn, convenient to input, has rich question types, powerful logic functions, and is easy to debug and preview, to solve the problems of single question type, weak logic function, low flexibility, high learning cost, inability to preview in time, and lack of powerful IDE tool support in the past questionnaire systems.
[0052] Please refer to Figure 1 The embodiment provides a questionnaire recognition method based on a deep neural network.
[0053] The embodiment takes the paddlepaddle deep learning development platform as the training and deployment platform of the model, and uses the ERNIE3.0 model as a pre-training model to save the training cost and data cost, and to balance the accuracy and speed of processing, which is specifically divided into the following stages:
[0054] Step 1, formatting the user questionnaire in the IQL questionnaire editing environment, dividing each question into paragraphs, modeling each sentence in the paragraph, reconstructing the completed modeling sentence, and obtaining the reconstructed text.
[0055] First, the user's questionnaire is identified as html format text for uniform processing, and the user questionnaire is converted to html format. The user questionnaire has multiple lines of sentences, and each line of sentence is labeled with a minimum p tag. Each minimum p tag text is considered as a sentence as input for the next step.
[0056] Second, as shown in Figure 2 , a question in the user questionnaire is divided into a paragraph, and a deep neural network is used to identify and classify the semantic of each sentence's minimum p tag, obtain the paragraph structure representation, and model each question according to the paragraph structure representation. The deep neural network includes a max pooling layer, an average pooling layer, and a fully connected layer, and the paragraph structure representation includes a beginning part B, an intermediate part I, and other parts O.
[0057] Further, in this stage of modeling, the number of texts contained in each line of sentence is indefinite, and the traditional truncation method will lose part of the semantics, resulting in loss of accuracy. Therefore, in this embodiment, the minimum p tags of each sentence of each question are input into the deep neural network according to the order of the sentences in the question, and the max pooling layer and the average pooling layer are used to pool the hidden state of each token of the sentence, and the fully connected layer outputs the paragraph structure representation. Referring again to Figure 2 , S1-S4 represent the content of a minimum p tag. A cell represents a hidden state, and three cells stacked represent a token with three hidden states, for example, S1 is a p tag with 3 tokens. Then the arrow above indicates that after the max and mean pooling operation, it enters a fully connected layer, and the output of each label is above.
[0058] Finally, the sentences are reconstructed according to the original questionnaire order and the paragraph structure representation, and the reconstructed text is obtained.
[0059] At this time, the reconstructed text is a long sequence, and the sequence is composed of a beginning part B, an intermediate part I, and other parts O structure. When identifying the question, the paragraph structure representation is identified. The three representations are a variant of a sequence labeling task based on a pre-trained model, which is a common token type prediction. Here, the type of each minimum p tag text is predicted.
[0060] Step 2, type classification of the reconstructed text, and adaptive weight calculation, obtaining the type of each question.
[0061] In this embodiment, step 2 involves a multi-classification text classification problem, that is, the paragraph structure representation in the reconstructed text needs to be classified into different topic types respectively, and then the respective classification labels are obtained. In addition, because the topic types of the training data set are inevitably unbalanced, and the traditional fixed weight method cannot adjust according to the dynamic changes in the training process and is prone to introduce bias, an adaptive weight calculation is specifically introduced when calculating the loss function. The sample frequency of each category is calculated before the training starts, and then the weight is adjusted according to the frequency.
[0062] Specifically, as follows:
[0063] S21, classifying according to the structure of the reconstructed text to obtain a classification label;
[0064] S22, calculating the sample frequency of each classification label, and adjusting the classification training weight according to the sample frequency;
[0065] S23, using a cross-entropy loss function to perform gradient training on the classification label, and after training, obtaining the final classification label of each topic.
[0066] Step 3, extracting information from the reconstructed text according to the topic type to obtain topic information.
[0067] In step 2, the questions in the questionnaire have been classified, and the next step S3 needs to extract the attributes of the classified questions, that is, to extract the question information according to the category. Specifically, the present embodiment can recognize the following question types, including single choice, multiple choice, ranking question, single fill-in-the-blank, multiple fill-in-the-blank, matrix fill-in-the-blank, matrix scale, matrix single choice, matrix multiple choice, matrix slider, matrix drop-down, matrix numerical value, matrix text, matrix combination, matrix Nps scale, file upload, scoring scale question, NPS scale question, one-level drop-down list, multi-level drop-down box, province-city-county drop-down, proportion question, slider, name, gender, mobile phone number, email, date, time, date and time, map, university selection, province drop-down, province-city drop-down, province-city-county drop-down, signature, paragraph explanation, paging, informed consent, etc. However, the basic components of the questions are question number, title, subtitle, option number, option content and logically related sentences.
[0068] Then, in order to extract the above question information, the present embodiment adopts multi-task learning, each task is responsible for predicting a question attribute, and finally the results of each task are combined. A small network is introduced to dynamically adjust the task weight when calculating the loss rate. The input of this network is the loss value of each task, and the output is the weight of the task. The steps are as follows:
[0069] When the question is a multiple-choice question, the extracted question information includes the question number, title, option number, option content, and logically related statements;
[0070] When the question is a short answer question, the extracted question information includes the question number, title, and logically related statements;
[0071] When the question is a true / false question, the extracted question information includes the question number, title, and logically related statements;
[0072] After extracting the question information for each type of question, the question information is merged.
[0073] It is trained in conjunction with the main task, and the parameters of the weight network are dynamically adjusted through backpropagation.
[0074] Furthermore, the process of extracting question information is a sequence labeling task based on a pre-trained model. Its main task is to process the sequence labeling. The input is the reconstructed text, and the output is the type of each token or character in the text (BIO tag). For example, a question consists of a question number, title, options, and logical statements. Here, we construct B-question number (the beginning of the question number), I-question number (the middle part of the question number), B-title, I-title, B-logic, I-logic, and O (other parts). After obtaining the model's output, the tokens are combined according to the output type. For example, the pseudocode for extracting question number information is as follows:
[0075] for i in range(token sequence length):
[0076] token_type = the type of the i-th token
[0077] if token_type == B-question number:
[0078] / / Iterate from i+1 until you encounter a token_type that is not I-question number.
[0079] for j in range(i+1, token sequence length):
[0080] If the type of the j-th token is not equal to I - question number:
[0081] break
[0082] The question number = token sequence [i:j].
[0083] Its tasks are: 1. Identify where each minimum p label starts, middle or other in the question text. Then combine the results into a question text; 2. According to the question text, predict what the question type is; 3. According to the question text, extract the question number, title, subtitle, options and logical sentences and other components; 4. According to the question text and the location of this text in the original text, generate logical sentences.
[0084] It also needs to be explained that the above logical related sentences mainly describe the appearance logic of the question or the verification logic of the answer of the question, for example: only respondents over 18 years old are allowed to answer a certain question, or jump to A20 after answering question A12.
[0085] Step 4, build an abstract syntax tree based on IQL language, input the question information into the abstract syntax tree based on IQL language in order, traverse the abstract syntax tree based on IQL language, and combine the question information through the preset syntax rule to generate logical sentences.
[0086] After completing the text structuring of steps 1-3, this embodiment will build an abstract syntax tree based on IQL language to realize the generation of logical sentences. In order to better improve the recognition output efficiency, an intermediate language IQL-ASDL is used as prior knowledge to improve the traditional encoder-decoder structure based Transformer generation model, which can be used to guide the model to select features, optimize architecture and improve interpretability. As shown in Figure 3 and Figure 4 As shown in the figure, the abstract syntax tree generated by the traditional sequence generation model is only the output code, which lacks syntax constraints, while the intermediate language IQL-ASDL added in this application can constrain the syntax of the question sequence by defining syntax rules, thereby improving the accuracy of question sequence recognition and output.
[0087] Specifically, as shown in Figure 4 The intermediate language IQL-ASDL includes syntax rules and execution units, the syntax rules are used to define the generation rules of the question, and the execution units are used to generate the currently recognized question according to the syntax rules and the question information; the syntax rules have multiple execution units, the first execution unit outputs the corresponding field or symbol according to the type of the current syntax rule, and the other execution units are set according to the type of the current syntax rule. According to the input question information, predict the question type of the current question, define the generation rules of the current question by using the syntax rules, and output the type of the syntax rule; set other execution units according to the syntax rule, output the field or symbol of the type of the syntax rule by using the first execution unit, output in sequence by using other execution units, and execute in a loop until all questions are output.
[0088] Ultimately, the output logic statement is the logic statement of the identified questionnaire.
[0089] To better explain step S4, this embodiment sets the syntax rule as a question-and-answer rule, including a definition statement and a question statement. The former is used to define how to output the execution unit of the current question type based on the current rule, and the latter is the selection of the specific question type.
[0090] like Figure 4 As shown, a random type of question is requested from the abstract syntax tree. In the first step, t1 predicts the question type for step t2 based on the question order. In the second step, t2 sets the corresponding execution units (t3, t5, t7, and t9) based on the predicted question type. Then, following a depth-first, left-to-right principle, DeclareType is processed first until completion before starting the next Action. This loop continues until the end, finally outputting code that conforms to the syntax rules. The pseudocode is as follows:
[0091] inputs = Question information and the order of the questions
[0092] pre_results = results from the previous step
[0093] pre_rule = the rule from the previous step
[0094] nodes = the rules and actions that need to be processed currently.
[0095] def step(inputs,pre_results,pre_rule,nodes)
[0096] if not nodes:
[0097] return
[0098] for node in nodes:
[0099] if node is Rule:
[0100] # Based on the syntax tree, provide the next possible rule and action under the current rule.
[0101] next_nodes = IQL-ASDL.next(rule)
[0102] # Based on the current state, the result of the previous step, and the possible results of the next step,
[0103] # Give the next Rule and Action
[0104] next_nodes = Predict(inputs,pre_results,pre_rule,next_nodes)
[0105] pre_results.append(step(inputs,pre_results,rule,next_nodes))
[0106] else if node is Action:
[0107] pre_results.append(GenToken(inputs,pre_results,pre_rule,action)).
[0108] It should be noted that for the foregoing method embodiments, in order to facilitate the description, they are all described as a series of action combinations, but those skilled in the art should know that the present application is not limited by the order of the described actions, because according to the present application, certain steps can be performed in other order or simultaneously.
[0109] Based on the same idea as the deep neural network-based questionnaire recognition method in the above embodiment, the present application also provides a deep neural network-based questionnaire recognition system, which can be used to execute the deep neural network-based questionnaire recognition method described above. In order to facilitate the description, in the structural diagram of the deep neural network-based questionnaire recognition system embodiment, only the part related to the embodiment of the present application is shown, and those skilled in the art can understand that the diagram structure does not constitute a limitation on the device, and can include more or fewer components than the diagram, or combine certain components, or different component arrangements.
[0110] Referring to Figure 5 In another embodiment of the present application, a deep neural network-based questionnaire recognition system 10 is provided, which includes a text reconstruction module 11, a type recognition module 12, an information extraction module 13, and an identification output module 14.
[0111] The text reconstruction module 11 is used to format the user questionnaire in the IQL questionnaire editing environment, divide each question into paragraphs, model each sentence in the paragraph, reconstruct the completed modeling sentence, and obtain the reconstructed text.
[0112] The type recognition module 12 is used to classify the types of the reconstructed text and perform adaptive weight calculation to obtain the type of each question.
[0113] The information extraction module 13 is configured to extract information from the reconstructed text according to the type of the question, and obtain question information.
[0114] The identification output module 14 is configured to construct an abstract syntax tree based on the IQL language, input the question information into the abstract syntax tree in sequence, traverse the abstract syntax tree, combine the question information through preset syntax rules, and generate a logic sentence.
[0115] It should be noted that the deep neural network-based questionnaire identification system of the present application corresponds to the deep neural network-based questionnaire identification method of the present application, and the technical features and advantages described in the above embodiment of the deep neural network-based questionnaire identification method are applicable to the embodiment of the deep neural network-based questionnaire identification method, and the specific content can be referred to the description in the method embodiment of the present application, which will not be repeated here, and hereby declared.
[0116] In addition, in the implementation of the deep neural network-based questionnaire identification system in the above embodiment, the logical division of each program module is only an example, and in actual application, the above functions can be completed by different program modules according to the needs, for example, the configuration requirements of the corresponding hardware or the convenience of software implementation, that is, the internal structure of the deep neural network-based questionnaire identification system is divided into different program modules to complete all or part of the functions described above.
[0117] Please refer to Figure 6 In one embodiment, an electronic device for implementing the deep neural network-based questionnaire identification method is provided, and the electronic device 20 can include a first processor 21, a first memory 22 and a bus, and can further include a computer program stored in the first memory 22 and executable on the first processor 21, such as a deep neural network-based questionnaire identification program 23.
[0118] The first memory 22 includes at least one type of readable storage medium, such as flash memory, mobile hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the first memory 22 can be an internal storage unit of the electronic device 20, such as a mobile hard disk of the electronic device 20. In other embodiments, the first memory 22 can also be an external storage device of the electronic device 20, such as a plug-in mobile hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. Further, the first memory 22 can include both an internal storage unit and an external storage device of the electronic device 20. The first memory 22 can be used to store application software and various data installed in the electronic device 20, such as the code of the questionnaire recognition program 23 based on deep neural network, and can also be used to temporarily store data that has been output or will be output.
[0119] The first processor 21 can be composed of an integrated circuit in some embodiments, such as a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same function or different functions, including one or more central processing units (CPU), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The first processor 21 is the control core of the electronic device, which connects various components of the entire electronic device through various interfaces and lines, and executes various functions and processes data of the electronic device 20 by running or executing programs or modules stored in the first memory 22 and calling data stored in the first memory 22.
[0120] Figure 6 Only the electronic device with components is shown, and those skilled in the art can understand that, Figure 6 The structure shown does not constitute a limitation on the electronic device 20, and can include fewer or more components than shown, or combine certain components, or different component arrangements.
[0121] The questionnaire recognition program 23 based on deep neural network stored in the first memory 22 of the electronic device 20 is a combination of a plurality of instructions, which, when running in the first processor 21, can achieve:
[0122] formatting the user questionnaire, dividing each question into a paragraph, modeling each sentence in the paragraph, reconstructing the modeled sentence, and obtaining the reconstructed text;
[0123] The reconstructed text is classified by type, and adaptive weight calculation is performed to obtain the type of each question;
[0124] Information extraction is performed on the reconstructed text according to the question type to obtain question information;
[0125] An abstract syntax tree is constructed, question information is input into the abstract syntax tree in order, the abstract syntax tree is traversed, and the question information is combined by a preset grammar rule to generate a logical sentence. Further, the modules / units integrated by the electronic device 20, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a non-volatile computer-readable storage medium. The computer-readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM).
[0126] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when the program is executed, the processes of the above-mentioned embodiments can be included. Any reference to a memory, storage, database or other medium used in the embodiments provided in the present application can include a non-volatile and / or volatile memory. The non-volatile memory can include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM) or a flash memory. The volatile memory can include a random access memory (RAM) or an external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM) and memory bus dynamic RAM (RDRAM) and the like.
[0127] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, however, as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present disclosure.
[0128] The above embodiments are the preferred embodiments of the present application, but the embodiments of the present application are not limited to the above embodiments, and any changes, modifications, substitutions, combinations, simplifications, etc. made without departing from the spirit and principles of the present application should be equivalent replacement manners and should be included in the protection scope of the present application.
Claims
1. A method for recognizing a questionnaire based on a deep neural network, characterized by, Comprise the following steps: The user questionnaire is formatted in the IQL questionnaire editing environment, each question is divided into paragraphs, each sentence in the paragraph is modeled, the completed modeling sentence is reconstructed, and the reconstructed text is obtained, specifically: Convert the user questionnaire into html format, and set the user questionnaire to have multiple line sentences, and use the minimum p tag to mark each line sentence; Divide a question in the user questionnaire into a paragraph, use a deep neural network to perform semantic recognition and classification training on the minimum p tag of each sentence, obtain a paragraph structure representation, and model each question according to the paragraph structure representation; the deep neural network comprises a maximum pooling layer, an average pooling layer and a full connection layer, and the paragraph structure representation comprises a beginning part, an intermediate part and other parts; According to the paragraph structure representation, the sentence is reconstructed, and the reconstructed text is obtained; Classify the reconstructed text by type and calculate the adaptive weight, and obtain the type of each question; The type classification of the reconstructed text and the adaptive weight calculation include: Classify according to the structure of the reconstructed text to obtain a classification label; Calculate the sample frequency of each classification label, and adjust the classification training weight according to the sample frequency; Use the cross-entropy loss function to perform gradient training on the classification label, and after training, obtain the final classification label of each question; According to the question type, the information of the reconstructed text is extracted to obtain the question information; An abstract syntax tree based on IQL language is constructed, the question information is input into the abstract syntax tree based on IQL language in order, the abstract syntax tree based on IQL language is traversed, the question information is combined through a preset syntax rule to generate a logical sentence, and the abstract syntax tree based on IQL language includes a syntax rule and an execution unit, the syntax rule is used to define the rule of question generation, and the execution unit is used to generate the currently recognized question according to the syntax rule and the question information. 2.The deep neural network based questionnaire recognition method of claim 1, wherein, The classification training, specifically: Input the minimum p tag of each sentence of each question into the deep neural network according to the order of the sentence in the question, use the maximum pooling layer and the average pooling layer to perform pooling operation on the hidden state of each token of the sentence, and the full connection layer outputs the paragraph structure representation. 3.The method of claim 1, wherein, According to the question type, the information of the reconstructed text is extracted, including: Use multi-task learning to predict multiple question information in the same question, including the following cases: When the question is a selection question, the extracted question information includes question number, title, option number, option content and logical related sentence; the logical related sentence is used to limit the appearance logic of the question or the verification logic of the answer of the question; When the question is a question and answer question, the extracted question information includes question number, title and logical related sentence; When the question is a judgment question, the extracted question information includes question number, title and logical related sentence; After completing the question information extraction of each type of question, the question information is combined. 4.The method of claim 1, wherein, The syntax rule has multiple execution units, the first execution unit outputs the corresponding field or symbol according to the type of the current syntax rule, and the other execution units are set according to the type of the current syntax rule. 5.The method of claim 4, wherein, According to the input question information, the question type of the current question is predicted, the generation rule of the current question is defined by using a syntax rule, and the type of the syntax rule is output; other execution units are set according to the syntax rule, the fields or symbols of the type of the syntax rule are output by using the first execution unit, the other execution units are sequentially output, and the loop execution is performed until all the questions are output. 6.A questionnaire recognition system based on a deep neural network, characterized by, The deep neural network-based questionnaire recognition method is applied to any one of claims 1-5, comprising a text reconstruction module, a type recognition module, an information extraction module, and a recognition output module. The text reconstruction module is used for formatting the user questionnaire in the IQL questionnaire editing environment, dividing each question into a paragraph, modeling each sentence in the paragraph, reconstructing the completed modeling sentence, and obtaining the reconstructed text. The type recognition module is used for classifying the type of the reconstructed text and performing adaptive weight calculation to obtain the type of each question. The information extraction module is used for extracting information from the reconstructed text according to the question type to obtain question information. The recognition output module is used for constructing an abstract syntax tree based on the IQL language, inputting the question information into the abstract syntax tree in sequence, traversing the abstract syntax tree, combining the question information through a preset syntax rule, and generating a logical sentence.
7. An electronic device, comprising: The electronic device comprises: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores computer program instructions executable by the at least one processor, and the computer program instructions are executed by the at least one processor to enable the at least one processor to execute the deep neural network-based questionnaire recognition method of any one of claims 1-5.
8. A computer-readable storage medium storing a program, characterized in that, The program is executed by the processor to implement the deep neural network-based questionnaire recognition method of any one of claims 1-5.
Citation Information
Patent Citations
Graphical questionnaire generation method and graphical questionnaire generation system
CN104572136A
Questionnaire generation method and device and storage medium
CN113033157A