Financial knowledge question and answer method, device and equipment and computer readable storage medium

By interpreting financial knowledge terms in user questions and using vector models to obtain relevant financial knowledge document slices, the guide text input into large language models is constructed, which solves the problem of understanding deviation of knowledge Q&A system in the field of capital management and improves the accuracy of the reply results.

CN119597867APending Publication Date: 2025-03-11CHINA MERCHANTS BANK
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411446382.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

In the application of existing financial knowledge question and answer systems based on large language models in the field of capital management, they are prone to misunderstanding due to the complexity of professional terms and concepts, resulting in low correlation between the retrieved relevant knowledge text and user problems, which in turn affects the accuracy of the response results of the large language model.

Method used

By interpreting the financial knowledge terms in user problems, the target problem is obtained and inputted to a pre-trained vector model to obtain the financial knowledge document slices related to the target problem. Then, the boot text is constructed based on the target problem and the financial knowledge document slice and entered into the large language model to obtain the response results.

Benefits of technology

By accurately understanding financial knowledge terms and improving the correlation judgment ability of vector models, the accuracy of the response results output by large language models is significantly improved, and thus the overall accuracy of the financial knowledge question and answer system is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597867A_ABST
    Figure CN119597867A_ABST
Patent Text Reader

Abstract

The invention discloses a financial knowledge questioning and answering method, device and equipment and a computer readable storage medium, and relates to the technical field of artificial intelligence, the method comprises the following steps: in response to a user questioning instruction, obtaining a user question, and explaining financial knowledge terms in the user question to obtain a target question; the target question is input into a vector model, target financial knowledge document slices related to the target question are obtained, and the vector model is obtained by taking the sample financial question and the sample financial knowledge document slices as model input data; label data constructed on the basis of real correlation between sample financial questions and sample financial knowledge document slices are used as model training labels for training to obtain the model training labels; and constructing a guide text based on the target question and the target financial knowledge document slice, and inputting the guide text into the large language model to obtain a reply result of the target question. The accuracy of the financial knowledge question-answering system based on the large language model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a financial knowledge question-answering method, device, equipment, and computer-readable storage medium. Background Art

[0002] With the rapid advancement of large language model technology, knowledge question-answering systems have become an important auxiliary tool for people to acquire knowledge and answer questions.

[0003] At present, the commonly used knowledge question-answering method is to retrieve relevant knowledge texts from the knowledge base based on the questions input by the user, and input the retrieved relevant knowledge texts and user questions as guide texts into the large language model, so that the large language model can answer the user questions based on the input information and input the answers corresponding to the user questions. However, when using this method to query knowledge in the field of capital management, since the field of capital management is a highly professional field that covers complex industry terms and concepts, the knowledge question-answering system is prone to misunderstanding the professional content in the field of capital management when understanding user questions and retrieving relevant knowledge texts, resulting in a low correlation between the relevant knowledge texts retrieved based on user questions and the user questions, which in turn results in a low accuracy of the response results output by the large language model based on user questions and relevant knowledge texts.

[0004] Therefore, how to improve the accuracy of the financial knowledge question-answering system based on a large language model is a problem that needs to be solved urgently. Summary of the invention

[0005] The main purpose of this application is to provide a financial knowledge question and answer method, device, equipment and computer-readable storage medium, aiming to improve the accuracy of the financial knowledge question and answer system based on a large language model.

[0006] To achieve the above objectives, the present application provides a financial knowledge question-answering method, which comprises:

[0007] In response to a user's question instruction, obtaining the user's question, interpreting the financial knowledge terms in the user's question, and obtaining a target question;

[0008] Input the target question into a vector model to obtain a target financial knowledge document slice related to the target question, wherein the vector model is trained using sample financial questions and sample financial knowledge document slices as model input data and label data constructed based on the true correlation between the sample financial questions and the sample financial knowledge document slices as model training labels;

[0009] A guide text is constructed based on the target question and the target financial knowledge document slice, and the guide text is input into a large language model to obtain an answer result for the target question.

[0010] In one embodiment, before the step of obtaining the user's question in response to the user's questioning instruction, the method further includes:

[0011] Monitoring user input information, acquiring candidate words related to the user input information based on the user input information, and outputting the candidate words;

[0012] In response to a user selection instruction, a target candidate word specified by the user selection instruction is determined to construct a user question based on the target candidate word.

[0013] In one embodiment, the step of interpreting the financial knowledge terms in the user's question to obtain the target question includes:

[0014] Identify financial knowledge terms in the user's question, and obtain preset target interpretations corresponding to the financial knowledge terms to explain the financial knowledge terms;

[0015] The financial knowledge term is replaced with the target definition to obtain a target question.

[0016] In one embodiment, the step of inputting the target question into a vector model to obtain a target financial knowledge document slice related to the target question includes:

[0017] The target problem is input into a vector model, a target vector of the target problem is established through the vector model, and a preset number of target document slice vectors with the highest similarity to the target vector are determined from a preset vector database, and the target document slice corresponding to the target document slice vector is determined to be a target financial knowledge document slice related to the target problem, wherein the vector database is constructed based on each document slice of the financial knowledge document and the document slice vector corresponding to each of the document slices.

[0018] In one embodiment, the step of determining a preset number of target document slice vectors having the highest similarity to the target vector from a preset vector database includes:

[0019] Acquire the account information of the target user who triggered the user question instruction, and determine the user role of the target user based on the account information;

[0020] Determine each first document slice vector in a preset vector database based on a preset first document type corresponding to the user role, wherein the first document slice vector is a document slice vector corresponding to a document slice of a first financial knowledge document, and the document type of the first financial knowledge document is the first document type;

