Question and answer pair generation method, electronic equipment, readable storage medium and program product
By automatically generating question-and-answer pairs through human-computer collaboration and using a neural network model to automatically select and adjust context fragments, the problems of low efficiency and high cost in existing technologies are solved, and efficient and accurate question-and-answer pair generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-12
- Publication Date
- 2026-04-14
AI Technical Summary
In existing technologies, question-answering pair generation relies on manual identification of questions, context positioning, and answer writing, resulting in low efficiency and high cost.
The system employs a human-machine collaboration approach, where the machine automatically generates questions and contextual fragments, while human supervision and adjustments are made. Question-answer pairs are generated through a neural network model, achieving automation and quality control.
It improves the efficiency of question-answer pair generation, reduces costs, and enhances the accuracy and reliability of question-answer pairs, while supporting flexible neural network model upgrades and modular design.
Smart Images

Figure CN121860032A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to a question-and-answer pair generation method, an electronic device, a readable storage medium, and a computer program product. Background Technology
[0002] In fields such as knowledge engineering, intelligent question answering systems, and machine learning training data construction, high-quality question-answer pairs are an important foundation for model training and application implementation.
[0003] In related technologies, generating question-answer pairs requires manual identification of questions from massive amounts of documents, manual location of context, and manual writing of answers. Due to its heavy reliance on human intervention, question-answer pair generation is inefficient and costly. Summary of the Invention
[0004] This disclosure provides a question-and-answer pair generation method, an electronic device, a readable storage medium, and a computer program product.
[0005] According to one aspect of this disclosure, a question-answer pair generation method is provided, comprising: determining a question-answer pair and a context fragment associated with a question in the question-answer pair from a structured document; displaying the structured document, the question-answer pair, and the context fragment; determining an adjusted context fragment in response to receiving an adjustment operation for the displayed context fragment; regenerating an answer based on the question and the adjusted context fragment using a first neural network model to obtain an adjusted answer; and generating a target question-answer pair based on the question and the adjusted answer.
[0006] According to one technical solution, by automatically extracting question-and-answer pairs and their related context fragments, and displaying the structured document along with the extracted question-and-answer pairs and context fragments, opportunities for human intervention in question-and-answer pair generation are provided. Furthermore, if an adjustment operation for the context fragments is received, a target question-and-answer pair is generated based on the question and the adjusted context fragments. Thus, a human-machine collaborative approach is adopted, with the machine automatically generating questions, automatically selecting context fragments, and automatically writing answers, while humans supervise the machine-selected context fragments and adjust them as needed. This reduces the workload of manually generating questions, manually selecting context fragments, and manually writing answers, improving the efficiency of question-and-answer pair generation and saving costs. Simultaneously, because humans participate in the decision-making process of question-and-answer pair generation, the quality of the generated question-and-answer pairs can be controlled, thereby improving the accuracy and reliability of the generated question-and-answer pairs.
[0007] According to a question-answer pair generation method of at least one embodiment of the present disclosure, the context fragment includes a plurality of different first fragments, a plurality of different second fragments, and a plurality of different third fragments, wherein the first fragment is the source fragment of the question in the structured document, the second fragment is a fragment in the structured document related to the question, and the third fragment is a fragment among the plurality of different second fragments predicted to be used to generate an answer to the question.
[0008] According to the technical solution of this embodiment, by identifying different types of fragments from a structured document, it is helpful to accurately locate text content of different functional types in the structured document, thereby providing data support for subsequent visualization, user adjustment and other operations.
[0009] According to at least one embodiment of the question-answer pair generation method of this disclosure, determining question-answer pairs and context fragments associated with questions in the question-answer pairs from a structured document includes: inputting the structured document, a pre-obtained question template, and a first prompt word into a second neural network model; generating question-answer pairs and the first fragment by the second neural network model based on the structured document, the question template, and the first prompt word; and inputting the structured document and the question in the question-answer pair into a third neural network model; performing context prediction by the third neural network model based on the question and the structured document to obtain the second fragment and the third fragment.
[0010] According to the technical solution of this embodiment, a second neural network model generates question-answer pairs and determines the first segment (i.e., the question source segment), while a third neural network model predicts the second segment (i.e., the question-related segment) and the third segment (i.e., the answer supporting segment). This decouples generation and inference, improves the modularity and maintainability of the question-answer pair generation process, and supports flexible replacement or upgrading of any neural network model without affecting the overall process. Simultaneously, it avoids the problems of high training difficulty and low accuracy caused by all information being output by the same neural network model.
[0011] According to at least one embodiment of the question-answer pair generation method of this disclosure, the adjusted context fragment includes an adjusted third fragment; after generating a target question-answer pair based on the question and the adjusted answer, the method further includes: taking the question, the structured document, the second fragment, and the third fragment as input, and using the adjusted third fragment as a supervision target, fine-tuning the third neural network model.
[0012] According to the technical solution of this embodiment, the third neural network model is fine-tuned through questions, structured documents, second segments, third segments, and adjusted third segments, realizing a closed-loop feedback learning mechanism. This mechanism enables the third neural network model to continuously learn user preferences and adjustment behaviors, evolving from a passive tool into an active learning intelligent partner, gradually improving its prediction accuracy of context segments through adaptive optimization. Long-term use can significantly reduce the frequency of manual intervention, lower future manual intervention costs, improve the accuracy of automated generation, and solve the problem of insufficient learning capacity.
[0013] According to at least one embodiment of the question-answer pair generation method of this disclosure, displaying the structured document, the question-answer pair, and the context fragment includes: displaying the structured document in a first area of an interactive interface and highlighting the first fragment and the second fragment in the structured document; displaying the question in the question-answer pair in a second area of the interactive interface; and in response to receiving a selection operation for the question, displaying the answer in the question-answer pair and the third fragment in a third area of the interactive interface.
[0014] According to the technical solution of this embodiment, by displaying structured documents, questions, answers and related context fragments in different areas in the interactive interface, and highlighting the first and second fragments, a hierarchical presentation and intuitive navigation of information is achieved. Users can quickly understand the source of the question, related content and the basis of the answer in the same view, which reduces the cognitive burden of humans and improves the accuracy and efficiency of users in adjusting the third fragment. It is especially suitable for question-and-answer pair review and editing tasks in complex document scenarios.
[0015] According to a question-and-answer pair generation method of at least one embodiment of the present disclosure, the adjusted context fragment includes an adjusted third fragment; in response to receiving an adjustment operation for the displayed context fragment, determining the adjusted context fragment includes: in response to receiving a deletion operation for a third fragment in the third region, deleting the third fragment corresponding to the deletion operation in the third region; in response to receiving a selection operation for a first fragment or a second fragment in the first region, treating the selected fragment as a newly added third fragment and displaying the selected fragment in the third region; and treating the third fragment in the third region as the adjusted third fragment.
[0016] According to the technical solution of this embodiment, users can directly adjust the third segment used to generate the answer by deleting the original third segment and adding a new third segment. This gives users complete control over the basis for answer generation, realizes the ability to finely edit the third segment, and avoids irrelevant or erroneous information interfering with answer generation. At the same time, during the process of adjusting the third segment, dynamic and real-time visual feedback is provided by adjusting the displayed content in the third area, making user operation more intuitive and improving the flexibility and accuracy of human-computer collaboration.
[0017] According to at least one embodiment of the question-answer pair generation method of this disclosure, an adjusted answer is obtained by regenerating the answer based on the question and the adjusted context fragment through a first neural network model. The method includes: upon receiving an answer adjustment request, inputting the question, the adjusted context fragment, and a pre-obtained second prompt word into the first neural network model, and regenerating the answer based on the question, the adjusted context fragment, and the second prompt word through the first neural network model to obtain the adjusted answer.
[0018] According to the technical solution of this embodiment, when an answer adjustment request is received, the first neural network model regenerates the answer based on the question, the adjusted context fragment, and the second prompt word, and uses the regenerated answer as the adjusted answer, thereby improving the intelligence of the answer adjustment and making the adjusted answer as consistent as possible with the content of the adjusted context fragment, reducing the workload of subsequent manual correction of the answer.
[0019] According to at least one embodiment of the question-answer pair generation method of this disclosure, while outputting the adjusted answer, the first neural network model also outputs a fourth segment and the confidence level of the fourth segment, wherein the fourth segment is a segment in the adjusted context segment associated with a first object in the adjusted answer, and the first object includes one or more of sentences, phrases, and keywords; generating a target question-answer pair based on the question and the adjusted answer includes: detecting whether there is a second object in the adjusted answer, wherein the second object is a first object in the adjusted answer that is not associated with the fourth segment or whose confidence level of the associated fourth segment is less than a confidence level threshold; if so, highlighting the second object in the adjusted answer while displaying the adjusted answer; determining a corrected answer in response to receiving a correction operation for the adjusted answer; and associating the question with the corrected answer to obtain the target question-answer pair.
[0020] According to the technical solution of this embodiment, by using the source fragment (i.e., the fourth fragment) and the confidence level of the source fragment of the first object in the adjusted answer output by the third neural network model, fine-grained source tracing and confidence evaluation are performed on the first object in the adjusted answer. Furthermore, first objects lacking a source or with low confidence (i.e., the second object) are highlighted to support subsequent answer correction operations. This improves the accuracy and contextual consistency of the obtained target question-answer pairs, effectively suppresses illusions, and allows the target question-answer pairs to be directly used to train downstream high-precision models or as a basis for key business decisions.
[0021] According to at least one embodiment of the question-answer pair generation method of this disclosure, after determining the corrected answer, the method further includes: taking the question, the answer, the adjusted answer, the structured document, the adjusted context fragment, and the pre-obtained third prompt word as input, and using the corrected answer as the supervision target, fine-tuning the first neural network model.
[0022] According to the technical solution of this embodiment, the first neural network model is fine-tuned through questions, answers, adjusted answers, structured documents, adjusted context fragments, third prompt words, and corrected answers, realizing a multimodal feedback learning mechanism. This mechanism enables the first neural network model to continuously learn the language expression habits and error correction logic of human experts, evolving from a passive tool into an active learning intelligent partner, gradually improving the accuracy of its output answers through adaptive optimization. Long-term use can significantly reduce the frequency of human intervention, lower future human intervention costs, improve the accuracy of automated generation, and solve the problem of insufficient learning ability.
[0023] According to at least one embodiment of the question-answer pair generation method of this disclosure, after generating target question-answer pairs based on the question and the adjusted answer, the method further includes: obtaining multiple different target question-answer pairs; comparing the questions of different target question-answer pairs to determine multiple target question-answer pairs with similar questions; comparing the answers of the multiple target question-answer pairs with similar questions; and issuing an alarm for the multiple target question-answer pairs with similar questions if the answers are inconsistent.
[0024] According to the technical solution of this embodiment, by comparing the question similarity and checking the answer consistency of multiple target question-answer pairs, the quality consistency control of cross-question-answer pairs is realized. It can effectively discover contradictory questions and answers caused by contextual differences, model fluctuations or human errors, prevent logical conflicts within the knowledge base, and ensure the accuracy and credibility of the final constructed knowledge system.
[0025] According to another aspect of this disclosure, an electronic device is provided, comprising: a memory storing a computer program; and a processor executing the computer program stored in the memory, such that the processor performs a question-and-answer pair generation method according to any embodiment of this disclosure.
[0026] According to another aspect of this disclosure, a readable storage medium is provided, wherein a computer program is stored therein, which, when executed by a processor, is used to implement the question-answer pair generation method of any embodiment of this disclosure.
[0027] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements a question-answer pair generation method according to any embodiment of this disclosure. Attached Figure Description
[0028] The accompanying drawings illustrate exemplary embodiments of the present disclosure and, together with the description thereof, serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.
[0029] Figure 1 This is a flowchart illustrating a question-and-answer pair generation method according to one embodiment of the present disclosure.
[0030] Figure 2 This is a schematic diagram illustrating the process of determining question-and-answer pairs and context fragments according to one embodiment of this disclosure.
[0031] Figure 3 This is a schematic diagram illustrating the process of displaying structured documents, question-and-answer pairs, and context fragments according to one embodiment of the present disclosure.
[0032] Figure 4 This is a visual example diagram of an interactive interface according to one embodiment of the present disclosure.
[0033] Figure 5 This is a schematic diagram illustrating the process of adjusting a context fragment according to one embodiment of the present disclosure.
[0034] Figure 6 This is a schematic diagram illustrating the process of generating target question-and-answer pairs according to one embodiment of the present disclosure.
[0035] Figure 7 This is a schematic diagram illustrating the process of comparing different target question-and-answer pairs according to one embodiment of the present disclosure.
[0036] Figure 8 This is a flowchart illustrating a question-and-answer pair generation method according to another embodiment of the present disclosure.
[0037] Figure 9 This is a schematic structural block diagram of a question-and-answer pair generation device according to one embodiment of the present disclosure.
[0038] Figure 10 This is a schematic block diagram of an electronic device according to one embodiment of the present disclosure. Detailed Implementation
[0039] The present disclosure will now be described in further detail with reference to the accompanying drawings and examples. It should be understood that the specific examples described herein are for illustrative purposes only and are not intended to limit the scope of the disclosure. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present disclosure are shown in the accompanying drawings.
[0040] It should be noted that, where there is no conflict, the embodiments and features described in this disclosure can be combined with each other. The technical solutions of this disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0041] Generating question-answer pairs requires the use of a massive amount of documents. If the generation of question-answer pairs is entirely dependent on manual methods, then it would require manual reading of a massive amount of documents, manual identification of questions from the massive amount of documents, manual location of the context fragments of each question, and manual writing of the answers based on the context fragments. This would result in low efficiency and high cost in generating question-answer pairs.
[0042] To address this, this disclosure proposes the following technical solution, which employs a human-machine collaborative approach. The machine automatically generates questions, selects context fragments, and writes answers, while a human monitors the machine-selected context fragments and adjusts them as needed. This reduces the workload of manually generating questions, selecting context fragments, and writing answers, improving the efficiency of question-and-answer pair generation and saving costs. Furthermore, because humans participate in the decision-making process during question-and-answer pair generation, the quality of the generated pairs can be controlled, resulting in higher accuracy and reliability.
[0043] The question-answer pair generation method disclosed herein can automatically generate accurate target question-answer pairs through human-computer collaboration. In this disclosure, electronic devices include, but are not limited to, mobile phones, tablets, laptops, personal computers, wearable devices, and ATMs.
[0044] Figure 1 A schematic diagram illustrating the overall flow of a question-and-answer pair generation method according to one embodiment of this disclosure is shown. Figure 1 The method M100 shown includes steps S110 to S150. This method can be executed by electronic devices such as mobile phones and tablets.
[0045] In step S110, question-answer pairs and context fragments associated with the questions in the question-answer pairs are determined from the structured document.
[0046] As one possible implementation, structured documents can be obtained by parsing unstructured documents uploaded by users. Unstructured documents can be in PDF, TXT, or HTML format. Structured documents can be in DOM tree format. The method for parsing unstructured documents into structured documents can be implemented using existing parsing algorithms, and is not limited thereto.
[0047] As another possible implementation, structured documents can be documents directly uploaded by users.
[0048] Question-answer pairs can be extracted from structured documents. The contextual fragments associated with the questions in a question-answer pair are fragments in the structured document, which may include multiple fragments.
[0049] In step S120, the structured document, question-and-answer pairs, and context fragments are displayed.
[0050] Since the question-and-answer pairs and context fragments are automatically generated and may contain errors, displaying the structured document, question-and-answer pairs, and context fragments after obtaining them allows users to easily verify them. This human-computer interaction method helps ensure the accuracy of the final generated question-and-answer pairs.
[0051] Structured documents, question-and-answer pairs, and contextual fragments can be displayed simultaneously or in a pre-set order; there is no limitation on this.
[0052] Considering the limited display area of the interactive interface, and that the display area required by the structured document, question-and-answer pairs, and context fragments may exceed the display area of the interactive interface, at least one of the structured document, question-and-answer pairs, and context fragments can be displayed in pages.
[0053] In step S130, in response to receiving an adjustment operation for the displayed context fragment, the adjusted context fragment is determined.
[0054] Adjustment operations may include deletion and / or addition. For example, a user can input adjustment operations for a displayed context segment via an interactive interface. Because adjustment operations characterize the specific context segment being adjusted, the adjusted context segment can be clearly identified after the adjustment operation is performed.
[0055] The adjusted context fragments can also be displayed, making it easier for users to check the adjustment results.
[0056] In step S140, the first neural network model regenerates the answer based on the question and the adjusted context fragment, thus obtaining the adjusted answer.
[0057] Since the context fragment is associated with the question in the question-answer pair, and the context fragment can be used to generate the answer corresponding to the question, after the context fragment is adjusted, regenerating the answer based on the question and the adjusted context fragment can yield a more accurate adjusted answer compared to the original answer, thereby improving the accuracy of the target question-answer pair generated subsequently.
[0058] The structure of the first neural network model disclosed herein can be any existing neural network model, such as deep learning-based neural network models, shallow neural network models, etc., all of which fall within the protection scope of this disclosure. Preferably, the first neural network model disclosed herein is a large language model.
[0059] The adjusted answer can be obtained by adding new content, deleting old content, or modifying old content, based on the answer in the question-and-answer pair.
[0060] The adjusted answer can be displayed, allowing users to easily verify the results. During the display of the adjusted answer, the original answer can be hidden.
[0061] In step S150, a target question-answer pair is generated based on the question and the adjusted answer.
[0062] For example, if no correction action is received for the adjusted answer, the question and the adjusted answer can be directly associated to generate a target question-answer pair. If a correction action is received for the adjusted answer, the question and the corrected answer can be associated to generate a target question-answer pair.
[0063] In some implementations, if no adjustment operation for the context segment is received, and no correction operation for the answer or the adjusted answer is received, the question-answer pair in step S110 can be directly used as the target question-answer pair.
[0064] The question-and-answer pair generation method of this disclosure automatically extracts question-and-answer pairs and their related context fragments, and displays the structured document along with the extracted question-and-answer pairs and context fragments. This provides an opportunity for human intervention in the generation of question-and-answer pairs. Furthermore, if an adjustment operation for the context fragments is received, a target question-and-answer pair is generated based on the question and the adjusted context fragments. Thus, a human-machine collaborative approach is adopted, with the machine automatically generating questions, automatically selecting context fragments, and automatically writing answers, while humans supervise the machine-selected context fragments and adjust them when necessary. This reduces the workload of manually generating questions, manually selecting context fragments, and manually writing answers, improving the efficiency of question-and-answer pair generation and saving costs. Simultaneously, because humans participate in the decision-making process of question-and-answer pair generation, the quality of the generated question-and-answer pairs can be controlled, thereby improving the accuracy and reliability of the generated question-and-answer pairs.
[0065] In some embodiments of this disclosure, the context fragment includes multiple different first fragments, multiple different second fragments, and multiple different third fragments, wherein the first fragment is the source fragment of the question in the structured document, the second fragment is the fragment in the structured document related to the question, and the third fragment is the fragment among the multiple different second fragments that is predicted to be used to generate the answer to the question.
[0066] For example, the question in the question-answer pair is extracted from the first segment.
[0067] The second segment can be obtained by retrieving segments from the structured document using keywords from the question. For example, named entity recognition can be performed on the question, and the identified named entities can be used as keywords. Then, the keywords can be matched with each segment in the structured document, and the segments in the structured document containing the keyword can be used as the second segment.
[0068] Although multiple second fragments are related to the keywords in the question, some of them may be irrelevant to the correct answer, meaning the correct answer doesn't need to be extracted from those fragments. The remaining second fragments may be relevant to the correct answer, meaning the correct answer needs to be extracted from them. Therefore, these remaining fragments can be considered third fragments, thus guiding the generation of the correct answer to some extent. Furthermore, since the third fragment represents the minimum set of fragments required to generate the answer, adjusting the context fragments can be equivalent to adjusting the third fragment, allowing subsequent adjustments to the answer to be made directly based on the adjusted third fragment.
[0069] The question-and-answer pair generation method described above helps to accurately locate text content of different functional types in a structured document by identifying different types of fragments from the document, thereby providing data support for subsequent visualization, user adjustments, and other operations.
[0070] Regarding step S110, in some embodiments of this disclosure, it may include, for example... Figure 2 Steps S111 and S112 are shown.
[0071] In step S111, the structured document, the pre-obtained question template, and the first prompt word are input into the second neural network model. The second neural network model generates question-answer pairs based on the structured document, the question template, and the first prompt word, resulting in question-answer pairs and the first segment.
[0072] Question templates can be used to provide examples of question structure, composition, and other information. Question templates and initial prompts can be customized to meet specific needs.
[0073] The structure of the second neural network model disclosed herein can be any existing neural network model, such as deep learning-based neural network models, shallow neural network models, etc., all of which fall within the protection scope of this disclosure. Preferably, the second neural network model of this disclosure is a large language model. The second neural network model and the first neural network model can be the same model.
[0074] The input to the second neural network model can be a structured document, a question template, and a first prompt word. The output can be the location information of the first segment in the structured document and a question-answer pair. It can be understood that after determining the location information of the first segment in the structured document, the specific first segment can be located using that location information.
[0075] In step S112, the structured document and the questions in the question-answer pair are input into the third neural network model. The third neural network model performs context prediction based on the questions and the structured document to obtain the second segment and the third segment.
[0076] The structure of the third neural network model disclosed herein can be any existing neural network model, such as deep learning-based neural network models, shallow neural network models, etc., all of which fall within the protection scope of this disclosure. The third neural network model may differ from both the second and first neural network models.
[0077] The input to the third neural network model can be a structured document and a question-answering pair, and the output can be the location information of the second and third segments in the structured document. It can be understood that after determining the location information of the second and third segments in the structured document, the specific second and third segments can be located using this location information.
[0078] For example, a structured document includes multiple segments and corresponding titles and / or indexes for each segment, whereby the titles and / or indexes can characterize the positional information of the segments within the structured document.
[0079] The question-answer pair generation method described above generates question-answer pairs and determines the first segment (i.e., the question source segment) through a second neural network model, and predicts the second segment (i.e., the question-related segment) and the third segment (i.e., the answer supporting segment) through a third neural network model. This decouples generation and inference, improves the modularity and maintainability of the question-answer pair generation process, and supports flexible replacement or upgrading of any neural network model without affecting the overall process. Simultaneously, it avoids the problems of high training difficulty and low accuracy caused by all information being output by the same neural network model.
[0080] In some embodiments of this disclosure, the adjusted context fragment includes the adjusted third fragment; correspondingly, after step S150, the process may further include: fine-tuning the third neural network model by taking the question, the structured document, the second fragment, and the third fragment as inputs and using the adjusted third fragment as the supervision target.
[0081] For example, specific behavioral patterns of users selecting, excluding, or adjusting the third segment can be recorded under different question types, including but not limited to the question, structured document, second segment, third segment, and adjusted third segment. For instance, for "definition" questions, users always select only the first segment; for "list" questions, users always combine multiple scattered segments. These behavioral patterns can be used to fine-tune the third neural network model or as features to optimize the context segment selection algorithm during the initial automatic generation of question-answer pairs. In this way, when encountering similar questions again, the third neural network model can more intelligently and accurately recommend or select context segments automatically. The third neural network model can learn which types of segments users tend to select for a certain type of question, how to filter redundant information, or how to combine multiple scattered segments. The input to the fine-tuned third neural network model during use is still the structured document and the question in the question-answer pair, and the output is still the position information of the second and third segments in the structured document.
[0082] The question-and-answer pair generation method described above fine-tunes the third neural network model using questions, structured documents, second fragments, third fragments, and adjusted third fragments, achieving a closed-loop feedback learning mechanism. This mechanism enables the third neural network model to continuously learn user preferences and adjust behaviors, evolving from a passive tool into an active learning intelligent partner. Through adaptive optimization, it gradually improves the prediction accuracy of its context fragments. Long-term use can significantly reduce the frequency of human intervention, lower future human intervention costs, improve the accuracy of automated generation, and solve the problem of insufficient learning capacity.
[0083] Regarding step S120, in some embodiments of this disclosure, it may include, for example... Figure 3 Steps S121 to S123 are shown.
[0084] In step S121, a structured document is displayed in the first area of the interactive interface, and the first and second segments are highlighted in the structured document.
[0085] Since the first and second segments are both question-related segments in the structured document, highlighting the first and second segments while displaying the structured document allows users to quickly understand the contextual information related to the question while reading the document. This guides users in adjusting the third segment, enabling them to select the most suitable third segment for generating the answer more efficiently and accurately. This reduces model illusions and low-quality answers caused by insufficient or redundant third segments, and shifts human-computer collaboration from passive verification to active guidance.
[0086] The interactive interface can be implemented through the touch screen of an electronic device or other hardware facilities.
[0087] Highlighting the first and second segments can be achieved by altering their display through one or more methods, such as labeling, increasing font size, changing the text's color, and changing the background color of the area containing the text. This allows the first and second segments in the structured document to have a different display effect than other segments in the document. The highlighting methods used for the first and second segments can be different, or the same method with different effects. For example, the background color of the area containing the first segment can be set to red, while the background color of the area containing the second segment can be set to yellow, making it easier for users to distinguish between the first and second segments.
[0088] Considering the possibility that the first and second segments might be the same segment, to avoid logical conflicts in highlighting, different highlighting priorities for different segment types can be pre-set. Then, when the first and second segments are the same, the field can be highlighted using the highlighting method of the segment with the highest priority, instead of the highlighting method of the segment with lower priority. For example, if the highlighting method for the first segment is to set the background color of its area to red, and the highlighting method for the second segment is to set the background color of its area to yellow, and the highlighting priority of the first segment is higher than that of the second segment, then when the first and second segments are the same, the field's background color will be red instead of yellow during display.
[0089] In step S122, the questions in the question-and-answer pair are displayed in the second area of the interactive interface.
[0090] In step S123, in response to receiving a selection operation for the question, the answer and the third segment of the question-answer pair are displayed in the third area of the interactive interface.
[0091] The selection action can include one or more of the following: single click, double click, selection box, and voice confirmation.
[0092] The first, second, and third areas can be different display areas. A structured document may contain multiple question-answer pairs. Displaying all of these pairs would occupy a large display area. Therefore, the questions from multiple question-answer pairs can be grouped together in the second area of the interactive interface for easy viewing. Furthermore, if a user selects a question in the second area, the answer and third fragment corresponding to the selected question can be displayed in the third area. The answers and third fragments for unselected questions will not be displayed in the third area initially. The third area can display the answer and third fragment for one selected question at a time, thus providing a larger display area for the currently selected question's answer and third fragment, making it easier for the user to view. Additionally, the third area can also display only the position information of the third fragment instead of the complete third fragment.
[0093] If a selection operation is detected targeting the third segment displayed in the third area, or the location information of the third segment, or the positioning control associated with the third segment, the display content of the first area can be adjusted to the third segment and / or the context of the third segment in the structured document. This allows users to more accurately and conveniently verify the source and relevance of the third segment, ensuring the traceability and accuracy of the subsequently generated answers.
[0094] Please combine Figure 4 In one example, the first area is the right side of the interactive interface, the second area is the left side of the interactive interface, and the third area is the middle area of the interactive interface.
[0095] The second area displays all questions related to the currently being processed document. Upon initial document loading, a series of question-and-answer pairs can be automatically generated using a second neural network model. The questions within these pairs are displayed in the second area. These automatically generated pairs can serve as a starting point for manual optimization, thus simplifying the workload of starting from scratch. Users can also manually add new questions by clicking the "Add New Question" control in the second area.
[0096] The third area displays a third fragment and answer related to the currently selected question. Regardless of whether the selected question is automatically generated by the second neural network model or manually entered, the third area displays at least one third fragment predicted by the third neural network model to be associated with the selected question. Each third fragment in the third area also has a delete control and a positioning control. When the delete control is triggered, the third fragment bound to it is automatically deleted from the third area. When the positioning control is triggered, the context of the third fragment bound to it is automatically displayed in the first area. This visual interaction allows users to intuitively understand the document's layout and content hierarchy, enabling them to accurately select the third fragment most useful for answering the question.
[0097] The third area also includes the first neural network model request control. Figure 4 (Not shown in the image), upon detecting that a request control has been triggered, the pre-obtained second prompt word, the question, and the third segment (i.e., the adjusted third segment) that can be displayed in the third area are input into the first neural network model. The first neural network model regenerates the answer and uses the regenerated answer as the adjusted answer. Initially, the answer displayed in the third area may be the answer in the question-answer pair of the selected question. After the user adjusts the third segment and triggers the answer adjustment, the answer displayed in the third area will switch to the adjusted answer. Subsequently, if the user corrects the adjusted answer, the answer displayed in the third area will switch to the corrected answer. Thus, the user can review, edit, and optimize the answer in the third area to ensure its accuracy, clarity, and completeness.
[0098] The first area displays the unstructured source document in a structured Document Object Model (DOM). The DOM can be understood as the "skeleton" or "table of contents" of the unstructured document, breaking down its content into logically hierarchical elements such as headings, paragraphs, sentences, lists, tables, or charts. When a selected segment is detected in the first area, it is designated as the third segment and displayed in the third area. This visual interaction allows users to intuitively understand the document's layout and content hierarchy, enabling them to accurately select the third segment most relevant to answering the question.
[0099] The question-and-answer pair generation method described above achieves hierarchical presentation and intuitive navigation of information by displaying structured documents, questions, answers, and related context fragments in different areas of the interactive interface, and highlighting the first and second fragments. Users can quickly understand the source of the question, related content, and the basis of the answer in the same view, reducing the cognitive burden on humans and improving the accuracy and efficiency of users adjusting the third fragment. It is especially suitable for question-and-answer pair review and editing tasks in complex document scenarios.
[0100] Regarding step S130, in some embodiments of this disclosure, the adjusted context fragment includes the adjusted third fragment; correspondingly, step S130 may include, for example... Figure 5 Steps S131 to S133 are shown.
[0101] In step S131, in response to receiving a deletion operation for a third segment in the third region, the third segment corresponding to the deletion operation is deleted from the third region.
[0102] For example, the third area may display a delete control corresponding to each third segment, and then when the delete control is detected to be triggered, it can be determined that a delete operation has been received for the third segment in the third area.
[0103] In step S132, in response to receiving a selection operation for a first segment or a second segment in the first region, the selected segment is added as a third segment and displayed in the third region.
[0104] The selection action can include one or more of the following: single click, double click, selection box, and voice confirmation.
[0105] When any segment other than the first and second segments is selected in the first area, it can also be displayed as a newly added third segment in the third area.
[0106] For example, the semantic similarity between the selected segment and the third segment can be calculated. If the semantic similarity is greater than a first similarity threshold, a message indicating high redundancy between the selected segment and the third segment is displayed. If the semantic similarity is less than a second similarity threshold, a semantic conflict between the selected segment and the third segment is indicated, thus facilitating user adjustment of the selected segment and improving the accuracy and conciseness of the adjusted third segment. The second similarity threshold is less than the first similarity threshold, and both the second and first similarity thresholds can be set according to requirements.
[0107] In step S133, the third segment in the third region is taken as the adjusted third segment.
[0108] When the adjustment operation stops, the third segment that can be displayed in the third area is the adjusted third segment, including the original segment that was not deleted and the newly added segment.
[0109] The question-and-answer pair generation method described above allows users to directly adjust the third segment used to generate the answer by deleting existing third segments or adding new ones. This gives users complete control over the basis for answer generation, enabling fine-grained editing of the third segment and preventing irrelevant or erroneous information from interfering with answer generation. Simultaneously, during the user's adjustment of the third segment, dynamic and real-time visual feedback is provided by adjusting the displayed content in the third area, making user operation more intuitive and improving the flexibility and accuracy of human-computer collaboration.
[0110] Regarding step S140, in some embodiments of this disclosure, it may include: upon receiving an answer adjustment request, inputting the question, the adjusted context fragment, and the pre-obtained second prompt word into a first neural network model, and regenerating the answer through the first neural network model based on the question, the adjusted context fragment, and the second prompt word to obtain the adjusted answer.
[0111] For example, the interactive interface may provide a first neural network model request control. Upon detecting that this request control has been triggered, it can be determined that an answer adjustment request has been received. The second prompt word can be set as needed.
[0112] The input to the first neural network model can be the question, the adjusted third segment, and the second prompt word, and the output can be the adjusted answer.
[0113] The question-answer pair generation method described above, upon receiving an answer adjustment request, regenerates the answer using a first neural network model based on the question, the adjusted context fragment, and the second prompt word, and uses the regenerated answer as the adjusted answer. This enhances the intelligence of the answer adjustment, ensuring that the adjusted answer is as consistent as possible with the content of the adjusted context fragment, and reducing the workload of subsequent manual correction of the answer.
[0114] Regarding step S150, in some embodiments of this disclosure, while outputting the adjusted answer, the first neural network model also outputs a fourth segment and the confidence level of the fourth segment. The fourth segment is a segment in the adjusted context segment that is associated with a first object in the adjusted answer. The first object includes one or more of sentences, phrases, and keywords. Accordingly, step S150 may include, for example, Figure 6 Steps S151 to S154 are shown.
[0115] For example, the first neural network model needs to fully understand the adjusted third segment in the process of generating the adjusted answer. Therefore, the first neural network model can know which segments of the adjusted third segment each first object in the adjusted answer depends on. Thus, when it outputs the adjusted answer, it can output the segments of the adjusted third segment that each first object in the adjusted answer depends on as the fourth segment.
[0116] For example, while displaying the adjusted answer in the interactive interface, the fourth segment and its confidence level can also be highlighted in the displayed adjusted third segment, facilitating subsequent correction of the adjusted answer by the user. Highlighting the fourth segment can be achieved by altering its display effect through one or more methods, such as labeling, increasing the font size, changing the text's own color, and changing the background color of the area where the text is located. This results in the fourth segment in the adjusted third segment having a different display effect than the other segments in the adjusted third segment. The highlighting methods used for the first, second, and fourth segments can be different, or the methods can be the same but with different effects. Highlighting the confidence level of the fourth segment can be achieved by labeling it near the fourth segment.
[0117] In step S151, it is detected whether there is a second object in the adjusted answer. The second object is the first object in the adjusted answer that is not associated with the fourth segment or whose confidence level of the associated fourth segment is less than the confidence level threshold.
[0118] The confidence threshold can be set according to requirements.
[0119] In step S152, if so, the second object is highlighted in the adjusted answer while the adjusted answer is being displayed.
[0120] For example, if a first object in the adjusted answer has no associated fourth segment in the adjusted third segment, or if the confidence level of the associated fourth segment is less than the confidence level threshold, it indicates that the first object (i.e., the second object) has no supporting evidence or is a potential "illusion." Therefore, the second object is highlighted to prompt the user and facilitate further manual verification or correction. "Illusion" refers to a second object generated by the first neural network model that appears reasonable but does not match the adjusted third segment or is completely fabricated.
[0121] Highlighting the second object can be achieved by altering its display effect through one or more methods, such as labeling, increasing the font size, changing the text's own color, and changing the background color of the area where the text is located. This results in the second object in the adjusted answer having a different display effect than other segments in the adjusted answer. The highlighting methods used for the first segment, the second segment, the fourth segment, and the second object can be different, or the methods can be the same but with different effects.
[0122] In step S153, in response to receiving a correction operation for the adjusted answer, the corrected answer is determined.
[0123] For example, the third area may provide an answer correction control. Upon detecting that the answer correction control has been triggered, an answer editing box may be provided to the user. If the adjusted answer in the answer editing box is detected to have been modified, it can be determined that a correction operation for the adjusted answer has been received. The content saved by the user in the answer editing box can then be used as the corrected answer. The corrected answer can be displayed in the third area.
[0124] If the adjusted answer does not contain a second object and no correction operation has been received for the adjusted answer, the question and the adjusted answer can be directly associated to obtain the target question-answer pair.
[0125] In step S154, the question is associated with the corrected answer to obtain the target question-answer pair.
[0126] The question-answer pair generation method described above uses the source fragment (i.e., the fourth fragment) and the confidence level of the source fragment of the first object in the adjusted answer output by the third neural network model to perform fine-grained source tracing and confidence evaluation of the first object in the adjusted answer. It also provides highlighted prompts for first objects (i.e., the second object) that lack a source or have low confidence levels to support subsequent answer correction operations. This improves the accuracy and contextual consistency of the obtained target question-answer pairs, effectively suppresses illusions, and allows the target question-answer pairs to be directly used to train downstream high-precision models or as a basis for key business decisions.
[0127] In some embodiments of this disclosure, after step S153, the method may further include: taking the question, answer, adjusted answer, structured document, adjusted context fragment, and pre-obtained third prompt word as input, and using the corrected answer as the supervision target, to fine-tune the first neural network model.
[0128] For example, all user modifications to the answer can be recorded, such as specific additions, deletions, and changes, as well as the revised and corrected answers. These detailed modification records are then transformed into structured feedback data, which may include the question, answer, revised answer, structured document, revised context fragments, corrected answer, and third-party prompts. This structured feedback data can be used to fine-tune the first neural network model. In this way, the first neural network model can learn user preferences and domain knowledge from the specific modifications to the user's answer, and then perform fine-grained instruction tuning or preference learning on the underlying layers. This makes the answers subsequently generated by the first neural network model more consistent with human intent and domain norms, such as being more concise, more detailed, using specific terminology, and avoiding specific expressions.
[0129] The question-and-answer pair generation method described above fine-tunes the first neural network model using questions, answers, adjusted answers, structured documents, adjusted context fragments, third-party prompts, and corrected answers. This achieves a multimodal feedback learning mechanism, enabling the first neural network model to continuously learn the language expression habits and error correction logic of human experts, evolving from a passive tool into an active learning intelligent partner. Through adaptive optimization, it gradually improves the accuracy of its output answers. Long-term use can significantly reduce the frequency of human intervention, lower future human intervention costs, improve the accuracy of automated generation, and solve the problem of insufficient learning ability.
[0130] In some embodiments of this disclosure, after step S150, the following steps may also be included: Figure 7 Steps S160 to S190 are shown.
[0131] In step S160, multiple different target question-answer pairs are obtained.
[0132] Multiple different target question-answer pairs can be obtained from the knowledge base, or from all target question-answer pairs generated from the current structured document.
[0133] In step S170, questions from different target question-answer pairs are compared to identify multiple target question-answer pairs with similar questions.
[0134] One possible implementation is to convert the questions in different target question-answer pairs into vectors, then calculate the vector similarity between the questions in each pair, and identify multiple target question-answer pairs whose vector similarity is greater than a vector similarity threshold as similar question-answer pairs. In this way, multiple similar target question-answer pairs can be identified relatively accurately based on vectors. The vector similarity threshold can be set according to requirements.
[0135] As another possible implementation, the questions in each pair of target question-answering pairs can be input into a large language model. The large language model can then determine the similarity between the two input questions, thereby identifying multiple target question-answering pairs with similar questions. In this way, multiple target question-answering pairs with similar questions can be quickly identified using a large language model.
[0136] In step S180, the answers of multiple target question-and-answer pairs with similar questions are compared.
[0137] One possible implementation is to input the answers from pairwise question-and-answer pairs with similar questions into a large language model. The large language model then judges the consistency between the two input answers, thereby identifying multiple question-and-answer pairs with inconsistent answers. In this way, multiple question-and-answer pairs with inconsistent answers can be quickly identified using a large language model.
[0138] As another possible implementation, the coverage of answers to keywords in the question can be calculated for multiple target question-answer pairs with similar questions. If multiple target question-answer pairs with similar questions have keyword coverage differences exceeding a threshold, then the answers to these pairs are considered inconsistent. This allows for relatively accurate identification of inconsistent target question-answer pairs based on keyword coverage. The threshold can be set according to requirements.
[0139] In one example, the similar questions in the two target question-answer pairs are "What is the definition of X?" and "What are the characteristics of X?". Therefore, the answers in these two target question-answer pairs can be compared to check whether the two answers describe X in a consistent way.
[0140] In step S190, if the answers to multiple target question-answer pairs with similar questions are inconsistent, an alarm is issued for the multiple target question-answer pairs with similar questions.
[0141] For example, multiple target question-and-answer pairs with similar questions can be displayed to the user in a list format, with quick jump links provided to help the user make unified corrections to the answers of these target question-and-answer pairs.
[0142] The question-answer pair generation method described above achieves cross-question-answer pair quality consistency control by comparing the question similarity and checking the answer consistency of multiple target question-answer pairs. It can effectively detect contradictory questions and answers caused by contextual differences, model fluctuations, or human errors, prevent logical conflicts within the knowledge base, and ensure the accuracy and credibility of the final constructed knowledge system.
[0143] Please combine Figure 8In one example, the question-answer pair generation method may include the following steps S201 to S220. The content related to steps S201 to S220 can be referred to the description of the above implementation method. For the sake of brevity, it will not be repeated here.
[0144] In step S201, an unstructured document is received.
[0145] In step S202, the unstructured document is converted into a structured document.
[0146] In step S203, the structured document, the pre-obtained question template, and the first prompt word are input into the second neural network model. The second neural network model generates question-answer pairs based on the structured document, the question template, and the first prompt word, resulting in question-answer pairs and the first segment.
[0147] In step S204, the structured document and the questions in the question-answer pair are input into the third neural network model. The third neural network model performs context prediction based on the questions and the structured document to obtain the second segment and the third segment.
[0148] In step S205, a structured document is displayed in the first area of the interactive interface, and the first and second segments are highlighted in the structured document.
[0149] In step S206, the questions in the question-and-answer pair are displayed in the second area of the interactive interface. Steps S206 and S205 can be executed simultaneously.
[0150] In step S207, in response to receiving a selection operation for a question displayed in the second area, the answer to the selected question in the question-answer pair and the third segment are displayed in the third area of the interactive interface.
[0151] In step S208, it is determined whether an adjustment operation for the third segment displayed in the third region has been received. If yes, proceed to step S209; otherwise, proceed to step S210.
[0152] In step S209, a third segment displayed in the third region is deleted and / or added according to the specific adjustment operation. Specifically, if a deletion operation is received for a third segment in the third region, the third segment corresponding to the deletion operation is deleted in the third region; if a selection operation is received for a first segment or a second segment in the first region, the selected segment is added as a new third segment and displayed in the third region.
[0153] In step S210, it is determined whether an answer adjustment request has been received. If yes, proceed to step S211; otherwise, proceed to step S219.
[0154] In step S211, upon receiving an answer adjustment request, the question, multiple third segments currently displayed in the third region, and pre-obtained second prompt words are input into the first neural network model to obtain the adjusted answer, the fourth segment, and the confidence level of the fourth segment. The fourth segment is a segment in the adjusted context that is associated with the first object in the adjusted answer. The first object includes one or more of sentences, phrases, and keywords.
[0155] In step S212, it is checked whether there is a second object in the adjusted answer. If so, proceed to step S213; otherwise, proceed to step S214.
[0156] In step S213, the answer displayed in the third area is replaced with the adjusted answer, and the second object is highlighted in the displayed adjusted answer.
[0157] In step S214, the answer displayed in the third area is replaced with the adjusted answer.
[0158] In step S215, the fourth segment and its confidence level are highlighted in the third segment displayed in the third region. Step S213 or step S215 may be performed simultaneously with step S215.
[0159] In step S216, it is determined whether a correction operation has been received for the adjusted answer displayed in the third area. If yes, proceed to step S217; otherwise, proceed to step S218.
[0160] In step S217, the question is associated with the corrected answer to obtain the target question-answer pair.
[0161] In step S218, the question is associated with the adjusted answer to obtain the target question-answer pair.
[0162] In step S219, the question and answer are associated to obtain the target question-answer pair.
[0163] In step S220, a consistency check is performed across target question-answer pairs. Specifically, multiple different target question-answer pairs are obtained; the questions of different target question-answer pairs are compared to identify multiple target question-answer pairs with similar questions; the answers of multiple target question-answer pairs with similar questions are compared; and if the answers of multiple target question-answer pairs with similar questions are inconsistent, an alarm is issued for the multiple target question-answer pairs with similar questions.
[0164] Based on any of the above embodiments, this disclosure also provides a question-answer pair generation apparatus.
[0165] Figure 9 This is a schematic block diagram of the structure of a question-and-answer pair generation device according to one embodiment of the present disclosure.
[0166] like Figure 9 As shown, the question-and-answer pair generation device includes: a first determining module 110, used to determine question-and-answer pairs and context fragments associated with questions in the question-and-answer pairs from a structured document; a display module 120, used to display the structured document, question-and-answer pairs, and context fragments; a second determining module 130, used to determine an adjusted context fragment in response to receiving an adjustment operation for the displayed context fragment; an adjustment module 140, used to regenerate the answer based on the question and the adjusted context fragment using a first neural network model to obtain an adjusted answer; and a generation module 150, used to generate a target question-and-answer pair based on the question and the adjusted answer.
[0167] The question-and-answer pair generation device described above can be in the form of computer software, and each module of the question-and-answer pair generation device can be implemented through computer software modules.
[0168] In some embodiments of this disclosure, the context fragment includes multiple different first fragments, multiple different second fragments, and multiple different third fragments, wherein the first fragment is the source fragment of the question in the structured document, the second fragment is the fragment in the structured document related to the question, and the third fragment is the fragment among the multiple different second fragments that is predicted to be used to generate the answer to the question.
[0169] In some embodiments of this disclosure, the first determining module 110 is used to: input a structured document, a pre-obtained question template, and a first prompt word into a second neural network model; generate question-answer pairs and a first segment by the second neural network model based on the structured document, the question template, and the first prompt word; and input the structured document and the question in the question-answer pair into a third neural network model; and perform context prediction by the third neural network model based on the question and the structured document to obtain a second segment and a third segment.
[0170] In some embodiments of this disclosure, the adjusted context fragment includes the adjusted third fragment; correspondingly, the question-answer pair generation apparatus further includes: a first fine-tuning module, used to fine-tune the third neural network model by taking the question, the structured document, the second fragment and the third fragment as input, and the adjusted third fragment as the supervision target.
[0171] In some embodiments of this disclosure, the display module 120 is configured to: display a structured document in a first area of the interactive interface, and highlight a first segment and a second segment in the structured document; display a question-and-answer pair in a second area of the interactive interface; and, in response to receiving a selection operation for a question, display the answer to the question-and-answer pair and a third segment in a third area of the interactive interface.
[0172] In some embodiments of this disclosure, the adjusted context fragment includes an adjusted third fragment; the second determining module 130 is configured to: in response to receiving a deletion operation for a third fragment in the third region, delete the third fragment corresponding to the deletion operation in the third region; in response to receiving a selection operation for a first fragment or a second fragment in the first region, treat the selected fragment as a newly added third fragment and display the selected fragment in the third region; and treat the third fragment in the third region as the adjusted third fragment.
[0173] In some embodiments of this disclosure, the adjustment module 140 is configured to: upon receiving an answer adjustment request, input the question, the adjusted context fragment, and the pre-obtained second prompt word into a first neural network model, and regenerate the answer based on the question, the adjusted context fragment, and the second prompt word through the first neural network model to obtain the adjusted answer.
[0174] In some embodiments of this disclosure, while outputting the adjusted answer, the first neural network model also outputs a fourth segment and the confidence level of the fourth segment, wherein the fourth segment is a segment in the adjusted context segment that is associated with a first object in the adjusted answer, and the first object includes one or more of sentences, phrases, and keywords; accordingly, the generation module 150 is configured to: detect whether there is a second object in the adjusted answer, wherein the second object is a first object in the adjusted answer that is not associated with the fourth segment or whose confidence level of the associated fourth segment is less than a confidence level threshold; if so, highlight the second object in the adjusted answer while displaying the adjusted answer; determine the corrected answer in response to receiving a correction operation for the adjusted answer; and associate the question with the corrected answer to obtain a target question-answer pair.
[0175] In some embodiments of this disclosure, the question-answer pair generation apparatus further includes: a second fine-tuning module, used to fine-tune the first neural network model by taking the question, answer, adjusted answer, structured document, adjusted context fragment, and pre-obtained third prompt word as input, and using the corrected answer as the supervision target.
[0176] In some embodiments of this disclosure, the question-answer pair generation device further includes: an acquisition module for acquiring multiple different target question-answer pairs; a first comparison module for comparing the questions of different target question-answer pairs to determine multiple target question-answer pairs with similar questions; a second comparison module for comparing the answers of multiple target question-answer pairs with similar questions; and an alarm module for issuing an alarm for multiple target question-answer pairs with similar questions when the answers of multiple target question-answer pairs with similar questions are inconsistent.
[0177] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0178] The subject executing the question-and-answer pair generation method in the specific embodiments of this disclosure can be an electronic device such as a mobile phone or computer.
[0179] Therefore, based on any of the above embodiments, this disclosure also provides an electronic device that can execute the question-answer pair generation method of any of the embodiments described above.
[0180] Figure 10 This is a schematic block diagram of an electronic device 1000 according to one embodiment of the present disclosure.
[0181] The hardware structure of electronic device 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnect buses and bridges, depending on the specific application and overall design constraints of the hardware. Bus 1100 connects various circuits including one or more processors 1200, memory 1300, screens 1500, and / or hardware modules. Bus 1100 can also connect various other circuits 1400 such as peripherals, voltage regulators, power management circuits, external antennas, etc. Bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, only one connection line is used in this diagram, but this does not indicate that there is only one bus or one type of bus.
[0182] For ease of explanation, certain steps of the above method are described in relation to modules. It should be understood that the corresponding module performing one or more steps of the above method may be one or more hardware modules specifically configured to perform the corresponding step, or implemented by a processor configured to perform the corresponding step, or stored in a computer-readable medium for implementation by a processor, or implemented by some combination thereof.
[0183] This disclosure also provides a readable storage medium storing a computer program that, when executed by a processor, is used to implement the methods described above. A "readable storage medium" can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples of a readable storage medium include: an electrical connection with one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable read-only memory (CDROM), etc.
[0184] This disclosure also provides a computer program product, the methods of which can be implemented wholly or partially through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented wholly or partially as a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed, all or part of the processes or functions of this disclosure are performed.
[0185] Computer programs or instructions can be stored in a readable storage medium or transferred from one readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The readable storage medium can be any available medium capable of access, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; an optical medium, such as a digital video optical disc; or a semiconductor medium, such as a solid-state drive. The computer-readable storage medium can be a volatile or non-volatile storage medium, or it can include both volatile and non-volatile types of storage media.
[0186] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, apparatus, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0187] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0188] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0189] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0190] In the description of this specification, the references to terms such as "one embodiment / mode," "some embodiments / modes," "example," "specific example," or "some examples," etc., refer to specific features, structures, or characteristics described in connection with that embodiment / mode or example, which are included in at least one embodiment / mode or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment / mode or example. Moreover, the specific features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments / modes or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments / modes or examples described in this specification, as well as the features of different embodiments / modes or examples.
[0191] Those skilled in the art should understand that the above embodiments are merely for illustrating the present disclosure and are not intended to limit the scope of the disclosure. Those skilled in the art can make other changes or modifications based on the above disclosure, and these changes or modifications still fall within the scope of the present disclosure.
Claims
1. A question-answer pair generation method, characterized in that, include: Identify question-answer pairs and contextual fragments associated with the questions in the structured documents; Display the structured document, the question-and-answer pairs, and the context fragments; In response to receiving an adjustment operation for the displayed context fragment, the adjusted context fragment is determined; The first neural network model regenerates the answer based on the question and the adjusted context fragment, thus obtaining the adjusted answer. as well as Generate a target question-and-answer pair based on the question and the adjusted answer.
2. The question-answer pair generation method according to claim 1, characterized in that, The context fragment includes multiple different first fragments, multiple different second fragments, and multiple different third fragments. The first fragment is the source fragment of the question in the structured document, the second fragment is a fragment in the structured document related to the question, and the third fragment is a fragment among the multiple different second fragments that is predicted to be used to generate the answer to the question.
3. The question-answer pair generation method according to claim 2, characterized in that, Identifying question-answer pairs and contextual fragments associated with the questions in the structured document, including: The structured document, the pre-obtained question template, and the first prompt word are input into a second neural network model. The second neural network model generates question-answer pairs based on the structured document, the question template, and the first prompt word, resulting in the question-answer pairs and the first segment; and The structured document and the question in the question-answer pair are input into a third neural network model. The third neural network model performs context prediction based on the question and the structured document to obtain the second segment and the third segment.
4. The question-answer pair generation method according to claim 3, characterized in that, The adjusted context fragment includes the adjusted third fragment; After generating the target question-answer pair based on the question and the adjusted answer, the process also includes: The problem, the structured document, the second segment, and the third segment are used as inputs, and the adjusted third segment is used as the supervision target to fine-tune the third neural network model.
5. The question-answer pair generation method according to claim 2, characterized in that, Displaying the structured document, the question-and-answer pairs, and the context fragments includes: The structured document is displayed in the first area of the interactive interface, and the first fragment and the second fragment are highlighted in the structured document; The questions in the question-and-answer pair are displayed in the second area of the interactive interface; and In response to receiving a selection operation for the question, the answer to the question and the third segment are displayed in the third area of the interactive interface.
6. The question-answer pair generation method according to claim 5, characterized in that, The adjusted context fragment includes the adjusted third fragment; In response to receiving an adjustment operation for the displayed context fragment, determining the adjusted context fragment includes: In response to receiving a deletion operation for a third segment in the third region, delete the third segment corresponding to the deletion operation in the third region; In response to receiving a selection operation for a first segment or a second segment in the first region, the selected segment is added as a third segment, and the selected segment is displayed in the third region; and The third segment in the third region is taken as the adjusted third segment.
7. The question-answer pair generation method according to claim 1, characterized in that, The first neural network model regenerates the answer based on the question and the adjusted context fragment, resulting in an adjusted answer, including: Upon receiving an answer adjustment request, the question, the adjusted context fragment, and the pre-obtained second prompt word are input into the first neural network model. The first neural network model then regenerates the answer based on the question, the adjusted context fragment, and the second prompt word, thus obtaining the adjusted answer.
8. The question-answer pair generation method according to claim 7, characterized in that, While outputting the adjusted answer, the first neural network model also outputs a fourth segment and the confidence level of the fourth segment. The fourth segment is a segment in the adjusted context that is associated with a first object in the adjusted answer. The first object includes one or more of sentences, phrases, and keywords. Generate a target question-answer pair based on the question and the adjusted answer, including: Detect whether there is a second object in the adjusted answer. The second object is a first object in the adjusted answer that is not associated with the fourth segment or whose confidence level of the associated fourth segment is less than the confidence level threshold. If so, the second object will be highlighted in the adjusted answer while the adjusted answer is being displayed; In response to receiving a correction operation for the adjusted answer, the corrected answer is determined; and The question is associated with the corrected answer to obtain the target question-answer pair.
9. The question-answer pair generation method according to claim 8, characterized in that, After determining the corrected answer, the following is also included: The first neural network model is fine-tuned by taking the question, the answer, the adjusted answer, the structured document, the adjusted context fragment, and the pre-obtained third prompt word as input, and using the corrected answer as the supervision target.
10. The question-answer pair generation method according to claim 1, characterized in that, After generating the target question-answer pair based on the question and the adjusted answer, the process also includes: Obtain multiple different target question-answer pairs; By comparing questions from different target question-answer pairs, multiple target question-answer pairs with similar questions are identified; Compare the answers to multiple target question-and-answer pairs that are similar to the question in question; and If the answers to multiple target question-answer pairs that are similar to the question are inconsistent, an alert will be issued for the multiple target question-answer pairs that are similar to the question.
11. An electronic device, characterized in that, include: Memory, the memory storing computer programs; as well as A processor that executes a computer program stored in the memory, causing the processor to perform the question-answer pair generation method according to any one of claims 1 to 10.
12. A readable storage medium, characterized in that, The readable storage medium stores a computer program, which, when executed by a processor, is used to implement the question-answer pair generation method according to any one of claims 1 to 10.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the question-answer pair generation method according to any one of claims 1 to 10.