Reply text recommendation method and device, electronic device, and storage medium

By constructing entity relationship subgraphs and feature splicing, combining object preferences and historical conversation features, and using pre-trained language models for text recommendation, we solve the problem of insufficient accuracy in reply text recommendations in the fintech field and achieve more accurate intent recognition and reply content recommendations.

CN119622079BActive Publication Date: 2025-10-10PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411375024.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-10-10
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

In the field of financial technology, the existing technology of reply text recommendation method based on graph neural network and language model has insufficient understanding of the object intention, resulting in low accuracy of reply text recommendation.

Method used

By obtaining the target question text, object preference text, historical conversation text and candidate answer text of the target object, text encoding processing and feature extraction are performed, an entity relationship subgraph is constructed, feature splicing is performed based on object preference and historical conversation features, and a pre-trained language model is used for text recommendation.

Benefits of technology

The accuracy of identifying the target object's intention is improved, thereby improving the accuracy of reply text recommendations and meeting the needs of scenarios such as financial product inquiries and investment consulting in the FinTech field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119622079B_ABST
    Figure CN119622079B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a reply text recommendation method and device, electronic equipment and storage medium, and belongs to the technical field of financial technology. The method comprises the following steps: encoding object preference text of a target object to obtain object preference features; encoding historical dialogue text of the target object to obtain historical dialogue features; encoding question and answer splicing text obtained by splicing a target question text and a candidate reply text to obtain question and answer splicing features; constructing a target entity relationship subgraph based on the target question text, the candidate reply text, the historical dialogue features and the question and answer splicing features; performing feature splicing based on the object preference features, the question and answer splicing features, target question entity embedding features, target dialogue entity embedding features and entity joint embedding features extracted from the target entity relationship subgraph to obtain target question and answer features; and performing text recommendation on the candidate reply text based on the target question and answer features. The embodiment of the application can improve the recommendation accuracy of the reply text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of financial technology, and in particular to a reply text recommendation method and device, electronic device, and storage medium. Background Art

[0002] Response text recommendation is a method that provides text recommendations for responses to questions posed by users through natural language conversations, such as on news websites, social media platforms, and online video platforms. For example, in a FinTech insurance information query, users seeking information about credit cards, specific product recommendations, insurance policies, and so on can enter their query and receive corresponding responses.

[0003] Currently, related technologies typically implement reply text recommendations using graph neural networks, such as the Robust Graph Convolutional Network (RGCN) and Knowledge-Aware Graph Networks (KagNet), or language model-based methods, such as the Unified Question Answering (UnifiedQA) framework. However, these methods lack an understanding of the object's intent, which affects the accuracy of reply text recommendations. Therefore, how to more accurately identify the query object's intent and thus improve the accuracy of reply text recommendations has become a technical problem that needs to be solved urgently. Summary of the Invention

[0004] The main purpose of the embodiments of the present application is to propose a reply text recommendation method and device, electronic device, and storage medium, aiming to more accurately identify the intention of the query object, thereby improving the accuracy of reply text recommendations.