[0021] Each of the first document slice vectors is used as a candidate vector, and a preset number of target document slice vectors having the highest similarity to the target vector are determined from the candidate vectors.

[0022] In one embodiment, the step of determining a preset number of target document slice vectors having the highest similarity to the target vector from the candidate vectors includes:

[0023] Calculating the similarity between each candidate vector and the target vector respectively;

[0024] A preset number of vectors in each of the candidate vectors that have the highest similarity with the target vector are used as target document slice vectors in the vector database that have the highest similarity with the target vector.

[0025] In one embodiment, after the step of inputting the guide text into the large language model to obtain the answer result of the target question, the financial knowledge question answering method further includes:

[0026] In the case where the reply result is that the answer cannot be given, determining each second document slice vector in the vector database based on the preset second document type corresponding to the user role, wherein the second document slice vector is a document slice vector corresponding to a document slice of a second financial knowledge document, the document type of the second financial knowledge document is the second document type, and the retrieval priority of the second document type is lower than the retrieval priority of the first document type;

[0027] Each of the second document slice vectors is used as the candidate vector, and the step of determining a preset number of target document slice vectors with the highest similarity to the target vector from each of the candidate vectors is returned to be executed until the response result is the answer to the target question and the target financial knowledge document slice on which the answer is based.

[0028] In addition, to achieve the above-mentioned purpose, the present application also provides a financial knowledge question-answering device, the financial knowledge question-answering device comprising:

[0029] An explanation module, for responding to a user's question instruction, obtaining a user's question, and explaining the financial knowledge terms in the user's question to obtain a target question;

[0030] A retrieval module, used to input the target question into a vector model to obtain a target financial knowledge document slice related to the target question, wherein the vector model is trained using sample financial questions and sample financial knowledge document slices as model input data and using label data constructed based on the true correlation between the sample financial questions and the sample financial knowledge document slices as model training labels;

[0031] The answering module is used to construct a guide text based on the target question and the target financial knowledge document slice, and input the guide text into the large language model to obtain an answer result for the target question.

[0032] In addition, to achieve the above-mentioned purpose, the present application also provides a storage medium, which is a computer-readable storage medium, and a program for implementing the financial knowledge question and answer method is stored on the computer-readable storage medium. The program for implementing the financial knowledge question and answer method is executed by a processor to implement the steps of the financial knowledge question and answer method as described above.

[0033] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned financial knowledge question and answer method when executed by a processor.

[0034] The present application provides a financial knowledge question-and-answer method, which first obtains user questions by responding to user question instructions, and interprets the financial knowledge terms in the user questions to obtain a target question after the interpretation; then the target question is input into a pre-trained vector model to obtain a financial knowledge document slice related to the target question, wherein the vector model is trained using a feature vector constructed based on sample financial questions and sample financial knowledge document slices as model input data, and using label data constructed based on the true correlation between the sample financial questions and the sample financial knowledge document slices as model training labels; then a guide text is constructed based on the target question and the financial knowledge document slices, and the guide text is input into a large language model to obtain an answer result for the target question.

[0035] To sum up, compared with the traditional knowledge question-and-answer method, which has weak text comprehension ability in the field of capital management, resulting in low correlation between the relevant knowledge text retrieved based on user questions and user questions, thereby resulting in low accuracy of the output results of the large language model, this application, on the one hand, ensures the correct understanding of the financial knowledge terms in the user questions by interpreting the financial knowledge terms in the user questions, and on the other hand, improves the ability of the vector model to judge the correlation between user questions and financial knowledge document slices by fine-tuning the vector model, thereby improving the positive correlation between the relevant financial knowledge document slices determined by the fine-tuned vector model based on the target question and the target question. In this way, the guide text constructed based on the accurate target question and the financial knowledge document slices that are indeed related to the target question is used as the input data of the large language model, which can improve the accuracy of the response results output by the large language model, that is, improve the accuracy of the financial knowledge question-and-answer system based on the large language model. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0038] Figure 1 This is a flowchart of the first embodiment of the financial knowledge question-answering method of the present application;

[0039] Figure 2 A schematic diagram of a word association function involved in an embodiment of the financial knowledge question-answering method of the present application;

[0040] Figure 3 A schematic diagram of the knowledge slicing process involved in an embodiment of the financial knowledge question-answering method of the present application;

[0041] Figure 4 A schematic diagram of a search and recall process involved in an embodiment of the financial knowledge question and answer method of the present application;

[0042] Figure 5 A schematic diagram of a financial knowledge question-answering process involved in an embodiment of the financial knowledge question-answering method of the present application;

[0043] Figure 6 This is a schematic diagram of the module structure of the financial knowledge question-answering device of this application;

[0044] Figure 7Schematic diagram of the device structure of the hardware operating environment involved in the financial knowledge question and answer method in the embodiment of the present application.

[0045] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0046] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0047] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0048] The main solution of the present application is: in response to a user's question instruction, obtaining the user's question, interpreting the financial knowledge terms in the user's question, and obtaining a target question; inputting the target question into a vector model to obtain a target financial knowledge document slice related to the target question, wherein the vector model is trained using sample financial questions and sample financial knowledge document slices as model input data, and using label data constructed based on the true correlation between the sample financial questions and the sample financial knowledge document slices as model training labels; constructing a guide text based on the target question and the target financial knowledge document slice, and inputting the guide text into a large language model to obtain an answer result to the target question.

