Financial product recommendation method and system and storage medium
Through the RAG multiple recall and fine sorting model, combined with vector processing and text matching algorithm, the problem that the existing financial product recommendation model cannot meet user needs is solved, and higher recommendation accuracy and diversity are achieved, which improves the financial industry. Quality of service.
Patent Information
- Application Number
- CN202411510377.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2024-11-26
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing financial product recommendation model is difficult to fully adapt to the complex and changeable financial environment, cannot meet the real needs of users, and the recommended financial products are insufficient in diversity and accuracy.
Using the RAG multi-channel recall model and fine sorting model, by collecting target user information, obtaining multiple candidate financial product categories, performing multiple recalls and deduplication, combining vectorization processing and text matching algorithms, forming a candidate financial product queue, and using The fine sorting model sorts the user product group to obtain the final recommended products.
It improves the overall recommendation accuracy of the financial product recommendation model, improves the service quality of the financial industry, better meets user needs, and provides more diverse financial product recommendations.
Smart Images

Figure CN119027219A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a financial product recommendation method, system and storage medium. Background Art
[0002] Financial institutions use financial product recommendation models to screen out financial products that may meet user needs, and use this as a basis for personalized product promotion to improve customer purchase behavior conversion rates. However, most of the current financial product recommendation models on the market only analyze and predict user behavior data through a single machine learning model, which often makes it difficult to fully adapt to the complex and changing financial environment and comprehensively consider various financial products on the market. The recommended financial products often fail to meet the real needs of users. Summary of the invention
[0003] In view of the deficiencies in the prior art, the present invention provides a financial product recommendation method, comprising: S1, collecting user information of the target user in the target recommendation scenario, and obtaining multiple candidate financial product categories that meet the needs of the target user, wherein the user information includes but is not limited to basic personal information, work information, credit record and financial status; S2, using the RAG multi-way recall model in the product knowledge base corresponding to multiple candidate financial product categories according to the target user information to obtain multiple recall results, and removing duplicates from multiple financial products in each recall result and combining them to form a candidate financial product queue; S3, pairing the user information with each candidate financial product in the candidate financial product queue to form multiple user product groups, wherein the user product group includes the user information and a financial product information, and using the trained precise ranking model to rank and score each user product group, and obtaining the financial products in the user product group with a set recommended number ranked first as the final recommended products.
[0004] Preferably, the step S2 specifically includes: S21, dividing the text introduction information of each financial product into blocks to form a first knowledge base, wherein each data block includes the name of the corresponding financial product and the content of the current data block; obtaining the historical transaction records of each financial product as a second knowledge base, wherein the historical transaction records include the name of the traded financial product and the transaction record information of the financial product; S22, performing vectorization conversion on all data blocks in the first knowledge base to form a first vector knowledge set; performing vectorization conversion on each transaction record information in the second knowledge base, and using the name of the financial product as a label for recall to form a second vector knowledge set; S23, performing word segmentation on the first knowledge base and the second knowledge base based on the Jieba word segmentation database, and then using a text matching algorithm to establish a knowledge index to form a corresponding first search database and a second search database; S24, after vectorizing the target user information, similar data vectors are respectively recalled in the first vector knowledge set and the second vector knowledge set, and the names of financial products corresponding to the similar data vectors are obtained as the recall results; the target user information is respectively recalled in the first search library and the second search library using a text matching algorithm to match the data, and the names of financial products corresponding to the matching data are obtained as the recall results; S25, removing duplicate financial product names in each recall result and combining them to form a candidate financial product queue.
[0005] Preferably, the step S22 specifically includes: Use three different embedded models to vectorize each data block in the first knowledge base, use the FAISS library tool to establish a separate vector library for the vector data generated by each embedded model, generate the corresponding first FAISS vector library, second FAISS vector library and third FAISS vector library, and store them in the first vector knowledge set; Three different embedded models are used to vectorize the transaction record information in the second knowledge base, and the corresponding financial product names are used as recall labels. The FAISS library tool is used to establish a separate vector library for the vector data generated by each embedded model, and the corresponding fourth FAISS vector library, fifth FAISS vector library and sixth FAISS vector library are generated and stored in the second vector knowledge set.
[0006] Preferably, the step S23 specifically includes: performing word segmentation on the first knowledge base and the second knowledge base based on the Jieba word segmentation library respectively, and then using the text matching algorithm BM25 to establish a knowledge index to form a corresponding first search library and a second search library.
[0007] Preferably, the step S24 specifically includes: arranging and merging the basic personnel information, work information, credit record and financial status in the target user information into information to be matched, and using the three different embedded models to vectorize the information to be matched to obtain three corresponding vectors to be matched; recalling six similar data vector groups from the three vectors to be matched in the corresponding first vector knowledge set and second vector knowledge set, wherein each similar data vector group contains a set number of similar data vectors, and obtaining the financial product names corresponding to the similar data vectors as the recall results of this path; using a text matching algorithm to recall the information to be matched in the first retrieval library and the second retrieval library respectively to obtain two corresponding matching data groups, wherein each matching data group contains a set number of matching data, and obtaining the financial product names corresponding to the matching data as the recall results of this path.
[0008] Preferably, the step S25 specifically includes: removing duplicates from the names of the financial products in the eight-way recall results and combining them to form a candidate financial product queue.
[0009] Preferably, the three embedded models are gte-large-embeddin model, bge-large-embedding model and m3e-large-embedding model.
[0010] The present invention also discloses a financial product recommendation system, including a business classification module, a multi-way recall module and a fine ranking module, wherein the business classification module is used to collect user information of a target user for a target recommendation scenario, and obtain multiple candidate financial product categories that meet the needs of the target user, wherein the user information includes but is not limited to basic personnel information, work information, credit record and financial status; the multi-way recall module is used to obtain multiple recall results using a RAG multi-way recall model in a product knowledge base corresponding to multiple candidate financial product categories according to the target user information, and multiple financial products in each recall result are removed and combined to form a candidate financial product queue; the fine ranking module is used to pair the user information with each candidate financial product in the candidate financial product queue to form multiple user product groups, wherein the user product group includes user information and a financial product information, and uses a trained fine ranking model to rank and score each user product group, and obtains the financial products in the user product group with a set recommended number ranked first as the final recommended products.
[0011] The present invention also discloses a server, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the aforementioned methods when executing the computer program.
[0012] The present invention also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the aforementioned methods are implemented.
[0013] The financial product recommendation method, system and storage medium disclosed in the present invention combine the RAG multi-way recall method and the precision ranking model with multiple retrieval strategies to recall financial products that may meet user needs from multiple loops and perform ranking and recommendation. By collecting user information of the target user in the target recommendation scenario, multiple candidate financial product categories that meet the target user's needs are obtained, and the RAG multi-way recall model is used in the product knowledge base corresponding to the multiple candidate financial product categories according to the target user information to obtain multi-way recall results, and the multiple financial products in each recall result are removed and combined to form a candidate financial product queue. Finally, after the user information is paired with each candidate financial product in the candidate financial product queue to form multiple user product groups, the trained precision ranking model is used to rank and score each user product group, and the financial products in the user product group with a set number of recommendations ranked first are obtained as the final recommended products, so as to improve the overall recommendation accuracy of the financial product recommendation model and improve the service quality of the financial industry.
[0014] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide further understanding of the present invention and constitute a part of this application. The illustrative embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0016] Figure 1 A schematic diagram of the steps of a financial product recommendation method disclosed in an embodiment of the present invention.
[0017] Figure 2 This is a schematic diagram of specific steps of step S2 disclosed in one embodiment of the present invention.
[0018] Figure 3 This is a schematic diagram of specific steps of step S22 disclosed in one embodiment of the present invention.
[0019] Figure 4 This is a schematic diagram of specific steps of step S24 disclosed in one embodiment of the present invention.
[0020] Figure 5 It is a schematic diagram of the structure of the bge-reranker-large model disclosed in one embodiment of the present invention.
[0021] Figure 6 This is a schematic diagram of the structure of a financial product recommendation system disclosed in another embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0024] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may include that the first and second features are in direct contact, or may include that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, a first feature being "above", "above" and "above" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. A first feature being "below", "below" and "below" a second feature includes that the first feature is directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature.
[0025] Unless otherwise defined, the technical or scientific terms used herein shall have the common meanings understood by persons with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the patent application specification and claims of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "a" do not indicate a quantity limitation, but indicate the existence of at least one.
[0026] This embodiment discloses a financial product recommendation method. Figure 1 As shown, the specific steps may include the following steps.
[0027] Step S1, collecting user information of the target user in the target recommendation scenario, and obtaining multiple candidate financial product categories that meet the needs of the target user, wherein the user information includes but is not limited to basic personal information, work information, credit record and financial status.
[0028] This embodiment uses a large language model to obtain candidate financial product categories that meet the needs of target users based on the collected user information. After pre-training, the large language model used will be further trained using a specific data set in the field of financial product purchases through a large model fine-tuning technology to adapt it to financial recommendation tasks. The fine-tuning process of the large language model specifically includes the following contents.
[0029] Step S101, obtaining historical financial product recommendation transaction records, wherein each transaction record contains user information of the traded financial product, and the corresponding label is the name of the financial product traded by the user and the category of the financial product to which it belongs.
[0030] Specifically, the pre-trained open source large model Chatglm3-6B is used for text classification. The model can handle longer input texts and supports text input lengths of up to 8K characters, allowing users to provide more detailed and useful information when inputting, thereby improving the model's mining of user intentions. After obtaining the historical financial product transaction records in the industry, a Chatglm3 fine-tuning dataset is constructed based on the historical financial product transaction records. The Chatglm3 fine-tuning dataset contains sample data of multiple user product transactions. Each sample data contains two parts: input and output. The input is configured as the user information of the transaction, and the output is configured as the name of the financial product traded by the user and the category of the financial product to which it belongs.
[0031] Step S102, dividing the data set into a training sample set, a validation sample set, and a test sample set according to the labeled financial product categories, and then performing supervised fine-tuning training on the text classification model.
[0032] Specifically, after the dataset is constructed, the Chatglm3 fine-tuning dataset is divided into training set, test set and validation set in proportion to train, test and validate the Chatglm3-6B model, and obtain the fine-tuned Chatglm3-6B model, which can output candidate financial product categories that meet user needs based on user information. Among them, the supervised fine-tuning process is completed by using the lora fine-tuning technology. Lora fine-tuning is an efficient fine-tuning technology for large pre-trained models. The core idea is to simulate the effect of full parameter fine-tuning by introducing trainable low-rank matrices A and B in the Transformer layer of the model without changing most of the weights of the pre-trained model, so as to achieve rapid adaptation of the model. Specifically, the two low-rank matrices A and B introduced in the added Lora layer, their product AB can approximately represent the change in the weight matrix during the fine-tuning process. ,Right now ,in, , , , .
[0033] During fine-tuning, keep the weight matrix of the original pre-trained model Chatglm3-6B Only training parameters A and B are used to update the Lora low-rank matrix, so that the fine-tuned large model can run on a single card. , after Lora fine-tuning, its forward propagation process becomes: .
[0034] After training, the trained lora weights are combined with the original weights to obtain the final fine-tuning model.
[0035] In another embodiment, the candidate financial product categories that meet the needs of the target user can also be obtained based on the pre-trained ernie3.0 text classification model. The model training process is similar to the Chatglm3-6B model training process. After obtaining the historical financial product transaction records in the industry, an ernie3.0 fine-tuning dataset is constructed based on the historical financial product transaction records. The ernie3.0 fine-tuning dataset contains sample data of multiple user product transactions. Each sample data includes an input and an output. The input is configured as the user information of the transaction, and the output is configured as the name of the financial product traded by the user and the financial product category to which it belongs.
[0036] In this embodiment, since the number of model parameters is small, in order to ensure the normal operation of the model, the configured input information only selects more important information, including work information, credit record, financial situation, and the user's existing financial product categories.
[0037] By responding to recommendation requests, we obtain the target user's user information for the target recommendation scenario to construct prompt sentences, and input them into the fine-tuned large language model to obtain multiple candidate financial product categories that meet the needs of the target user. For each input, we first obtain user information and construct prompts through the internal application programming interface, and then use the fine-tuned large language model to make predictions to obtain the types of financial products that the user is most interested in.
[0038] Step S2: Use the RAG multi-way recall model to obtain multi-way recall results in the product knowledge base corresponding to multiple candidate financial product categories according to the target user information, and remove duplicates from multiple financial products in each recall result and combine them to form a candidate financial product queue.
[0039] Specifically, after obtaining the candidate financial product categories that meet the needs of the target user, it is necessary to further screen out specific financial products that meet the user's needs from the candidate financial product categories based on the screened financial product categories that the user is interested in and the user information, so as to achieve preliminary recommendations of financial products to the user. This embodiment mainly achieves the above requirements through RAG multi-path recall technology. This embodiment comprehensively utilizes multiple recall strategies and models to recall the most relevant information to the user's query from a large-scale knowledge base through multiple paths, and merges the candidate information returned by all recall paths into a large candidate set.
[0040] In this embodiment, since the multi-way recall method is mainly divided into two categories in the field of large language model application, namely, vector recall, i.e., dense vector recall, and inverted recall, i.e., sparse vector recall, and the recall effect and time consumption of different recall methods are different, this embodiment adopts multiple models of the two methods in combination to establish a knowledge base containing multiple vector libraries and retrieval libraries, and then recalls are performed separately through the two methods to capture the characteristics of different dimensions of the data and increase the diversity and accuracy of the recall results. Figure 2 As shown, step S2 may specifically include the following contents.
[0041] Step S21, divide the text introduction information of each financial product into blocks to form a first knowledge base, wherein each data block contains the corresponding financial product name and the current data block content; obtain the historical transaction records of each financial product as the second knowledge base, wherein the historical transaction records include the name of the traded financial product and the transaction record information of the financial product.
[0042] Specifically, a knowledge base is first constructed based on the introduction information and historical transaction records of each financial product in the financial product category that the user is interested in. Since the text introduction information of each financial product is relatively long, this embodiment divides it into blocks to improve the speed and accuracy of the subsequent processing process. Each data block formed after the division contains a financial product name and relatively independent part of the introduction information corresponding to the financial product.
[0043] Step S22, vectorize all data blocks in the first knowledge base to form a first vector knowledge set; vectorize each transaction record information in the second knowledge base, and use the name of the financial product as a label for recall to form a second vector knowledge set.
[0044] Specifically, relevant candidates are recalled through vector recall, and user features and material features are all represented by vectors. The text introduction information blocks of each financial product in the first knowledge base and the transaction record information of each financial product in the second knowledge base are converted into vectors using a vector model and stored in the corresponding vector library. Subsequently, the similarity between the vectors is calculated, and the financial products that the user is interested in are recalled from the vector library according to the user's intention and related information. Among them, since different vector models have different sensitivities and accuracies for different types of data, their recall effects are different, so multiple vector models are selected to vectorize the data. Specifically, if Figure 3 As shown, the step S22 may specifically include the following contents.
[0045] Step S221, use three different embedded models to vectorize each data block in the first knowledge base, and use the FAISS library tool to establish a separate vector library for the vector data generated by each embedded model, generate the corresponding first FAISS vector library, second FAISS vector library and third FAISS vector library, and store them in the first vector knowledge set.
[0046] Step S222, use three different embedded models to vectorize the transaction record information in the second knowledge base, use the corresponding financial product name as the recall label, and use the FAISS library tool to establish a separate vector library for the vector data generated by each embedded model, generate the corresponding fourth FAISS vector library, fifth FAISS vector library and sixth FAISS vector library, and store them in the second vector knowledge set.
[0047] In this embodiment, three vector models gte-large-embeddin, bge-large-embedding, and m3e-large-embedding can be selected to respectively perform vectorization processing on each data block cut from the text introduction information of each financial product in the first knowledge base and the transaction record information of each financial product in the second database, and use the FAISS library tool to establish a separate vector library for the vector data generated by each model. Finally, 6 FAISS vector libraries can be established, thereby improving the overall recall accuracy and performance.
[0048] Step S23, segmenting the first knowledge base and the second knowledge base based on the Jieba word segmentation database, and then using a text matching algorithm to establish a knowledge index to form a corresponding first search database and a second search database.
[0049] Specifically, relevant candidates are recalled through inverted recall, the word segmenter is used to segment the document, and the text matching algorithm BM25 is used to establish an inverted index for different attributes of financial products, and two index libraries are established for subsequent targeted recall of relevant candidates. Specifically, the BM25 algorithm is an algorithm for information retrieval, which calculates the score of the document based on the term frequency TF and the inverse document frequency IDF to evaluate the degree of match between the document and the query, thereby measuring the relevance between the document and the user query. It is widely used in information retrieval fields such as search engines and natural language processing. Its calculation formula is as follows: , in, is the i-th morpheme in the query; d is the document; R(qi, d) is the relevance score between morpheme qi and document d: , , Where k1, k2, and b are adjustment factors, which are usually set based on experience. Generally, k1=2 and b=0.75. fi is the frequency of occurrence of qi in d, qfi is the frequency of occurrence of qi in the question, dl is the length of document d, and avgdl is the average length of all documents. The weight representing the relevance of a word to a document. In this embodiment, the weight is obtained by inverse document frequency: , Among them, N is the total number of documents in the index, and n(qi) is the number of documents containing qi.
[0050] Step S24, after vectorizing the target user information, similar data vectors are recalled in the first vector knowledge set and the second vector knowledge set respectively, and the financial product name corresponding to each similar data vector is obtained as the recall result; the target user information is used to use a text matching algorithm to recall matching data in the first retrieval library and the second retrieval library respectively, and the financial product name corresponding to each matching data is obtained as the recall result.
[0051] Specifically, after the knowledge base is constructed, the types of financial products that the user may be interested in are recalled based on the user information. Since this embodiment establishes 6 FAISS vector libraries and 2 bm25 search libraries, this embodiment adopts an 8-way recall strategy. Specifically, Figure 4 As shown, step S24 may specifically include the following contents.
[0052] Step S241, the basic information, work information, credit record and financial status of the target user in the information are sorted and merged into the information to be matched, and the three different embedded models are used to vectorize the information to be matched to obtain the corresponding three vectors to be matched. In this embodiment, the three embedded models selected are the same as the models used when building the knowledge base, namely, the gte-large-embeddin model, the bge-large-embedding model and the m3e-large-embedding model.
[0053] Step S242, recall six similar data vector groups from the corresponding first vector knowledge set and second vector knowledge set respectively for the three vectors to be matched, wherein each similar data vector group contains a set number of similar data vectors, and obtain the names of financial products corresponding to the similar data vectors as the recall results of this path.
[0054] Specifically, financial products that meet user needs are recalled in the search database by means of vector recall. Specifically, for a vector library established with financial product introduction information, specific financial products are returned; for a vector library established with historical transaction records of financial products, the last financial product purchased in the transaction record is returned.
[0055] Step S243: Use the text matching algorithm to retrieve the two matching data groups corresponding to the information to be matched in the first search database and the second search database, respectively, wherein each matching data group contains a set number of matching data, and obtain the names of financial products corresponding to the matching data as the recall results of this search. Specifically, the financial products that meet the user's needs are retrieved in the search database by reverse recall.
[0056] Step S25, removing duplicate financial product names in the recall results and combining them to form a candidate financial product queue.
[0057] In this embodiment, step S25 specifically includes: removing duplicates from the names of the financial products in the 8 recall results and combining them to form a candidate financial product queue. In this embodiment, each recall path corresponding to each financial product category initially screened can recall 10 candidates, and a total of 80 candidates are recalled.
[0058] Step S3, pairing the user information with each candidate financial product in the candidate financial product queue to form multiple user product groups, wherein the user product group includes the user information and a financial product information, and using the trained precise ranking model to rank and score each user product group, and obtaining the financial products in the user product groups with a set recommended number ranked first as the final recommended products.
[0059] Specifically, after obtaining several financial products recalled by RAG, the recalled financial products are further sorted by the trained fine ranking model to obtain the best candidate financial products that best meet the needs of users. The fine ranking model can be selected from the bge-reranker-large open source fine ranking model, the bce-reranker-base_v1 open source fine ranking model, etc. In this embodiment, the bge-reranker-large model with a relatively high download volume is selected, and its architecture is as follows: Figure 5 As shown, it includes an embedding input layer, an encoder layer and a loss function layer, wherein the embedding input layer includes a text embedding layer, a position embedding layer and a token type embedding layer, wherein the encoder layer is composed of 24 consecutive encoder layers Transformer Encoder stacked together, and the loss function layer is configured to be composed of a first loss function and a second loss function, wherein the first loss function is configured to judge the semantic relevance of user information and product information, and the second loss function is configured to judge the word order of user information and financial product information.
[0060] Specifically, this embodiment adds a second loss function for judging the word order correlation between user information features and financial product features on the basis of the first loss function for judging the semantic correlation between user information features and financial product features in the original model, so as to enable the model to learn the causal relationship between user information and product information and enhance the model's ability to understand semantics. At the same time, considering the small number of training sets, only one 1024*1 fully connected layer is added to the second loss function to reduce the difficulty of training.
[0061] In this embodiment, the first loss function is configured as: ; The second loss function is configured as: ; The final loss function is configured as: ; in and Represents two labels respectively. As learnable parameters, they are used to represent the weights of the two parts of the loss.
[0062] Specifically, As a learnable parameter, it represents the weight of the two parts of the loss. Using adaptive weights to adjust the ratio of the two parts of the loss is better than directly adding the two parts of the loss or manually setting the ratio of the two parts of the loss.
[0063] In this embodiment, since the open source refined ranking model belongs to a general domain model, and the product information within the bank belongs to private domain information, the refined ranking score obtained by directly using the open source model may be lower than the set threshold, resulting in a small number of recalls and inability to recommend more products. Therefore, this embodiment fine-tunes the bge-reranker-large open source model by constructing a refined ranking fine-tuning dataset, which specifically includes the following contents.
[0064] Step S301, obtaining user information features and features of the traded financial products in historical financial product recommendation transaction records, wherein the user information features include historical conversation information, financial situation information, work situation information and credit situation information, and the financial product features include product descriptions, product specifications and product requirements. The user information features are split into a first user feature group and a second user feature group, wherein the first user feature group includes historical conversation information of the target user, and the second user feature group includes financial situation information, work situation information and credit situation information; and the financial product features are split into a first product feature group and a second product feature group, wherein the first product feature group includes product descriptions of corresponding financial products, and the second product feature group includes product specifications and product requirements of corresponding financial products.
[0065] Specifically, the bge-reranker-large model is fine-tuned using the user information features and the features of the traded financial products in the historical financial product recommendation transaction records as sample data, where the features of the traded financial products can be obtained from the product knowledge base based on the names of the financial products in the historical financial product recommendation transaction records. At this time, since the maximum input length of the bge-reranker-large model is 512, and the length of the collected user information and financial product features combined is greater than 512, the input information needs to be readjusted by splitting to ensure that the input data is not truncated, that is, the user information and financial product features are split into two parts, where the user information is split into historical conversation information and information including financial status, work status, and credit status; the financial product features are split into product descriptions and product features.
[0066] Step S302, constructing the user information features and the features of the traded financial products in each historical financial product recommendation transaction record into four positive training data, wherein the four positive training data are the first user feature group and the first product feature group, the first user feature group and the second product feature group, the second user feature group and the first product feature group, and the second user feature group and the second product feature group.
[0067] Step S303, replace the financial product features in the historical financial product recommendation transaction records with other financial product categories or with products with significantly different specifications in the same financial product category, and construct four negative training data with the user information features and the replaced financial product features.
[0068] Specifically, after the splitting is completed, multiple positive training data and multiple negative training data are constructed according to each feature information after the splitting. Among them, the positive training data is semantically close to the original sample data, and the negative training data is semantically different from the original sample data. It can be constructed by replacing the products in the product information with products of other major financial categories, such as replacing loan products with deposit products, insurance products, etc., or by replacing the products in the product information with products with large specifications in the same major financial category, so that the user information does not match the product information. Since the cross entropy loss function is used in this embodiment, the ratio of positive and negative examples is not greatly affected, so no specific requirements are made on the ratio of positive and negative examples. The ratio of positive and negative examples in the training data of this embodiment is 1:15, that is, each historical financial product recommendation transaction record constructs a semantically close positive sample and fifteen negative samples obtained by replacement, and constructs positive and negative training data on this basis.
[0069] Step S304, the positive training data and the negative training data are mixed and formed into a training set, a validation set and a test set according to a set ratio, and then input into a refined ranking model for training.
[0070] In this embodiment, after the fine-tuning data is constructed, it is divided into a training set, a validation set, and a test set in a ratio of 7:1.5:1.5, and the positive training data and the negative training data are respectively input into the model for training, validation, and testing, wherein the label of the positive training data is 1 when used as input, and the label of the negative training data is 0 when used as input. Since each test sample in this test environment has 3-5 financial products that can be recommended to the user, this embodiment uniformly takes 3 financial products as labels, and counts the number of overlaps between the 3 financial products and the first 3 products selected in the refined ranking model. If there is one product overlap, the score is 1, if there are two products overlap, the score is 2, and if there are three products overlap, the score is 3. Finally, the average score of the samples in all test sets is the evaluation index of the refined ranking model.
[0071] After the model fine-tuning training is completed, the candidate financial products obtained after the rough ranking can be fine-ranked according to the fine-tuned bge-reranker-large model to obtain the optimal financial product recommendation results under each financial product category, which specifically includes the following contents.
[0072] Step S31, respectively pairing each user information feature with each candidate financial product feature in the candidate financial product queue using a first order and a second order to form a plurality of user product groups, wherein the user product group includes a user information feature and a candidate financial product feature, wherein the first order is to put the user information feature first and the candidate financial product feature second in the user product group, and the second order is to put the candidate financial product feature first and the user information feature second in the user product group.
[0073] Specifically, step S31 also includes: obtaining user information features and financial product features corresponding to each candidate financial product recalled for each financial product category, splitting the user information features into a first user feature and a second user feature, the first user feature including historical conversation information, and the second user feature including user financial status information, work status information, and credit status information; splitting the financial product features corresponding to each recalled candidate financial product into a first product feature and a second product feature, the first product feature including a product description of the corresponding financial product, and the second product feature including product specifications and product requirements of the corresponding financial product.
[0074] That is, the first user feature and the second user feature corresponding to the user information feature are paired with the first product feature and the second product feature corresponding to each recalled candidate financial product, respectively, to generate n*4 positive user product groups and n*4 reverse user product groups, where n is the total number of candidate financial products under each recalled financial product category. In this embodiment, n=80, the user information feature in the positive user product group is before the financial product feature, and the user information feature in the reverse user product group is after the financial product feature. Through the different constructions of the same sample data in the first order and the second order, the robustness of the model is further increased, and the prediction accuracy of the model is improved.
[0075] Step S34: use the trained fine ranking model to rank and score each user product group, and obtain the financial products in the user product groups with a set number of recommendations that are ranked first as the final recommended products.
[0076] Specifically, the n*4*2 user product groups corresponding to each financial product category are input into the fine-tuned trained model to obtain the scores corresponding to the n*4*2 user product groups, that is, the user information and each financial product can obtain eight scores, and the preset number of financial products with the largest scores are the financial products finally screened out to be recommended to users.
[0077] Furthermore, a feedback mechanism can be added to the multi-channel recall module to dynamically adjust the weight of each channel to dynamically adjust the number of recall vectors for each channel. That is, within a preset time period, the number of final recommended financial products recalled by each channel in the sample is counted, and the number of subsequent recall vectors for each channel is calculated: The number of recalls for channel i = basic recall number + weight* (total number of recalls - basic recall number * number of channels); ; in, It is the number of optimal financial products from each channel within the preset time period finally obtained by the precise sorting model; N is the total number of samples in the preset time period.
[0078] The financial product recommendation method disclosed in this embodiment combines the RAG multi-way recall method with the precise ranking model to recall financial products that may meet user needs from multiple loops and perform ranked recommendations. By collecting user information of the target user in the target recommendation scenario, multiple candidate financial product categories that meet the target user's needs are obtained, and the RAG multi-way recall model is used to obtain multi-way recall results in the product knowledge base corresponding to the multiple candidate financial product categories based on the target user information. The multiple financial products in each recall result are deduplicated and combined to form a candidate financial product queue. Finally, after the user information is paired with each candidate financial product in the candidate financial product queue to form multiple user product groups, the trained precise ranking model is used to rank and score each user product group, and the financial products in the user product group with a set number of recommendations ranked first are obtained as the final recommended products, so as to improve the overall recommendation accuracy of the financial product recommendation model and improve the service quality of the financial industry.
[0079] In another embodiment, if Figure 6As shown, a financial product recommendation system is also disclosed, including a business classification module 1, a multi-way recall module 2 and a precision ranking module 3. Among them, the business classification module is used to collect user information of the target user for the target recommendation scenario, and obtain multiple candidate financial product categories that meet the needs of the target user, and the user information includes but is not limited to basic personnel information, work information, credit record and financial status. The multi-way recall module is used to use the RAG multi-way recall model in the product knowledge base corresponding to multiple candidate financial product categories according to the target user information to obtain multiple recall results, and multiple financial products in each recall result are removed and combined to form a candidate financial product queue. The precision ranking module is used to pair the user information with each candidate financial product in the candidate financial product queue to form multiple user product groups, and the user product group includes user information and a financial product information, and uses the trained precision ranking model to rank and score each user product group, and obtains the financial products in the user product group with a set number of recommendations ranked in front as the final recommended products.
[0080] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. Similar parts between the various embodiments can be referred to each other. For the financial product recommendation system disclosed in the embodiment, since it corresponds to the financial product recommendation method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the aforementioned method part.
[0081] In other embodiments, a server is also provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, each step of the financial product recommendation method described in the above embodiments is implemented.
[0082] If the financial product recommendation system is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned financial product recommendation method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0083] In conclusion, the above is only a preferred embodiment of the present invention, and all equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the patent of the present invention.
Claims
1. A financial product recommendation method, characterized in that: The steps include: S1, collecting user information of the target user in the target recommendation scenario, and obtaining multiple candidate financial product categories that meet the needs of the target user, wherein the user information includes but is not limited to basic personal information, work information, credit record and financial status; S2, using the RAG multi-way recall model in the product knowledge base corresponding to multiple candidate financial product categories according to the target user information to obtain multiple recall results, and removing duplicates from multiple financial products in each recall result and combining them to form a candidate financial product queue; S3, pairing the user information with each candidate financial product in the candidate financial product queue to form multiple user product groups, wherein the user product group includes the user information and a financial product information, and using the trained precise ranking model to rank and score each user product group, and obtaining the financial products in the user product group with a set recommended number ranked first as the final recommended products.
2. The financial product recommendation method according to claim 1, characterized in that: The step S2 specifically includes: S21, dividing the text introduction information of each financial product into blocks to form a first knowledge base, wherein each data block includes the name of the corresponding financial product and the content of the current data block; obtaining the historical transaction records of each financial product as a second knowledge base, wherein the historical transaction records include the name of the traded financial product and the transaction record information of the financial product; S22, performing vectorization conversion on all data blocks in the first knowledge base to form a first vector knowledge set; performing vectorization conversion on each transaction record information in the second knowledge base, and using the name of the financial product as a label for recall to form a second vector knowledge set; S23, performing word segmentation on the first knowledge base and the second knowledge base based on the Jieba word segmentation database, and then using a text matching algorithm to establish a knowledge index to form a corresponding first search database and a second search database; S24, after vectorizing the target user information, similar data vectors are respectively recalled in the first vector knowledge set and the second vector knowledge set, and the names of financial products corresponding to the similar data vectors are obtained as the recall results; the target user information is respectively recalled in the first search library and the second search library using a text matching algorithm to match the data, and the names of financial products corresponding to the matching data are obtained as the recall results; S25, removing duplicate financial product names in each recall result and combining them to form a candidate financial product queue.
3. The financial product recommendation method according to claim 2, characterized in that: The step S22 specifically includes: Use three different embedded models to vectorize each data block in the first knowledge base, use the FAISS library tool to establish a separate vector library for the vector data generated by each embedded model, generate the corresponding first FAISS vector library, second FAISS vector library and third FAISS vector library, and store them in the first vector knowledge set; Three different embedded models are used to vectorize the transaction record information in the second knowledge base, and the corresponding financial product names are used as recall labels. The FAISS library tool is used to establish a separate vector library for the vector data generated by each embedded model, and the corresponding fourth FAISS vector library, fifth FAISS vector library and sixth FAISS vector library are generated and stored in the second vector knowledge set.
4. The financial product recommendation method according to claim 3, characterized in that: The step S23 specifically includes: The first knowledge base and the second knowledge base are segmented based on the Jieba word segmentation library, and then the text matching algorithm BM25 is used to establish the knowledge index to form the corresponding first retrieval library and the second retrieval library.
5. The financial product recommendation method according to claim 4, characterized in that: The step S24 specifically includes: The basic information, work information, credit record and financial status of the target user in the information are sorted and merged into the information to be matched, and the three different embedded models are used to vectorize the information to be matched to obtain the corresponding three vectors to be matched; Recall six similar data vector groups from the corresponding first vector knowledge set and second vector knowledge set respectively for the three vectors to be matched, where each similar data vector group contains a set number of similar data vectors, and obtain the names of financial products corresponding to the similar data vectors as the recall results of this path; The information to be matched is respectively recalled from the first search library and the second search library using a text matching algorithm to obtain two corresponding matching data groups, wherein each matching data group contains a set number of matching data, and the financial product name corresponding to the matching data is obtained as the recall result of this path.
6. The financial product recommendation method according to claim 5, characterized in that: The step S25 specifically includes: The names of the financial products in the eight-way recall results are removed by duplication and then combined to form a candidate financial product queue.
7. The financial product recommendation method according to claim 6, characterized in that: The three embedded models are gte-large-embeddin model, bge-large-embedding model and m3e-large-embedding model.
8. A financial product recommendation system, characterized in that: include: The business classification module is used to collect user information of the target user in the target recommendation scenario and obtain multiple candidate financial product categories that meet the needs of the target user. The user information includes but is not limited to basic personal information, work information, credit record and financial status; A multi-channel recall module is used to obtain multi-channel recall results using the RAG multi-channel recall model in the product knowledge base corresponding to multiple candidate financial product categories according to the target user information, and to remove duplicates from multiple financial products in each recall result and combine them to form a candidate financial product queue; The fine ranking module is used to pair the user information with each candidate financial product in the candidate financial product queue to form multiple user product groups, wherein the user product group includes the user information and a financial product information, and use the trained fine ranking model to rank and score each user product group, and obtain the financial products in the user product groups with a set recommended number ranked first as the final recommended products.
9. A server comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Recommendation method and device based on logistic regression, computing equipment and readable storage medium
CN111008321A
Table correlation recommendation method based on multi-path recall and ESIM fine ranking
CN115510826A
Intelligent interaction method and device, medium and electronic equipment
CN118585629A
Multi-path recall retrieval enhancement generation method and device based on real-time data index
CN118820400A
Adaptive fault identification system
US5351247A
Cited By
Automobile financial product recommendation method and system based on artificial intelligence
CN119648344A
Financial product recommendation method and device based on LLMs
CN120821912A
Scientific and technological achievement recommendation method, equipment, medium and system based on business behavior chain
CN122087167A