[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a reply text recommendation method, the method comprising:

[0006] Obtaining a target question text, a target preference text, a historical conversation text, and candidate answer texts for the target question text from a target object;

[0007] Performing text encoding processing on the object preference text to obtain object preference features;

[0008] Performing text encoding processing on the historical conversation text to obtain historical conversation features;

[0009] Performing text splicing on the target question text and the candidate answer text to obtain a question-answer splicing text, and performing text encoding processing on the question-answer splicing text to obtain question-answer splicing features;

[0010] Construct a subgraph based on the target question text, the candidate answer text, the historical conversation features, and the question-answer concatenation features to obtain a target entity relationship subgraph;

[0011] Extract embedded entity features based on the target entity relationship subgraph to obtain target question entity embedding features, target dialogue entity embedding features, and entity joint embedding features;

[0012] Performing feature splicing based on the object preference feature, the question-answer splicing feature, the target question entity embedding feature, the target dialogue entity embedding feature, and the entity joint embedding feature to obtain a target question-answer feature;

[0013] The candidate answer texts are recommended based on the target question and answer features.

[0014] In some embodiments, a subgraph is constructed based on the target question text, the candidate answer text, the historical conversation features, and the question-answer concatenation features to obtain a target entity relationship subgraph, including:

[0015] Perform entity extraction on the target question text based on a preset knowledge graph to obtain question entity data;

[0016] Perform entity extraction on the candidate reply text based on the preset knowledge graph to obtain reply entity data;

[0017] Constructing an entity relationship graph based on the question entity data and the answer entity data to obtain an initial entity relationship subgraph;

[0018] The initial entity relationship subgraph is updated based on the historical conversation features and the question-answer splicing features to obtain the target entity relationship subgraph.

[0019] In some embodiments, the initial entity relationship subgraph includes a first subgraph node, the first subgraph node corresponding to a target question entity in the question entity data and a target answer entity in the answer entity data, and updating the initial entity relationship subgraph based on the historical conversation features and the question-answer splicing features to obtain the target entity relationship subgraph includes:

[0020] Determining a second subgraph node based on the historical conversation feature and the question-answer splicing feature;

[0021] Performing entity relationship extraction based on the question-answer concatenation feature and the target question entity to obtain a first entity relationship;

[0022] Performing entity relationship extraction based on the question-answer concatenation feature and the target answer entity to obtain a second entity relationship;

[0023] perform entity relation extraction based on the historical dialogue feature and the question and answer splicing feature to obtain a third entity relation;

[0024] perform subgraph updating on the initial entity relation subgraph based on a preset graph attention network, the first subgraph node, the second subgraph node, the first entity relation, the second entity relation and the third entity relation to obtain the target entity relation subgraph.

[0025] In some embodiments, the performing embedding entity feature extraction based on the target entity relation subgraph to obtain a target question entity embedding feature, a target dialogue entity embedding feature and an entity joint embedding feature comprises:

[0026] perform embedding entity feature extraction on the historical dialogue feature based on the target entity relation subgraph to obtain the target question entity embedding feature;

[0027] perform embedding entity feature extraction on the question and answer splicing feature based on the target entity relation subgraph to obtain the target dialogue entity embedding feature;

[0028] perform embedding entity feature extraction on remaining entities based on the target entity relation subgraph to obtain a remaining entity embedding feature;

[0029] perform feature preprocessing on the remaining entity embedding feature based on a preset number of subgraph entity embeddings to obtain a preprocessed embedding feature;

[0030] perform pooling processing on the preprocessed embedding feature to obtain the entity joint embedding feature.

[0031] In some embodiments, the performing text recommendation on the candidate reply text based on the target question and answer feature comprises:

[0032] perform feature conversion on the target question and answer feature to obtain a linear question and answer feature;

[0033] perform normalization processing on the linear question and answer feature to obtain a semantic matching result;

[0034] perform text recommendation on the candidate reply text based on the semantic matching result.

[0035] In some embodiments, the performing feature conversion on the target question and answer feature to obtain a linear question and answer feature comprises:

[0036] perform linear mapping on the target question and answer feature to obtain a linear mapping question and answer feature;

[0037] perform linear rectification on the linear mapping question and answer feature to obtain a linear rectification question and answer feature;

[0038] Perform linear mapping on the linear rectified question-answering feature to obtain a linear question-answering feature.

[0039] In some embodiments, the performing text recommendation on the candidate reply text based on the semantic matching result includes:

[0040] Determining a target reply text from the candidate reply texts based on the semantic matching result;

[0041] Based on a pre-trained dialogue language model, a dialogue response is generated for the target question text and the target answer text to obtain a recommended answer text.

[0042] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a reply text recommendation device, the device comprising:

[0043] An acquisition module, configured to acquire a target question text, a target preference text, a historical conversation text, and candidate answer texts of the target question text from a target object;

[0044] A first encoding module is used to perform text encoding processing on the object preference text to obtain object preference features;

[0045] A second encoding module is used to perform text encoding processing on the historical conversation text to obtain historical conversation features;

[0046] a third encoding module, configured to perform text splicing on the target question text and the candidate answer text to obtain a question-answer splicing text, and perform text encoding processing on the question-answer splicing text to obtain question-answer splicing features;

[0047] A subgraph construction module is used to construct a subgraph based on the target question text, the candidate answer text, the historical conversation features, and the question-answer splicing features to obtain a target entity relationship subgraph;

[0048] A feature extraction module is used to extract embedded entity features based on the target entity relationship subgraph to obtain target question entity embedding features, target dialogue entity embedding features and entity joint embedding features;

[0049] a splicing module, configured to perform feature splicing based on the object preference feature, the question-answer splicing feature, the target question entity embedding feature, the target dialogue entity embedding feature, and the entity joint embedding feature to obtain a target question-answer feature;

[0050] A recommendation module is used to recommend the candidate answer texts based on the target question and answer features.

[0051] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the method described in the first aspect when executing the computer program.

[0052] To achieve the above-mentioned purpose, the fourth aspect of the embodiments of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method described in the first aspect.

[0053] The present application proposes a reply text recommendation method and device, electronic device, and storage medium, which obtain the target question text, object preference text, historical conversation text, and candidate reply text of the target question text of the target object; further, perform text encoding processing on the object preference text to obtain object preference features; perform text encoding processing on the historical conversation text to obtain historical conversation features; perform text splicing on the target question text and the candidate reply text to obtain question-answer splicing text, and perform text encoding processing on the question-answer splicing text to obtain question-answer splicing features; further, perform subgraph construction based on the target question text, candidate reply text, historical conversation features, and question-answer splicing features to obtain a target entity relationship subgraph; perform embedded entity feature extraction based on the target entity relationship subgraph to obtain target question entity embedding features, target conversation entity embedding features, and entity joint embedding features; further, perform feature splicing based on the object preference features, question-answer splicing features, target question entity embedding features, target conversation entity embedding features, and entity joint embedding features to obtain target question-answer features; further, perform text recommendation on the candidate reply text based on the target question-answer features. Compared with related technologies, this application judges candidate reply texts by combining object preference text, historical conversation text and question-and-answer splicing text, which can better focus on the background knowledge of the target object, thereby improving the accuracy of the target object's intention recognition, and then making more accurate judgments on candidate reply texts to improve the recommendation accuracy of reply texts. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 This is a flow chart of the reply text recommendation method provided by the embodiment of the present application;

[0055] Figure 2 yes Figure 1 A flowchart of step S150 in FIG.

[0056] Figure 3 yes Figure 2 A flowchart of step S240 in FIG.

[0057] Figure 4 yes Figure 1A flowchart of step S160 in FIG.

[0058] Figure 5 yes Figure 1 A flowchart of step S180 in FIG.

[0059] Figure 6 yes Figure 5 A flowchart of step S510 in FIG.

[0060] Figure 7 yes Figure 5 A flowchart of step S530 in FIG.

[0061] Figure 8 This is a structural diagram of a reply text recommendation device provided in an embodiment of the present application;

[0062] Figure 9 This is a hardware structure diagram of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0064] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.

[0065] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0066] First, let’s analyze some of the terms used in this application:

[0067] Artificial intelligence (AI) is a new technical discipline that studies and develops theories, methods, technologies, and application systems for simulating, extending, and expanding human intelligence. A branch of computer science, AI seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. AI can simulate the information processes of human consciousness and thinking. It also encompasses the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.

[0068] Natural language processing (NLP): NLP uses computers to process, understand, and apply human languages ​​(such as Chinese and English). A branch of artificial intelligence, NLP is an interdisciplinary field between computer science and linguistics, often referred to as computational linguistics. Natural language processing encompasses grammatical analysis, semantic analysis, and discourse comprehension. Natural language processing is commonly used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis, and opinion mining. It encompasses data mining, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research related to language processing, and linguistics research related to language computing.

[0069] A knowledge graph is an information system used to store and represent knowledge. It organizes entities and their relationships in a graph format. A knowledge graph typically consists of nodes (representing entities such as people, places, and things) and edges (representing relationships between entities). This structure enables knowledge to be represented and searched in an intuitive manner.