[0049] At present, the commonly used knowledge question-answering method is to retrieve relevant knowledge texts from the knowledge base based on the questions input by the user, and input the retrieved relevant knowledge texts and user questions as guide texts into the large language model, so that the large language model can answer the user questions based on the input information and input the answers corresponding to the user questions. However, when using this method to query knowledge in the field of capital management, since the field of capital management is a highly professional field that covers complex industry terms and concepts, the knowledge question-answering system is prone to misunderstanding the professional content in the field of capital management when understanding user questions and retrieving relevant knowledge texts, resulting in a low correlation between the relevant knowledge texts retrieved based on user questions and the user questions, which in turn results in a low accuracy of the response results output by the large language model based on user questions and relevant knowledge texts.

[0050] Specifically, the commonly used knowledge question-answering methods also include the rule-based and template-based methods. The knowledge question-answering system in this method includes multiple functional modules, namely, a knowledge base creation module, a natural language processing module, a matching query rule module, a result generation module, and a user interface module. Among them, the knowledge base creation module is used to construct question-answer pairs according to the knowledge points in the document and store them in the knowledge base to construct the document into a question-answering knowledge base; the natural language processing module is used to convert the natural language query input by the user into a structured syntax tree; the matching query rule module is used to map the structured syntax tree to the corresponding rules or templates; the result generation module is used to obtain the corresponding answer according to the matched question; the user interface module is used to provide an interface for the user to interact with the system. However, the defects of this method include high costs for knowledge update, construction of question-answer pairs, and maintenance of the knowledge base, and low real-time performance; the knowledge base has limited coverage, and questions that are not in the knowledge base cannot be answered; user questions are diverse, and the probability of rule matching is low.

[0051] Compared with the traditional knowledge question-and-answer method, which has a weak ability to understand text in the field of capital management, resulting in a low correlation between the relevant knowledge text retrieved based on user questions and the user questions, thereby resulting in low accuracy of the output results of the large language model, this application, on the one hand, ensures the correct understanding of the financial knowledge terms in the user questions by interpreting the financial knowledge terms in the user questions, and on the other hand, improves the ability of the vector model to judge the correlation between user questions and financial knowledge document slices by fine-tuning the vector model, thereby improving the positive correlation between the relevant financial knowledge document slices determined by the fine-tuned vector model based on the target question and the target question. In this way, the guide text constructed based on the accurate target question and the financial knowledge document slices that are indeed related to the target question is used as the input data of the large language model, which can improve the accuracy of the response results output by the large language model, that is, improve the accuracy of the financial knowledge question-and-answer system based on the large language model.

[0052] It should be noted that the execution subject of the method in each embodiment of the financial knowledge question-and-answer method of this application can be a financial knowledge question-and-answer system, or a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a financial knowledge question-and-answer device that can realize the above functions, etc., and this embodiment does not specifically limit this. The following takes the financial knowledge question-and-answer system as an example to illustrate this embodiment and the following embodiments. For the convenience of description, the following content is explained by omitting the execution subject.

[0053] Based on this, this application proposes a financial knowledge question-answering method of the first embodiment, please refer to Figure 1 The financial knowledge question-answering method includes steps S10 to S30:

[0054] Step S10, in response to a user's question instruction, obtaining a user's question, interpreting the financial knowledge terms in the user's question, and obtaining a target question;

[0055] It should be noted that after the user enters the user question, the user question command can be triggered based on the interactive interface to ask questions. Financial knowledge terms refer to professional terms in financial fields such as capital management, such as LGD (Loss Given Default), PD (Probability of Default), liquidation, bad debt, leverage, etc. It should be understood that the financial knowledge terms that need to be explained in user questions refer to the English abbreviations, common names, abbreviations, etc. of professional terms in the financial field. If such texts are not explained, then when the relevant document slices are retrieved based on the user question in the future, it is easy for the user question to have a low correlation with the document slice, resulting in the problem of low accuracy of the output results of the large language model.

[0056] In response to a user question instruction triggered by the user, the question input by the user (ie the above-mentioned user question) is obtained, and the financial knowledge terms in the user question are interpreted to obtain a target question.

[0057] In a feasible implementation, the step S10 may include:

[0058] Step S101, identifying financial knowledge terms in the user's question, obtaining a preset target interpretation or target full name corresponding to the financial knowledge term to explain the financial knowledge term;

[0059] Step S102: Replace the financial knowledge term with the target definition or the full name of the target to obtain a target question.

[0060] It should be noted that the Chinese definitions or professional full names of common financial knowledge terms are pre-defined. For example, a professional term library is constructed based on the mapping relationship between each financial knowledge term and its corresponding Chinese definition or professional full name.

[0061] After obtaining the user's question, the financial knowledge terms in the user's question are identified based on the financial knowledge terms recorded in the professional terminology library, and the preset Chinese interpretations or professional full names corresponding to the financial knowledge terms in the user's question (hereinafter referred to as target interpretations for distinction) are obtained from the professional terminology library. Then, the financial knowledge terms in the user's question are replaced with the target interpretations to obtain the question after term replacement (hereinafter referred to as the target question for distinction).

[0062] For example, when it is identified that the financial knowledge terms contained in the user's question are LGD and margin call, the Chinese interpretation of LGD is found in the professional terminology library as default loss rate, and the full professional term for margin call is non-performing loan. Then, the LGD in the user's question is replaced with default loss rate, and the margin call in the user's question is replaced with non-performing loan to obtain the question after term replacement, that is, the above-mentioned target problem.

[0063] In this way, the embodiment of the present application identifies the abbreviations, common names and English abbreviations in the user's questions, explains and replaces such financial knowledge terms, so as to assist the large language model in understanding professional vocabulary and ensure the accuracy of the response results.

[0064] Step S20, inputting the target question into a vector model to obtain a target financial knowledge document slice related to the target question, wherein the vector model is trained using a feature vector constructed based on a sample financial question and a sample financial knowledge document slice as model input data, and using label data constructed based on the true correlation between the sample financial question and the sample financial knowledge document slice as model training labels;

