Dialogue method and device based on large model, model training method and device and electronic equipment

By slicing candidate documents, determining the target slice and associated slice, and generating prompt text in combination with the big model, the problem of insufficient comprehensiveness and accuracy of the dialogue method in the prior art answers is solved, and higher quality answer generation is achieved.

CN118886501APending Publication Date: 2024-11-01BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410907343.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-08
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

In the prior art, large-model-based dialogue methods have shortcomings in the comprehensiveness and accuracy of the answer text, and it is difficult to effectively generate comprehensive and accurate answers.

Method used

By slicing candidate documents, determining the target slice and associated slice, generating prompt text in combination with the big model, and inputting it into the model to generate answer text, the comprehensiveness and accuracy of the answer is improved.

Benefits of technology

By comprehensively considering the target slice and the associated slice, the generated answer text improves comprehensiveness and accuracy, and enhances the quality of the prompt text of the big model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118886501A_ABST
    Figure CN118886501A_ABST
Patent Text Reader

Abstract

The invention provides a dialogue method and device based on a large model, a model training method and device and electronic equipment, and relates to the technical field of artificial intelligence, in particular to the technical field of natural language processing, deep learning and large models. The method comprises the following steps: slicing a candidate document to obtain a plurality of candidate slices; determining a target slice from the plurality of candidate slices based on a question text; obtaining a candidate slice having an association relationship with the target slice as an associated slice; based on the target slice and the associated slice, obtaining a prompt text of the first large model; and inputting the prompt text into the first large model, and outputting an answer text for the question text by the first large model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to the field of natural language processing, deep learning, and large model technology, and in particular to a dialogue method based on a large model, a model training method, an apparatus, an electronic device, a storage medium, and a computer program product. Background Art

[0002] At present, with the continuous development of artificial intelligence technology, large models have advantages such as good generalization and have been widely used in information extraction, text credibility assessment, machine translation and other fields. For example, in the field of dialogue, answer text can be generated based on large models. However, the dialogue method in related technologies has the problem of low comprehensiveness and accuracy of answer text. Summary of the invention

[0003] The present disclosure proposes a dialogue method based on a large model, a model training method, an apparatus, an electronic device, a storage medium and a computer program product.

[0004] According to the first aspect of the present disclosure, a dialogue method based on a large model is proposed, including: slicing a candidate document to obtain multiple candidate slices; based on a question text, determining a target slice from the multiple candidate slices; obtaining a candidate slice that has an association relationship with the target slice as an associated slice; based on the target slice and the associated slice, obtaining a prompt text of a first large model; inputting the prompt text into the first large model, and having the first large model output an answer text for the question text.

[0005] According to a second aspect of the present disclosure, a model training method is proposed, comprising: slicing a sample candidate document to obtain a plurality of sample candidate slices; determining a sample target slice from the plurality of sample candidate slices based on a sample question text; acquiring a sample candidate slice having an association relationship with the sample target slice as a sample associated slice; obtaining a sample prompt text of a first large model based on the sample target slice and the sample associated slice; inputting the sample prompt text into the first large model, and having the first large model output a predicted answer text for the sample question text; and training the first large model based on the predicted answer text and the sample answer text for the sample question text.

[0006] According to a third aspect of the present disclosure, a dialogue device based on a large model is proposed, including: a slicing module, used to slice candidate documents to obtain multiple candidate slices; a determination module, used to determine a target slice from the multiple candidate slices based on a question text; a first acquisition module, used to obtain a candidate slice that has an association relationship with the target slice as an associated slice; a second acquisition module, used to obtain a prompt text of a first large model based on the target slice and the associated slice; a third acquisition module, used to input the prompt text into the first large model, and the first large model outputs an answer text for the question text.

[0007] According to a fourth aspect of the present disclosure, a model training device is proposed, comprising: a slicing module, used to slice a sample candidate document to obtain a plurality of sample candidate slices; a determination module, used to determine a sample target slice from a plurality of sample candidate slices based on a sample question text; a first acquisition module, used to acquire a sample candidate slice having an association relationship with the sample target slice as a sample associated slice; a second acquisition module, used to acquire a sample prompt text of a first large model based on the sample target slice and the sample associated slice; a third acquisition module, used to input the sample prompt text into the first large model, and the first large model outputs a predicted answer text for the sample question text; and a training module, used to train the first large model based on the predicted answer text and the sample answer text for the sample question text.

[0008] According to a fifth aspect of the present disclosure, an electronic device is proposed, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the large model-based dialogue method proposed in the first aspect above, or execute the model training method proposed in the second aspect above.

[0009] According to the sixth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is proposed, wherein the computer instructions are used to enable the computer to execute the large model-based dialogue method proposed in the first aspect, or to execute the model training method proposed in the second aspect.

[0010] According to the seventh aspect of the present disclosure, a computer program product is proposed, including a computer program, which, when executed by a processor, implements the large model-based dialogue method proposed in the first aspect, or implements the model training method proposed in the second aspect.

[0011] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0013] Figure 1 A flowchart of a large model-based dialogue method according to an embodiment of the present disclosure;

[0014] Figure 2 A flowchart of a large model-based dialogue method according to another embodiment of the present disclosure;

[0015] Figure 3 A flowchart of a large model-based dialogue method according to another embodiment of the present disclosure;

[0016] Figure 4 A flowchart of a large model-based dialogue method according to another embodiment of the present disclosure;

[0017] Figure 5 A flowchart of a large model-based dialogue method according to another embodiment of the present disclosure;

[0018] Figure 6 A flowchart of a large model-based dialogue method according to another embodiment of the present disclosure;

[0019] Figure 7 A flowchart of a model training method according to an embodiment of the present disclosure;

[0020] Figure 8 It is a structural schematic diagram of a dialogue device based on a large model according to an embodiment of the present disclosure;

[0021] Fig. 9 It is a structural schematic diagram of a model training device according to an embodiment of the present disclosure;

[0022] Fig.10 A schematic block diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0023] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0024] AI (Artificial Intelligence) is a technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. At present, AI technology has the advantages of high automation, high precision and low cost, and has been widely used.

[0025] Natural Language Processing (NLU) is a science that studies computer systems that can effectively implement natural language communication, especially the software systems therein. It is an important direction in the fields of computer science and artificial intelligence.

[0026] DL (Deep Learning) is a new research direction in the field of ML (Machine Learning). It is a science that learns the inherent laws and representation levels of sample data, enabling machines to have analytical learning capabilities like humans and to recognize data such as text, images, and sounds. It is widely used in speech and image recognition.