[0070] Robustly Optimized BERT Pre-training Approach (RoBERTa): A large-scale language pre-training model based on a variant of BERT. By improving the pre-training strategy, RoBERTa aims to provide an efficient and optimized BERT model to improve performance on various natural language processing tasks.

[0071] Multi-Layer Perceptron (MLP): It is a basic feedforward neural network model and also an artificial neural network with a directional structure.

[0072] Sigmoid function: a kind of S-shaped curve function, which compresses the input value to between 0 and 1, so that the extreme value of the input is close to 0 or 1.

[0073] Rectified Linear Unit (ReLU): a kind of nonlinear activation function, which realizes nonlinear conversion through a simple threshold judgment. When the input is positive, the output is the same as the input; when the input is negative or zero, the output is zero. This design makes ReLU very efficient in calculation, and helps to alleviate the gradient vanishing problem when training deep networks.

[0074] Answer text recommendation is a method of providing answer text recommendation service for the questions put forward by the object in the form of natural language dialogue, such as news websites, social media, online video platforms, etc. For example, in the insurance information query of financial technology, if the user wants to query information about credit cards, specific product recommendations, insurance policies, etc., the user can input the question to be queried to get the corresponding answer content.

[0075] At present, the technology of using knowledge graph to realize dialogue question and answer can be divided into two categories: (1) using the method based on graph neural network to realize answer text recommendation, that is, using graph convolution network, graph attention network and other graph neural networks to encode the knowledge graph, and answering the question based on reasoning on the graph, such as robust graph convolutional network (RGCN), knowledge-aware graph network (KagNet) and the like; (2) using the method based on language model to realize answer text recommendation, that is, using BERT and other language models to understand the semantics of the question, and combining the knowledge graph to answer the question, such as unified question answering framework (UnifiedQA), question answering with graph neural networks (QA-GNN) and the like. However, when these methods are applied to specific question and answer scenarios, the understanding of the object's intention is insufficient, thereby affecting the accuracy of the answer text recommendation. Therefore, how to more accurately identify the intention of the query object and improve the accuracy of the answer text recommendation has become a technical problem to be solved.

[0076] Based on this, the embodiments of the present application provide an answer text recommendation method and device, electronic equipment and storage medium, which aims to more accurately identify the intention of the query object and improve the accuracy of the answer text recommendation.

[0077] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results.

[0078] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0079] The reply text recommendation method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The recommendation method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, or as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the reply text recommendation method, etc., but is not limited to the above forms.

[0080] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0081] It should be noted that in each specific embodiment of the present application, when it comes to the need to perform relevant processing based on data related to the identity or characteristics of the object, such as object portrait information, object behavior data, and object historical behavior data, the permission or consent of the object will be obtained first, and the collection, use and processing of such data will comply with relevant laws, regulations and standards. In addition, when the embodiment of the present application needs to obtain the sensitive personal information of the object, the separate permission or consent of the object will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the separate permission or consent of the object, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0082] See also Figure 1 , Figure 1 This is an optional flow chart of the reply text recommendation method provided by the embodiment of the present application. In some embodiments of the present application, Figure 1 The method may specifically include but is not limited to steps S110 to S180.

[0083] Step S110, obtaining the target question text, the object preference text, the historical conversation text, and the candidate answer texts of the target question text of the target object;

[0084] Step S120, performing text encoding processing on the object preference text to obtain object preference features;

[0085] Step S130, performing text encoding processing on the historical conversation text to obtain historical conversation features;

[0086] Step S140: concatenate the target question text and the candidate answer text to obtain a question-answer concatenation text, and perform text encoding processing on the question-answer concatenation text to obtain question-answer concatenation features;

[0087] Step S150: construct a subgraph based on the target question text, candidate answer texts, historical conversation features, and question-answer concatenation features to obtain a target entity relationship subgraph;

[0088] Step S160: extracting embedded entity features based on the target entity relationship subgraph to obtain target question entity embedding features, target dialogue entity embedding features, and entity joint embedding features;

[0089] Step S170: performing feature concatenation based on the object preference feature, the question-answer concatenation feature, the target question entity embedding feature, the target dialogue entity embedding feature, and the entity joint embedding feature to obtain the target question-answer feature;

[0090] Step S180: Recommend candidate answer texts based on the target question and answer features.

[0091] Compared with the related art, the steps S110 to S180 of the present application can better focus on the background knowledge of the target object by combining the object preference text, the historical dialogue text and the question and answer splicing text to judge the candidate reply text, thereby improving the accuracy of the intention recognition of the target object, and further more accurately judging the candidate reply text to improve the recommendation accuracy of the reply text. In the field of financial technology, the reply text recommendation method provided by the embodiments of the present application can be applied to investment consulting scenarios (such as replying to questions about investment suggestions, market trends, risk assessment, etc.), financial product query scenarios (such as replying to information queries about credit cards, loan products, insurance policies, etc.), financial regulation interpretation scenarios (such as explaining financial regulations to help the object understand the connotation and scope of application of the regulations), etc., that is, for replying to the questions raised by the object.

[0092] It should be noted that the present scheme is not limited to recommending only text as a reply, but can also be a structure, an image, a video, etc., which is not limited here.

[0093] In step S110 of some embodiments, the target object can be a user of each application platform, a consumer group, etc., for example, in the field of personalized article recommendation, the target object can be a user reading an article; in the field of personalized online mall, the target object can be a buyer purchasing goods. The target object can input a question that he or she wants to consult in the consultation interface of the target application, and the target application can recommend more accurate reply content to the target object by using the reply text recommendation method of the present application. Since the preferences and personal characteristics of each target object are different, even if the same target question text is input, the obtained reply content should be different. However, the related art is insufficient in understanding the background knowledge and intention of the target object when facing dialogue questions in the financial Q&A scenario, resulting in inaccurate recommended reply content. The target application refers to the program software that the target object is browsing and using.

[0094] It should be noted that the target question text is used to represent the text of the problem input by the target object to be solved, and the reply content that can accurately answer the question is needed. For example, in the financial product query scenario, the target question text q can be "I am interested in index funds. How do I choose an index fund suitable for me?".