[0065] It should be noted that for fine-tuning the vector model, that is, constructing a sample data set. In a feasible implementation manner, the sample data set includes multiple positive sample data and multiple negative sample data. A piece of positive sample data includes a relevant question in the financial field (hereinafter referred to as the sample financial question for distinction) and a slice of financial knowledge document positively related to the sample financial question (hereinafter referred to as the sample financial knowledge document slice for distinction), as well as the true relevance between the sample financial question and the sample financial knowledge document slice. A piece of negative sample data includes a sample financial question in the financial field and a sample financial knowledge document slice negatively related to the sample financial question, as well as the true relevance between the sample financial question and the sample financial knowledge document slice. Exemplarily, the positive sample data can be expressed as: "positive_samples": [{"question": "Question 1", "positive_samples": ["Document slice pos1"]}], and the negative sample data can be expressed as: "negative_samples": [{"question": "Question 1", "negative_samples": ["Document slice neg1"]}]. In another feasible implementation manner, the sample data set includes multiple pieces of sample data. Each piece of sample data includes a sample financial question, a sample financial knowledge document slice positively related to this sample financial question, a sample financial knowledge document slice negatively related to this sample financial question, as well as the true relevance between the sample financial question and each sample financial knowledge document slice. Exemplarily, the sample data can be expressed as: [{"question": "Question 1", "positive_samples": ["Document slice pos1"], "negative_samples": ["Document slice nge1", "Document slice nge2",..., "Document slice nge10"]}], [{"question": "Question 2", "positive_samples": ["Document slice pos1"], "negative_samples": ["Document slice nge1", "Document slice nge2",..., "Document slice nge10"]}]...]. Training the vector model according to the sample data set to obtain a trained vector model. It should be understood that the trained vector model has the ability to judge the relevance between a user question in the financial field and a relevant slice of financial knowledge document. And, a slice of financial knowledge document refers to a text segment in a knowledge document in the financial field.

[0066] Input the target question into the pre-trained vector model, and determine the target slice of financial knowledge document related to the target question through the vector model.

[0067] In this way, compared with the un-fine-tuned vector model that retrieves relevant financial knowledge document slices based on user questions, the fine-tuned vector model retrieves target financial knowledge document slices with a higher correlation with user questions, which improves the accuracy of the retrieval and recall of relevant financial knowledge document slices. For reference, the experiment shows that the retrieval and recall accuracy of the fine-tuned vector model has increased from 45% to 90%, which is a significant effect.

[0068] Step S30, constructing a guide text based on the target question and the target financial knowledge document slice, and inputting the guide text into a large language model to obtain an answer result for the target question.

[0069] It should be noted that the present application embodiment does not limit the construction method of the guide text. For example, in a feasible implementation, the target question and the target financial knowledge document slices are spliced ​​to obtain the guide text. The above guide text refers to Prompt.

[0070] After constructing the guide text based on the target question and the target financial knowledge document slice, the guide text is input into the large language model to obtain the answer result of the target question.

[0071] In this embodiment, before step S10, the financial knowledge question-and-answer method of this application further includes:

[0072] Step A10, monitoring user input information, acquiring candidate words related to the user input information based on the user input information, and outputting the candidate words;

[0073] Step A20, in response to a user selection instruction, determining a target candidate word specified by the user selection instruction, so as to construct a user question based on the target candidate word.

[0074] It should be noted that the financial knowledge question and answer system of the present application includes a word association function module, which is used to generate relevant phrases based on user input content to assist users in constructing user questions.

[0075] Monitor the information input by the user in the interactive interface (hereinafter referred to as user input information for distinction), associate the preset candidate words corresponding to the user input information based on the user input information, and output each candidate word, then the user can select one of the candidate words based on their own needs (hereinafter referred to as the target candidate word for distinction), and trigger the user selection instruction, the financial knowledge question and answer system responds to the user selection instruction triggered by the user, determines the target candidate word, and constructs the user question based on the target candidate word. Among them, the embodiment of the present application does not limit the rules of word association. For example, in a feasible implementation, the candidate words containing the user input information or the term similar to the user input information are obtained in the preset candidate word database, and the 5 candidate words with the highest number of selections in each candidate word are determined according to the user's historical selection information and displayed to the user for the user to choose. For example, in another feasible implementation, multiple candidate words containing the user input information are obtained in the preset candidate word database, and 5 of the candidate words are randomly selected and displayed to the user for the user to choose. The above-mentioned preset candidate word database is pre-constructed based on professional vocabulary commonly used in the financial field.

[0076] For example, Figure 2 Shown is a schematic diagram of the word association function. When the user enters "real estate" in the input box of the interactive interface, the word association function module automatically displays relevant candidate words based on the input content, such as commercial real estate risk exposure, real estate development risk exposure, etc., for the user to choose.

[0077] Thus, the embodiment of the present application takes into account that there are a large number of professional terms in the field of capital management, and there are differences or ambiguities between user descriptions (abbreviations, slang) and the professional terms themselves, which affect the model's answers. Therefore, word association technology is proposed to help users quickly locate target words, assist users in completing questions, and accurately capture user intentions, thereby ultimately improving the answer accuracy of the large language model.

[0078] On the one hand, the embodiments of the present application ensure the correct understanding of the financial knowledge terms in the user's questions by interpreting the financial knowledge terms in the user's questions. On the other hand, by fine-tuning the vector model, the ability of the vector model to judge the correlation between the user's questions and the financial knowledge document slices is improved, thereby improving the positive correlation between the relevant financial knowledge document slices determined by the fine-tuned vector model based on the target question and the target question. In this way, the guide text constructed based on the accurate target question and the financial knowledge document slices that are indeed relevant to the target question is used as the input data of the large language model, which can improve the accuracy of the response results output by the large language model, that is, improve the accuracy of the financial knowledge question and answer system based on the large language model.