[0027] A large model refers to a machine learning model with a large parameter scale and complexity. It requires a lot of computing resources and storage space to train and store, and often requires distributed computing and special hardware acceleration technology. Large models have stronger generalization and expression capabilities. Large models include LLM (Large Language Model). A large language model refers to a deep learning model trained with a large amount of text data, which can generate natural language text or understand the meaning of language text. Large language models can handle a variety of natural language tasks, such as text classification, question and answer, dialogue, etc., and are an important path to artificial intelligence.

[0028] Figure 1 FIG. 1 is a flow chart of a large model-based dialogue method according to an embodiment of the present disclosure. Figure 1 As shown, the method includes:

[0029] S101, slicing the candidate document to obtain a plurality of candidate slices.

[0030] It should be noted that the execution subject of the large model-based dialogue method of the embodiment of the present disclosure may be a hardware device with data information processing capabilities and / or the necessary software required to drive the hardware device to work. Optionally, the execution subject may include a workstation, a server, a computer, a user terminal and other intelligent devices. Among them, the user terminal includes but is not limited to a mobile phone, a computer, an intelligent voice interaction device, an intelligent home appliance, a vehicle-mounted terminal, etc.

[0031] It should be noted that there are no excessive restrictions on the candidate documents, for example, they may be composed of at least one language such as Chinese and English, for example, they may include private documents of an enterprise. The candidate slices are generated from the candidate text segments of the candidate documents, for example, the candidate slices may include the candidate text segments of the candidate documents.

[0032] It should be noted that slicing the candidate document to obtain multiple candidate slices can be achieved by using any document slicing method in the relevant technology, and no excessive restrictions are made here.

[0033] In one implementation, slicing the candidate document to obtain multiple candidate slices includes obtaining the number of candidate slices based on the data volume of the candidate document, and slicing the candidate document based on the number of candidate slices to obtain multiple candidate slices.

[0034] It should be noted that there are no excessive restrictions on the data volume of the candidate document. For example, it may include the number of words, characters, paragraphs, lines, etc. of the candidate document.

[0035] In some examples, the number of candidate slices is positively correlated with the amount of data in the candidate documents.

[0036] In some examples, based on the data volume of the candidate document, the number of candidate slices is obtained, including obtaining the ratio of the data volume of the candidate document to the upper limit of the data volume of the candidate slice, and obtaining the smallest positive integer not less than the ratio as the number of candidate slices.

[0037] In some examples, the amount of data for each candidate slice is equal.

[0038] In one embodiment, slicing the candidate document to obtain multiple candidate slices includes slicing the multiple candidate documents respectively to obtain multiple candidate slices. It can be understood that at this time, at least two slices of the multiple candidate slices come from different candidate documents.

[0039] For example, candidate document A can be sliced ​​to obtain candidate slices 1 to 5, candidate document B can be sliced ​​to obtain candidate slices 6 to 10, and candidate document C can be sliced ​​to obtain candidate slices 11 to 20.

[0040] S102, determining a target slice from multiple candidate slices based on the question text.

[0041] It should be noted that there are no excessive restrictions on the question text, for example, it can be composed of at least one language such as Chinese, English, etc. The multiple candidate slices include a target slice, and the number of the target slice is at least one.

[0042] In one embodiment, based on the question text, a target slice is determined from multiple candidate slices, including obtaining the similarity between the question text and the candidate slices, and determining the target slice from the multiple candidate slices based on the similarity.

[0043] In some examples, obtaining the similarity between the question text and the candidate slices includes obtaining the similarity between text features of the question text and text features of the candidate slices.

[0044] In some examples, determining a target slice from a plurality of candidate slices based on similarity includes taking a candidate slice having a similarity greater than a set value as a target slice.

[0045] In some examples, determining a target slice from multiple candidate slices based on similarity includes sorting the multiple candidate slices from high to low according to similarity, and taking the top N candidate slices as the target slice, where N is a positive integer.

[0046] In some examples, determining a target slice from a plurality of candidate slices based on similarity includes taking a candidate slice with a maximum similarity as the target slice.

[0047] In one embodiment, based on the question text, a target slice is determined from multiple candidate slices, including determining a retrieval parameter based on the question text, and retrieving the target slice from multiple candidate slices based on the retrieval parameter.

[0048] It should be noted that there are not too many restrictions on the search parameters. For example, they can include knowledge fields, search keywords, etc.

[0049] In some examples, based on the question text, determining search parameters includes extracting search keywords from the question text.

[0050] In some examples, based on the question text, the search parameters are determined, including performing semantic analysis on the question text to obtain the knowledge field to which the question text belongs as the search parameters.

[0051] S103, obtaining a candidate slice associated with the target slice as an associated slice.

[0052] It should be noted that there may be an association relationship between two candidate slices, and the above association relationship can be established in advance. The associated slice refers to a candidate slice that has an association relationship with the target slice, and the multiple candidate slices include the associated slice, and the number of the associated slices is at least one.

[0053] It should be noted that there are not too many restrictions on the association relationship. For example, it can include supplementary explanations, reference relationships, inclusion relationships, causal relationships, etc.

[0054] In one embodiment, the method further includes establishing an association relationship between the candidate fifth slice and the candidate sixth slice if the candidate fifth slice is a candidate slice that supplements the candidate sixth slice.

[0055] For example, if candidate slice 1 is clause 1, candidate slice 6 is provision 1, and clause 1 is content that supplements provision 1, then an association relationship can be established between candidate slice 1 and candidate slice 6. In this embodiment, candidate slice 1 is the candidate fifth slice, and candidate slice 6 is the candidate sixth slice.

[0056] In one embodiment, the method also includes obtaining a directory hierarchy of candidate text segments of the candidate document, identifying that the third text segment includes a fourth text segment, and that the directory hierarchy of the fourth text segment is subordinate to the directory hierarchy of the third text segment, obtaining a candidate slice that supplements the third text segment as a candidate seventh slice, obtaining a candidate eighth slice corresponding to the fourth text segment, and establishing an association relationship between the candidate seventh slice and the candidate eighth slice.

[0057] It should be noted that there are no excessive restrictions on the directory hierarchy, for example, it may include chapters, sections, items, etc. The directory structures of different candidate documents may be different, and the directory hierarchies of different candidate text segments may be different.

[0058] For example, if candidate slice 1 is clause 1, candidate slice 6 is the candidate slice corresponding to the first section of the second chapter of candidate document B, the second chapter of candidate document B is regulation 1, and clause 1 is the content that supplements regulation 1, then an association relationship can be established between candidate slice 1 and candidate slice 6. In this embodiment, the second chapter of candidate document B is the third text segment, the first section of the second chapter of candidate document B is the fourth text segment, candidate slice 1 is the candidate seventh slice, and candidate slice 6 is the candidate eighth slice.

