Method, apparatus, medium, and electronic device for assisting in outputting results from q&a models
By matching user questions with preset questions and text fragments in a question answering model, the method enhances accuracy in specialized fields by ensuring precise relevance and similarity, addressing the limitations of existing models.
Patent Information
- Authority / Receiving Office
- HK · HK
- Patent Type
- Applications
- Filing Date
- 2026-05-27
- Publication Date
- 2026-07-10
AI Technical Summary
Existing question answering models in specialized fields like law, medicine, and finance struggle to achieve satisfactory accuracy despite optimizations such as prompt word expansion and domain-adaptive training.
A method that involves obtaining a preset text fragment question list set, matching user-input questions with preset questions generated from text fragments, and selecting text fragments based on similarity and relevance thresholds to enhance accuracy by inputting them into a pre-trained question answering model.
This approach improves the accuracy of question answering outputs by ensuring precise matching and relevance, eliminating the need for question-and-response conversion, and utilizing text fragments as reference knowledge for more accurate results.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
(19) State Intellectual Property Office (12) Invention Patent Application (10) Application Publication Number (43) Application Publication Date (21) Application Number 202610239471.0 (22) Application Date 2026.02.28 (71) Applicant Hong Kong International New Economy Research Institute Limited Address Room 221, 2 / F, 12W Tower, Phase III, Shatin Science Park, New Territories, Hong Kong, China (72) Inventors Fu Rao Liu Chen (74) Patent Agency Beijing Zhongwei United Intellectual Property Agency Co., Ltd. 11579 Patent Attorney Li Xiaofeng (51) Int.Cl. G06F 16 / 3329 (2025.01) G06F 18 / 22 (2023.01) (54) Invention Title Method, Apparatus, Medium and Electronic Equipment for Assisting Question-Answering Model Output (57) Abstract This application provides a method, apparatus, medium and electronic equipment for assisting question-answering model output, relating to the field of artificial intelligence. The method includes: acquiring a preset text fragment question list set YW; responding to a target question MQ input by a user, obtaining a first target preset question list WM based on MQ and YW; obtaining a corresponding first target preset text fragment list BW based on WM and YW; and inputting BW and MQ into a pre-trained question-answering model to obtain the corresponding output result. This application inputs the target question and several target preset text fragments into a pre-trained question-answering model, using the target preset text fragments as reference knowledge for outputting the answer to the target question, resulting in higher accuracy of the output result. Claims 2 pages, Description 9 pages, Drawings 2 pages, CN 121979998 A 2026.05.05 CN 1 21 97 99 98 A 1. A method for assisting question-answering model output, characterized in that the method includes: S100, obtaining a preset text fragment question list set YW=(YW1, YW2, ..., YWi, ..., YWn); i=1,2, ...,n; where n is the number of preset text fragments; YWi is the preset question list corresponding to the i-th preset text fragment; YWi=(YWi,1, YWi,2, ..., YWi,a, ..., YWi,f(i)); a=1,2, ...,f(i); f(i) is the number of preset questions generated by the i-th preset text fragment according to the pre-trained question generation model; YWi,a is the a-th preset question generated by the pre-trained question generation model according to the i-th preset text fragment; each preset question has a corresponding preset relevance to the corresponding preset text fragment; S200, in response to receiving the target question MQ input by the user, obtain the first target preset question list WM=(WM1, WM2, ..., WMj, ..., WMm) based on MQ and YW; j=1, 2, ..., m; where m is the number of the first target preset questions; WMj is the j-th question.The first objective is a predefined question; the first similarity PWj between WMj and MQ is greater than a predefined first similarity threshold; S300, based on WM and YW, obtain the corresponding first objective predefined text fragment list BW=(BW1, BW2, ..., BWp, ..., BWq); p=1,2,...,q; where q is the number of first objective predefined text fragments; BWp is the p-th first objective predefined text fragment; the first importance score BWGp between BWp and MQ is greater than a predefined first importance score threshold; BWGp meets the following condition: BWGp= Σ mj=1(PWj·PBp,j); PBp,j is the predefined relevance between BWp and WMj; S400, input BW and MQ into the pre-trained question answering model to obtain the corresponding output results. 2. The method for outputting an auxiliary question-answering model according to claim 1, characterized in that step S200 includes: S210, in response to receiving the target question MQ input by the user, obtaining a deduplicated initial preset question list YT=(YT1, YT2, ..., YTx, ..., YTy) according to YW; x=1, 2, ..., y; y is the number of initial preset questions obtained after deduplication; YTx is the xth initial preset question; S220, obtaining a target preset question list WM=(WM1, WM2, ..., WMj, ..., WMm) according to MQ and YT. 3. The method for outputting an auxiliary question-answering model according to claim 1, characterized in that PWj satisfies the following condition: PMj = (MQX·WMXj) / (|MQX|·|WMXj|); where MQX is the first target feature vector obtained by vectorizing MQ according to a preset vectorization method; WMXj is the first feature vector obtained by vectorizing WMj according to a preset vectorization method. 4. The method for outputting an auxiliary question-answering model according to claim 1, characterized in that step S100 includes: S110, obtaining an 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, obtaining a text fragment corresponding to each initial non-text fragment according to the fragment description corresponding to each initial non-text fragment and a preset conversion method mapping table; wherein the preset conversion method mapping table includes each fragment description and a text conversion method corresponding to each fragment description; S130, obtaining a preset text fragment question list set YW=(YW1, YW2, ..., YWi, ..., YWn) according to the text fragment corresponding to each initial non-text fragment and each initial text fragment. 5. The method for outputting an auxiliary question-answering model according to claim 1, characterized in that after step S100, the method further includes: S500, in response to receiving a target question MQ input by a user, obtaining a first target tag MQB corresponding to MQ according to a preset tag 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 MQB is different from each dedicated tag in the preset dedicated tag list, obtain at least one second target tag corresponding to MQ according to the preset tag library; S800, according to the preset tag library, MQ, and YW, obtain a second target preset question list EM=(EM1, EM2, ..., EMg, ..., EMh); g=1, 2, ..., h; where h is the number of second target preset questions; EWg is the g-th second target preset question; the second similarity PEg between EMg and MQ is greater than the preset second similarity threshold; S900, according to YW and EM, obtain the corresponding second target preset text fragment list FW=(FW1, FW2, ..., FWc, ... FWd); c=1,2,…,d; where d is the number of second target preset text fragments; FWc is the c-th second target preset text fragment; the second importance score FWGc between FWc and MQ is greater than the preset second importance score threshold; FWGc meets the following condition: FWGc= Σ hg=1(EMg·PFc,g); PFc,g is the preset relevance between FWc and EMG; 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, wherein PEg meets the following condition: PEg = (MQH·EMHg) / (|MQH|·|EMHg|); where MQH is the second target feature vector obtained by vectorizing at least one second target label corresponding to MQ according to the preset vectorization method; EMGg is the second feature vector obtained by vectorizing at least one second target label corresponding to EMG according to the preset vectorization method. 8. An apparatus for assisting question-answering model output, characterized in that the apparatus comprises: an acquisition unit, configured to acquire a preset text fragment question list set YW=(YW1, YW2, ..., YWi, ..., YWn); i=1, 2, ..., n; where n is the number of preset text fragments; YWi is the preset question list corresponding to the i-th preset text fragment; YWi=(YWi,1, YWi,2, ..., YWi,a, ..., YWi,f(i)); a=1, 2, ..., f(i); f(i) is the number of preset questions generated by the i-th preset text fragment according to a pre-trained question generation model; YWi,a is the number of preset questions generated by the pre-trained question generation model according to the i-th preset text fragment.The a-th preset question is generated; each preset question has a corresponding preset relevance with its corresponding preset text fragment; a receiving unit is used to, in response to receiving the target question MQ input by the user, obtain a first target preset question list WM=(WM1, WM2, ..., WMj, ..., WMm) based on MQ and YW; j=1,2,...,m; where m is the number of first target preset questions; WMj is the j-th first target preset question; the first similarity PWj between WMj and MQ is greater than a preset first similarity threshold; a obtaining unit is used to obtain a corresponding first target preset text fragment list BW=(BW1, BW2, ..., BWp, ..., BWq) based on WM and YW; p=1,2,...,q; where q is the number of first target preset text fragments; BWp is the p-th first target preset text fragment; the first importance score BWGp between BWp and MQ is greater than a preset first importance score threshold; BWGp meets the following condition: BWGp= Σ mj=1(PWj·PBp,j); PBp,j is the preset correlation between BWp and WMj; Output unit, used to input BW and MQ into the pre-trained question answering model to obtain the corresponding output result. 9. A non-transient computer-readable storage medium, characterized in that the storage medium stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by a processor to implement the method of any one of claims 1-7. 10. An electronic device, characterized in that it includes a processor and the non-transient computer-readable storage medium of claim 9. Claims 2 / 2 Page 3 CN 121979998 A Method, apparatus, medium and electronic device for assisting question answering model output Technical Field
[0001] This application relates to the field of artificial intelligence, and in particular to a method, apparatus, medium and electronic device for assisting question answering model output. Background Art
[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 technical means such as prompt word expansion and domain-adaptive training, the accuracy of their responses is still difficult to reach a satisfactory level. Therefore, there is an urgent need for a method that can improve the accuracy of the output results of question answering models in specialized question answering fields. Summary of the Invention
[0003] To address the above-mentioned technical problems, this application provides a method, apparatus, medium, and electronic device to assist in the output of question answering models, at least partially solving the problems existing in the prior art.
[0004] In a first aspect of this application, a method for assisting question-answering model output is provided, the method comprising the following steps: S100, obtaining a preset text fragment question list set YW=(YW1, YW2, ..., YWi, ..., YWn); i=1, 2, ..., n; where n is the number of preset text fragments; YWi is the preset question list corresponding to the i-th preset text fragment; YWi=(YWi,1, YWi,2, ..., YWi,a, ..., YWi,f(i)); a=1, 2, ..., f(i); f(i) is the number of preset questions generated by the i-th preset text fragment according to the pre-trained question generation model; YWi,a is the a-th preset question generated by the pre-trained question generation model according to the i-th preset text fragment; each preset question has a corresponding preset relevance to the corresponding preset text fragment.
[0005] S200, in response to receiving the target question MQ input by the user, a first target preset question list WM=(WM1, WM2, ..., WMj, ..., WMm) is obtained according to MQ and YW; j=1, 2, ..., m; where m is the number of first target preset questions; WMj is the j-th first target preset question; the first similarity PWj between WMj and MQ 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, ..., BWp, ..., BWq); p=1, 2, ..., q; where q is the number of first target preset text fragments; BWp is the p-th first target preset text fragment; the first importance score BWGp between BWp and MQ is greater than the preset first importance score threshold; BWGp meets the following condition: BWGp= Σ mj=1(PWj·PBp,j); PBp,j is the preset relevance between BWp and WMj.
[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 question-answering model output is provided. The apparatus includes: an acquisition unit, configured to acquire a preset text fragment question list set YW=(YW1, YW2, ..., YWi, ..., YWn); i=1, 2, ..., n; where n is the number of preset text fragments; YWi is the preset question list corresponding to the i-th preset text fragment; YWi =(YWi,1, YWi,2, ..., YWi,a, ..., YWi,f(i)); a=1, 2, ..., f(i); f(i) is the number of preset questions generated by the i-th preset text fragment according to a pre-trained question generation model; YWi,a is the a-th preset question generated by the pre-trained question generation model according to the i-th preset text fragment; each preset question has a corresponding preset relevance to the corresponding preset text fragment.A receiving unit, configured to, in response to receiving the target question MQ input by the user, obtain a first target preset question list WM=(WM1, WM2, ..., WMj, ..., WMm); j=1,2, ...,m; where m is the number of first target preset questions; WMj is the j-th first target preset question; the first similarity PWj between WMj and MQ is greater than a preset first similarity threshold; A obtaining unit, configured to, based on WM and YW, obtain a corresponding first target preset text fragment list BW=(BW1, BW2, ..., BWp, ..., BWq); p=1,2, ...,q; where q is the number of first target preset text fragments; BWp is the p-th first target preset text fragment; the first importance score BWGp between BWp and MQ is greater than a preset first importance score threshold; BWGp meets the following condition: BWGp= Σ mj=1(PWj·PBp,j); PBp,j is the preset correlation between BWp and WMj; Output unit, used to input BW and MQ into a pre-trained question-answering model to obtain the corresponding output result.
[0009] In a third aspect of this application, a non-transient computer-readable storage medium is provided, the storage medium storing at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by a processor to realize 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-transient computer-readable storage medium.
[0011] This application has at least the following beneficial effects: The method for outputting an auxiliary question-answering model provided by this application first obtains a preset text fragment question list set, including each preset text fragment having several corresponding preset questions, where the corresponding preset questions are the questions that the preset text fragment can answer. Then, when a target question input by a user is received, the target question input by the user is matched with the preset questions corresponding to each preset text fragment to obtain a first target preset question list. Due to the high complexity and specialization of specialized knowledge, the corresponding preset text fragments are also more difficult to understand. However, the corresponding preset questions are easier to understand than the preset text fragments themselves. Therefore, matching the user-input target question with several preset questions generated from the preset text fragments is a more accurate approach than directly matching the user-input target question with preset text fragment questions. This method, being the same type of natural language matching, eliminates the need for question-and-response conversion and yields more precise matching results. The first similarity between each target preset question in the first target preset question list and the target question is greater than the preset first similarity threshold; the higher the similarity, the higher the threshold.This indicates that the closer the target question is to the meaning expressed by the first target preset question, the better. Then, 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 better the fit between the preset question and its corresponding preset text fragment; conversely, the worse the fit. The first importance score of each first target preset text fragment in the first target preset text fragment list is greater than the 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 also 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. That is, 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 from the target question are input into the pre-trained question answering model, and the accuracy of the output result is relatively high.
[0012] This application matches the preset question (i.e. the question that each preset text fragment can answer) generated in reverse from each preset text fragment with the target question. It is the same type of natural language matching, and there is no need to convert between the question and the corresponding answer. Then, based on the selected target questions with high similarity, several target preset text fragments with high relevance to the target question are selected in reverse. Finally, the target question and several target preset text fragments are input into the pre-trained question answering model. The target preset text fragment is used as the reference knowledge for the output answer of the target question, so that the accuracy of the output result is relatively high.
[0013] Brief Description of the Drawings: To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the 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 is a flowchart of the method for outputting the auxiliary question-answering model provided in the embodiment of this application; Figure 2 is a structural block diagram of the device for outputting the auxiliary question-answering model provided in the embodiment of this application. Detailed Description of the Embodiments
[0015] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments in 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 the above-mentioned 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 an order other than those illustrated or described herein. In addition, 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 includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or inherent to these processes, methods, products or devices.
[0017] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. 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. Furthermore, this device and / or practice the method can be implemented using other structures and / or functionalities besides one or more of the aspects set forth herein.
[0018] Please refer to Figure 1. An embodiment of this application provides a method for assisting question-answering model output. The method includes the following steps: S100, obtaining a preset text fragment question list set YW=(YW1, YW2, ..., YWi, ..., YWn); i=1, 2, ..., n; where n is the number of preset text fragments; YWi is the preset question list corresponding to the i-th preset text fragment; YWi=(YWi,1, YWi,2, ..., YWi,a, ..., YWi,f(i)); a=1, 2, ..., f(i); f(i) is the number of preset questions generated by the i-th preset text fragment according to the pre-trained question generation model; YWi,a is the a-th preset question generated by the pre-trained question generation model according to the i-th preset text fragment; each preset question has a corresponding preset relevance to the corresponding preset text fragment. Specification 3 / 9 pages 6 CN 121979998 A
[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) in this embodiment 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, obtaining an initial database; wherein, the initial database includes initial text segments and initial non-text segments; each initial non-text segment has a corresponding segment description.
[0020] Here, the initial database is a database of a specific field, for example: it can be a database of the financial field. It includes initial text segments and initial non-text segments. Among them, the initial non-text segments can be data in the form of tables, triples, pictures and videos, etc. Each initial non-text segment has a corresponding segment description, for example: when the initial non-text segment is a table, its corresponding segment description is a table segment.
[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 each fragment description and the text conversion method corresponding to each fragment description. That is, each type of fragment description corresponds to an initial non-text fragment with a corresponding text conversion method. The text conversion methods of initial non-text fragments corresponding to different types of fragment descriptions may be the same or different. Based on the preset conversion method mapping table, perform text conversion on each initial non-text fragment to obtain its corresponding text fragment (i.e., natural language fragment). The initial text fragment is not processed as described above.
[0023] S130, based on the text fragment corresponding to each initial non-text fragment and each initial text fragment, obtain a preset text fragment problem list set YW=(YW1, YW2, ..., YWi, ..., YWn).
[0024] Here, after converting the initial non-text fragments into corresponding text fragments according to the aforementioned method, a list of preset text fragments is obtained together with each initial text fragment. Then, one or more preset questions are generated for each preset text fragment according to the pre-trained question generation model. The preset questions are the questions that the preset text fragment can answer. As an example: the preset text fragment is: "A credit card charges an annual fee after activation," and the generated preset questions can be "If the credit card is not activated, will an annual fee be charged?", "Does the credit card charge an annual fee?", etc. Here, the pre-trained question generation model can be any model used by those skilled in the art to achieve the purpose of generating the corresponding preset questions, and no specific limitation is made here.
[0025] In addition, for each preset text fragment, one or more preset questions are generated corresponding to it. The preset text fragment and each preset question have a corresponding preset relevance. The preset relevance can be generated simultaneously when the preset questions are generated using the pre-trained question generation model. The higher the preset relevance, the more suitable the preset question is with the corresponding preset text fragment; conversely, the less suitable the preset question is with the corresponding preset text fragment.
[0026] S200, in response to receiving the target question MQ input by the user, according to MQ and YW, a first target preset question list WM=(WM1, WM2, ..., WMj, ..., WMm); j=1,2, ...,m; where m is the number of first target preset questions; WMj is the j-th first target preset question; the first similarity PWj between WMj and MQ 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, obtaining a deduplicated initial preset question list YT=(YT1, YT2, ..., YTx, ..., YTy) based on YW; x=1, 2, ..., y; y is the number of initial preset questions obtained after deduplication; YTx is the xth initial preset question.
[0028] Here, the preset question list corresponding to each preset text fragment in YW is obtained, and the same preset questions are deduplicated to obtain the initial preset question list. That is, any two initial preset questions in the initial preset question list are different. The initial preset question list is all the questions that can be answered by all the above preset text fragments.
[0029] S220, obtaining the target preset question list WM=(WM1, WM2, ..., WMj, ..., WMm) based on MQ and YT.
[0030] First, the similarity between MQ and each initial preset question in YT is obtained. The similarity acquisition method is as follows: MQ is vectorized according to a preset vectorization method to obtain MQX, and each initial preset question in YT is vectorized according to a preset vectorization method to obtain the corresponding feature vector. MQX and the feature vector corresponding to each initial preset question in YT are matched for similarity. If the corresponding similarity is greater than a preset first similarity threshold, it is determined as the first target preset question, thus obtaining the first target preset question list.
[0031] Further, PWj meets the following condition: PMj=(MQX·WMXj) / (|MQX|·|WMXj|).
[0032] Wherein, MQX is the first target feature vector obtained by vectorizing MQ according to a preset vectorization method; WMXj is the first feature vector obtained by vectorizing WMj according to a preset vectorization method.
[0033] It should be noted that the above vectorization method is any vectorization method used by those skilled in the art for the purpose of vectorizing text content, and is not specifically limited here.
[0034] S300, according to WM and YW, the corresponding first target preset text fragment list BW=(BW1, BW2, ..., BWp, ..., BWq) is obtained; p=1,2, ...,q; where q is the number of first target preset text fragments; BWp is the p-th first target preset text fragment; the first importance score BWGp between BWp and MQ is greater than the preset first importance score threshold; BWGp meets the following condition: BWGp= Σ mj=1(PWj·PBp,j); PBp,j is the preset relevance between BWp and WMj.
[0035] Specifically, the first importance score of a certain target preset text fragment represents the sum of the products between each first similarity and the corresponding preset relevance of the target preset text. That is, the first importance score is positively correlated with the preset relevance between the target preset text and each target preset question, and also positively correlated with the similarity between each target preset question and the target question. Taking into account the above two factors, the obtained importance score of the target preset text fragment can more accurately reflect the relevance between it and the target question. That is, 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 score.
[0036] S400, BW and MQ are input into the pre-trained question answering model to obtain the corresponding output results.
[0037] Specifically, finally, the target question and several target preset text fragments are input into the pre-trained question answering model, using the target preset text fragments as reference knowledge for the output answer of the target question, so that the accuracy of the output results is high.
[0038] In an 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, obtaining the first target tag MQB corresponding to MQ according to a preset tag generation method.
[0039] S600, if MQB is the same as any special tag 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 tag is used to determine whether the target input directly enters the pre-trained question-answering model. For the above question-answering model, the target question input by the user may be a question outside the domain of the initial database. For example, if the aforementioned initial database is a financial database, when the target question is "transfer to human agent", the first target tag MQB corresponding to MQ is "transfer to human agent", and "transfer to human agent" is a special tag in the preset special tag list.When the MQ is directly input into the pre-trained question-answering model, the corresponding output result is obtained (the pre-trained question-answering model provides relevant output results such as human customer phone calls). That is, the above-mentioned special tag list sets several special tags for questions that do not require knowledge of the above-mentioned special domain (for example: the financial field). Specification 5 / 9 pages 8 CN 121979998 A
[0041] For questions in the special domain that are not corresponding to the above-mentioned initial database, it is not necessary to use the above-mentioned first target preset text fragment list as auxiliary input. Directly input into the large model for processing is more efficient and the results are closer to the user's needs.
[0042] In an exemplary embodiment of this application, after step S500, the method further includes: S700, if the MQB is different from each special tag in the preset special tag list, obtain at least one second target tag corresponding to the MQ according to the preset tag library.
[0043] Specifically, if MQB is different from each of the special tags in the preset special tag list, it means that the target problem is a problem in the special domain of the corresponding initial database. At this time, according to 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 special domain of the initial database. For example, if the special domain of the initial database is the financial field, the second target tag can be savings card, credit card, annual interest rate, etc.
[0044] It should be noted that the tag acquisition method can be generated according to the pre-trained tag selection model, and the tag selection model can be any model used by those skilled in the art to achieve the purpose of tag selection. No specific limitation is made here.
[0045] S800, according to the preset tag library, MQ and YW, the second target preset problem list EM=(EM1, EM2, ..., EMg, ..., EMh) is obtained; g=1, 2, ..., h; where h is the number of second target preset problems; EWg is the g-th second target preset problem; the second similarity PEg between EMg and MQ is greater than the preset second similarity threshold.
[0046] Specifically, PEg meets the following condition: PEg = (MQH·EMHg) / (|MQH|·|EMHg|); where MQH is the second target feature vector obtained by vectorizing at least one second target label corresponding to MQ and MQ according to a preset vectorization method; EMHg is the second feature vector obtained by vectorizing at least one second target label corresponding to EMH and EMH according to a preset vectorization method.
[0047] S900, according to YW and EM, the corresponding second target preset text fragment list FW = (FW1, FW2, ..., FWc, ..., FWd); c = 1, 2, ..., d; where d is the number of second target preset text fragments; FWc is the cth second target preset text fragment.Let the text fragments be: the second importance score FWGc between FWc and MQ is greater than the preset second importance score threshold; FWGc meets the following condition: FWGc = Σ hg=1(EMg·PFc, g); PFc, g are the preset relevance between FWc and EMG.
[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 of 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, according to the preset tag library, the target question and each preset question are assigned corresponding tags respectively, and the corresponding tags and the target question (or preset question) are used together to generate the corresponding second feature vector. Since the tags are descriptions of the key points of the question itself, they are used as part of the feature vector for subsequent similarity matching, so that the final second target preset text fragment list is more accurate and has a higher relevance to the target question. The output of the pre-trained question answering model obtained in this way is more accurate.
[0050] It should be noted that, in another embodiment of the above embodiments, the second target label corresponding to the target question can be directly matched with the label determined by each preset question according to the 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 based on the question content itself and the label matching degree. And several target preset questions and several target preset text fragments are determined based on the third similarity.
[0051] In an exemplary embodiment of this application, a knowledge graph corresponding to the target question and each preset text fragment can also be generated according to the target question and each preset text fragment, thereby replacing the above-mentioned matching method based on the feature vector generated according to the question content with matching based on the generated knowledge graph. And the knowledge graph, the label and the preset question list described on page 6 / 9 of the specification can jointly construct a new vector for subsequent matching, which is not specifically limited here.
[0052] Please refer to Figure 2. An embodiment of this application provides a device 100 for assisting question-answering model output. The device includes: an acquisition unit 110, used to acquire a preset text fragment question list set YW=(YW1, YW2, ..., YWi, ..., YWn); i = 1, 2, ..., n; where n is the number of preset text fragments; YWi is the preset question list corresponding to the i-th preset text fragment; YWi=(YWi, 1, YWi, 2, ..., YWi, a, ..., YWi, f(i)); a=1, 2, ..., f(i); f(i) is the root of the i-th preset text fragment.The number of preset questions generated by the pre-trained question generation model; YWi,a is the a-th preset question generated by the pre-trained question generation model based on the i-th preset text fragment; each preset question has a corresponding preset relevance with the corresponding preset text fragment; receiving unit 120 is used to, in response to receiving the target question MQ input by the user, obtain a first target preset question list WM=(WM1, WM2, ..., WMj, ..., WMm) based on MQ and YW; j=1,2,...,m; where m is the number of first target preset questions; WMj is the j-th first target preset question; the first similarity PWj between WMj and MQ is greater than a preset first similarity threshold; obtaining unit 130 is used to obtain a corresponding first target preset text fragment list BW=(BW1, ..., WMm) based on WM and YW. BW2, ..., BWp, ..., BWq); p = 1, 2, ..., q; where q is the number of the first target preset text fragments; BWp is the p-th first target preset text fragment; the first importance score BWGp between BWp and MQ is greater than the preset first importance score threshold; BWGp meets the following condition: BWGp = Σ mj=1(PWj·PBp,j); PBp,j is the preset relevance between BWp and WMj; 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, which includes program code. When the program product is run on an electronic device, the program code is used to cause the electronic device to perform the steps in the methods of various exemplary embodiments of this application described above.
[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 these 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 one step may be broken down into multiple steps, etc.
[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, mobile 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 method according to the embodiments of this application.
[0056] In an exemplary embodiment of this application, an electronic device capable of implementing the above 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 as: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."
[0058] An electronic device according to such an embodiment of this application. The electronic device is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0059] The electronic device is manifested in the form of a general-purpose computing device. Components of the electronic device may include, but are not limited to: at least one processor, at least one memory, and a bus connecting different system components (including the memory and the processor).
[0060] Wherein, the memory stores program code that can be executed by the processor, causing the processor to perform the steps described in the "Exemplary Methods" section of this specification 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 application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0063] The bus may be one or more of several types of bus structures, including a storage bus or storage controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures.
[0064] The electronic device may also communicate with one or more external devices (e.g., a keyboard, pointing device, Bluetooth device, etc.), and may also communicate with one or more devices that enable a user to interact with the electronic device, and / or with any device that enables the electronic device to communicate with one or more other computing devices (e.g., a router, modem, etc.). Such communication may be performed through an input / output (I / O) interface. Furthermore, the electronic device can communicate with one or more networks (e.g., 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, including but not limited to: microcode, device drivers, and redundancy processing, can be used in conjunction with the electronic device.Devices, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0065] Through the above description of the embodiments, those skilled in the art can easily 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, mobile 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 method according to the embodiments of this application.
[0066] In an exemplary embodiment of this application, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above in this specification is stored. In some possible embodiments, various aspects of this application can also be implemented in the form of a program product, which includes program code, which, when the program product is run on a terminal device, is used to cause the terminal device to execute the steps of the various exemplary embodiments of this application described in the "Exemplary Methods" section of this specification.
[0067] The program product can take the form of any combination of one or more readable media. A readable medium can be a readable signal medium or a readable storage medium. A readable storage medium can 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: an electrical connection having one or more wires, a portable disk, a hard disk, 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 device, magnetic storage device, or any suitable combination thereof.
[0068] A computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium can also be any readable medium other than a readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0069] The program code contained on the readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0070] Programs for performing the operations of this application can be written in any combination of one or more programming languages.The code, programming languages include object-oriented programming languages—such as Java, C++, etc.—as well as conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's 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 methods 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 can be executed synchronously or asynchronously, for example, in multiple modules.
[0072] It should be noted that although several modules or units of the device for performing actions are mentioned in the above detailed description, 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 into multiple modules or units for embodiment.
[0073] The above are merely specific embodiments of this application, but the protection scope 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 protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims. Instruction manual, page 9 / 9, CN 121979998 A, Figure 1; Instruction manual drawing, page 1 / 2, CN 121979998 A, Figure 2; Instruction manual drawing, page 2 / 2, CN 121979998 A, Abstract: METHOD, APPARATUS, MEDIUM, AND ELECTRONIC DEVICE FOR ASSISTING IN OUTPUTTING RESULTS FROM Q&A MODELS. The present invention relates to the technical field of AI-powered technology, in particular to a method, apparatus, medium,and electronic device for assisting in outputting results from Q&A models. The method includes the steps of obtaining a set of question lists for preset text segments, in response to receiving a target question MQ input by users, obtaining a first target preset question list, based on WM and YW, obtaining a corresponding list of first target preset text segments, and inputting BW and MQ into a pre-trained Q&A model to obtain a corresponding output result. The present invention makes it possible to jointly input the target question and several target preset text segments into the pre-trained Q&A model, so as to enable the target preset text segments to serve as reference knowledge for outputting an answer to a target question, so that output results have high accuracy. Abstract Figure attached to the abstract obtaining a set of question lists for preset text segments YW=(YW1,YW2, ,YWi, ,YWn);i=1,2, ,n in response to receiving a target question MQ input by users, obtaining a first targetpreset question list WM=(WM1,WM2, ,WMj, ,WMm);j=1,2, ,m; based on MQ and YW based on WM and YW, obtaining a corresponding list of first target preset text segments BW=(BW1,BW2, ,BWp, ,BWq);p=1,2, ,q inputting BW and MQ into a pre-trained Q&A model to obtain a corresponding output result S100 S200 S300 S400 Fig.1
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.