[0079] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. On this basis, the step S20 may include:

[0080] Step S201, input the target problem into the vector model, establish the target vector of the target problem through the vector model, and determine a preset number of target document slice vectors with the highest similarity to the target vector from a preset vector database, and determine that the target document slice corresponding to the target document slice vector is the target financial knowledge document slice related to the target problem, wherein the vector database is constructed based on each document slice of the financial knowledge document and the document slice vector corresponding to each of the document slices.

[0081] It should be noted that if Figure 3 The figure shows a schematic diagram of the knowledge slicing process. There are many types of knowledge documents in the field of capital management, such as new capital regulations, economic capital, supplementary documents, original texts of the Basel Accord, etc. Each type of financial knowledge document is sliced, that is, divided into multiple text fragments, and then a unique slice ID is assigned to each type of document slice, that is, a mapping relationship between document slices and slice IDs is established, and each document slice is input into the fine-tuned vector model to obtain the vector of each document slice (hereinafter referred to as the document slice vector for distinction), and then each document slice and the slice ID of the document slice and the document slice vector are saved as a set of associated data to a pre-created vector database. Among them, each document slice in the vector database is saved separately according to the document type, that is, it can be understood that document slices belonging to the same document type are saved in the same location.

[0082] The target question is input into the vector model, a vector of the target question (hereinafter referred to as the target vector for distinction) is established through the vector model, and a preset number of document slice vectors (hereinafter referred to as the target document slice vectors for distinction) with the highest similarity to the target vector are determined from a preset vector database, and the document slices associated with each target document slice vector are determined based on the vector database (hereinafter referred to as the target document slices for distinction), and the target document slices are determined as target financial knowledge document slices related to the pre-target question.

[0083] The embodiment of the present application does not limit the number of selected target financial knowledge document slices. In one feasible implementation, four document slice vectors with the highest similarity to the target vector are determined from a preset vector database, and the target document slices associated with each of the four document slice vectors are determined as the target financial knowledge document slices.

[0084] In a specific implementation, the step S201 may include:

[0085] Step B10, obtaining the account information of the target user who triggered the user question instruction, and determining the user role of the target user based on the account information;

[0086] It should be noted that the target user's account information that triggers the user's question instruction refers to the account information currently logged in to the financial knowledge question answering system. The account information represents the user role of the target user, where the user roles include head office users and branch users.

[0087] Step B20, determining each first document slice vector in a preset vector database based on the preset first document type corresponding to the user role, wherein the first document slice vector is a document slice vector corresponding to a document slice of a first financial knowledge document, and the document type of the first financial knowledge document is the first document type;

[0088] It should be noted that the document types corresponding to different user roles are preset (hereinafter referred to as the first document type for distinction). It should be understood that different user roles pay attention to different documents. When the head office user asks a question, the retrieval order of various knowledge documents is the new capital regulations, economic capital, supplementary documents and the original text of the Basel Accord; when the branch user asks a question, the retrieval order of various knowledge documents is economic capital, new capital regulations, supplementary documents and the original text of the Basel Accord. The first document type refers to the document type with the highest retrieval priority under different user roles, that is, when the user role is a head office user, the first document type is the new capital regulations; when the user role is a branch user, the first document type is economic capital.

[0089] Based on the preset first document type corresponding to the user role, the document slice vectors belonging to the first document type in the preset vector database (hereinafter referred to as the first document slice vector for distinction) are determined. It should be understood that the first document slice vector is the document slice vector corresponding to the document slice of the financial knowledge document (hereinafter referred to as the first financial knowledge document for distinction) whose document type is the first document type.

[0090] In this way, the embodiment of the present application introduces a user role identification and knowledge routing module to ensure that users with different roles can quickly and accurately obtain document information within their scope of interest, thereby improving user experience.

[0091] Step B30: taking each of the first document slice vectors as a candidate vector, and determining a preset number of target document slice vectors having the highest similarity with the target vector from each of the candidate vectors.

[0092] Each first document slice vector is used as a candidate vector, and a preset number of target document slice vectors having the highest similarity to the target vector are determined from the candidate vectors.

[0093] In this implementation, the step B30 may include:

[0094] Step B301, respectively calculating the similarity between each candidate vector and the target vector;

[0095] Step B302: taking a preset number of vectors in the candidate vectors that have the highest similarity with the target vector as target document slice vectors in the vector database that have the highest similarity with the target vector.

[0096] The embodiments of the present application do not limit the method for calculating the similarity between vectors. In one feasible implementation, the Euclidean distance between the candidate vector and the target vector is calculated, and the similarity between the vectors is evaluated using the Euclidean distance, that is, the smaller the Euclidean distance, the higher the similarity. In another feasible implementation, the cosine similarity between the candidate vector and the target vector is calculated, and the cosine similarity is used to evaluate the similarity between the vectors, that is, the cosine similarity is used as the similarity between the vectors.

[0097] The similarity between each candidate vector and the target vector is calculated respectively, and a preset number of vectors with the highest similarity to the target vector among the candidate vectors are used as the target document slice vectors.

