Method and device for assisting in outputting question and answer model, medium and electronic equipment
By acquiring a pre-set list of text fragment questions and using a pre-trained question generation model, and selecting highly relevant text fragments as input to the question answering model based on similarity and importance scores, the problem of insufficient accuracy of existing question answering models in professional fields is solved, and higher output accuracy is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONG KONG INTERNATIONAL NEW ECONOMIC RESEARCH INSTITUTE CO LTD
- Filing Date
- 2026-02-28
- Publication Date
- 2026-05-05
AI Technical Summary
Existing question-answering models struggle to achieve satisfactory accuracy in specialized fields.
By acquiring a pre-set list of text fragment questions, a pre-trained question generation model is used to generate pre-set questions. Based on the similarity and importance scores of the target questions input by the user, pre-set text fragments with high relevance are selected as input to the question answering model to improve the accuracy of the output.
It improves the accuracy of the question-answering model's output in professional fields. By matching the same type of natural language, it reduces the conversion steps between questions and answers, and enhances the accuracy of the matching results.
Smart Images

Figure CN121979998A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and in particular to methods, apparatus, media and electronic devices for assisting question-answering model output. Background Technology
[0002] In the current field of intelligent question answering systems, with the rapid development of Natural Language Processing (NLP) technology, question answering models have become an important component in various applications, especially in scenarios requiring highly specialized knowledge answers, such as law, medicine, and finance. The question answering needs in these fields often have extremely high requirements for accuracy and professionalism. However, although existing question answering models have been optimized through various techniques such as prompt word expansion and domain-adaptive training, their accuracy still falls short of satisfactory levels. Therefore, there is an urgent need for a method to improve the accuracy of question answering model outputs in specialized question answering domains. Summary of the Invention
[0003] To address the aforementioned technical problems, this application provides a method, apparatus, medium, and electronic device for assisting question-answering model output, which at least partially solves the problems existing in the prior art.
[0004] In a first aspect of this application, a method for assisting the output of a question-answering model is provided, the method comprising the following steps: S100, Obtain the preset text fragment question list set YW=(YW1, YW2, ..., YW... i , ..., YW n ); i = 1, 2, ..., n; where n is the number of preset text segments; YW i YW is the list of preset questions corresponding to the i-th preset text fragment; i =(YW i,1 YW i,2 , ..., YW i,a , ..., YW i,f(i) ); a = 1, 2, ..., f(i); f(i) is the number of preset questions generated by the pre-trained question generation model based on the i-th preset text segment; YW i,a The pre-trained question generation model generates the a-th preset question based on the i-th preset text fragment; each preset question has a corresponding preset relevance to the preset text fragment.
[0005] S200, in response to receiving the target question MQ input by the user, obtains the first target preset question list WM=(WM1, WM2, ..., WM) based on MQ and YW. j ..., WM m ); j = 1, 2, ..., m; where m is the number of pre-set questions for the first objective; WM jPre-set a problem for the j-th primary objective; WM j The first similarity PW between MQ and MQ j The similarity is greater than the preset first similarity threshold.
[0006] S300, based on WM and YW, obtain the corresponding first target preset text fragment list BW=(BW1, BW2, ..., BW... p BW q ); p = 1, 2, ..., q; where q is the number of preset text fragments for the first target; BW p Preset a text fragment for the p-th first target; BW p The first importance rating between MQ and BWG p Greater than the preset first importance rating threshold; BWG p Meets the following criteria: BWG p =Σ m j=1 (PW j ·PB p,j ); PB p,j For BW p With WM j The pre-defined correlation between them.
[0007] S400: Input BW and MQ into the pre-trained question-answering model to obtain the corresponding output results.
[0008] In a second aspect of this application, an apparatus for assisting the output of a question-answering model is provided, the apparatus comprising: The acquisition unit is used to acquire a preset text fragment question list set YW=(YW1, YW2, ..., YW... i , ..., YW n ); i = 1, 2, ..., n; where n is the number of preset text segments; YW i YW is the list of preset questions corresponding to the i-th preset text fragment; i =(YW i,1 YW i,2 , ..., YW i,a , ..., YW i,f(i) ); a = 1, 2, ..., f(i); f(i) is the number of preset questions generated by the pre-trained question generation model based on the i-th preset text segment; YW i,a The pre-trained question generation model generates the a-th preset question based on the i-th preset text segment; each preset question and its corresponding preset text segment have a corresponding preset relevance. The receiving unit is used to respond to the received target question MQ input by the user, and obtain the first target preset question list WM=(WM1, WM2, ..., WM) based on MQ and YW.j ..., WM m ); j = 1, 2, ..., m; where m is the number of pre-set questions for the first objective; WM j Pre-set a problem for the j-th primary objective; WM j The first similarity PW between MQ and MQ j The similarity is greater than the preset first similarity threshold; The unit is used to obtain the corresponding first target preset text fragment list BW=(BW1, BW2, ..., BW) based on WM and YW. p BW q ); p = 1, 2, ..., q; where q is the number of preset text fragments for the first target; BW p Preset a text fragment for the p-th first target; BW p The first importance rating between MQ and BWG p Greater than the preset first importance rating threshold; BWG p Meets the following criteria: BWG p =Σ m j=1 (PW j ·PB p,j ); PB p,j For BW p With WM j The pre-defined correlation between them; The output unit is used to input BW and MQ into the pre-trained question answering model to obtain the corresponding output results.
[0009] In a third aspect of this application, a non-transitory computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored in the storage medium, and the at least one instruction or at least one program is loaded and executed by a processor to implement the aforementioned method for outputting an auxiliary question-answering model.
[0010] In a fourth aspect of this application, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0011] This application has at least the following beneficial effects: The method for outputting the auxiliary question-answering model provided in this application first obtains a set of preset text fragment questions, in which each preset text fragment has several corresponding preset questions. Here, the corresponding preset questions are the questions that can be answered by the preset text fragment. Then, when a user inputs a target question, the target question is matched with the preset questions corresponding to each of the above preset text fragments to obtain a first target preset question list. Due to the high complexity and specialization of professional domain knowledge, the content of its corresponding preset text fragments is also more difficult to understand, while its corresponding preset questions are easier to understand than the preset text fragments themselves. Therefore, it can be seen that matching the user input target question with several preset questions generated in reverse from the preset text fragments is the same type of natural language matching as directly matching the user input target question with the preset text fragment questions. It does not require the conversion between questions and corresponding answers, and the matching result obtained is more accurate. The first similarity between each target preset question in the first target preset question list and the target question is greater than a preset first similarity threshold. The higher the similarity, the closer the meaning expressed by the target question and the first target preset question is. Next, based on the obtained list of first target preset questions and the aforementioned correspondence between each preset question and each preset text fragment, a list of first target preset text fragments is obtained. Each preset question and its corresponding preset text fragment have a corresponding preset relevance. The higher the preset relevance, the more suitable the preset question and its corresponding preset text fragment are; conversely, the lower the preset relevance, the less suitable the preset question and its corresponding preset text fragment are. The first importance score of each first target preset text fragment in the first target preset text fragment list is greater than a preset first importance score threshold. Here, the first importance score of a target preset text fragment represents the sum of the products of each first similarity and the corresponding preset relevance for that target preset text. That is, the first importance score is positively correlated with both the preset relevance between the target preset text and each target preset question, and positively correlated with the similarity between each target preset question and the target question. Considering both factors, the obtained importance score of the target preset text fragment more accurately reflects the relevance to the target question. In other words, the higher the importance score, the higher the relevance between the target preset text fragment and the target question, and vice versa. Finally, the target question and the target preset text fragment obtained based on the target question are input into the pre-trained question answering model, and the accuracy of the output results is high.
[0012] This application matches the target question with the preset questions generated in reverse from each preset text fragment (i.e., the questions that each preset text fragment can answer). This is a natural language matching of the same type, without the need for conversion between the question and the corresponding answer. Then, based on the selected target questions with high similarity, several target text fragments with high relevance to the target question are further selected in reverse. Finally, the target question and several target text fragments are input into a pre-trained question answering model. The target preset text fragments are used as reference knowledge for outputting the answer to the target question, resulting in high accuracy of the output results. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 A flowchart illustrating the method for outputting the auxiliary question-answering model provided in this application embodiment; Figure 2 A structural block diagram of the device for outputting the auxiliary question-answering model provided in the embodiments of this application. Detailed Implementation
[0015] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0016] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0017] It should be noted that the following description covers various aspects of embodiments within the scope of the appended claims. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this application, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.
[0018] Please refer to Figure 1 As shown, embodiments of this application provide a method for assisting question-answering model output, the method comprising the following steps: S100, Obtain the preset text fragment question list set YW=(YW1, YW2, ..., YW... i , ..., YW n ); i = 1, 2, ..., n; where n is the number of preset text segments; YW i YW is the list of preset questions corresponding to the i-th preset text fragment; i =(YW i,1 YW i,2 , ..., YW i,a , ..., YW i,f(i) ); a = 1, 2, ..., f(i); f(i) is the number of preset questions generated by the pre-trained question generation model based on the i-th preset text segment; YW i,a The pre-trained question generation model generates the a-th preset question based on the i-th preset text fragment; each preset question has a corresponding preset relevance to the preset text fragment.
[0019] Specifically, it is understood that, since the number of preset questions corresponding to each preset text segment may be different in this embodiment, f(i) does not refer to a specific function or function result value, but rather to a possible value that varies with the specific value of i. For example, when i=1, f(i)=5; when i=2, f(i)=8; when i=3, f(i)=8. Step S100 includes: S110, Obtain the initial database; wherein, the initial database includes initial text fragments and initial non-text fragments; each initial non-text fragment has a corresponding fragment description.
[0020] Here, the initial database is a database for a specific domain; for example, it could be a database for the financial sector. It includes initial text fragments and initial non-text fragments. The initial non-text fragments can be data in the form of tables, triples, images, and videos, etc. Each initial non-text fragment has a corresponding fragment description; for example, when the initial non-text fragment is a table, its corresponding fragment description is a table fragment.
[0021] S120, based on the fragment description corresponding to each initial non-text fragment and the preset conversion method mapping table, obtain the text fragment corresponding to each initial non-text fragment; wherein, the preset conversion method mapping table includes each fragment description and the text conversion method corresponding to each fragment description.
[0022] Here, the preset conversion method mapping table includes a description of each segment and the corresponding text conversion method for each segment description. That is, each type of segment description corresponds to an initial non-text segment with a corresponding text conversion method. The text conversion methods for the initial non-text segments corresponding to different types of segment descriptions may be the same or different. According to the preset conversion method mapping table, each initial non-text segment is converted to obtain its corresponding text segment (i.e., a natural language segment). The initial text segment, however, is not processed in the above way.
[0023] S130, Based on the text segment corresponding to each initial non-text segment and each initial text segment, obtain the preset text segment problem list set YW=(YW1, YW2, ..., YW... i , ..., YW n ).
[0024] Here, after converting the initial non-text fragments into corresponding text fragments using the aforementioned method, a list of preset text fragments is obtained together with each initial text fragment. Then, a pre-trained question generation model generates one or more preset questions corresponding to each preset text fragment. The preset questions are those that the preset text fragment can answer. For example, if the preset text fragment is "A credit card incurs an annual fee after activation," the generated preset questions could be "Does a credit card incur an annual fee if it is not activated?" or "Does a credit card incur an annual fee?" Here, the pre-trained question generation model can be any model used by those skilled in the art to generate the corresponding preset questions; no specific limitations are imposed here.
[0025] In addition, for each preset text segment, one or more corresponding preset questions are generated. Each preset text segment and each preset question has a corresponding preset relevance, which can be generated simultaneously when the preset questions are generated using the pre-trained question generation model. A higher preset relevance indicates a better fit between the preset question and its corresponding preset text segment; conversely, a lower preset relevance indicates a less suitable fit.
[0026] S200, in response to receiving the target question MQ input by the user, obtains the first target preset question list WM=(WM1, WM2, ..., WM) based on MQ and YW. j ..., WM m ); j = 1, 2, ..., m; where m is the number of pre-set questions for the first objective; WM j Pre-set a problem for the j-th primary objective; WM j The first similarity PW between MQ and MQ j The similarity is greater than the preset first similarity threshold.
[0027] Specifically, step S200 includes: S210, in response to receiving the target question MQ input by the user, obtain the initial preset question list YT=(YT1, YT2, ..., YT) after deduplication according to YW. x , ..., YT y ); x = 1, 2, ..., y; y is the number of initial preset questions obtained after deduplication; YT x This is the xth initial preset question.
[0028] Here, the list of preset questions corresponding to each preset text fragment in YW is obtained. Duplicate preset questions are removed to obtain an initial list of preset questions. That is, no two initial preset questions in the initial list are the same. The initial list of preset questions contains all the questions that can be answered by all the aforementioned preset text fragments.
[0029] S220, based on MQ and YT, obtain the target preset problem list WM=(WM1, WM2, ..., WM... j ..., WM m ).
[0030] First, the similarity between MQ and each initial preset question in YT is obtained. The similarity is obtained by vectorizing MQ using a preset vectorization method to obtain MQX, and vectorizing each initial preset question in YT using the same preset method to obtain its corresponding feature vector. The feature vectors corresponding to each initial preset question in YT are then matched for similarity. If the similarity is greater than a preset first similarity threshold, it is identified as the first target preset question, thus obtaining the list of first target preset questions.
[0031] Furthermore, PW j Meets the following conditions: PM j =(MQX·WMX j ) / (|MQX|·|WMX j |).
[0032] Wherein, MQX is the first target feature vector obtained by vectorizing MQ according to a preset vectorization method; WMX j To make WM j The first feature vector is obtained by vectorization according to the preset vectorization method.
[0033] It should be noted that the above vectorization methods are any vectorization methods used by those skilled in the art for the purpose of vectorizing text content, and no specific limitations are made here.
[0034] S300, based on WM and YW, obtain the corresponding first target preset text fragment list BW=(BW1, BW2, ..., BW... p BW q ); p = 1, 2, ..., q; where q is the number of preset text fragments for the first target; BW p Preset a text fragment for the p-th first target; BW p The first importance rating between MQ and BWG p Greater than the preset first importance rating threshold; BWG p Meets the following criteria: BWG p =Σ m j=1 (PW j ·PB p,j ); PB p,j For BW p With WM j The pre-defined correlation between them.
[0035] Specifically, the first importance score of a target preset text fragment represents the sum of the products of each first similarity and the corresponding preset relevance for that target preset text. That is, the first importance score is positively correlated with both the preset relevance between the target preset text and each target preset question, and positively correlated with the similarity between each target preset question and the target question. Considering both factors, the obtained importance score of the target preset text fragment more accurately reflects its relevance to the target question. In other words, the higher the first importance score, the higher the relevance between the target preset text fragment and the target question, and vice versa. In this embodiment, several preset text fragments with a first importance score threshold are determined as the target importance scores.
[0036] S400: Input BW and MQ into the pre-trained question-answering model to obtain the corresponding output results.
[0037] Specifically, the target question and several target text fragments are then input into the pre-trained question-answering model. The target text fragments serve as reference knowledge for the output answer to the target question, resulting in higher accuracy of the output.
[0038] In one exemplary embodiment of this application, after step S100, the method further includes: S500, in response to receiving the target question MQ input by the user, obtains the first target label MQB corresponding to MQ according to the preset label generation method.
[0039] S600, if MQB is the same as any of the special tags in the preset special tag list, then MQ is input into the pre-trained question answering model to obtain the corresponding output result.
[0040] Specifically, the first target label is used to determine whether the target input directly enters the pre-trained question-answering model. For the question-answering model mentioned above, the target question input by the user may be a question outside the domain of the initial database. For example, if the initial database is a financial database, and the target question is "transfer to human agent," then the first target label MQB corresponding to MQ is "transfer to human agent," and "transfer to human agent" is a special label in the pre-set special label list. In this case, MQ is directly input into the pre-trained question-answering model to obtain the corresponding output result (the pre-trained question-answering model provides the relevant output results such as the human agent's phone number). That is, the above-mentioned special label list sets several special labels for questions that can be answered without knowledge of the above-mentioned special domain (for example, the financial domain).
[0041] For the domain-specific problems not corresponding to the initial database, there is no need to use the pre-defined list of text fragments for the first objective as auxiliary input. Directly inputting these fragments into the large model for processing is more efficient and yields results that better meet the user's needs.
[0042] In one exemplary embodiment of this application, after step S500, the method further includes: S700, if the MQB is different from each of the dedicated tags in the preset dedicated tag list, obtain at least one second target tag corresponding to the MQ according to the preset tag library.
[0043] Specifically, if MQB differs from every dedicated tag in the preset dedicated tag list, it indicates that the target problem is a problem within the dedicated domain of the corresponding initial database. In this case, based on the preset tag library, at least one second target tag is assigned to MQ. Here, the preset tag library stores several tags corresponding to the dedicated domain of the initial database. For example, if the dedicated domain of the initial database is the financial domain, the second target tag could be debit card, credit card, annual interest rate, etc.
[0044] It should be noted that the label acquisition method can be generated based on a pre-trained label selection model, and the label selection model can be any model used by those skilled in the art to achieve the purpose of selecting labels, without any specific limitation here.
[0045] S800, based on the preset tag library, MQ, and YW, obtains the second target preset problem list EM=(EM1, EM2, ..., EM...). g , ..., EM h ); g = 1, 2, ..., h; where h is the number of pre-defined problems for the second objective; EW g Pre-set a problem for the g-th second objective; EM g The second similarity PE between MQ and g It is greater than the preset second similarity threshold.
[0046] Specifically, PE g Meets the following conditions: PE g =(MQH·EMH g ) / (|MQH|·|EMH g |); Wherein, MQH is the second target feature vector obtained by vectorizing MQ and at least one second target label corresponding to MQ according to a preset vectorization method; EMH g For EM g and EM g The corresponding second target label is vectorized according to a preset vectorization method to obtain the second feature vector.
[0047] S900, based on YW and EM, obtain the corresponding second target preset text fragment list FW=(FW1, FW2, ..., FW... c FW d ); c = 1, 2, ..., d; where d is the number of preset text fragments for the second target; FW c Preset a text fragment for the c-th second target; FW c Second most important rating between FWG and MQ c Greater than the preset second importance rating threshold; FWG c Meets the following criteria: FWG c =Σ h g=1 (EM g ·PF c,g ); PF c,g For FW c With EM g The pre-defined correlation between them.
[0048] S1000: Input FW and MQ into the pre-trained question answering model to obtain the corresponding output results.
[0049] Specifically, in this embodiment, the method for obtaining the second target preset text fragment list is the same as steps S200-S300, and will not be repeated here. It should be noted that in this embodiment, corresponding tags are assigned to the target question and each preset question according to a preset tag library, and the corresponding tags and the target question (or preset question) are used together to generate a corresponding second feature vector. Since the tags describe the key points of the question itself, they are used as part of the feature vector for subsequent similarity matching, making the final second target preset text fragment list more accurate and more relevant to the target question. This results in a more accurate output from the pre-trained question-answering model.
[0050] It should be noted that, in another embodiment of the above example, the second target label corresponding to the target question can be directly matched with the label determined by each preset question according to a preset label library to obtain the label matching degree between the target question and each preset question. Then, a third similarity is obtained based on the similarity between the label matching degree and the first feature vector obtained from the question content itself, and the label matching degree. Several target preset questions and several target preset text fragments are then determined based on the third similarity.
[0051] In one exemplary embodiment of this application, a knowledge graph corresponding to the target question and each preset text fragment can be generated based on the target question and each preset text fragment. This replaces the aforementioned matching method based on feature vectors generated from the question content with matching based on the generated knowledge graph. Furthermore, the knowledge graph, the tags, and the preset question list can jointly construct new vectors for subsequent matching; no specific limitations are imposed here.
[0052] Please refer to Figure 2 As shown, an embodiment of this application provides an apparatus 100 for assisting in the output of a question-answering model, the apparatus comprising: Acquisition unit 110 is used to acquire a preset text fragment question list set YW=(YW1, YW2, ..., YW... i , ..., YW n ); i = 1, 2, ..., n; where n is the number of preset text segments; YW i YW is the list of preset questions corresponding to the i-th preset text fragment; i =(YW i,1 YW i,2 , ..., YW i,a , ..., YW i,f(i) ); a = 1, 2, ..., f(i); f(i) is the number of preset questions generated by the pre-trained question generation model based on the i-th preset text segment; YW i,a The pre-trained question generation model generates the a-th preset question based on the i-th preset text segment; each preset question and its corresponding preset text segment have a corresponding preset relevance. The receiving unit 120 is configured to, in response to receiving the target question MQ input by the user, obtain a first target preset question list WM = (WM1, WM2, ..., WM...) based on MQ and YW. j ..., WM m ); j = 1, 2, ..., m; where m is the number of pre-set questions for the first objective; WM j Pre-set a problem for the j-th primary objective; WM j The first similarity PW between MQ and MQ j The similarity is greater than the preset first similarity threshold; Unit 130 is used to obtain the corresponding first target preset text fragment list BW=(BW1, BW2, ..., BW) based on WM and YW. p BW q ); p = 1, 2, ..., q; where q is the number of preset text fragments for the first target; BW p Preset a text fragment for the p-th first target; BW p The first importance rating between MQ and BWG pGreater than the preset first importance rating threshold; BWG p Meets the following criteria: BWG p =Σ m j=1 (PW j ·PB p,j ); PB p,j For BW p With WM j The pre-defined correlation between them; Output unit 140 is used to input BW and MQ into the pre-trained question answering model to obtain the corresponding output results.
[0053] Embodiments of this application also provide a computer program product including program code that, when the program product is run on an electronic device, causes the electronic device to perform the steps of the methods described above according to various exemplary embodiments of this application.
[0054] Furthermore, although the steps of the method in this application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0055] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this application.
[0056] In an exemplary embodiment of this application, an electronic device capable of implementing the above-described method is also provided.
[0057] Those skilled in the art will understand that various aspects of this application can be implemented as a system, method, or program product. Therefore, various aspects of this application can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, collectively referred to herein as a "circuit," "module," or "system."
[0058] An electronic device according to this embodiment of the present application. The electronic device is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of this application.
[0059] Electronic devices are manifested in the form of general-purpose computing devices. Components of an electronic device may include, but are not limited to: at least one processor, at least one memory, and buses connecting different system components (including memory and processor).
[0060] The memory stores program code that can be executed by a processor, causing the processor to perform the steps described in the "Exemplary Methods" section above, according to various exemplary embodiments of this application.
[0061] The storage may include readable media in the form of volatile storage, such as random access memory (RAM) and / or cache memory, and may further include read-only memory (ROM).
[0062] The storage may also include programs / utilities having a set (at least one) of program modules, including but not limited to: an operating system, one or more applications, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0063] A bus can represent one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus that uses any of the various bus architectures.
[0064] The electronic device can also communicate with one or more external devices (such as keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (such as routers, modems, etc.). This communication can be performed via input / output (I / O) interfaces. Furthermore, the electronic device can communicate with one or more networks (such as local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter. As shown in the figure, the network adapter communicates with other modules of the electronic device via a bus. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0065] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this application.
[0066] In exemplary embodiments of this application, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible implementations, various aspects of this application may also be implemented as a program product including program code, which, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of this application described in the "Exemplary Methods" section above.
[0067] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0068] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0069] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0070] Program code for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0071] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this application, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0072] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0073] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for assisting the output of a question-answering model, characterized in that, The method includes: S100, Obtain the preset text fragment question list set YW=(YW1, YW2, ..., YW... i , ..., YW n ); i = 1, 2, ..., n; where n is the number of preset text segments; YW i YW is the list of preset questions corresponding to the i-th preset text fragment; i =(YW i,1 YW i,2 , ..., YW i,a , ..., YW i,f(i) ); a = 1, 2, ..., f(i); f(i) is the number of preset questions generated by the pre-trained question generation model based on the i-th preset text segment; YW i,a The pre-trained question generation model generates the a-th preset question based on the i-th preset text segment; each preset question and its corresponding preset text segment have a corresponding preset relevance. S200, in response to receiving the target question MQ input by the user, obtains the first target preset question list WM=(WM1, WM2, ..., WM) based on MQ and YW. j ..., WM m ); j = 1, 2, ..., m; where m is the number of pre-set questions for the first objective; WM j Pre-set a problem for the j-th primary objective; WM j The first similarity PW between MQ and MQ j The similarity is greater than the preset first similarity threshold; S300, based on WM and YW, obtain the corresponding first target preset text fragment list BW=(BW1, BW2, ..., BW... p BW q ); p = 1, 2, ..., q; where q is the number of preset text fragments for the first target; BW p Preset a text fragment for the p-th first target; BW p The first importance rating between MQ and BWG p Greater than the preset first importance rating threshold; BWG p Meets the following criteria: BWG p =Σ m j=1 (PW j ·PB p,j ); PB p,j For BW p With WM j The pre-defined correlation between them; S400: Input BW and MQ into the pre-trained question-answering model to obtain the corresponding output results.
2. The method for outputting the auxiliary question-answering model according to claim 1, characterized in that, S200 includes: S210, in response to receiving the target question MQ input by the user, obtain the initial preset question list YT=(YT1, YT2, ..., YT) after deduplication according to YW. x , ..., YT y ); x = 1, 2, ..., y; y is the number of initial preset questions obtained after deduplication; YT x This is the xth initial preset problem; S220, based on MQ and YT, obtain the target preset problem list WM=(WM1, WM2, ..., WM... j ..., WM m ).
3. The method for outputting the auxiliary question-answering model according to claim 1, characterized in that, PW j Meets the following conditions: PM j =(MQX·WMX j ) / (|MQX|·|WMX j |); Wherein, MQX is the first target feature vector obtained by vectorizing MQ according to a preset vectorization method; WMX j To make WM j The first feature vector is obtained by vectorization according to the preset vectorization method.
4. The method for outputting the auxiliary question-answering model according to claim 1, characterized in that, S100 includes: S110, Obtain the initial database; wherein, the initial database includes initial text fragments and initial non-text fragments; each initial non-text fragment has a corresponding fragment description; S120, based on the fragment description corresponding to each initial non-text fragment and the preset conversion method mapping table, obtain the text fragment corresponding to each initial non-text fragment; wherein, the preset conversion method mapping table includes each fragment description and the text conversion method corresponding to each fragment description; S130, Based on the text segment corresponding to each initial non-text segment and each initial text segment, obtain the preset text segment problem list set YW=(YW1, YW2, ..., YW... i , ..., YW n ).
5. The method for outputting the auxiliary question-answering model according to claim 1, characterized in that, After step S100, the method further includes: S500, in response to receiving the target question MQ input by the user, obtains the first target label MQB corresponding to MQ according to the preset label generation method; S600, if MQB is the same as any of the special tags in the preset special tag list, then MQ is input into the pre-trained question answering model to obtain the corresponding output result.
6. The method for outputting the auxiliary question-answering model according to claim 5, characterized in that, After step S500, the method further includes: S700, if the MQB is different from each of the dedicated tags in the preset dedicated tag list, obtain at least one second target tag corresponding to the MQ according to the preset tag library; S800, based on the preset tag library, MQ, and YW, obtains the second target preset problem list EM=(EM1, EM2, ..., EM...). g , ..., EM h ); g = 1, 2, ..., h; where h is the number of pre-defined problems for the second objective; EW g Pre-set a problem for the g-th second objective; EM g The second similarity PE between MQ and g The similarity is greater than the preset second similarity threshold; S900, based on YW and EM, obtain the corresponding second target preset text fragment list FW=(FW1, FW2, ..., FW... c FW d ); c = 1, 2, ..., d; where d is the number of preset text fragments for the second target; FW c Preset a text fragment for the c-th second target; FW c Second most important rating between FWG and MQ c Greater than the preset second importance rating threshold; FWG c Meets the following criteria: FWG c =Σ h g=1 (EM g ·PF c,g ); PF c,g For FW c With EM g The pre-defined correlation between them; S1000: Input FW and MQ into the pre-trained question answering model to obtain the corresponding output results.
7. The method for outputting the auxiliary question-answering model according to claim 6, characterized in that, PE g Meets the following conditions: PE g =(MQH·EMH g ) / (|MQH|·|EMH g |); Wherein, MQH is the second target feature vector obtained by vectorizing MQ and at least one second target label corresponding to MQ according to a preset vectorization method; EMH g For EM g and EM g The corresponding second target label is vectorized according to a preset vectorization method to obtain the second feature vector.
8. A device for assisting in the output of a question-answering model, characterized in that, The device includes: The acquisition unit is used to acquire a preset text fragment question list set YW=(YW1, YW2, ..., YW... i , ..., YW n ); i = 1, 2, ..., n; where n is the number of preset text segments; YW i YW is the list of preset questions corresponding to the i-th preset text fragment; i =(YW i,1 YW i,2 , ..., YW i,a , ..., YW i,f(i) ); a = 1, 2, ..., f(i); f(i) is the number of preset questions generated by the pre-trained question generation model based on the i-th preset text segment; YW i,a The pre-trained question generation model generates the a-th preset question based on the i-th preset text segment; each preset question and its corresponding preset text segment have a corresponding preset relevance. The receiving unit is used to respond to the received target question MQ input by the user, and obtain the first target preset question list WM=(WM1, WM2, ..., WM) based on MQ and YW. j ..., WM m ); j = 1, 2, ..., m; where m is the number of pre-set questions for the first objective; WM j Pre-set a problem for the j-th primary objective; WM j The first similarity PW between MQ and MQ j The similarity is greater than the preset first similarity threshold; The unit is used to obtain the corresponding first target preset text fragment list BW=(BW1, BW2, ..., BW) based on WM and YW. p BW q ); p = 1, 2, ..., q; where q is the number of preset text fragments for the first target; BW p Preset a text fragment for the p-th first target; BW p The first importance rating between MQ and BWG p Greater than the preset first importance rating threshold; BWG p Meets the following criteria: BWG p =Σ m j=1 (PW j ·PB p,j ); PB p,j For BW p With WM j The pre-defined correlation between them; The output unit is used to input BW and MQ into the pre-trained question answering model to obtain the corresponding output results.
9. A non-transitory computer-readable storage medium, characterized in that, The storage medium stores at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the method as described in any one of claims 1-7.
10. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 9.