[0095] It should be noted that the object preference text is used to represent the personalized preference information of the target object in the scenario associated with the target question text, that is, the target object's past preference data, such as favorite investment methods, topics of interest, etc. The object preference text is used to represent the characteristic information of the target object itself, and can be obtained through other public channels without specific limitation. In addition, if the personalized preference information of the target object collected is not in text form, this application can also perform entity extraction on this information to obtain the object preference text, that is, the object preference text can be a collection of multiple keywords that can represent the personalized preferences of the object. In the financial product query scenario, the object preference text s of the target object can be "['long-term investment', 'high-risk preference']".

[0096] It should be noted that the historical conversation text can be the text of multiple rounds of conversations between the target subject and the target question text, including previous questions asked by the target subject and the system's responses. For example, before entering the target question text, the target subject in this application has already engaged in multiple rounds of conversations in the target application. The historical conversation text c at this time may include "(Question Q1: "I have investable funds, but I'm looking for higher returns. Are there any suitable investment products?", Answer A1: "Knowing your investment preferences and risk attitude, I can give you some advice."), (Question Q2: "I plan to invest my funds for more than five years.", Answer A2: "Based on your investment preferences and risk attitude, you may consider the following medium- to long-term investment products: stock funds, index funds, or growth funds. These products generally have higher return potential, but also come with corresponding risks.")" In this way, a historical conversation text containing two rounds of conversations can be obtained. The application can select a specific number of rounds of historical conversation text based on actual computing speed and accuracy requirements, and this is not specifically limited here.

[0097] It should be noted that this application can first match the target question text with the reply text through a text matching model to obtain at least one candidate reply text. In order to improve the accuracy of the recommendation of the reply content, this application will process each candidate reply text to determine the corresponding target question and answer features, thereby determining the degree of matching between the candidate reply text and the target question text. For example, for the target question text q input by the target object, "I am interested in index funds. How do I choose an index fund that suits me?", this application can obtain multiple candidate reply texts, which can be expressed as "["target index", "tracking error", "expense ratio", "historical performance", "fund size"], that is, five candidate reply texts can be included at this time.

[0098] In step S120 of some embodiments, the present application may input the target question text, object preference text, historical conversation text, and candidate answer texts to the target question text into a pre-trained answer text recommendation model. The answer text recommendation model may include an object encoding sub-model, a conversation encoding sub-model, a question-answer encoding sub-model, a sub-graph construction sub-model, an embedding feature extraction sub-model, and a text recommendation sub-model. Based on this, the present application may perform text encoding processing on the object preference text based on the object encoding sub-model to obtain object preference features.

[0099] This application can convert object preference text in natural language form into feature vectors through the object encoding sub-model, and the object encoding sub-model can be built based on structures such as BERT and Word2Vec to obtain object preference features for subsequent models to understand the needs of object personalization. For example, the object preference text is "['long-term investment', 'high-risk preference']", which can represent the investment preference and risk attitude of the target object. At this time, all the texts in the object preference text can be spliced ​​together to obtain s1 = "long-term investment [CLS] high-risk preference", where [CLS] is used to represent the beginning of a sentence in the text, which can correspond to the word vector of the first word in the input text, and the first neuron in the model output layer can usually be used to predict the category of the text. Furthermore, the spliced ​​object preference text can be subjected to text encoding processing based on the object encoding sub-model to obtain object preference features. Wherein, the object preference feature can be the CLS partial vector output by the object encoding sub-model built based on BERT, which can be expressed as s2 = BERT_cls(s1).

[0100] In step S130 of some embodiments, the present application may perform text encoding processing on the historical conversation text based on the conversation encoding sub-model to obtain historical conversation features. Specifically, the present application may first perform text concatenation on the acquired historical conversation text, and then input the concatenated text into the conversation encoding sub-model for text encoding processing. The conversation encoding sub-model may be constructed based on a pre-trained language model, such as a model constructed by BERT or RoBERTa. That is, the conversation encoding sub-model and the object encoding sub-model may be the same or different, without limitation.

[0101] For example, two rounds of historical dialogue texts are selected as c = "(question Q1: "I have an investment fund, but I hope to pursue higher returns. Is there an investment product suitable for me?", answer A1: "I understand your investment preferences and risk attitude, and I can give you some suggestions."), (question Q2: "I plan to invest funds for more than 5 years.", answer A2: "Based on your investment preferences and risk attitude, you can consider the following medium and long-term investment products: stock funds, index funds or growth funds. These products usually have higher return potential, but also come with corresponding risks.")", and the two rounds of historical dialogue texts are spliced to obtain c1 = "[CLS] I have an investment fund, but I hope to pursue higher returns. Is there an investment product suitable for me? [SEP] I understand your investment preferences and risk attitude, and I can give you some suggestions. [SEP] I plan to invest funds for more than 5 years. [SEP] Based on your investment preferences and risk attitude, you can consider the following medium and long-term investment products: stock funds, index funds or growth funds. These products usually have higher return potential, but also come with corresponding risks. [SEP]", wherein [SEP] is used to represent the end of a sentence or document, and is used to separate different sentences. Further, the historical dialogue text after splicing is encoded based on the dialogue encoding sub-model to obtain historical dialogue features representing dialogue context features, i.e., c2 = RoBERTa_cls(c1), wherein RoBERTa represents the model structure of the dialogue encoding sub-model, and RoBERTa_cls represents the output corresponding to the [CLS] token of RoBERTa.

[0102] In the above embodiments, by considering the personalized object preference features and the historical dialogue features capable of reflecting the historical interaction habits of the object, the model can better understand the object's intention, and improve the recommendation accuracy of the answer text.

[0103] In step S140 of some embodiments, the application also merges the target question text and the candidate answer text to form a question and answer splicing text, and further encodes the question and answer splicing text through a question and answer encoding sub-model to learn the relationship between the candidate answer text and the target question text. The question and answer encoding sub-model can be the same as or different from the dialogue encoding sub-model and the object encoding sub-model, and is not limited, and can be constructed based on a pre-trained language model, such as BERT, RoBERTa, etc.