[0098] In the embodiment of the present application, considering that there is too much text content, it is impossible to input all of it into the large language model as input data, and when there is too much input data, the effect of the large language model will also be reduced. Therefore, the document slice corresponding to the current user role is first determined through knowledge routing, and then the most relevant preset number of document slices are found as the target financial knowledge document slice. For example, Figure 4 The figure shows a schematic diagram of the retrieval and recall process. The user question input by the user is "LGD of qualified financial collateral", and the target question obtained after term replacement is "Default loss rate (LGD) of qualified financial collateral". The target question is input into the fine-tuned vector model to obtain the target vector. Based on the target vector, each first document slice vector in the recall vector database is retrieved, and each first document slice vector is used as a candidate vector for this round of question and answer. The similarity between the target vector and each candidate vector in the vector database is calculated, and the similarity between the target vector and slice 1 is 0.3265, the similarity between the target vector and slice 2 is 0.7654, etc. Then, the candidate vectors are arranged from high to low according to the similarity between the candidate vectors and the target vector, and the arrangement order is slice 2, slice i+1, slice i, slice n... In this way, the document slices corresponding to the candidate vectors arranged in the first four positions are determined as the target financial knowledge document slices, namely slice 2, slice i+1, slice i and slice n.

[0099] Thus, the embodiments of the present application take into account that professional issues in the field of capital management contain a large number of professional terms in the field of capital management, which cannot be accurately understood by existing vector models, resulting in low efficiency in retrieving and recalling related document fragments. Therefore, the embodiments of the present application construct a domain-specific training corpus and a fine-tuned vector model to improve the accuracy of retrieval and recall of professional issues.

[0100] In this embodiment, after step S30, the financial knowledge question-answering method of this application further includes:

[0101] Step C10, when the reply result is that the answer cannot be given, determining each second document slice vector in the vector database based on the preset second document type corresponding to the user role, wherein the second document slice vector is a document slice vector corresponding to a document slice of a second financial knowledge document, the document type of the second financial knowledge document is the second document type, and the retrieval priority of the second document type is lower than the retrieval priority of the first document type;

[0102] It should be noted that the reply results of the large language model include the first reply result and the second reply result, where the first reply result is unanswerable (i.e., model rejection), and the second reply result is the answer to the target question and the target financial knowledge document slice based on the answer. It can be understood that the reply results are divided into two categories: answerable and unanswerable.

[0103] When the answer result of this round of replies is that the answer cannot be answered, continue to determine each document slice vector (hereinafter referred to as the second document slice vector for distinction) belonging to the second document type in the vector database based on the preset document type (hereinafter referred to as the second document type for distinction) corresponding to the user role. It should be understood that the second document type is a document type with a lower retrieval priority than the first document type under the current user role, and the second document slice vector is a document slice vector corresponding to the document slice of the financial knowledge document (hereinafter referred to as the second financial knowledge document for distinction) of the second document type.

[0104] Step C20, taking each of the second document slice vectors as the candidate vector, and returning to execute the step of determining a preset number of target document slice vectors with the highest similarity to the target vector from each of the candidate vectors, until the response result is the answer to the target question and the target financial knowledge document slice on which the answer is based.

[0105] Each second document slice vector is used as a candidate vector, and the step of determining a preset number of target document slice vectors with the highest similarity to the target vector from each candidate vector is returned to execute until the response result output by the large language model is the answer to the target question and the target financial knowledge document slice based on the answer.

[0106] In one feasible implementation, when the user role of the current target user is a head office user, the preset search order corresponding to the head office user is the new capital regulations, economic capital, supplementary documents and the original text of the Basel Accord. If the large language model cannot answer the question when selecting the four target financial knowledge document slices of the new capital regulations type, then continue to retrieve the four most relevant target financial knowledge document slices of the economic capital type, that is, retrieve and recall knowledge document slices of different document types in sequence according to the search order corresponding to the current user role, until the large language model can derive an answer based on the retrieved target financial knowledge document slices. It can be understood that the first document type is the new capital regulations, and the second document type is economic capital, supplementary documents and the original text of the Basel Accord. In addition, it should be noted that the response result output by the large language model in the embodiment of the present application includes the answer to the target question and the document slice on which the answer is based, thereby ensuring the traceability and verifiability of the answer, enabling users to verify the reliability of the content generated by the model and improving the credibility of the system.

[0107] For example, Figure 5 The figure shows a schematic diagram of the financial knowledge question-answering process. First, the financial knowledge documents and vector models are preprocessed, that is, the vector model is fine-tuned, and each type of financial knowledge document is segmented to obtain each document slice, and each document slice is input into the fine-tuned vector model to obtain the vector of each document slice, and each document slice and each document slice vector are saved into a pre-constructed vector database; in addition, when the user enters a question in the interactive interface, the word association function is automatically started to assist the user in entering the question, and then the user question output by the user is replaced with terms to obtain the target question, and the target question is input into the fine-tuned vector model, and the vector model is used to retrieve and recall a preset number of target financial knowledge document slices from the vector database based on the target question and the current user role, and then a prompt is constructed based on each target financial knowledge document slice and the target question, and input into the LLM (Large Language Models) to determine whether the response result is unanswerable. If so, the search and recall step is returned, and if not, the answer to the target question and the document slice referenced by the answer are obtained.

[0108] In this way, the embodiment of the present application designs a knowledge routing module based on user roles, that is, the priority of retrieval and recall is determined according to the priority of the document types that the pre-set user roles are concerned about, thereby realizing the knowledge routing of group documents with different user roles and improving the retrieval efficiency. It is ensured that in the document question and answer scenario in the field of capital management of commercial banks, different knowledge documents can be routed according to the user's role. For example, the head office users give priority to the documents related to the new capital regulations and need to be routed to the new capital regulations documents first, while the branch users need to be routed to the economic capital documents first.