[0059] It should be noted that there are not too many restrictions on the candidate documents of the target slice and the associated slice sources.

[0060] For example, the target slice and the associated slice come from the same candidate document.

[0061] For example, at least two slices of the target slice and the associated slice are from different candidate documents. Thus, slices from different documents can be considered to generate the answer text, thereby improving the comprehensiveness and accuracy of the answer text.

[0062] S104, obtaining a prompt text of the first large model based on the target slice and the associated slice.

[0063] It should be noted that there are no excessive restrictions on the prompt text (prompt), for example, the prompt text can be in a vector format.

[0064] It should be noted that the first large model can be implemented by any large model in the relevant technology, and no further limitation is given here. For example, it can be a Transformer model, and it should be noted that the Transformer model is a neural network model based on the self-attention mechanism. For example, the first large model can be a large language model.

[0065] In one embodiment, based on the target slice and the associated slice, the prompt text of the first large model is obtained, including splicing the target slice and the associated slice to obtain the prompt text.

[0066] In one embodiment, based on the target slice and the associated slice, the prompt text of the first large model is obtained, including splicing the question text, the target slice and the associated slice to obtain the prompt text, so as to realize the generation of the prompt text.

[0067] In one embodiment, based on the target slice and the associated slice, the prompt text of the first large model is obtained, including obtaining a template of the prompt text, splicing the target slice and the associated slice to obtain a spliced ​​text, and replacing the first text to be replaced in the template of the prompt text with the spliced ​​text to obtain the prompt text.

[0068] In some examples, the method further includes replacing the second text to be replaced in the template of the prompt text with the question text to obtain the prompt text.

[0069] S105, inputting the prompt text into the first large model, and the first large model outputs the answer text for the question text.

[0070] In one embodiment, the method further includes generating a response text based on the target slice and the associated slice by using a first large model.

[0071] In some examples, the answer text is generated based on the target slice and the associated slices by the first large model, including extracting answer keywords from the target slice and the associated slices by the first large model, and generating the answer text based on the answer keywords by the first large model.

[0072] For example, answer keywords are extracted from the target slice and the associated slice by using the first large model, including extracting answer keywords from the target slice and the associated slice based on the question text by using the first large model.

[0073] In some examples, answer text is generated based on the target slice and the associated slices by the first large model, including performing semantic analysis on the target slice and the associated slices by the first large model to obtain answer keywords, and generating answer text based on the answer keywords by the first large model.

[0074] The dialogue method based on the large model proposed in the present disclosure slices the candidate document to obtain multiple candidate slices, determines the target slice from the multiple candidate slices based on the question text, obtains the candidate slice associated with the target slice as the associated slice, obtains the prompt text of the first large model based on the target slice and the associated slice, inputs the prompt text into the first large model, and the first large model outputs the answer text for the question text. Thus, the target slice determined based on the question text and the candidate slice associated with the target slice can be comprehensively considered to obtain the prompt text of the first large model, so that the first large model can comprehensively consider the target slice and the associated slice to generate the answer text, thereby improving the comprehensiveness of the prompt text of the first large model, and further improving the comprehensiveness and accuracy of the answer text.

[0075] In the above embodiment, in step S101, the candidate document is sliced ​​to obtain multiple candidate slices, which can be combined with Figure 2 Further understanding, Figure 2 FIG. 1 is a flow chart of a large model-based dialogue method according to another embodiment of the present disclosure. Figure 2 As shown, the method includes:

[0076] S201, obtaining the directory hierarchy of the candidate text segments of the candidate document.

[0077] The relevant contents of step S201 can be found in the above embodiment and will not be described again here.

[0078] S202: Determine a first text segment from a plurality of candidate text segments, wherein the first text segment does not include a text segment at a next directory level.

[0079] S203, slicing the candidate document to obtain a plurality of first text segments, wherein the first text segments are candidate slices.

[0080] For example, each first text segment is a candidate slice.

[0081] For example, the first text segment may include a candidate text segment at the smallest directory level.

[0082] For example, the candidate document includes chapters 1 to 3, chapter 1 includes sections 1 to 2, chapter 2 includes sections 1 to 2, chapter 3 includes sections 1 to 3, and section 1 of chapter 3 includes headings 1 to 3.

[0083] It can be understood that Section 1 of Chapter 1, Section 2 of Chapter 1, Section 1 of Chapter 2, Section 2 of Chapter 2, Section 1 of Chapter 3, Section 1, First Item of Chapter 3, Section 1, Second Item of Chapter 3, Section 1, Third Item of Chapter 3, Section 2 of Chapter 3, and Section 3 of Chapter 3 are all first text fragments.

[0084] The candidate documents can be sliced ​​to obtain the first section of the first chapter, the second section of the first chapter, the first section of the second chapter, the second section of the second chapter, the first item of the first section of the third chapter, the second item of the first section of the third chapter, the third item of the first section of the third chapter, the second section of the third chapter, and the third section of the third chapter.

[0085] It can be understood that the first section of chapter 1, the second section of chapter 1, the first section of chapter 2, the second section of chapter 2, the first item of chapter 3, the second item of chapter 3, the first item of chapter 3, the second section of chapter 3, and the third section of chapter 3 are all candidate slices.

[0086] In one embodiment, the method further includes storing the directory hierarchy of the candidate text segments corresponding to the candidate slices. Thus, the directory hierarchy of the text segments corresponding to the document slices can be stored so as to retain the hierarchical relationship between the text segments.

[0087] S204, determining a target slice from multiple candidate slices based on the question text.

[0088] S205: Acquire a candidate slice associated with the target slice as an associated slice.

[0089] S206, obtaining a prompt text of the first large model based on the target slice and the associated slice.

[0090] S207, input the prompt text into the first large model, and the first large model outputs the answer text for the question text.

[0091] The relevant contents of steps S204-S207 can be found in the above embodiment and will not be repeated here.

[0092] The large model-based dialogue method proposed in the present disclosure obtains the directory hierarchy of the candidate text segments of the candidate document, determines the first text segment from multiple candidate text segments, wherein the first text segment does not include the text segments of the next directory hierarchy, slices the candidate document, and obtains multiple first text segments, wherein the first text segment is a candidate slice. Thus, the document can be sliced ​​taking into account the directory hierarchy of the text segments of the document, and the document can be sliced ​​at a finer granularity.

[0093] In the above embodiment, in step S101, the candidate document is sliced ​​to obtain multiple candidate slices, which can be combined with Figure 3 Further understanding, Figure 3 FIG. 1 is a flow chart of a large model-based dialogue method according to another embodiment of the present disclosure. Figure 3 As shown, the method includes:

[0094] S301, slicing the candidate document to obtain a plurality of initial slices.

[0095] S302: If the data volume of the initial slice is less than or equal to a set threshold, the initial slice is used as a candidate slice.

[0096] S303: If the data volume of the initial slice is greater than the set threshold, a summary text of the initial slice is obtained as a candidate slice.

[0097] It should be noted that there are no excessive restrictions on setting the threshold.

[0098] It should be noted that there are no excessive restrictions on the data volume of the initial slice. For example, it may include the number of words, characters, paragraphs, lines, etc. of the initial slice.

[0099] It should be noted that the terms summary text, summary text, induction text, and generalization text can be interchangeable. The summary text of the initial slice can be obtained by using any summary text acquisition method in the relevant technology, and no further limitation is made here.

[0100] In one embodiment, obtaining the summary text of the initial slice includes inputting the initial slice into the third largest model, and the third largest model outputting the summary text of the initial slice. Thus, the initial slice can be processed by the third largest model to obtain the summary text of the initial slice.

[0101] It should be noted that, for the relevant contents of the third model, reference can be made to the relevant contents of the first model in the above embodiment, which will not be repeated here.

[0102] S304, determining a target slice from multiple candidate slices based on the question text.

[0103] S305: Acquire a candidate slice associated with the target slice as an associated slice.

[0104] S306, obtaining a prompt text of the first large model based on the target slice and the associated slice.

[0105] S307, input the prompt text into the first large model, and the first large model outputs the answer text for the question text.

[0106] The relevant contents of steps S304-S307 can be found in the above embodiment and will not be repeated here.

[0107] The large model-based dialogue method proposed in the present disclosure slices the candidate document to obtain multiple initial slices. If the data volume of the initial slice is less than or equal to the set threshold, the initial slice is used as a candidate slice. If the data volume of the initial slice is greater than the set threshold, the summary text of the initial slice is obtained as a candidate slice. Therefore, if the data volume of the initial slice is small, the initial slice is directly used as a candidate slice. If the data volume of the initial slice is large, the summary text of the initial slice can be obtained as a candidate slice, so that the data volume of the candidate slice is small, which helps to save computing resources and storage space.

[0108] Based on any of the above embodiments, obtaining a candidate slice associated with the target slice as an associated slice includes obtaining a candidate slice that supplements the target slice, and / or obtaining a candidate slice that supplements the target slice as an associated slice. Thus, the associated slice can be determined by considering the association relationship of the supplementary descriptions between the document slices.

[0109] For example, if the target slice is Clause 1, candidate slice 6 is Regulation 1, and Clause 1 is the content that supplements Regulation 1, then candidate slice 6 that supplements the target slice can be used as an associated slice.

[0110] For example, if the target slice is Clause 1, candidate slice 7 is Provision 2, and Provision 2 is the content that supplements Clause 1, then candidate slice 7 that supplements the target slice can be used as an associated slice.

[0111] In the above embodiment, in step S103, the candidate slices associated with the target slice are obtained as associated slices. Figure 4 Further understanding, Figure 4 FIG. 1 is a flow chart of a large model-based dialogue method according to another embodiment of the present disclosure. Figure 4 As shown, the method includes:

[0112] S401, slicing the candidate document to obtain a plurality of candidate slices.

[0113] S402, determining a target slice from multiple candidate slices based on the question text.

[0114] S403: Obtain the directory hierarchy of the candidate text segment of the candidate document.

[0115] The relevant contents of steps S401 - S403 can be found in the above embodiment and will not be described again here.

[0116] S404, obtaining a target text segment corresponding to the target slice.

[0117] S405 , identifying that the second text segment includes a target text segment, and the directory hierarchy of the target text segment is subordinate to the directory hierarchy of the second text segment.

[0118] S406: Obtain a candidate slice that supplements the description of the second text segment, and / or obtain a candidate slice that supplements the description of the second text segment as an associated slice.

[0119] It can be understood that the candidate slice that supplements the second text segment is also a candidate slice that supplements the target text segment (i.e., the target slice), and the candidate slice that supplements the second text segment is also a candidate slice that supplements the target text segment (i.e., the target slice).

[0120] For example, if candidate slice 1 is clause 1, and the target slice is the candidate slice corresponding to the first section of the third chapter of candidate document B, and the third chapter of candidate document B is provision 2, and provision 2 is the content that supplements clause 1, then candidate slice 1 that supplements provision 2 can be used as an associated slice. It can be understood that the candidate slices that supplement the target slice include candidate slice 1.

[0121] For example, if candidate slice 1 is clause 1, the target slice is the candidate slice corresponding to the first section of the second chapter of candidate document B, the second chapter of candidate document B is regulation 1, and clause 1 is the content that supplements regulation 1, then candidate slice 1 that supplements regulation 1 can be used as the associated slice. It can be understood that the candidate slice that supplements the target slice includes candidate slice 1.

[0122] S407, obtaining a prompt text of the first large model based on the target slice and the associated slice.

[0123] S408, input the prompt text into the first large model, and the first large model outputs the answer text for the question text.

[0124] The relevant contents of steps S407-S408 can be found in the above embodiment and will not be repeated here.

[0125] The large model-based dialogue method proposed in the present disclosure obtains the directory hierarchy of the candidate text segment of the candidate document, obtains the target text segment corresponding to the target slice, identifies that the second text segment includes the target text segment, and the directory hierarchy of the target text segment is subordinate to the directory hierarchy of the second text segment, obtains the candidate slice that supplements the second text segment, and / or obtains the candidate slice that supplements the second text segment as an associated slice. Thus, the associated relationship of the supplementary descriptions between the text segments and the hierarchical relationship between the text segments can be comprehensively considered to determine the associated slice.

[0126] In the above embodiment, in step S103, the candidate slices associated with the target slice are obtained as associated slices. Figure 5 Further understanding, Figure 5 FIG. 1 is a flow chart of a large model-based dialogue method according to another embodiment of the present disclosure. Figure 5 As shown, the method includes:

[0127] S501, slicing the candidate document to obtain multiple candidate slices.

[0128] S502, determining a target slice from multiple candidate slices based on the question text.

[0129] The relevant contents of steps S501 - S502 can be found in the above embodiment and will not be described again here.

[0130] S503, constructing a knowledge tree based on the multiple candidate slices and the association relationships between the multiple candidate slices, wherein the candidate nodes in the knowledge tree are used to represent the candidate slices, and the edges in the knowledge tree are used to represent the association relationships.