[0104] For example, by splicing the target question text q and a candidate answer text, we can get a question-answer splicing text qa = "I am interested in index funds. How do I choose an index fund that suits me? [CLS] target index". We further use the question-answer encoding sub-model built based on RoBERTa to encode the question-answer splicing text, and take the CLS part of RoBERTa output to obtain the question-answer splicing feature q1 = RoBERTa_cls(qa).

[0105] In step S150 of some embodiments, in order to further determine the relationship between the target question text, historical conversation text and candidate answer text, the present application can construct a subgraph based on the target question text, candidate answer text, historical conversation features and question-answer splicing features to obtain a target entity relationship subgraph to form a visual representation of the relationship between entities, thereby facilitating the subsequent extraction of key features.

[0106] See also Figure 2 , Figure 2 This is a specific flow chart of step S150 provided in an embodiment of the present application. In some embodiments of the present application, step S150 may specifically include but is not limited to steps S210 to S240.

[0107] Step S210: extracting entities from the target question text based on a preset knowledge graph to obtain question entity data;

[0108] Step S220: extracting entities from the candidate reply text based on a preset knowledge graph to obtain reply entity data;

[0109] Step S230: constructing an entity relationship graph based on the question entity data and the answer entity data to obtain an initial entity relationship subgraph;

[0110] Step S240 , updating the initial entity relationship subgraph based on the historical conversation features and the question-answer concatenation features to obtain the target entity relationship subgraph.

[0111] In steps S210 and S220 of some embodiments, the preset knowledge graph refers to a pre-constructed knowledge graph related to the domain to which the target question text belongs, a database containing a large number of entities and their relationships in the domain. In this case, entity extraction can be performed on the target question text and the candidate answer text based on the preset knowledge graph to extract the entities in the text. The algorithm used for entity extraction can be an entity recognition algorithm, such as Named Entity Recognition (NER), which extracts entities from the text and matches them with corresponding entities in the preset knowledge graph to obtain question entity data and answer entity data. Question entity data refers to the key entities and related information extracted from the target question text, while answer entity data refers to the key entities and related information extracted from the candidate answer text. For example, if the target question text is q = "I am interested in index funds. How do I choose an index fund that is suitable for me?", the entity a = "index fund" contained in question q is extracted and initialized as a1 = RoBERTa_cls(a), where question q can contain multiple entities.

[0112] In step S230 of some embodiments, the present application can extract all entities a contained in the target question text q and all entities e contained in the candidate answer text based on a preset knowledge graph, and construct an initial entity relationship subgraph G based on all nodes on all k-hop paths between all entities a and all entities e.

[0113] It should be noted that when constructing the initial entity-relationship subgraph G, the embedding vectors of the entities and relationships are required. For example, the encoded embedding representation of an entity can be a text composed of the entity and the [CLS] token, such as "[CLS] Index Fund." The encoded embedding representation of a relationship can be a text composed of the entity relationship, the [CLS] token, and the [SEP] token, such as "The relationship between [CLS] Index Fund and [SEP] Fund is [SEP] Fund Type."

[0114] In step S240 of some embodiments, in order to deeply learn the relationship between multiple types of texts, the present application can update the subgraph based on historical conversation features and question-answer splicing features to obtain the target entity relationship subgraph, so that the updated entity relationship subgraph is more accurate and complete.

[0115] In the above embodiment, the present application can extract key entity information from the target object's questions and candidate answers, and construct a graph reflecting the relationship between entities, so as to better understand and respond to the object's query.

[0116] It should be noted that the initial entity-relationship subgraph includes a first subgraph node, which corresponds to a target question entity in the question entity data and a target reply entity in the reply entity data. In other words, an edge connecting two first subgraph nodes in the initial entity-relationship subgraph represents a relationship between the corresponding two entities.

[0117] See also Figure 3 , Figure 3 This is a specific flow chart of step S240 provided in an embodiment of the present application. In some embodiments of the present application, step S240 may specifically include but is not limited to steps S310 to S350.

[0118] Step S310: determining a second subgraph node based on historical conversation features and question-answer concatenation features;

[0119] Step S320: extracting entity relationships based on the question-answer concatenation features and the target question entity to obtain a first entity relationship;

[0120] Step S330, performing entity relationship extraction based on the question-answer concatenation feature and the target answer entity to obtain a second entity relationship;

[0121] Step S340: extracting entity relationships based on historical conversation features and question-answer concatenation features to obtain a third entity relationship;

[0122] Step S350 , performing a subgraph update on the initial entity relationship subgraph based on the preset graph attention network, the first subgraph node, the second subgraph node, the first entity relationship, the second entity relationship, and the third entity relationship to obtain a target entity relationship subgraph.

[0123] In step S310 of some embodiments, the present application may add the question-answer concatenation feature q1 (i.e., question embedding) and the historical conversation feature c2 (i.e., conversation context embedding) as additional nodes to the initial entity relationship subgraph, which may be used as the second subgraph node.

[0124] In some embodiments, in steps S320 to S340, a first entity relationship, a second entity relationship, and a third entity relationship are simultaneously constructed based on the question-answer concatenation feature q1, the historical conversation feature c2, the target question entity a, and the target answer entity e. That is, while determining the second subgraph node, the present application constructs a first entity relationship between q1 and a, r1 = "question entity is...", a second entity relationship between q1 and e, r2 = "selection entity is...", and a third entity relationship between c2 and q1, r3 = "conversation history is...".

[0125] In step S350 of some embodiments, further, the present application can perform a subgraph update on the initial entity relationship subgraph based on the preset graph attention network, the first subgraph node, the second subgraph node, the first entity relationship, the second entity relationship and the third entity relationship to obtain the target entity relationship subgraph.

[0126] The present application can update the node representations in the initial entity relationship subgraph based on Graph Attention Networks (GAT). For each node in the initial entity relationship subgraph, the representation of node t in the k+1th layer is updated using the following formula 1:

[0127]

[0128] In formula 1, N t represents all neighbor nodes of node t, α pt represents the attention weight of node p to node t, m pt represents the message sent by neighbor node p to t, represents the embedding representation of node t in the kth layer.