[0109] In addition, compared with the existing technology, this application significantly improves the professionalism and adaptability of the question-and-answer system in the field of commercial bank capital management. First, by integrating word association technology and professional terminology libraries, the large model's ability to parse industry terms is enhanced, ensuring the accuracy and professionalism of the answers. Secondly, by using a domain-customized vector model, the recall rate of document fragments for complex professional questions is improved. In addition, the innovative introduction of user role-based knowledge routing provides customized services for users of different roles, enhancing the practicality of the system. Finally, the implementation of the answer tracing function enables users to verify the source of information, enhancing the credibility of the system and user satisfaction. In summary, this application has built a smarter, more accurate, more efficient, more professional and more reliable capital management question-and-answer platform, which significantly improves the accuracy of answers.

[0110] The present application also provides a financial knowledge question-answering device. Figure 6 , the financial knowledge question-answering device comprises:

[0111] An explanation module 10 is used to respond to a user's question instruction, obtain a user's question, and explain the financial knowledge terms in the user's question to obtain a target question;

[0112] A retrieval module 20 is used to input the target question into a vector model to obtain a target financial knowledge document slice related to the target question, wherein the vector model is trained using sample financial questions and sample financial knowledge document slices as model input data and using label data constructed based on the real correlation between the sample financial questions and the sample financial knowledge document slices as model training labels;

[0113] The answering module 30 is used to construct a guide text based on the target question and the target financial knowledge document slice, and input the guide text into the large language model to obtain an answer result for the target question.

[0114] Optionally, the financial knowledge question-answering device further comprises a word association module, and the word association module is used to:

[0115] Monitoring user input information, acquiring candidate words related to the user input information based on the user input information, and outputting the candidate words;

[0116] In response to a user selection instruction, a target candidate word specified by the user selection instruction is determined to construct a user question based on the target candidate word.

[0117] Optionally, the interpretation module 10 is further used for:

[0118] Identify financial knowledge terms in the user's question, and obtain preset target interpretations corresponding to the financial knowledge terms to explain the financial knowledge terms;

[0119] The financial knowledge term is replaced with the target definition to obtain a target question.

[0120] Optionally, the retrieval module 20 is further used for:

[0121] The target problem is input into a vector model, a target vector of the target problem is established through the vector model, and a preset number of target document slice vectors with the highest similarity to the target vector are determined from a preset vector database, and the target document slice corresponding to the target document slice vector is determined to be a target financial knowledge document slice related to the target problem, wherein the vector database is constructed based on each document slice of the financial knowledge document and the document slice vector corresponding to each of the document slices.

[0122] Optionally, the retrieval module 20 is further used for:

[0123] Acquire the account information of the target user who triggered the user question instruction, and determine the user role of the target user based on the account information;

[0124] Determine each first document slice vector in a preset vector database based on a preset first document type corresponding to the user role, wherein the first document slice vector is a document slice vector corresponding to a document slice of a first financial knowledge document, and the document type of the first financial knowledge document is the first document type;

[0125] Each of the first document slice vectors is used as a candidate vector, and a preset number of target document slice vectors having the highest similarity to the target vector are determined from the candidate vectors.

[0126] Optionally, the retrieval module 20 is further used for:

[0127] Calculating the similarity between each candidate vector and the target vector respectively;

[0128] A preset number of vectors in each of the candidate vectors that have the highest similarity with the target vector are used as target document slice vectors in the vector database that have the highest similarity with the target vector.

[0129] Optionally, the financial knowledge question-answering device further includes a knowledge routing module, and the knowledge routing module is used to:

[0130] In the case where the reply result is that the answer cannot be given, determining each second document slice vector in the vector database based on the preset second document type corresponding to the user role, wherein the second document slice vector is a document slice vector corresponding to a document slice of a second financial knowledge document, the document type of the second financial knowledge document is the second document type, and the retrieval priority of the second document type is lower than the retrieval priority of the first document type;

[0131] Each of the second document slice vectors is used as the candidate vector, and the step of determining a preset number of target document slice vectors with the highest similarity to the target vector from each of the candidate vectors is returned to be executed until the response result is the answer to the target question and the target financial knowledge document slice on which the answer is based.

[0132] The financial knowledge question-answering device provided in the embodiment of the present application adopts the financial knowledge question-answering method in the above embodiment, which can solve the technical problem of how to improve the accuracy of the financial knowledge question-answering system based on a large language model. Compared with the prior art, the beneficial effects of the financial knowledge question-answering device provided in the embodiment of the present application are the same as the beneficial effects of the financial knowledge question-answering method provided in the above embodiment, and the other technical features in the financial knowledge question-answering device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0133] The present application provides a financial knowledge question and answer device, which includes: at least one processor; and 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 so that the at least one processor can execute the financial knowledge question and answer method in the above-mentioned embodiment one.

[0134] Reference below Figure 7 , which shows a schematic diagram of the structure of a financial knowledge question-and-answer device suitable for implementing the embodiment of the present application. The financial knowledge question-and-answer device in the embodiment of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The financial knowledge question and answer device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0135] like Figure 7As shown, the financial knowledge question-and-answer device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the financial knowledge question-and-answer device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the financial knowledge question answering device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a financial knowledge question answering device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0136] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0137] The financial knowledge question-answering device provided by this application adopts the financial knowledge question-answering method in the above embodiment, which can solve the technical problem of how to improve the accuracy of the financial knowledge question-answering system based on a large language model. Compared with the prior art, the beneficial effects of the financial knowledge question-answering device provided by this application are the same as the beneficial effects of the financial knowledge question-answering method provided by the above embodiment, and the other technical features in the financial knowledge question-answering device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0138] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0139] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0140] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, the computer-readable program instructions being used to execute the financial knowledge question-and-answer method in the above-mentioned embodiment.

[0141] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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 above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0142] The computer-readable storage medium may be included in the financial knowledge question-answering device; or may exist independently without being assembled into the financial knowledge question-answering device.