[0131] It should be noted that the candidate nodes in the knowledge tree correspond one-to-one to the candidate slices, that is, the number of candidate nodes in the knowledge tree is equal to the number of candidate slices. The edges in the knowledge tree are used to represent the association relationship between the candidate slices corresponding to the two candidate nodes connected by the edges. The edges in the knowledge tree may include undirected edges, directed edges, etc. There may or may not be an edge between any two candidate nodes in the knowledge tree.

[0132] In one embodiment, a knowledge tree is constructed based on multiple candidate slices and the association relationship between the multiple candidate slices, including if the candidate first slice is a candidate slice that supplements the description of the candidate second slice, the candidate second node corresponding to the candidate second slice is used as the parent node of the candidate first node corresponding to the candidate first slice, and a connection edge is added between the candidate first node and the candidate second node. Thus, the association relationship of the supplementary description between the document slices can be taken into account, the parent-child relationship of the candidate nodes can be determined and the connection edge can be added to construct the knowledge tree.

[0133] S504: Determine the target node corresponding to the target slice based on the knowledge tree.

[0134] S505: The candidate slices corresponding to the candidate nodes having a connection edge with the target node are used as associated slices.

[0135] It should be noted that the target node refers to the candidate node corresponding to the target slice in the knowledge tree.

[0136] In one embodiment, the candidate slice corresponding to the candidate node having a connection edge with the target node is used as an associated slice, including using the candidate slice corresponding to the parent node of the target node as an associated slice. It can be understood that the candidate slice corresponding to the parent node of the target node is a candidate slice that supplements the target slice, and thus, the candidate slice that supplements the target slice can be used as an associated slice.

[0137] In one embodiment, the candidate slice corresponding to the candidate node having a connection edge with the target node is used as an associated slice, including the candidate slice corresponding to the child node of the target node as an associated slice. It can be understood that the candidate slice corresponding to the child node of the target node is a candidate slice that supplements the target slice, and thus the candidate slice that supplements the target slice can be used as an associated slice.

[0138] S506, obtaining a prompt text of the first large model based on the target slice and the associated slice.

[0139] S507, input the prompt text into the first large model, and the first large model outputs the answer text for the question text.

[0140] The relevant contents of steps S506-S507 can be found in the above embodiment and will not be repeated here.

[0141] The large model-based dialogue method proposed in the present disclosure constructs a knowledge tree based on multiple candidate slices and the association relationship between the multiple candidate slices, wherein the candidate nodes in the knowledge tree are used to characterize the candidate slices, and the edges in the knowledge tree are used to characterize the association relationship. Based on the knowledge tree, the target node corresponding to the target slice is determined, and the candidate slice corresponding to the candidate node having a connection edge with the target node is used as the associated slice. Thus, considering the association relationship between the multiple candidate slices and the multiple candidate slices, a knowledge tree can be constructed, and based on the knowledge tree, the target node corresponding to the target slice is determined, and the candidate slice corresponding to the candidate node connected to the target node is obtained as the associated slice, so as to achieve the acquisition of the associated slice.

[0142] Based on any of the above embodiments, the method further includes inputting the candidate third slice into the second large model, and the second large model outputs the association relationship recognition result of the candidate third slice, wherein the association relationship recognition result includes whether there is an association relationship between the candidate third slice and the candidate fourth slice. Thus, the document slices can be processed by the second large model to identify whether there is an association relationship between the document slices.

[0143] It should be noted that, for the relevant contents of the second largest model, reference can be made to the relevant contents of the first largest model in the above embodiment, which will not be repeated here.

[0144] In one embodiment, the method also includes performing semantic analysis on the candidate third slice through a second large model, determining that the candidate third slice is a candidate slice that supplements the candidate fourth slice, or determining that the candidate third slice is a candidate slice that supplements the candidate fourth slice, and generating an association relationship recognition result indicating that there is an association relationship between the candidate third slice and the candidate fourth slice.

[0145] In the above embodiment, the first model obtains the answer text, which can be combined with Figure 6 Further understanding, Figure 6 FIG. 1 is a flow chart of a large model-based dialogue method according to another embodiment of the present disclosure. Figure 6 As shown, the method includes:

[0146] S601, slicing the candidate document to obtain a plurality of candidate slices.

[0147] S602, determining a target slice from multiple candidate slices based on the question text.

[0148] S603: Acquire a candidate slice associated with the target slice as an associated slice.

[0149] S604, concatenating the question text, the target slice and the associated slice to obtain a prompt text.

[0150] S605, inputting the prompt text into the first large model.

[0151] The relevant contents of steps S601-S605 can be found in the above embodiment and will not be repeated here.

[0152] S606: Determine a key slice from the target slice and the associated slices using the first large model.

[0153] It should be noted that the key slice includes a target slice and / or an associated slice, and the number of the key slice is at least one.

[0154] In one embodiment, determining a key slice from a target slice and associated slices by using a first large model includes determining a key slice from a target slice and associated slices based on a question text by using the first large model.

[0155] In some examples, a key slice is determined from a target slice and associated slices based on a question text through a first large model, including obtaining the similarity between the question text and the target slice through the first large model, obtaining the similarity between the question text and the associated slice through the first large model, and determining the key slice from the target slice and the associated slice based on the similarity through the first large model.

[0156] It should be noted that, for the relevant content of obtaining the similarity between the question text and the document slice, please refer to the above embodiment.

[0157] In some examples, determining a key slice from a target slice and associated slices based on similarity using the first large model includes using the first large model to select slices with similarity greater than a set value as key slices.

[0158] In some examples, the key slices are determined from the target slices and the associated slices based on similarity using the first large model, including sorting the target slices and the associated slices from high to low according to similarity using the first large model, and taking the top N slices as the key slices.

[0159] S607, generating a response text based on the key slices through the first large model.

[0160] In one embodiment, the answer text is generated based on the key slices by the first large model, including extracting answer keywords from the key slices by the first large model, and generating the answer text based on the answer keywords by the first large model.

[0161] For example, answer keywords are extracted from key slices through the first large model, including extracting answer keywords from key slices based on question text through the first large model.

[0162] In one embodiment, the answer text is generated based on the key slices by the first large model, including performing semantic analysis on the key slices by the first large model to obtain answer keywords, and generating the answer text based on the answer keywords by the first large model.

[0163] The large model-based dialogue method proposed in the present disclosure determines key slices from the target slices and the associated slices through the first large model, and generates a reply text based on the key slices through the first large model. Thus, the key slices can be further determined from the target slices and the associated slices through the first large model to generate a reply text.