[0129] In step S160 of some embodiments, the target entity relationship subgraph is obtained after K-layer GAT update. In order to extract deeper entity information, the present application can extract the target question entity embedding feature q_gnn, the target dialogue entity embedding feature c_gnn and the entity joint embedding feature r_gnn from the target entity relationship subgraph based on the embedding feature extraction submodel to reflect the linkage between entities.

[0130] See also Figure 4 , Figure 4 This is a specific flow chart of step S160 provided in an embodiment of the present application. In some embodiments of the present application, step S160 may specifically include but is not limited to steps S410 to S450.

[0131] Step S410: extracting embedded entity features from historical conversation features based on the target entity relationship subgraph to obtain target question entity embedded features;

[0132] Step S420: extracting embedded entity features from the question-answer concatenation features based on the target entity relationship subgraph to obtain target dialogue entity embedded features;

[0133] Step S430, extracting embedded entity features of the remaining entities based on the target entity relationship subgraph to obtain remaining entity embedded features;

[0134] Step S440, performing feature preprocessing on the remaining entity embedding features based on the preset number of sub-graph entity embeddings to obtain preprocessed embedding features;

[0135] Step S450: pooling the preprocessed embedding features to obtain entity joint embedding features.

[0136] In steps S410 to S430 of some embodiments, the present application can extract target question entity embedding features q_gnn, target dialogue entity embedding features c_gnn and remaining entity embedding features rs = [r1_gnn, r2_gnn, ...] from the target entity relationship subgraph based on the embedding feature extraction sub-model, where the remaining entity embedding features represent the embedding representation of the new remaining entities in the subgraph.

[0137] In step S440 of some embodiments, further, the present application may perform feature preprocessing on the remaining entity embedding features based on the preset sub-graph entity embedding number w, that is, the present application may randomly select w entity embedding features from the remaining entity embedding features rs to form preprocessed embedding features. Wherein, if w is greater than the vector length of rs, feature extraction is performed on the remaining entity embedding features rs, such as directly truncating the vector after the length w, or extracting w vectors to obtain preprocessed embedding features. If w is greater than the vector length of rs, a preset value (such as vector 0) may be used to fill the remaining entity embedding features rs to obtain preprocessed embedding features.

[0138] In step S450 of some embodiments, the preprocessed embedded features may be further pooled (e.g., max pooling, average pooling, etc.) to obtain the entity joint embedded feature r_gnn. For example, a max pooling operation is performed on the preprocessed embedded features rw = [r_1_gnn, r_2_gnn, ... r_w_gnn] to obtain the final entity joint embedded feature r_gnn = Max Pooling(rw).

[0139] In step S170 of some embodiments, to integrate multiple feature information to form a comprehensive question-answer feature, the present application may concatenate the object preference feature s2, the question-answer concatenation feature q1, the target question entity embedding feature q_gnn, the target conversation entity embedding feature c_gnn, and the entity joint embedding feature r_gnn to obtain the target question-answer feature w1 = [q1; s2; q_gnn; c_gnn; r_gnn]. This can help the model combine multiple aspects of information to enhance the accuracy of recommendations.

[0140] In step S180 of some embodiments, further, the present application may perform text recommendations for candidate answer texts corresponding to the target question and answer features based on a text recommendation sub-model. Specifically, the text recommendation sub-model includes a semantic matching unit, a sorting unit, and a dialogue language model. Among them, the semantic matching unit is used to predict the predicted matching probability between the candidate answer text and the target question text. The sorting unit is used to sort the predicted matching probabilities corresponding to multiple candidate answer texts and determine the candidate answer text with the highest predicted matching probability. The dialogue language model is used to add prompts to make the generated answer content diverse and the answer content more naturally expressed.

[0141] In the above embodiment, the present application can use the target question and answer features to score the candidate reply texts (i.e., predict the matching probability), evaluate the degree of match between the answer and the object's needs, and sort the candidate answers based on the scoring results, and finally recommend the most relevant response to the target object. Through the above steps, an effective text recommendation system can be built to improve user experience and meet personalized needs. This process uses multiple text feature integration, embedded learning and recommendation mechanisms to achieve accurate question and answer matching.

[0142] See also Figure 5 , Figure 5 This is a specific flow chart of step S180 provided in an embodiment of the present application. In some embodiments of the present application, step S180 may specifically include but is not limited to steps S510 to S530.

[0143] Step S510: performing feature conversion on the target question-answer feature to obtain a linear question-answer feature;

[0144] Step S520: normalize the linear question-answering features to obtain a semantic matching result;

[0145] Step S530: Recommend candidate reply texts based on the semantic matching results.

[0146] In steps S510 and S520 of some embodiments, the semantic matching unit of the present application can be constructed based on the MLP structure, and the semantic matching unit includes an input layer, a hidden layer and an output layer. Each layer is composed of multiple neurons (also called nodes), and each neuron is connected to all neurons in the previous layer to form a full connection. The hidden layer is one or more layers of neurons located between the input layer and the output layer. The neurons in the hidden layer weight and transform the input through weights and activation functions, and pass the results to the next layer. The output layer is used to generate the final semantic matching result, which can be a predicted matching probability or a predicted matching score. Specifically, the target question and answer features are input into the input layer of the semantic matching unit, and the target question and answer features are subjected to feature conversion based on the hidden layer of the semantic matching unit to obtain linear question and answer features. Furthermore, the linear question and answer features are normalized based on the output layer of the semantic matching unit to obtain a semantic matching result. Among them, the normalization processing of the output layer can adopt an appropriate activation function according to the task type. For example, the Sigmoid function is used for binary classification problems, the Softmax function is used for multi-classification problems, and the Relu activation function can solve the problem of gradient disappearance and improve the expression ability and prediction accuracy of the model. No specific limitation is made here.

[0147] See also Figure 6 , Figure 6 This is a specific flow chart of step S510 provided in an embodiment of the present application. In some embodiments of the present application, step S510 may specifically include but is not limited to steps S610 to S630.

[0148] Step S610, performing linear mapping on the target question-answer feature to obtain a linearly mapped question-answer feature;

[0149] Step S620: linearly rectify the linearly mapped question-answer feature to obtain a linearly rectified question-answer feature;

[0150] Step S630: linearly map the linear rectified question-answering features to obtain linear question-answering features.