[0143] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the financial knowledge question-and-answer device, the financial knowledge question-and-answer device: responds to a user question instruction, obtains a user question, interprets the financial knowledge terms in the user question, and obtains a target question; inputs the target question into a vector model to obtain a target financial knowledge document slice related to the target question, wherein the vector model is trained using sample financial questions and sample financial knowledge document slices as model input data, and using label data constructed based on the true correlation between the sample financial questions and the sample financial knowledge document slices as model training labels; constructs a guide text based on the target question and the target financial knowledge document slice, and inputs the guide text into a large language model to obtain an answer result for the target question.

[0144] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0145] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0146] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0147] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned financial knowledge question-answering method, and can solve the technical problem of how to improve the accuracy of the financial knowledge question-answering system based on a large language model. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the financial knowledge question-answering method provided in the above-mentioned embodiment, and will not be repeated here.

[0148] An embodiment of the present application provides a computer program product, including a computer program, which implements the steps of the above-mentioned financial knowledge question and answer method when executed by a processor.

[0149] The computer program product provided in this application can improve the accuracy of the financial knowledge question answering system based on the large language model. Compared with the prior art, the beneficial effects of the computer program product provided in the embodiment of this application are the same as the beneficial effects of the financial knowledge question answering method provided in the above embodiment, which will not be repeated here.

[0150] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.

Claims

1. A financial knowledge question-answering method, characterized in that: The financial knowledge question-answering method comprises: In response to a user's question instruction, obtaining the user's question, interpreting the financial knowledge terms in the user's question, and obtaining a target question; Input the target question into a vector model to obtain a target financial knowledge document slice related to the target question, wherein the vector model is trained using sample financial questions and sample financial knowledge document slices as model input data and label data constructed based on the true correlation between the sample financial questions and the sample financial knowledge document slices as model training labels; A guide text is constructed based on the target question and the target financial knowledge document slice, and the guide text is input into a large language model to obtain an answer result for the target question.

2. The method according to claim 1, characterized in that Before the step of obtaining the user's question in response to the user's questioning instruction, the method further includes: Monitoring user input information, acquiring candidate words related to the user input information based on the user input information, and outputting the candidate words; In response to a user selection instruction, a target candidate word specified by the user selection instruction is determined to construct a user question based on the target candidate word.

3. The method according to claim 1, characterized in that The step of interpreting the financial knowledge terms in the user's question to obtain the target question includes: Identify financial knowledge terms in the user's question, and obtain preset target interpretations corresponding to the financial knowledge terms to explain the financial knowledge terms; The financial knowledge term is replaced with the target definition to obtain a target question.

4. The method according to claim 1, characterized in that The step of inputting the target question into the vector model to obtain a target financial knowledge document slice related to the target question includes: The target problem is input into a vector model, a target vector of the target problem is established through the vector model, and a preset number of target document slice vectors with the highest similarity to the target vector are determined from a preset vector database, and the target document slice corresponding to the target document slice vector is determined to be a target financial knowledge document slice related to the target problem, wherein the vector database is constructed based on each document slice of the financial knowledge document and the document slice vector corresponding to each of the document slices.

5. The method according to claim 4, characterized in that The step of determining a preset number of target document slice vectors having the highest similarity to the target vector from a preset vector database comprises: Acquire the account information of the target user who triggered the user question instruction, and determine the user role of the target user based on the account information; Determine each first document slice vector in a preset vector database based on a preset first document type corresponding to the user role, wherein the first document slice vector is a document slice vector corresponding to a document slice of a first financial knowledge document, and the document type of the first financial knowledge document is the first document type; Each of the first document slice vectors is used as a candidate vector, and a preset number of target document slice vectors having the highest similarity to the target vector are determined from the candidate vectors.

6. The method according to claim 5, characterized in that The step of determining a preset number of target document slice vectors having the highest similarity to the target vector from each of the candidate vectors comprises: Calculating the similarity between each candidate vector and the target vector respectively; A preset number of vectors in each of the candidate vectors that have the highest similarity with the target vector are used as target document slice vectors in the vector database that have the highest similarity with the target vector.

7. The method according to claim 5, characterized in that After the step of inputting the guide text into the large language model to obtain the answer result of the target question, the financial knowledge question answering method further includes: In the case where the reply result is that the answer cannot be given, determining each second document slice vector in the vector database based on the preset second document type corresponding to the user role, wherein the second document slice vector is a document slice vector corresponding to a document slice of a second financial knowledge document, the document type of the second financial knowledge document is the second document type, and the retrieval priority of the second document type is lower than the retrieval priority of the first document type; Each of the second document slice vectors is used as the candidate vector, and the step of determining a preset number of target document slice vectors with the highest similarity to the target vector from each of the candidate vectors is returned to be executed until the response result is the answer to the target question and the target financial knowledge document slice on which the answer is based.

8. A financial knowledge question-answering device, characterized in that: The financial knowledge question-answering device comprises: An explanation module, for responding to a user's question instruction, obtaining a user's question, and explaining the financial knowledge terms in the user's question to obtain a target question; A retrieval module, used to input the target question into a vector model to obtain a target financial knowledge document slice related to the target question, wherein the vector model is trained using sample financial questions and sample financial knowledge document slices as model input data and using label data constructed based on the true correlation between the sample financial questions and the sample financial knowledge document slices as model training labels; The answering module is used to construct a guide text based on the target question and the target financial knowledge document slice, and input the guide text into the large language model to obtain an answer result for the target question.

9. A financial knowledge question-answering device, characterized in that: The financial knowledge question-answering device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the financial knowledge question-answering method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the financial knowledge question-and-answer method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Associative word generation method, associative word generation device, electronic equipment and storage medium

    CN121457612A