[0164] Figure 7 FIG. 1 is a flow chart of a model training method according to an embodiment of the present disclosure. Figure 7 As shown, the method includes:

[0165] S701, slicing the sample candidate document to obtain a plurality of sample candidate slices.

[0166] S702, based on the sample question text, determine a sample target slice from multiple sample candidate slices.

[0167] S703: Acquire a sample candidate slice associated with the sample target slice as a sample associated slice.

[0168] S704, obtaining a sample prompt text of the first large model based on the sample target slice and the sample associated slice.

[0169] S705, input the sample prompt text into the first large model, and the first large model outputs the predicted answer text for the sample question text.

[0170] It should be noted that the execution subject of the model training method of the embodiment of the present disclosure may be a hardware device with data information processing capabilities and / or the necessary software required to drive the hardware device to work. Optionally, the execution subject may include a workstation, a server, a computer, a user terminal and other intelligent devices. Among them, the user terminal includes but is not limited to a mobile phone, a computer, an intelligent voice interaction device, a smart home appliance, a car terminal, etc.

[0171] It should be noted that, the relevant contents of step S701 can refer to the relevant contents of step S101, the relevant contents of step S702 can refer to the relevant contents of step S102, the relevant contents of step S703 can refer to the relevant contents of step S103, the relevant contents of step S704 can refer to the relevant contents of step S104, and the relevant contents of step S705 can refer to the relevant contents of step S105, and they will not be repeated here.

[0172] S706: Training the first large model based on the predicted answer text and the sample answer text for the sample question text.

[0173] It should be noted that the first large model is trained based on the predicted answer text and the sample answer text for the sample question text, and any model training method in the relevant technology can be used to achieve this, and no further restrictions are made here. Among them, the model training method may include LoRA (Low-Rank Adaptation) and instruction fine-tuning (Instruction Fine-Tuning) methods. It should be noted that LoRA is a method for efficient fine-tuning of model parameters (Parameter-Efficient Fine-Tuning).

[0174] In one embodiment, the first large model is trained based on the predicted answer text and the sample answer text for the sample question text, including the predicted answer text and the sample answer text, to obtain the loss function of the first large model, and the first large model is trained based on the loss function. It should be noted that there is no excessive limitation on the loss function, for example, it may include CE (Cross Entropy), MSE (Mean-Square Error), KL (Kullback-Leibler) divergence, contrast loss function, etc.

[0175] The model training method proposed in the present disclosure slices the sample candidate document to obtain multiple sample candidate slices, determines the sample target slice from the multiple sample candidate slices based on the sample question text, obtains the sample candidate slice associated with the sample target slice as the sample associated slice, obtains the sample prompt text of the first large model based on the sample target slice and the sample associated slice, inputs the sample prompt text into the first large model, and the first large model outputs the predicted answer text for the sample question text, and trains the first large model based on the predicted answer text and the sample answer text for the sample question text. Thus, the sample target slice determined based on the sample question text and the sample candidate slice associated with the sample target slice can be comprehensively considered to obtain the sample prompt text of the first large model, so that the first large model can comprehensively consider the sample target slice and the sample associated slice to generate the predicted answer text, and the first large model can learn the relationship between the sample target slice, the sample associated slice and the sample answer text during the training process, so that the trained first large model can generate the answer text based on the target slice and the associated slice.

[0176] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0177] According to an embodiment of the present disclosure, the present disclosure also provides a large model-based dialogue device for implementing the above-mentioned large model-based dialogue method.

[0178] Figure 8 It is a block diagram of a conversation device based on a large model according to an embodiment of the present disclosure.

[0179] like Figure 8 As shown, the large model-based dialogue device 800 includes: a slicing module 801, a determination module 802, a first acquisition module 803, a second acquisition module 804 and a third acquisition module 805.

[0180] The slicing module 801 is used to slice the candidate document to obtain multiple candidate slices;

[0181] The determination module 802 is used to determine a target slice from a plurality of candidate slices based on the question text;

[0182] The first acquisition module 803 is used to acquire a candidate slice associated with the target slice as an associated slice;

[0183] The second acquisition module 804 is used to obtain the prompt text of the first large model based on the target slice and the associated slice;

[0184] The third acquisition module 805 is used to input the prompt text into the first large model, and the first large model outputs the answer text for the question text.

[0185] In one embodiment of the present disclosure, the slicing module 801 is also used to: obtain the directory hierarchy of the candidate text segments of the candidate document; determine a first text segment from multiple candidate text segments, wherein the first text segment does not include text segments of the next directory hierarchy; slice the candidate document to obtain multiple first text segments, wherein the first text segment is the candidate slice.

[0186] In one embodiment of the present disclosure, the slicing module 801 is also used to: slice the candidate document to obtain multiple initial slices; if the data volume of the initial slice is less than or equal to a set threshold, use the initial slice as the candidate slice; if the data volume of the initial slice is greater than the set threshold, obtain the summary text of the initial slice as the candidate slice.

[0187] In one embodiment of the present disclosure, the first acquisition module 803 is further used to: acquire a candidate slice that supplements the target slice, and / or acquire a candidate slice that supplements the target slice as the associated slice.

[0188] In one embodiment of the present disclosure, the first acquisition module 803 is also used to: obtain the directory hierarchy of the candidate text segment of the candidate document; obtain the target text segment corresponding to the target slice; identify that the second text segment includes the target text segment, and the directory hierarchy of the target text segment is subordinate to the directory hierarchy of the second text segment; obtain a candidate slice that supplements the second text segment, and / or obtain a candidate slice that supplements the second text segment as the associated slice.

[0189] In one embodiment of the present disclosure, the first acquisition module 803 is also used to: construct a knowledge tree based on the multiple candidate slices and the association relationship between the multiple candidate slices, wherein the candidate nodes in the knowledge tree are used to characterize the candidate slices, and the edges in the knowledge tree are used to characterize the association relationship; based on the knowledge tree, determine the target node corresponding to the target slice; and use the candidate slice corresponding to the candidate node having a connecting edge with the target node as the associated slice.

[0190] In one embodiment of the present disclosure, the first acquisition module 803 is also used for: if the candidate first slice is a candidate slice that supplements the candidate second slice, the candidate second node corresponding to the candidate second slice is used as the parent node of the candidate first node corresponding to the candidate first slice, and a connecting edge is added between the candidate first node and the candidate second node; the candidate slice corresponding to the parent node of the target node is used as the associated slice.

[0191] In one embodiment of the present disclosure, the first acquisition module 803 is further used to: input the candidate third slice into the second large model, and the second large model outputs the association relationship identification result of the candidate third slice, wherein the association relationship identification result includes whether there is an association relationship between the candidate third slice and the candidate fourth slice.