[0151] In steps S610 to S630 of some embodiments, the structure for performing feature conversion on the target question-answer feature in the present application may specifically include at least two layers of MLP, and the process of calculating the semantic matching result is shown in the following formula 2:

[0152] p=Simoid(Linear2(RELU(Linear1(w)))) (Formula 2)

[0153] In Formula 2, w represents a target question and answer feature, Linear1(w) represents a linear mapping question and answer feature, RELU(Linear1(w)) represents a linear rectification question and answer feature, Linear2(RELU(Linear1(w))) represents a linear question and answer feature, Simoid(·) is a normalization function, and p represents a semantic matching result.

[0154] In step S530 of some embodiments, after determining the semantic matching result of each candidate reply text, the candidate reply text can be recommended based on the semantic matching result.

[0155] Please refer to Figure 7 , Figure 7 is a specific flowchart of step S530 provided by the embodiments of the present application. In some embodiments of the present application, step S530 can specifically include but is not limited to steps S710 to S720.

[0156] Step S710, determining a target reply text from the candidate reply text based on the semantic matching result;

[0157] Step S720, generating a dialogue reply based on a pre-trained dialogue language model for the target question text and the target reply text to obtain a recommended reply text.

[0158] In steps S710 to S720 of some embodiments, the semantic matching result can represent the matching degree of the candidate reply text and the target question text. If the semantic matching result is in the form of probability, the present application can obtain the predicted matching probability corresponding to each candidate answer, and select the candidate answer with the highest probability as the correct target reply text. Further, the target question text and the target reply text can be input into the dialogue language model, and the generated answer can be made diverse and the answer expression can be made more natural by adding prompts. The dialogue language model can be a pre-trained ChatGLM structure.

[0159] It should be noted that the training process of the preset reply text recommendation model can specifically include: obtaining a training sample set, the training sample set including a plurality of training samples, and each training sample including a sample question text, a sample object preference text, a sample historical dialogue text, a plurality of sample candidate reply texts of the sample question text, and a sample target reply text. Further, the sample target question and answer feature of the training sample is determined according to the above steps S120 to S170, the sample target question and answer feature is processed based on the reply text recommendation model to determine a predicted sample reply text from the plurality of sample candidate reply texts, and the predicted sample reply text is recommended according to the dialogue language model.

[0160] It should be noted that in the process of training the reply text recommendation model, cross-entropy loss calculation can be performed based on the sample target reply text and the predicted sample reply text to obtain a model loss value, and the reply text recommendation model is adjusted in parameters according to the model loss value. When the reply text recommendation model after parameter adjustment meets the preset ending condition, the final reply text recommendation model used in actual use is obtained.

[0161] It should be noted that the preset ending condition can be that all training samples are trained, or the number of iterations of the model reaches a preset number threshold, or the recommendation accuracy at this time reaches a preset accuracy threshold, which is not limited here.

[0162] It should be noted that the non-company software tools or components appearing in the embodiments of the present application are only examples and do not represent actual use.

[0163] The reply text recommendation method provided in the embodiments of the present application adds a part of feature extraction of the object preference text and the historical dialogue text of the target object on the basis of the QA-GNN model. For the input target question text, additional multi-round dialogue context historical information and object preference feature information can be added, which can make the reply text recommendation system pay attention to the background knowledge of different target objects, thereby improving the accuracy of intent recognition for the target object. In addition, by combining the dialogue language model, the determined target reply text can make the reply content have diversity and the language expression more natural, greatly improving the interactive experience of the object.

[0164] Please refer to Figure 8 The embodiments of the present application also provide a reply text recommendation device, which can implement the above-mentioned reply text recommendation method. The device comprises:

[0165] The acquisition module 810 is configured to acquire a target question text of a target object, an object preference text, a historical dialogue text, and a candidate reply text of the target question text.

[0166] The first encoding module 820 is configured to perform text encoding processing on the object preference text to obtain object preference features.

[0167] The second encoding module 830 is configured to perform text encoding processing on the historical dialogue text to obtain historical dialogue features.

[0168] The third encoding module 840 is configured to splice the target question text and the candidate reply text to obtain a question and answer spliced text, and perform text encoding processing on the question and answer spliced text to obtain question and answer spliced features.

[0169] A subgraph construction module 850 is configured to construct a subgraph based on the target question text, candidate answer texts, historical conversation features, and question-answer concatenation features to obtain a target entity relationship subgraph;

[0170] Feature extraction module 860, configured to extract embedded entity features based on the target entity relationship subgraph to obtain target question entity embedding features, target dialogue entity embedding features, and entity joint embedding features;

[0171] A splicing module 870 is configured to perform feature splicing based on the object preference feature, the question-answer splicing feature, the target question entity embedding feature, the target dialogue entity embedding feature, and the entity joint embedding feature to obtain a target question-answer feature;

[0172] The recommendation module 880 is used to recommend candidate answer texts based on the target question and answer features.

[0173] The specific implementation of the reply text recommendation device in the embodiment of the present application is basically the same as the specific implementation of the above-mentioned reply text recommendation method, and will not be repeated here.

[0174] The present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-described reply text recommendation method when executing the computer program. The electronic device can be any smart terminal, such as a tablet computer or an in-vehicle computer.

[0175] See also Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:

[0176] The processor 910 may be implemented as a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0177] The memory 920 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 920 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 920 and is called by the processor 910 to execute the reply text recommendation method of the embodiments of this application.

[0178] Input / output interface 930, used to implement information input and output;

[0179] Communication interface 940, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);

[0180] bus 950 , which transmits information between various components of the device (e.g., processor 910 , memory 920 , input / output interface 930 , and communication interface 940 );

[0181] The processor 910 , the memory 920 , the input / output interface 930 , and the communication interface 940 are connected to each other in communication within the device via a bus 950 .

[0182] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned reply text recommendation method.

[0183] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0184] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0185] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0186] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0187] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.

[0188] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0189] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0190] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0191] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0192] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0193] If the integrated unit 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 technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0194] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.

Claims

