Method, apparatus and storage medium for automatically generating requirement documents based on human-computer interaction
By building dialogue templates and keyword dictionaries, automated software requirements document generation is realized, solving the problems of maintenance difficulties and manual labeling dependencies in the existing technology, and improving the efficiency and accuracy of software requirements acquisition.
Patent Information
- Application Number
- CN202211235370.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-10
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-10-10
AI Technical Summary
In the prior art, rules-based dialogue systems have difficulty maintaining complex dialogues and tasks. Data-driven dialogue systems rely on high-cost manual annotations, and software requirements rely on developers for a lot of time, lack industry knowledge.
Based on human-computer interaction, a dialogue template is constructed and software requirements are obtained through multiple rounds of dialogue, and the requirements information is extracted using preset standards and keyword dictionaries to generate software requirements documents that meet ISO standards.
Generate software requirements documents through an automated dialogue system, saving labor and time costs, and improving the efficiency and accuracy of software requirements acquisition.
Smart Images

Figure CN115630146B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of document generation, and in particular to a method, device and storage medium for automatically generating requirement documents based on human-computer interaction. Background Art
[0002] Conversational bots primarily fall into the categories of chatbots, question-and-answer (Q&A), and task-oriented. Task-oriented bots differ from the previous two primarily in their emphasis on context, with each conversation affecting the next. Task-oriented human-computer interaction can be categorized by the technology used: rule-based, semantic parsing-based, and data-driven. Rule-based conversational systems include direct implementation methods that highly couple conversation logic and management, and state-transition-based methods. While these methods are easy to understand and fast to implement, defining specific rules for each scenario can make the system bulky. As the number of conversations and tasks increases, data and code maintenance becomes increasingly difficult, and reusability is also limited. Due to the diversity and complexity of languages, conversational systems based solely on logical structures and conditions cannot meet the needs of real-world conversations.
[0003] With the advancement of deep learning, data-driven, task-oriented human-computer interaction systems are gaining increasing attention. These dialogue systems employ an end-to-end approach and consist of four major components: natural language understanding, dialogue state tracking, dialogue policy learning, and natural language generation. Robust dialogue systems require a large amount of effectively annotated data. This presents a challenge, however, due to misunderstandings and a lack of industry expertise, labeled data is often expensive and ineffective. Recent research has primarily focused on modeling conversational text sequences and using sequence models to predict the next moment of dialogue. However, due to the scarcity of dialogue datasets, most research has been limited to smaller systems such as restaurant ordering and flight search.
[0004] Despite the long history of development of natural language processing and conversational systems, these technologies have provided limited feedback to software engineering efforts. Even obtaining initial software requirements still requires developers to spend significant time guiding clients through software descriptions, often involving repetitive tasks like explaining industry terminology and guiding through fixed processes. Summary of the Invention
[0005] In order to solve at least one of the technical problems existing in the prior art to a certain extent, the present invention aims to provide a method, device and storage medium for automatically generating a requirement document based on human-computer interaction.
[0006] The technical solution adopted in the present invention is:
[0007] A method for automatically generating a requirements document based on human-computer interaction, comprising the following steps:
[0008] S1. Build a dialogue template corresponding to the software requirement document specification based on a preset standard;
[0009] S2. Ask questions to the user according to the dialogue template and collect feedback information;
[0010] S3. Extract the requirement information in the user's message according to the feedback information and predict the response action;
[0011] S4. Fill the requirement information into the dialogue template in the response action and construct a response message according to the requirement information;
[0012] S5. Repeat steps S2 to S4 until the dialogue stops after obtaining a complete software description, or ends when no new information can be obtained;
[0013] S6. Generate a mind map and a software requirement document that meets the preset standard according to the obtained information.
[0014] Furthermore, the dialogue template consists of different sub-modules. In each sub-module, a requirement name, priority, acquisition status, default value, questioning method, and invalid questioning times are marked for different requirements. The set of all sub-modules corresponds to the complete software requirement document;
[0015] Among them, in each round of dialogue, one sub-module in the dialogue template is obtained for questioning.
[0016] Furthermore, step S2 specifically includes:
[0017] Scan the dialogue template to obtain the sub-module with the highest priority and the status of the sub-module is unfilled or being filled;
[0018] Ask questions to the user according to the obtained sub-module and collect the user's feedback information;
[0019] Among them, the complete dialogue task is divided into multiple subtasks, and the goal of each subtask is to fill a sub-module of the dialogue template.
[0020] Furthermore, the step of extracting the requirement information in the user's message includes three steps: constructing a requirement keyword dictionary, extracting requirement keywords, and extracting the message theme;
[0021] Among them, the step of constructing a requirement keyword dictionary includes: extracting high-frequency words in the requirement document, constructing keywords in the software requirement field, constructing keyword categories according to the text characteristics of the software requirement field, and constructing a keyword dictionary according to the keywords and keyword categories;
[0022] The step of extracting requirement keywords includes: extracting keywords in the feedback information according to the prompt of the missing requirement information in the dialogue template and the requirement keyword dictionary;
[0023] The step of extracting message topics includes: classifying message topics into different submodules of the conversation template, and extracting user message topics based on keyword feature fusion;
[0024] The features of user message topics, keywords and sentence text are used as input to predict response actions, obtaining accurate response actions for user messages.
[0025] Furthermore, the step S4 includes:
[0026] Construct question-based responses or knowledge-retrieval-based responses based on the message subject.
[0027] Furthermore, the step of constructing question-answering includes:
[0028] Scan the dialogue template, obtain the submodule that needs to be filled, fill the required information into the submodule, and update the information acquisition status of the submodule;
[0029] Rescan the dialogue template and construct a response text based on the submodule or the next priority submodule. If the submodule information is too short or still missing, ask additional questions about the submodule. Otherwise, search for the next priority submodule.
[0030] The step of constructing a knowledge retrieval response includes:
[0031] The knowledge requested by the user is retrieved from the constructed software requirements knowledge database based on the keywords, the retrieved data is used as the response text, and after the response is constructed, the dialogue state is required to roll back to the state before this round of dialogue.
[0032] Furthermore, the step S4 further includes the following steps:
[0033] Set the inquiry count threshold in the dialogue template. When the number of invalid questions reaches the inquiry count threshold, it is determined that the user cannot answer the requirement. The dialogue will skip the sub-module and search for the next priority sub-module.
[0034] Furthermore, the step S5 includes:
[0035] Define each submodule in the dialogue template as a subtask, and complete a subtask after several rounds of dialogue;
[0036] For a subtask, if no valid answer is obtained multiple times, the subtask will be ended and skipped;
[0037] If the dialogue template scan is completed and no new information can be obtained, the entire dialogue task is terminated;
[0038] If the user requests to stop the conversation during the conversation, the entire conversation task is terminated.
[0039] Another technical solution adopted by the present invention is:
[0040] A device for automatically generating a requirements document based on human-computer interaction, comprising:
[0041] At least one processor;
[0042] At least one memory for storing at least one program;
[0043] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.
[0044] Another technical solution adopted by the present invention is:
[0045] A computer-readable storage medium storing a program executable by a processor, where the program executable by the processor is used to execute the above method when executed by the processor.
[0046] The beneficial effects of the present invention are as follows: The present invention adds preset requirements acquisition questions to the template, asks questions to the user according to the template information and the requirements acquisition status in the template, parses the user's intention and the requirements information in the message, and generates a formatted software requirements document at the end of the conversation, saving labor and time costs for requirements acquisition. Description of the Drawings
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following introduces the accompanying drawings of the relevant technical solutions in the embodiments of the present invention or the prior art. It should be understood that the accompanying drawings below only facilitate a clear expression of some embodiments of the technical solutions in the present invention. For those skilled in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0048] Figure 1 is a flowchart of a method for automatically generating a requirements document based on human-computer interaction in an embodiment of the present invention;
[0049] Figure 2 is a schematic diagram of the definition of the dialogue state based on the dialogue template in an embodiment of the present invention;
[0050] Figure 3 is a schematic diagram of the dialogue template for requirements acquisition in an embodiment of the present invention. Detailed Embodiments
[0051] Embodiments of the present invention will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention and should not be construed as a limitation of the present invention. For the step numbers in the following embodiments, they are only set for the convenience of description and illustration, and no limitation is imposed on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0052] In the description of the present invention, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation of the present invention.
[0053] In the description of the present invention, the meaning of "several" is one or more, the meaning of "multiple" is more than two, and understandings such as "greater than", "less than", "exceeding", etc. do not include the present number, and understandings such as "above", "below", "within", etc. include the present number. If there is a description of "first" and "second", it is only for the purpose of distinguishing technical features and should not be construed as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features or implicitly indicating the sequence relationship of the indicated technical features.
[0054] In the description of the present invention, unless otherwise clearly defined, words such as "set", "installed", "connected", etc. should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above words in the present invention in combination with the specific content of the technical solution.
[0055] In view of the problems of the prior art, the present invention provides a method for obtaining software requirements based on human-computer interaction and automatically generating a software requirements document. The method includes designing a dialogue template for requirement acquisition according to the software requirements document, adding preset requirement acquisition questions to the template, asking questions to the user based on the template information and the requirement acquisition status in the template, guiding the user to express detailed and complete software requirements through context-related multi-round conversations, parsing the requirement information in the user's intention and message, predicting the response method according to the parsing result and the current conversation state, filling the requirement information into the target position of the dialogue template in the response method, and updating the requirement acquisition status. The dialogue guidance can answer the user's context-independent chat while asking questions to the user. The method also provides parsing in the form of modeling language and mind map to help the user sort out the requirements. At the end of the conversation, a formatted software requirements document will be generated, saving labor and time costs for requirement acquisition.
[0056] As Figure 1As shown in the figure, this embodiment provides a method for automatically generating a requirements document based on human-computer interaction, including the following steps:
[0057] S101. Construct a dialogue template corresponding to the software requirements document specification based on a preset standard.
[0058] In this embodiment, the preset standard is the ISO standard. A dialogue template is constructed according to the software requirements standard description made according to ISO. In the dialogue template, clear requirement names, priorities, acquisition statuses, default values, questioning methods, and invalid questioning times are marked for different requirements, and they are stored in the database in a fixed format. This standard dialogue template corresponds to the software requirements document. A complete dialogue is a task, and this task is divided into multiple subtasks. Each subtask is a multi-round dialogue, and each subtask asks questions for a module in the template.
[0059] S102. Ask the user questions according to the dialogue template and collect feedback information.
[0060] As an optional implementation method, a mind map is used to give dialogue prompts, and the dialogue framework is displayed to the user in the form of a mind map using front-end components, converting the dialogue logic into a graph for easy user understanding.
[0061] Ask the user questions about the unacquired requirement with the highest priority in the dialogue template. Scan all sub-modules in the dialogue template, select the sub-module with the highest priority whose status is unfilled or being filled, and the human-computer interaction is carried out around the information of this sub-module. Ask questions about the missing information in this sub-module according to the question style provided by the sub-module. The complete dialogue task is divided into multiple subtasks, and the goal of each subtask is to fill a sub-module of the dialogue template.
[0062] S103. Extract the requirement information in the user's message according to the feedback information and predict the response action.
[0063] Extract the requirement information in the user's message and predict the response action. Extracting the requirement information is divided into three modules: constructing a requirement keyword dictionary, extracting requirement keywords, and extracting the message theme. The response action is predicted based on the extracted requirement information. The construction of the requirement keyword dictionary extracts high-frequency words from a large number of requirements documents to construct keywords in the software requirements field, constructs keyword categories based on the text characteristics of the software requirements field, and the keywords and keyword categories jointly construct the keyword dictionary; the requirement keyword extraction module extracts keywords in the message according to the requirement gaps in the dialogue template and the requirement keyword dictionary; the message theme extraction module classifies the message theme into different sub-modules of the dialogue template and fuses and extracts the theme of the user's message according to the keyword characteristics. The user's message theme, keyword characteristics, and sentence text characteristics are used as the input for predicting the response action to obtain an accurate response action for the user's message.
[0064] S104. Fill the requirement information into the dialogue template during the response action, and construct a response message based on the requirement information.
[0065] When filling the requirement information into the dialogue template and constructing a response message based on the dialogue template during the response action, there are two construction methods. One is to construct a question-based response according to the message theme, and the other is to construct a knowledge retrieval-based response. Constructing a question-based response according to the message theme requires scanning the dialogue template to obtain the sub-module to be filled, filling the requirement information into this sub-module, and updating the information acquisition status of the sub-module; scanning the dialogue template again, constructing a response text from this sub-module or the next sub-module with a higher priority. If the information in this sub-module is too short or still missing, supplementary questions will be asked for this sub-module, otherwise, the next sub-module with a higher priority will be searched. Constructing a knowledge retrieval-based response requires retrieving the knowledge requested by the user from the pre-constructed software requirement knowledge database based on keywords, using the retrieved data as the response text, and requiring the dialogue state to roll back to before this round of dialogue after the response is constructed.
[0066] S105. If the user fails to respond to the message multiple times, skip this requirement query.
[0067] If the user fails to respond to the message multiple times, skip this requirement query. The requirements to be questioned in the dialogue template are all set with a threshold for the number of queries. If no valid requirement information is extracted from the user's answer, then this query is an invalid query. When the number of invalid queries reaches this threshold, it is considered that the user cannot answer this requirement, and the dialogue will skip this module and search for the next sub-module with a higher priority.
[0068] S106. Repeat steps S102 to S105 until a complete software description is obtained and the dialogue stops, or end the dialogue when no new information can be obtained.
[0069] Define each sub-module in the dialogue template as a sub-task. If the user completes a sub-task after several rounds of dialogue, this sub-task ends successfully. If the user answers off-topic multiple times, this sub-task will end directly and be skipped; complete each sub-task in turn according to the requirement priorities set in the dialogue template. After scanning the dialogue template, end the entire dialogue task. The dialogue task will also end if the user requests to stop the dialogue during the dialogue process.
[0070] S107. Generate a mind map and a software requirement document that meets the preset standards based on the information obtained.
[0071] The acquired information is used to generate a software requirements document that complies with ISO standards. The information collected in the conversation template is converted into a requirements document that includes software user roles, constraints, functional requirements, and non-functional requirements, all in the format of an ISO standard software specification. After the conversation concludes, the results are displayed in detail on the front end in the form of a mind map, visualizing the conversation process and content and facilitating user modification and updates.
[0072] The above method is explained in detail below with reference to the accompanying drawings and specific embodiments.
[0073] like Figure 1 As shown, this embodiment provides a method for automatically generating requirement documents based on human-computer interaction. In this embodiment, a pipeline-based human-computer interaction model is constructed, and intent recognition, entity extraction, and strategy selection are implemented in sequence in one process, and information is shared between modules to improve the accuracy of each dialogue round. First, in order to enable users to better understand the operation of the embodiment of the present invention, before the dialogue, the embodiment of the present invention uses a mind map to display the outline of the requirement information that needs to be interacted with the user, and gives simple prompts to guide users to propose customized software requirements. The method specifically includes the following steps:
[0074] The first step is to build a dialogue template and display it.
[0075] Construct a dialogue template based on the software requirement standard description made by ISO. In the dialogue template, clearly define the requirement name, priority, acquisition status, default value, question method, and invalid question count for different requirements, such as Figure 2 As shown in FIG. , the dialogue template is stored in a database in a fixed format, and the standard dialogue template corresponds to the software requirement document.
[0076] Before retrieving the conversation template, scan the template to check the formatting and priority accuracy of each submodule within it. Scanning the template retrieves the submodule content and location required for the current task based on the priority and status of the requirement. Filling the template with the updated requirement content based on the submodule path and updating the requirement retrieval status. Present the conversation template logic on the front-end as a mind map.
[0077] In the second step, the template is scanned to obtain the highest priority requirements that have not been obtained or are being obtained.
[0078] Traverse the template, select the highest priority requirement at the same level as the current task, return the path and sub-module information of the sub-module, build the problem based on the preset problems and requirement acquisition status in the sub-module, and return a response message to the user.
[0079] The third step is to extract demand information from user messages.
[0080] According to the characteristics of texts in the field of software description, the embodiments of the present invention give specific intents such as customizing software, describing entity relationships, describing functions, describing system users, asking about modeling definitions, describing compatibility, describing response time, describing security, describing stability, etc., as well as auxiliary dialogue intents such as confirmation, denial, etc. The pre-trained model of BERT is used to construct word vectors for the message text of the user, generate utterance embeddings, and after passing through a convolutional neural network, the output is input into a fully connected layer, and the output of the fully connected layer passes through Softmax to obtain the predicted user intent. When identifying the user intent, the embodiments of the present invention set a minimum confidence threshold, and the intent below this threshold will be classified as beyond the prediction range. When the user sends irrelevant chatter, the present invention will prompt the user to re-express.
[0081] According to the application field of this embodiment, a target entity is given, including system users, function names, software names, etc. Key requirement information and slot values are obtained by extracting named entities. The pre-trained model of BERT is used to construct word vectors of the user message, and the word vectors are used as the input of a bidirectional long short-term memory network to predict the label classification of each word. After being constrained by a conditional random field, accurate entity labels are obtained, and the obtained slot values are filled into the slots.
[0082] As Figure 3 shown, a keyword element table constructed according to the characteristics of texts in the software requirement field is used to extract keywords in the user message, such as "crash", "permission", etc. The keyword embeddings, utterance embeddings, slot values, user intent, and response action of the previous time step are concatenated to construct a dialogue state feature. Among them, the key entity feature does not express specific values. It only focuses on the category of the entity, whether the entity is obtained, and the confidence of the existence of the entity. At the first dialogue, the response action of the previous time step is defaulted to the action of waiting for the user message. The present invention creates a tracker for each user action to record information such as the text, intent, and entity of the user message and related confidence values, and the tracker will pass the information it records in this time step.
[0083] In the fourth step, select a response action, fill in the template, and construct a complete reply.
[0084] In the embodiment of the present invention, the dialogue state representation is put into a long short-term memory network to calculate the current historical dialogue state. After multiplying with the action mask, illegal actions are filtered out. After passing through a Softmax layer, it is normalized into a probability distribution, and the result with the highest probability is the response action. After selecting the correct response action, first fill in the template, and then construct a detailed and complete reply. Scan the template to obtain the sub-modules that need to be filled, fill the obtained information into the sub-modules, and update the state. If there is no valid requirement information in the user message, the number of invalid questions will be incremented by one. If the reply given by the robot to the user involves entities, the entities will be combined with the designed reply template to generate a complete reply, and the template of this reply is determined by the missing information in the dialogue template; if it is a response action that does not require supplementary information, directly reply with the corresponding reply template.
[0085] Step 5, complete the subtasks in sequence.
[0086] Repeat steps 2 to 4 until a complete software description is obtained and stop, or end the dialogue when no new information can be obtained. Complete each subtask in sequence according to the requirement priorities set in the dialogue template. When the user successfully completes a multi-round dialogue, this subtask will end. When the user answers off-topic multiple times, this subtask will be skipped. When the user requests to stop the dialogue, the entire dialogue task will end. When the scanning of the dialogue template is completed and no new information can be obtained, the dialogue ends and the entire dialogue task is completed.
[0087] Step 6, generate a software requirements document.
[0088] After the complete dialogue ends, the information collected will be generated into a text-based document in the format of a specified software requirements template. The embodiment of the present invention uses the standard of the ISO1998 software requirements specification document. The necessary information of the customized software will be shown in the document, and relevant modeling language pictures will be included, and text prompts will be given in the chapters that require manual addition of information. Finally, the embodiment of the present invention will also give a mind map to visually display the dialogue.
[0089] This embodiment also provides a device for automatically generating a requirements document based on human-computer interaction, including:
[0090] At least one processor;
[0091] At least one memory for storing at least one program;
[0092] When the at least one program is executed by the at least one processor, the at least one processor implements Figure 1 The method shown.
[0093] An apparatus for automatically generating a requirements document based on human-computer interaction according to this embodiment can execute a method for automatically generating a requirements document based on human-computer interaction provided in the method embodiment of the present invention, can execute any combination of the implementation steps of the method embodiment, and has the corresponding functions and beneficial effects of the method.
[0094] This application embodiment also discloses a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes Figure 1 the method shown.
[0095] This embodiment also provides a storage medium storing instructions or programs that can execute a method for automatically generating a requirements document based on human-computer interaction provided in the method embodiment of the present invention. When the instructions or programs are run, any combination of the implementation steps of the method embodiment can be executed, and the corresponding functions and beneficial effects of the method are provided.
[0096] In some alternative embodiments, the functions / operations mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the functions / operations involved, two consecutive blocks shown may actually be executed substantially simultaneously or the blocks can sometimes be executed in the reverse order. In addition, the embodiments presented and described in the flowcharts of the present invention are provided by way of example for the purpose of providing a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logical flows presented herein. Alternative embodiments are contemplated, in which the order of various operations is changed and the sub-operations described as part of a larger operation are executed independently.
[0097] Furthermore, although the present invention has been described in the context of functional modules, it should be understood that unless otherwise stated to the contrary, one or more of the functions and / or features may be integrated in a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It can also be understood that a detailed discussion of the actual implementation of each module is not necessary for understanding the present invention. More precisely, considering the attributes, functions, and internal relationships of the various functional modules in the devices disclosed herein, the actual implementation of the modules will be understood within the ordinary skills of an engineer. Therefore, those skilled in the art can implement the present invention as set forth in the claims without undue experimentation. It can also be understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0098] If the above-mentioned functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs, etc., which can store program codes of various kinds.
[0099] The logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a definite sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch instructions from the instruction execution system, apparatus, or device and execute the instructions), or in combination with these instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in combination with an instruction execution system, apparatus, or device.
[0100] More specific examples (non-exhaustive list) of computer-readable media include the following: electrical connection parts with one or more wirings (electronic devices), portable computer disk cartridges (magnetic devices), random access memories (RAMs), read-only memories (ROMs), erasable programmable read-only memories (EPROMs or flash memories), optical fiber devices, and portable compact disc read-only memories (CDROMs). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or, if necessary, other suitable processing, and then storing it in a computer memory.
[0101] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), and the like.
[0102] In the foregoing description of this specification, descriptions with reference to the terms "one embodiment / example", "another embodiment / example", or "certain embodiments / examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0103] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the claims and their equivalents.
[0104] The above has specifically described the preferred embodiments of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art can also make various equivalent deformations or substitutions without departing from the spirit of the present invention, and these equivalent deformations or substitutions are all included within the scope defined by the claims of this application.
Claims
1. An automatic generation method for requirement documents based on human-computer interaction, characterized in that, It includes the following steps: S1. Build a dialogue template corresponding to the software requirement document specification based on a preset standard; S2. Ask questions to the user according to the dialogue template and collect feedback information; S3. Extract the requirement information in the user's message according to the feedback information and predict the response action; S4. Fill the requirement information into the dialogue template in the response action and build a response message according to the requirement information; S5. Repeat steps S2 to S4 until the dialogue stops after obtaining a complete software description or ends when no new information can be obtained; S6. Generate a mind map and a software requirement document that meets the preset standard according to the information obtained; The step of extracting the requirement information in the user's message includes three steps: building a requirement keyword dictionary, extracting requirement keywords, and extracting the message theme; Among them, the step of building a requirement keyword dictionary includes: extracting high-frequency words in the requirement document, building keywords in the software requirement field, building keyword categories according to the text characteristics of the software requirement field, and building a keyword dictionary according to the keywords and keyword categories; The step of extracting requirement keywords includes: extracting keywords in the feedback information according to the prompts of the missing requirement information in the dialogue template and the requirement keyword dictionary; The step of extracting the message theme includes: classifying the message theme into different sub-modules of the dialogue template and fusing and extracting the user's message theme according to the keyword characteristics; Use the characteristics of the user's message theme, keywords, and sentence text as the input for predicting the response action to obtain an accurate response action for the user's message.
2. The automatic generation method of a requirements document based on human-computer interaction according to claim 1, characterized in that The dialogue template consists of different sub-modules. In each sub-module, the requirement name, priority, acquisition status, default value, questioning method, and invalid questioning times are marked for different requirements. The set of all sub-modules corresponds to the complete software requirement document; Among them, in each round of dialogue, one sub-module in the dialogue template is obtained for questioning.
3. The automatic generation method of a requirement document based on human-computer interaction according to claim 2, characterized in that, The step S2 specifically includes: Scan the dialogue template to obtain the sub-module with the highest priority and the status of the sub-module is unfilled or being filled; Ask questions to the user according to the obtained sub-module and collect the user's feedback information; Among them, the complete dialogue task is divided into multiple subtasks, and the goal of each subtask is to fill a sub-module of the dialogue template.
4. A method for automatically generating a requirements document based on human-computer interaction according to claim 1, characterized in that, The step S4 includes: Build a question-based response or a knowledge retrieval-based response according to the message theme.
5. The automatic generation method of a requirements document based on human-computer interaction according to claim 4, characterized in that The step of building a question-based response includes: Scan the dialogue template to obtain the sub-module to be filled, fill the requirement information into the sub-module, and update the information acquisition status of the sub-module; Rescan the dialogue template and build a response text according to the sub-module or the next-priority sub-module. If the information of the sub-module is too short, supplementary questions are asked for the sub-module, otherwise the next-priority sub-module is searched; The step of building a knowledge retrieval-based response includes: Retrieve the knowledge requested by the user in the built knowledge database of software requirements according to the keywords, use the retrieved data as the response text, and require the dialogue state to roll back to before this round of dialogue after building the response.
6. The automatic generation method of a requirements document based on human-computer interaction according to claim 1, wherein The step S4 also includes the following steps: Set the threshold for the number of inquiries in the dialogue template. When it is detected that the number of invalid inquiries reaches the threshold for the number of inquiries, it is determined that the user cannot answer the requirement, and the dialogue will skip the sub-module and search for the next-priority sub-module.
7. A method for automatically generating a requirements document based on human-computer interaction according to claim 1, characterized in that The step S5 includes: Define each sub-module in the dialogue template as a sub-task, and complete a sub-task after several rounds of dialogue; For a sub-task, if a valid answer cannot be obtained multiple times, directly end and skip this sub-task; If the scanning of the dialogue template ends and no new information can be obtained, end the entire dialogue task; If the user requests to stop the dialogue during the dialogue process, end the entire dialogue task.
8. An automatic requirement document generation device based on human-computer interaction, characterized in that, It includes: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1-7.
9. A computer-readable storage medium storing a program executable by a processor, characterized in that, The program executable by the processor is used to execute the method according to any one of claims 1-7 when executed by the processor.
Citation Information
Patent Citations
Automatic analysis modeling method, system and device based on text cognition and medium
CN112579444A
Assisting users of chat session to participate in chat session
US20200125632A1