[0192] In one embodiment of the present disclosure, the second acquisition module 804 is further used to: splice the question text, the target slice and the associated slice to obtain the prompt text.

[0193] In one embodiment of the present disclosure, the third acquisition module 805 is further used to: determine a key slice from the target slice and the associated slice using the first large model; and generate the answer text based on the key slice using the first large model.

[0194] In one embodiment of the present disclosure, at least two of the target slice and the associated slice are derived from different candidate documents.

[0195] The dialogue device based on the large model proposed in the present disclosure slices the candidate document to obtain multiple candidate slices, determines the target slice from the multiple candidate slices based on the question text, obtains the candidate slice associated with the target slice as the associated slice, obtains the prompt text of the first large model based on the target slice and the associated slice, inputs the prompt text into the first large model, and the first large model outputs the answer text for the question text. Thus, the target slice determined based on the question text and the candidate slice associated with the target slice can be comprehensively considered to obtain the prompt text of the first large model, so that the first large model can comprehensively consider the target slice and the associated slice to generate the answer text, thereby improving the comprehensiveness of the prompt text of the first large model, and further improving the comprehensiveness and accuracy of the answer text.

[0196] According to an embodiment of the present disclosure, the present disclosure also provides a model training device for implementing the above-mentioned model training method.

[0197] Fig. 9 It is a block diagram of a model training device according to an embodiment of the present disclosure.

[0198] like Fig. 9 As shown, the model training device 900 includes: a slicing module 901, a determination module 902, a first acquisition module 903, a second acquisition module 904, a third acquisition module 905 and a training module 906.

[0199] The slicing module 901 is used to slice the sample candidate document to obtain multiple sample candidate slices;

[0200] The determination module 902 is used to determine a sample target slice from a plurality of sample candidate slices based on the sample question text;

[0201] The first acquisition module 903 is used to acquire a sample candidate slice associated with the sample target slice as a sample associated slice;

[0202] The second acquisition module 904 is used to obtain the sample prompt text of the first large model based on the sample target slice and the sample associated slice;

[0203] The third acquisition module 905 is used to input the sample prompt text into the first large model, and the first large model outputs the predicted answer text for the sample question text;

[0204] The training module 906 is used to train the first large model based on the predicted answer text and the sample answer text for the sample question text.

[0205] The model training device proposed in the present disclosure slices the sample candidate document to obtain multiple sample candidate slices, determines the sample target slice from the multiple sample candidate slices based on the sample question text, obtains the sample candidate slice associated with the sample target slice as the sample associated slice, obtains the sample prompt text of the first large model based on the sample target slice and the sample associated slice, inputs the sample prompt text into the first large model, and the first large model outputs the predicted answer text for the sample question text, and trains the first large model based on the predicted answer text and the sample answer text for the sample question text. Thus, the sample target slice determined based on the sample question text and the sample candidate slice associated with the sample target slice can be comprehensively considered to obtain the sample prompt text of the first large model, so that the first large model can comprehensively consider the sample target slice and the sample associated slice to generate the predicted answer text, and the first large model can learn the relationship between the sample target slice, the sample associated slice and the sample answer text during the training process, so that the trained first large model can generate the answer text based on the target slice and the associated slice.

[0206] According to an embodiment of the present disclosure, the present disclosure also proposes an electronic device, a readable storage medium, and a computer program product.

[0207] Fig.10 A schematic block diagram of an example electronic device 1000 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0208] like Fig.10 As shown, the device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0209] A number of components in the device 1000 are connected to the I / O interface 1005, including: an input unit 1006, such as a keyboard, a mouse, etc.; an output unit 1006, such as various types of displays, speakers, etc.; a storage unit 1008, such as a disk, an optical disk, etc.; and a communication unit 1009, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1009 allows the device 1000 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0210] The computing unit 1001 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1001 performs the various methods and processes described above, such as a dialogue method based on a large model and a model training method. For example, in some embodiments, a dialogue method based on a large model and a model training method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1008. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1000 via the ROM 1002 and / or the communication unit 1009. When the computer program is loaded into the RAM 1003 and executed by the computing unit 1001, one or more steps of the dialogue method based on the large model and the model training method described above may be executed. Alternatively, in other embodiments, the computing unit 1001 may be configured to execute a large model-based dialogue method or a model training method in any other appropriate manner (eg, by means of firmware).

[0211] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0212] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be presented to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0213] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0214] To propose interactions with a user account, the systems and techniques described herein may be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user account; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user account can propose input to the computer. Other types of devices may also be used to propose interactions with the user account; for example, feedback proposed to the user account may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user account may be received in any form (including acoustic input, voice input, or tactile input).

[0215] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user account computer with a graphical user account interface or a web browser through which a user account can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communications network). Examples of communications networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0216] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0217] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the steps of the large model-based dialogue method and the model training method described in the above embodiments of the present disclosure are implemented.

[0218] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0219] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A dialogue method based on a large model, comprising: Slice the candidate documents to obtain multiple candidate slices; Based on the question text, determining a target slice from a plurality of candidate slices; Acquire a candidate slice associated with the target slice as an associated slice; Based on the target slice and the associated slice, obtaining a prompt text of the first large model; The prompt text is input into the first large model, and the first large model outputs an answer text for the question text.

2. The method according to claim 1, wherein: The candidate document is sliced ​​to obtain multiple candidate slices, including: Obtaining a directory hierarchy of candidate text segments of the candidate document; Determine a first text segment from the plurality of candidate text segments, wherein the first text segment does not include a text segment at a next directory level; The candidate document is sliced ​​to obtain a plurality of the first text segments, wherein the first text segments are the candidate slices.

3. The method according to claim 1, wherein: The candidate document is sliced ​​to obtain multiple candidate slices, including: Slicing the candidate document to obtain a plurality of initial slices; If the data amount of the initial slice is less than or equal to the set threshold, the initial slice is used as the candidate slice; If the data volume of the initial slice is greater than the set threshold, a summary text of the initial slice is obtained as the candidate slice.

4. The method according to claim 1, wherein: The step of obtaining a candidate slice associated with the target slice as an associated slice includes: A candidate slice that supplements the target slice is obtained, and / or a candidate slice that supplements the target slice is obtained as the associated slice.

5. The method according to claim 1, wherein: The step of obtaining a candidate slice associated with the target slice as an associated slice includes: Obtaining a directory hierarchy of candidate text segments of the candidate document; Obtaining a target text segment corresponding to the target slice; Identify that the second text segment includes the target text segment, and the directory hierarchy of the target text segment is subordinate to the directory hierarchy of the second text segment; A candidate slice for supplementing the description of the second text segment is obtained, and / or a candidate slice for supplementing the description of the second text segment is obtained as the associated slice.