1. A reply text recommendation method, characterized in that: The method comprises: Obtaining a target question text, a target preference text, a historical conversation text, and candidate answer texts for the target question text from a target object; Performing text encoding processing on the object preference text to obtain object preference features; Performing text encoding processing on the historical conversation text to obtain historical conversation features; Performing text splicing on the target question text and the candidate answer text to obtain a question-answer splicing text, and performing text encoding processing on the question-answer splicing text to obtain question-answer splicing features; A subgraph is constructed based on the target question text, the candidate answer text, the historical conversation features and the question-answer splicing features to obtain a target entity relationship subgraph; wherein, the subgraph is constructed based on the target question text, the candidate answer text, the historical conversation features and the question-answer splicing features to obtain a target entity relationship subgraph, including: performing entity extraction on the target question text based on a preset knowledge graph to obtain question entity data; performing entity extraction on the candidate answer text based on the preset knowledge graph to obtain answer entity data; performing entity relationship graph construction based on the question entity data and the answer entity data to obtain an initial entity relationship subgraph; performing subgraph update on the initial entity relationship subgraph based on the historical conversation features and the question-answer splicing features to obtain the target entity relationship subgraph; Extract embedded entity features based on the target entity relationship subgraph to obtain target question entity embedding features, target dialogue entity embedding features, and entity joint embedding features; Performing feature splicing based on the object preference feature, the question-answer splicing feature, the target question entity embedding feature, the target dialogue entity embedding feature, and the entity joint embedding feature to obtain a target question-answer feature; The candidate answer texts are recommended based on the target question and answer features.

2. The method according to claim 1, characterized in that The initial entity relationship subgraph includes a first subgraph node, the first subgraph node corresponding to a target question entity in the question entity data and a target answer entity in the answer entity data, and the subgraph updating of the initial entity relationship subgraph based on the historical conversation features and the question-answer splicing features to obtain the target entity relationship subgraph includes: Determining a second subgraph node based on the historical conversation feature and the question-answer splicing feature; Performing entity relationship extraction based on the question-answer concatenation feature and the target question entity to obtain a first entity relationship; Performing entity relationship extraction based on the question-answer concatenation feature and the target answer entity to obtain a second entity relationship; Extracting entity relationships based on the historical conversation features and the question-answer concatenation features to obtain a third entity relationship; The initial entity relationship subgraph is updated based on a preset graph attention network, the first subgraph node, the second subgraph node, the first entity relationship, the second entity relationship and the third entity relationship to obtain the target entity relationship subgraph.

3. The method according to claim 2, characterized in that The embedding entity feature extraction based on the target entity relationship subgraph to obtain the target question entity embedding feature, the target dialogue entity embedding feature and the entity joint embedding feature includes: Performing embedding entity feature extraction on the historical conversation features based on the target entity relationship subgraph to obtain the target question entity embedding feature; Performing embedding entity feature extraction on the question-answer concatenation feature based on the target entity relationship subgraph to obtain the target dialogue entity embedding feature; Extracting embedded entity features of the remaining entities based on the target entity relationship subgraph to obtain embedded features of the remaining entities; Performing feature preprocessing on the remaining entity embedding features based on a preset number of sub-graph entity embeddings to obtain preprocessed embedding features; Pooling is performed on the preprocessed embedding features to obtain the entity joint embedding features.

4. The method according to any one of claims 1 to 3, characterized in that The recommending the candidate answer texts based on the target question-answer features includes: Performing feature conversion on the target question-answering feature to obtain a linear question-answering feature; Normalizing the linear question-answering features to obtain a semantic matching result; The candidate reply texts are recommended based on the semantic matching results.

5. The method according to claim 4, characterized in that The step of performing feature conversion on the target question-answer feature to obtain a linear question-answer feature includes: Performing linear mapping on the target question-answer feature to obtain a linearly mapped question-answer feature; Performing linear rectification on the linear mapping question-answer feature to obtain a linear rectification question-answer feature; Linear mapping is performed on the linear rectified question-answering feature to obtain a linear question-answering feature.

6. The method according to claim 4, characterized in that The performing text recommendation on the candidate reply text based on the semantic matching result includes: Determining a target reply text from the candidate reply texts based on the semantic matching result; Based on a pre-trained dialogue language model, a dialogue response is generated for the target question text and the target answer text to obtain a recommended answer text.

7. A reply text recommendation device, characterized in that: The device comprises: An acquisition module, configured to acquire a target question text, a target preference text, a historical conversation text, and candidate answer texts of the target question text from a target object; A first encoding module is used to perform text encoding processing on the object preference text to obtain object preference features; A second encoding module is used to perform text encoding processing on the historical conversation text to obtain historical conversation features; a third encoding module, configured to perform text splicing on the target question text and the candidate answer text to obtain a question-answer splicing text, and perform text encoding processing on the question-answer splicing text to obtain question-answer splicing features; A subgraph construction module is used to construct a subgraph based on the target question text, the candidate answer text, the historical conversation features and the question-answer splicing features to obtain a target entity relationship subgraph; wherein, the subgraph construction based on the target question text, the candidate answer text, the historical conversation features and the question-answer splicing features to obtain a target entity relationship subgraph includes: performing entity extraction on the target question text based on a preset knowledge graph to obtain question entity data; performing entity extraction on the candidate answer text based on the preset knowledge graph to obtain answer entity data; constructing an entity relationship graph based on the question entity data and the answer entity data to obtain an initial entity relationship subgraph; performing subgraph update on the initial entity relationship subgraph based on the historical conversation features and the question-answer splicing features to obtain the target entity relationship subgraph; A feature extraction module is used to extract embedded entity features based on the target entity relationship subgraph to obtain target question entity embedding features, target dialogue entity embedding features and entity joint embedding features; a splicing module, configured to perform feature splicing based on the object preference feature, the question-answer splicing feature, the target question entity embedding feature, the target dialogue entity embedding feature, and the entity joint embedding feature to obtain a target question-answer feature; A recommendation module is used to recommend the candidate answer texts based on the target question and answer features.

8. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Response recommendation method, reply recommendation device and intelligent equipment

    CN112527998A

  • Text recommendation method and device, computer equipment and storage medium

    CN113704422A