6. The method according to claim 1, wherein: The step of obtaining a candidate slice associated with the target slice as an associated slice includes: Based on the plurality of candidate slices and the association relationships between the plurality of candidate slices, a knowledge tree is constructed, wherein the candidate nodes in the knowledge tree are used to represent the candidate slices, and the edges in the knowledge tree are used to represent the association relationships; Based on the knowledge tree, determining a target node corresponding to the target slice; The candidate slice corresponding to the candidate node having a connection edge with the target node is used as the associated slice.

7. The method according to claim 6, wherein: The step of constructing a knowledge tree based on the plurality of candidate slices and the association relationship between the plurality of candidate slices includes: If the candidate first slice is a candidate slice that supplements the candidate second slice, use the candidate second node corresponding to the candidate second slice as the parent node of the candidate first node corresponding to the candidate first slice, and add a connecting edge between the candidate first node and the candidate second node; The step of using the candidate slice corresponding to the candidate node having a connection edge with the target node as the associated slice includes: The candidate slice corresponding to the parent node of the target node is used as the associated slice.

8. The method according to claim 1, wherein: The method further comprises: The candidate third slice is input into the second large model, and the second large model outputs an association relationship recognition result of the candidate third slice, wherein the association relationship recognition result includes whether there is an association relationship between the candidate third slice and the candidate fourth slice.

9. The method according to claim 1, wherein: The step of obtaining a prompt text of a first large model based on the target slice and the associated slice includes: The question text, the target slice and the associated slice are spliced ​​to obtain the prompt text.

10. The method according to claim 1, wherein: The method further comprises: Determine a key slice from the target slice and the associated slice by using the first large model; The answer text is generated based on the key slices through the first large model.

11. The method according to any one of claims 1 to 10, wherein: At least two of the target slice and the associated slice are derived from different candidate documents.

12. A model training method, comprising: Slicing the sample candidate document to obtain multiple sample candidate slices; Based on the sample question text, determine a sample target slice from multiple sample candidate slices; Acquire a sample candidate slice associated with the sample target slice as a sample associated slice; Based on the sample target slice and the sample associated slice, obtain a sample prompt text of the first large model; Inputting the sample prompt text into the first large model, and having the first large model output a predicted answer text for the sample question text; The first large model is trained based on the predicted answer text and the sample answer text for the sample question text.

13. A dialogue device based on a large model, comprising: A slicing module, used to slice the candidate documents to obtain multiple candidate slices; A determination module, used for determining a target slice from a plurality of candidate slices based on the question text; A first acquisition module, configured to acquire a candidate slice associated with the target slice as an associated slice; A second acquisition module, configured to obtain a prompt text of the first large model based on the target slice and the associated slice; The third acquisition module is used to input the prompt text into the first large model, and the first large model outputs the answer text for the question text.

14. The device according to claim 13, wherein: The slicing module is also used for: Obtaining a directory hierarchy of candidate text segments of the candidate document; Determine a first text segment from the plurality of candidate text segments, wherein the first text segment does not include a text segment at a next directory level; The candidate document is sliced ​​to obtain a plurality of the first text segments, wherein the first text segments are the candidate slices.

15. The device according to claim 13, wherein: The slicing module is also used for: Slicing the candidate document to obtain a plurality of initial slices; If the data amount of the initial slice is less than or equal to the set threshold, the initial slice is used as the candidate slice; If the data volume of the initial slice is greater than the set threshold, a summary text of the initial slice is obtained as the candidate slice.

16. The device according to claim 13, wherein: The first acquisition module is further used for: A candidate slice that supplements the target slice is obtained, and / or a candidate slice that supplements the target slice is obtained as the associated slice.

17. The device according to claim 13, wherein: The first acquisition module is further used for: Obtaining a directory hierarchy of candidate text segments of the candidate document; Obtaining a target text segment corresponding to the target slice; Identify that the second text segment includes the target text segment, and the directory hierarchy of the target text segment is subordinate to the directory hierarchy of the second text segment; A candidate slice for supplementing the description of the second text segment is obtained, and / or a candidate slice for supplementing the description of the second text segment is obtained as the associated slice.

18. The device according to claim 13, wherein: The first acquisition module is further used for: Based on the plurality of candidate slices and the association relationships between the plurality of candidate slices, a knowledge tree is constructed, wherein the candidate nodes in the knowledge tree are used to represent the candidate slices, and the edges in the knowledge tree are used to represent the association relationships; Based on the knowledge tree, determining a target node corresponding to the target slice; The candidate slice corresponding to the candidate node having a connection edge with the target node is used as the associated slice.

19. The device according to claim 18, wherein: The first acquisition module is further used for: If the candidate first slice is a candidate slice that supplements the candidate second slice, use the candidate second node corresponding to the candidate second slice as the parent node of the candidate first node corresponding to the candidate first slice, and add a connecting edge between the candidate first node and the candidate second node; The step of using the candidate slice corresponding to the candidate node having a connection edge with the target node as the associated slice includes: The candidate slice corresponding to the parent node of the target node is used as the associated slice.

20. The device according to claim 13, wherein: The first acquisition module is further used for: The candidate third slice is input into the second large model, and the second large model outputs an association relationship recognition result of the candidate third slice, wherein the association relationship recognition result includes whether there is an association relationship between the candidate third slice and the candidate fourth slice.

21. The device according to claim 13, wherein: The second acquisition module is further used for: The question text, the target slice and the associated slice are spliced ​​to obtain the prompt text.

22. The device according to claim 13, wherein: The third acquisition module is further used for: Determine a key slice from the target slice and the associated slice by using the first large model; The answer text is generated based on the key slices through the first large model.

23. The device according to any one of claims 13 to 22, wherein: At least two of the target slice and the associated slice are derived from different candidate documents.

24. A model training device, comprising: A slicing module, used to slice the sample candidate document to obtain multiple sample candidate slices; A determination module, used for determining a sample target slice from a plurality of sample candidate slices based on a sample question text; A first acquisition module, configured to acquire a sample candidate slice associated with the sample target slice as a sample associated slice; A second acquisition module, configured to obtain a sample prompt text of a first large model based on the sample target slice and the sample associated slice; A third acquisition module, used for inputting the sample prompt text into the first large model, and the first large model outputs a predicted answer text for the sample question text; A training module is used to train the first large model based on the predicted answer text and the sample answer text for the sample question text.

25. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 12.

26. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-12.

27. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 12.