Text recommendation method and device, equipment, storage medium and program product

By building a conversation graph network and performing semantic transformation and clustering, the problem of low recommendation accuracy in existing text recommendation methods is solved, and a more efficient text recommendation effect is achieved.

CN119537673APending Publication Date: 2025-02-28TENCENT TECH (CHENGDU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311075432.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-23
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The existing text recommendation method recommends the user's attribute characteristics before or during the session, resulting in low recommendation accuracy and users need to spend time selecting the required text, which affects communication efficiency.

Method used

By constructing a conversation graph network, the session text is transformed based on the association relationship in the graph network, semantic features are obtained, and clustering is performed to improve the recommendation accuracy.

Benefits of technology

It improves the accuracy of text recommendations, reduces the possibility of recommending too many duplicate texts, and improves the efficiency of user communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537673A_ABST
    Figure CN119537673A_ABST
Patent Text Reader

Abstract

The invention provides a text recommendation method and device, electronic equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: acquiring a plurality of session texts in a target application scene, and constructing a session graph network according to session attributes of the session texts; wherein the session graph network comprises a plurality of nodes and a plurality of edges, each node corresponds to one session text, and each edge is used for representing an association relationship between the session texts corresponding to the associated nodes; based on the association relationship represented by each edge in the session graph network, performing semantic conversion processing on the session text corresponding to each node in the session graph network to obtain semantic features of the session text corresponding to each node; and performing clustering processing based on the semantic features of the session text corresponding to each node to obtain a clustering result, and performing text recommendation on the target application scene according to the clustering result. Through the method and the device, the text recommendation accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a text recommendation method, device, equipment, storage medium and program product. Background Art

[0002] Artificial Intelligence (AI) is a comprehensive technology in computer science. By studying the design principles and implementation methods of various intelligent machines, machines are given the functions of perception, reasoning and decision-making. Artificial intelligence technology is an interdisciplinary subject that covers a wide range of fields, such as natural language processing technology and machine learning / deep learning. With the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0003] Text recommendation is one of the important tasks in the field of natural language processing. In related technologies, when making text recommendations before or during a user session, most of the recommendations are based on the attribute characteristics of the session text itself. However, this recommendation method often recommends multiple semantically repetitive texts to users, and the recommendation accuracy needs to be improved. Users need to spend a certain amount of time to select the required text, which affects the user's communication efficiency. Summary of the invention

[0004] Embodiments of the present application provide a text recommendation method, device, electronic device, computer-readable storage medium, and computer program product, which can improve the accuracy of text recommendation.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] The present application embodiment provides a text recommendation method, including:

[0007] Acquire multiple conversation texts in a target application scenario, and construct a conversation graph network according to conversation attributes of each of the conversation texts;

[0008] The conversation graph network includes a plurality of nodes and a plurality of edges, each node corresponds to a conversation text, and each edge is used to represent the association relationship between the conversation texts corresponding to the associated nodes;

[0009] Based on the association relationship represented by each edge in the conversation graph network, a semantic conversion process is performed on the conversation text corresponding to each node in the conversation graph network to obtain the semantic features of the conversation text corresponding to each node;

[0010] Clustering is performed based on the semantic features of the conversation text corresponding to each node to obtain a clustering result, and text recommendation is performed for the target application scenario based on the clustering result.

[0011] The present application provides a text recommendation device, including:

[0012] A network construction module, used to obtain multiple conversation texts in a target application scenario, and construct a conversation graph network according to conversation attributes of each of the conversation texts;

[0013] The conversation graph network includes a plurality of nodes and a plurality of edges, each node corresponds to a conversation text, and each edge is used to represent the association relationship between the conversation texts corresponding to the associated nodes;

[0014] A semantic conversion module, configured to perform semantic conversion processing on the conversation text corresponding to each node in the conversation graph network based on the association relationship represented by each edge in the conversation graph network, so as to obtain the semantic features of the conversation text corresponding to each node;

[0015] The text recommendation module is used to perform clustering processing based on the semantic features of the conversation text corresponding to each node to obtain a clustering result, and to perform text recommendation for the target application scenario based on the clustering result.

[0016] In the above scheme, the network construction module is also used to determine the session attributes of each of the conversation texts, wherein the session attributes include the conversation object and the conversation time; according to the conversation time of each of the conversation texts, a homogeneous graph network corresponding to the conversation texts belonging to the same conversation object and a heterogeneous graph network corresponding to the conversation texts belonging to different conversation objects are constructed; and the constructed homogeneous graph network is combined with the heterogeneous graph network to obtain a conversation graph network.

[0017] In the above scheme, the semantic conversion module is also used to perform sentence vector conversion processing on the conversation text corresponding to each node in the conversation graph network to obtain the sentence vector of the conversation text corresponding to each node; based on the association relationship represented by each edge in the conversation graph network, perform environmental feature extraction processing on the conversation text corresponding to each node in the conversation graph network to obtain the environmental vector of the conversation text corresponding to each node; based on the environmental vector of the conversation text corresponding to each node, determine the semantic feature of the conversation text corresponding to each node.

[0018] In the above scheme, the semantic conversion module is also used to perform the following processing on the source node and the target node associated with each edge in the conversation graph network: determine the environment vector of the conversation text corresponding to the source node, wherein, when the source node is the first node in the conversation graph network, the environment vector of the conversation text corresponding to the source node is obtained by initializing the sentence vector of the conversation text corresponding to the source node; based on the association relationship between the source node and the target node, perform environmental feature prediction processing according to the environment vector of the conversation text corresponding to the source node to obtain the environment vector of the conversation text corresponding to the target node.

[0019] In the above scheme, the environment vector includes a homogeneous environment vector and a heterogeneous environment vector. The semantic conversion module is also used to, when the source node and the target node are homogeneous nodes, perform environment feature prediction processing according to the homogeneous environment vector of the conversation text corresponding to the source node to obtain the environment vector of the conversation text corresponding to the target node; when the source node and the target node are heterogeneous nodes, perform environment feature prediction processing according to the heterogeneous environment vector of the conversation text corresponding to the source node to obtain the environment vector of the conversation text corresponding to the target node.

[0020] In the above scheme, the semantic conversion module is also used to, when there are multiple edges associated with the target node in the conversation graph network and multiple corresponding source nodes, perform environmental vector prediction based on the association relationship between each source node and the target node and according to the environmental vector of the conversation text corresponding to each source node to obtain the predicted environmental vectors of the conversation texts corresponding to the multiple target nodes; and perform fusion processing on the predicted environmental vectors of the conversation texts corresponding to the multiple target nodes to obtain the environmental vector of the conversation text corresponding to the target node.

[0021] In the above scheme, the semantic conversion processing is implemented by a semantic conversion model, and the device also includes: a model training module, used to obtain an initial semantic conversion model and a session graph network sample, wherein the session graph network sample includes multiple nodes and edges, each node corresponds to a session sample, and each edge is used to represent the association relationship between the session samples corresponding to the associated nodes; based on the association relationship represented by each edge in the session graph network sample, a homogeneous graph network sample and a heterogeneous graph network sample are extracted from the session graph network sample, wherein the session samples corresponding to the source node and the target node associated with each edge in the homogeneous graph network sample belong to the same session object, and the session samples corresponding to the source node and the target node associated with each edge in the heterogeneous graph network sample belong to different session objects; the initial semantic conversion model is trained based on the homogeneous graph network sample and the heterogeneous graph network sample to obtain the semantic conversion model.

[0022] In the above scheme, the semantic conversion model includes a homogeneous conversion network and a heterogeneous conversion network. The model training module is also used to construct a first loss function of the homogeneous conversion network based on the homogeneous graph network sample; construct a second loss function of the heterogeneous conversion network based on the heterogeneous graph network sample; combine the first loss function and the second loss function to construct a third loss function of the initial semantic conversion model, and update the parameters of the initial semantic conversion model according to the third loss function to obtain the semantic conversion model.

[0023] In the above scheme, the model training module is also used to perform sentence vector conversion processing on the conversation samples corresponding to the source node and the target node associated with each edge in the homogeneous graph network sample, so as to obtain the sentence vector of the conversation samples corresponding to the source node and the target node associated with each edge in the homogeneous graph network sample; based on the sentence vector corresponding to the conversation sample corresponding to the source node, determine the semantic features and homogeneous environment vector of the conversation sample corresponding to the source node, and perform environment feature prediction processing based on the homogeneous environment vector of the conversation sample corresponding to the source node to obtain the environment vector of the conversation sample corresponding to the target node; based on the environment vector of the conversation sample corresponding to the target node, determine the semantic features of the conversation sample corresponding to the target node, and determine the similarity probability between the semantic features of the conversation sample corresponding to the source node and the semantic features of the conversation sample corresponding to the target node; determine the association weight between the source node and the target node, and construct a first loss function corresponding to the homogeneous conversion network based on the similarity probability and the association weight.

[0024] In the above scheme, the model training module is also used to perform sentence vector conversion processing on the conversation samples corresponding to the source node and the target node associated with each edge in the heterogeneous graph network sample, so as to obtain the sentence vector of the conversation samples corresponding to the source node and the target node associated with each edge in the heterogeneous graph network sample; based on the sentence vector corresponding to the conversation sample corresponding to the source node, determine the semantic features and heterogeneous environment vector of the conversation sample corresponding to the source node, and perform environment feature prediction processing based on the heterogeneous environment vector to obtain the environment vector of the conversation sample corresponding to the target node; based on the environment vector of the conversation sample corresponding to the target node, determine the semantic features of the conversation sample corresponding to the target node, and determine the similarity probability between the semantic features of the conversation sample corresponding to the source node and the semantic features of the conversation sample corresponding to the target node; determine the association weight between the source node and the target node, and construct a second loss function corresponding to the heterogeneous conversion network based on the similarity probability and the association weight.

[0025] In the above scheme, the text recommendation module is also used to perform clustering processing based on the semantic features of the conversation text corresponding to each node, and obtain a clustering result for characterizing the division of multiple conversation texts into a target number of conversation categories; wherein the similarity between the semantic features of the conversation texts in one conversation category exceeds a similarity threshold, and the silhouette coefficient corresponding to the target number is greater than the silhouette coefficients corresponding to other numbers; determine the recommendation priority of each conversation text in each conversation category of the clustering result in the target application scenario, and select the conversation text with a recommendation priority higher than the recommendation priority threshold for text recommendation.

[0026] An embodiment of the present application provides an electronic device, including:

[0027] A memory for storing computer executable instructions or computer programs;

[0028] The processor is used to implement the text recommendation method provided in the embodiment of the present application when executing the computer executable instructions or computer program stored in the memory.

[0029] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions or a computer program for implementing the text recommendation method provided in the embodiment of the present application when executed by a processor.

[0030] An embodiment of the present application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, the text recommendation method provided in the embodiment of the present application is implemented.

[0031] The embodiments of the present application have the following beneficial effects:

[0032] By applying the embodiments of the present application, when performing text recommendation for a target application scenario, based on the association relationship represented by each edge in the conversation graph network, semantic conversion processing is performed on the conversation text corresponding to each node in the conversation graph network to obtain the semantic features of the conversation text corresponding to each node, and clustering processing is performed based on the semantic features of the conversation text corresponding to each node. Since the meaning of the conversation text corresponding to each node and the association relationship between the conversation texts are combined during the semantic conversion processing, a more accurate clustering result can be obtained, so that when performing text recommendation for the target application scenario based on the clustering result, it is possible to avoid recommending too many repeated texts, thereby improving the accuracy of text recommendation and further improving communication efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 is a structural diagram of a text recommendation system provided in an embodiment of the present application;

[0034] Figure 2 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0035] Figure 3 It is a flowchart of a text recommendation method provided in an embodiment of the present application;

[0036] Figure 4 It is a flowchart of a text recommendation method provided in an embodiment of the present application;

[0037] Figure 5 It is a flowchart of a text recommendation method provided in an embodiment of the present application;

[0038] Figure 6 It is a flowchart of a text recommendation method provided in an embodiment of the present application;

[0039] Figure 7 It is a flowchart of a training method for a semantic conversion model provided in an embodiment of the present application;

[0040] Figure 8 It is a flowchart of a training method for a semantic conversion model provided in an embodiment of the present application;

[0041] Fig. 9 It is a schematic diagram of constructing a conversation graph network provided in an embodiment of the present application;

[0042] Fig.10 is an application diagram of the text recommendation method provided in an embodiment of the present application;

[0043] Fig.11 is a schematic diagram of the change of the silhouette coefficient with the number of categories provided in the embodiment of the present application;

[0044] Fig.12 is an application diagram of the text recommendation method provided in an embodiment of the present application;

[0045] Figures 13A-13D It is an application diagram of the text recommendation method provided in the embodiment of the present application. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0047] It is understandable that in the embodiments of the present application, when data related to user information (such as user conversation texts, habits, interests and hobbies, etc.) is involved, when the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0048] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0049] In the following description, the terms "first\second..." are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second..." can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

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

[0051] The text recommendation provided in the embodiments of the present application can be implemented by various electronic devices, for example, it can be implemented by a terminal device or a server alone, or it can be implemented by a terminal and a server in collaboration. The following describes an exemplary application when the electronic device is implemented as a server in a text recommendation system, see Figure 1 , Figure 1 It is a structural diagram of a text recommendation system provided in an embodiment of the present application. The terminal 400 is connected to the server 200 via a network 300. The network 300 may be a wide area network or a local area network, or a combination of the two.

[0052] In some embodiments, the server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or 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 terminal 400 may include but is not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, etc. The terminal and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.

[0053] In some embodiments, the function of the text recommendation system is implemented based on the server 200. The server 200 obtains multiple conversation texts in the target application scenario from the terminal 400. The server 200 constructs a conversation graph network according to the conversation attributes of each conversation text; wherein the conversation graph network includes multiple nodes and multiple edges, each node corresponds to a conversation text, and each edge is used to represent the association relationship between the conversation texts corresponding to the associated nodes; based on the association relationship represented by each edge in the conversation graph network, the conversation text corresponding to each node in the conversation graph network is semantically converted to obtain the semantic features of the conversation text corresponding to each node; clustering is performed based on the semantic features of the conversation text corresponding to each node to obtain a clustering result, and text recommendation is performed for the target application scenario according to the clustering result, such as sending the recommended text to the terminal 400 for presentation.

[0054] In other embodiments, the embodiments of the present application can be implemented with the aid of cloud technology, which refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or a local area network to achieve data computing, storage, processing, and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model. It can form a resource pool that is used on demand and is flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources.

[0055] Next, the structure of the electronic device for implementing the text recommendation method provided by the embodiment of the present application is described. As mentioned above, the electronic device provided by the embodiment of the present application can be Figure 1 Server 200 in . Figure 2 , Figure 2 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, Figure 2 The server 200 shown includes: at least one processor 210, a memory 250, and at least one network interface 220. The various components in the server 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 240 is not described in detail. Figure 2 Various buses are labeled as bus system 240 .

[0056] The processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0057] The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 250 may optionally include one or more storage devices that are physically remote from the processor 210.

[0058] The memory 250 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 250 described in the embodiments of the present application is intended to include any suitable type of memory.

[0059] In some embodiments, memory 250 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0060] The operating system 251 includes system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic businesses and processing hardware-based tasks; a network communication module 252 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 220. Exemplary network interfaces 220 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB), etc.

[0061] In some embodiments, the text recommendation device provided in the embodiments of the present application can be implemented in software. Figure 2 A text recommendation device 255 stored in a memory 250 is shown, which may be software in the form of a program or plug-in, including the following software modules: a network construction module 2551, a semantic conversion module 2552, and a text recommendation module 2553. These modules are logical, and therefore may be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.

[0062] In some embodiments, the terminal or server can implement the text recommendation method provided in the embodiments of the present application by running a computer program. For example, the computer program can be a native program (e.g., a dedicated text recommendation program) or a software module in the operating system; it can be a native application (APP, Application), that is, a program that needs to be installed in the operating system to run; it can also be a small program that can be embedded in any APP, that is, a program that can be run only by downloading it to a browser environment. In short, the above-mentioned computer program can be any form of application, module or plug-in.

[0063] The text recommendation method provided by the embodiment of the present application will be described in conjunction with the exemplary application and implementation of the server 200 provided by the embodiment of the present application. Figure 3 , Figure 3: is a flowchart of a text recommendation method provided by an embodiment of the present application, the method comprising:

[0064] In step 101, a plurality of conversation texts in a target application scenario are obtained, and a conversation graph network is constructed according to conversation attributes of each conversation text.

[0065] Here, the target application scenario is an application scenario involving conversational communication, such as a social application scenario, a conversational communication scenario outside a game, etc. The conversation text is the conversation content corresponding to the target application scenario, which can be text content edited by a user through a text editing tool, or text content obtained by voice conversion of a voice file, or text content obtained by other means. This application does not limit the method for obtaining the conversation text.

[0066] After obtaining multiple conversation texts in the target application scenario, a conversation graph network can be constructed according to the conversation attributes of each conversation text, wherein the conversation graph network includes multiple nodes and multiple edges, each node corresponds to a conversation text, and each edge is used to represent the association relationship between the conversation texts corresponding to the associated nodes.

[0067] In some embodiments, see Figure 4 , Figure 4 is a flowchart of a text recommendation method provided in an embodiment of the present application, Figure 3 In step 101, a conversation graph network is constructed according to the conversation attributes of each conversation text, which can be obtained by Figure 4 The steps 1011 to 1013 shown are implemented as follows: in step 1011, the session attributes of each session text are determined, wherein the session attributes include the session object and the session time; in step 1012, according to the session time of each session text, a homogeneous graph network corresponding to the session texts belonging to the same session object and a heterogeneous graph network corresponding to the session texts belonging to different session objects are constructed; in step 1013, the constructed homogeneous graph network and the heterogeneous graph network are combined to obtain a session graph network.

[0068] Here, when constructing a conversation graph network, the conversation attributes corresponding to each conversation text, such as the conversation object and the conversation time, can be determined first. According to the sequence of the conversation time of each conversation text, it is judged whether the adjacent conversation texts belong to the same conversation object. When the adjacent conversation texts belong to the same conversation object, a homogeneous graph network is constructed according to the adjacent conversation texts; when the adjacent conversation texts belong to different conversation objects, a heterogeneous graph network is constructed according to the adjacent conversation texts; and so on, according to the obtained multiple conversation texts, multiple homogeneous graph networks and multiple heterogeneous graph networks can be constructed; finally, the constructed homogeneous graph network and heterogeneous graph network are combined to obtain a complete conversation graph network.

[0069] For example, see Fig. 9 , Fig. 9 1 is a schematic diagram of constructing a conversation graph network provided in an embodiment of the present application. Taking the communication between conversation object 1 and conversation object 2 as an example, the conversation texts exchanged between the two are: conversation text 1 (corresponding to conversation object 1) -> conversation text 2 (corresponding to conversation object 1) -> conversation text 3 (corresponding to conversation object 2) -> conversation text 4 (corresponding to conversation object 1) -> conversation text 5 (corresponding to conversation object 2). When the network is constructed for the above multiple conversation texts, the constructed conversation graph network can be represented as: node 1 -> node 2 -> node 3 -> node 4 -> node 5, wherein node 1 corresponds to conversation text 1, node 2 Corresponding to conversation text 2, since both conversation text 1 and conversation text 2 correspond to conversation object 1, node 1->node 2 belongs to a homogeneous graph network; and node 3 corresponds to conversation text 3. Since conversation text 3 corresponds to conversation object 2, conversation text 2 and conversation text 3 correspond to different conversation objects, so node 2->node 3 belongs to a heterogeneous graph network. Similarly, node 3->node 4->node 5 belongs to a heterogeneous graph network. By combining the constructed homogeneous graph network and heterogeneous graph network according to the chronological order of the conversation time of each conversation text, we can obtain the conversation graph network when conversation object 1 and conversation object 2 communicate.

[0070] In step 102, based on the association relationship represented by each edge in the conversation graph network, a semantic conversion process is performed on the conversation text corresponding to each node in the conversation graph network to obtain the semantic features of the conversation text corresponding to each node.

[0071] In some embodiments, see Figure 5 , Figure 5 is a flowchart of a text recommendation method provided in an embodiment of the present application, Figure 3 Step 102 shown may be performed by Figure 5 Steps 1021 to 1023 are shown to achieve:

[0072] In step 1021, sentence vector conversion is performed on the conversation text corresponding to each node in the conversation graph network to obtain the sentence vector of the conversation text corresponding to each node.

[0073] Here, when performing sentence vector conversion on the conversation text, the conversation text corresponding to each node in the conversation graph network can be directly input into the trained sentence vector conversion model, and the conversation text can be processed by the sentence vector conversion model to obtain the sentence vector of the conversation text corresponding to each node; the conversation text corresponding to each node in the conversation graph network can also be processed by word segmentation to obtain multiple words corresponding to each conversation text, and then the multiple words corresponding to each conversation text can be vector converted to obtain the corresponding multiple word vectors, and the multiple word vectors can be concatenated to obtain the sentence vector corresponding to each conversation text; in addition, other methods can be used to obtain the sentence vector of the conversation text, and the present application does not limit the method for obtaining the sentence vector.

[0074] In step 1022, based on the association relationship represented by each edge in the conversation graph network, the conversation text corresponding to each node in the conversation graph network is subjected to environmental feature extraction processing to obtain an environmental vector of the conversation text corresponding to each node.

[0075] In some embodiments, see Figure 6 , Figure 6 is a flowchart of a text recommendation method provided in an embodiment of the present application, Figure 5 Step 1022 shown may be performed by, for each source node and target node associated with each edge in the conversation graph network, executing Figure 6 Steps 10221-10222 shown are implemented as follows:

[0076] In step 10221, determine the environment vector of the conversation text corresponding to the source node.

[0077] Here, among the source nodes and target nodes associated with each edge in the conversation graph network, the target node is the next adjacent node of the source node, and the environment vector of the conversation text corresponding to the source node is used to predict the environment vector of the conversation text corresponding to the target node. The environment vector is used to feedback the contextual features between the conversation texts corresponding to different nodes. When the source node is the first node in the conversation graph network, the environment vector of the conversation text corresponding to the source node is obtained by initializing the sentence vector of the conversation text corresponding to the source node. When the source node is not the first node in the conversation graph network, the environment vector of the conversation text corresponding to the source node is predicted based on the environment vector of the previous node adjacent to the source node.

[0078] In step 10222, based on the association relationship between the source node and the target node, environmental feature prediction processing is performed according to the environmental vector of the conversation text corresponding to the source node to obtain the environmental vector of the conversation text corresponding to the target node.

[0079] Here, when the association relationship between the source node and the target node indicates that the target node is the next adjacent node of the source node, the environment feature prediction process is performed based on the environment vector of the conversation text corresponding to the source node to obtain the environment vector of the conversation text corresponding to the target node.

[0080] In some embodiments, the environment vector includes a homogeneous environment vector and a heterogeneous environment vector, and the environment feature prediction processing can be performed based on the environment vector of the conversation text corresponding to the source node to obtain the environment vector of the conversation text corresponding to the target node in the following manner: when the source node and the target node are homogeneous nodes, the environment feature prediction processing is performed based on the homogeneous environment vector of the conversation text corresponding to the source node to obtain the environment vector of the conversation text corresponding to the target node; when the source node and the target node are heterogeneous nodes, the environment feature prediction processing is performed based on the heterogeneous environment vector of the conversation text corresponding to the source node to obtain the environment vector of the conversation text corresponding to the target node.

[0081] Here, when the source node and the target node are homogeneous nodes, that is, the conversation text corresponding to the source node and the conversation text corresponding to the target node belong to the same conversation object, the homogeneous environment vector can better reflect the conversation characteristics of the same conversation object. Therefore, the environment vector of the conversation text corresponding to the target node is predicted based on the homogeneous environment vector of the conversation text corresponding to the source node, which can also reflect the conversation characteristics of the conversation object. When the source node and the target node are heterogeneous nodes, that is, the conversation text corresponding to the source node and the conversation text corresponding to the target node belong to different conversation objects, the heterogeneous environment vector can better reflect the conversation characteristics of different conversation objects. Therefore, the environment vector of the conversation text corresponding to the target node is predicted based on the heterogeneous environment vector of the conversation text corresponding to the source node, which can reflect the conversation characteristics of different conversation objects. Moreover, since when the source node is the first node in the conversation graph network, the homogeneous environment vector and the heterogeneous environment vector of the conversation text corresponding to the source node are both initially obtained by performing an initial operation on the sentence vector of the conversation text corresponding to the source node, and the sentence vector of the conversation text corresponding to the source node is the best expression of the intrinsic meaning of the conversation text, the homogeneous environment vector and the heterogeneous environment vector of the conversation text corresponding to the source node are context features predicted on the basis of the essential meaning of the conversation text, and can fully learn the context dependency of the conversation text.

[0082] In step 1023, based on the environment vector of the conversation text corresponding to each node, the semantic features of the conversation text corresponding to each node are determined.

[0083] In practical applications, the semantic features are determined in different ways according to different application scenarios. For example, for the first node in the conversation graph network, since there is no previous adjacent node (i.e., there is no previous context relationship to refer to), the sentence vector of the conversation text corresponding to the first node can be regarded as the semantic feature of the conversation text; for another example, for the intermediate node in the conversation graph network, since the intermediate node already has a corresponding conversation text, the conversation text corresponding to the intermediate node can be converted into a sentence vector to obtain the corresponding sentence vector, and the environment vector of the conversation text corresponding to the intermediate node can be predicted by the environment vector of the conversation text corresponding to the previous adjacent node of the intermediate node, so the sentence vector and the environment vector of the conversation text corresponding to the intermediate node can be fused, and the fusion result can be used as the semantic feature of the conversation text corresponding to the intermediate node; for another example, for the future node in the conversation graph network (i.e., predicting the next conversation text), since the conversation text corresponding to the future node has not yet been predicted, the environment vector of the conversation text corresponding to the future node can be predicted by the environment vector of the conversation text corresponding to the previous adjacent node of the future node, so the predicted environment vector of the conversation text corresponding to the future node can be used as the semantic feature of the conversation text corresponding to the future node.

[0084] It can be understood that when determining the semantic features corresponding to the conversation text corresponding to each node, since the sentence vector (the representation of the intrinsic meaning of the conversation text) of the conversation text corresponding to the node itself, or the environment vector (context feature) of the conversation text corresponding to the adjacent node is taken into consideration, the semantic features can fully reflect the true meaning and semantic environment information of the conversation text. When clustering is performed based on the semantic features later, more accurate clustering results can be obtained, so that when text is recommended for the target application scenario based on the clustering results, it is possible to avoid recommending too many repeated texts, thereby improving the accuracy of text recommendations.

[0085] In some embodiments, the following method can be used to predict the environmental vector of the conversation text corresponding to the target node based on the association relationship between the source node and the target node, and to obtain the environmental vector of the conversation text corresponding to the target node: when there are multiple edges associated with the target node and multiple corresponding source nodes in the conversation graph network, based on the association relationship between each source node and the target node, predict the environmental vector of the conversation text corresponding to each source node, and obtain the predicted environmental vectors of the conversation texts corresponding to multiple target nodes; and fuse the predicted environmental vectors of the conversation texts corresponding to the multiple target nodes to obtain the environmental vector of the conversation text corresponding to the target node.

[0086] Here, when there are multiple adjacent source nodes to a target node, an environmental vector prediction can be performed based on the environmental vector of the conversation text corresponding to each source node, respectively, to obtain predicted environmental vectors of the conversation texts corresponding to multiple target nodes, and then the multiple predicted environmental vectors are fused, and the fusion result is used as the environmental vector of the conversation text corresponding to the target node; in this way, the environmental vectors corresponding to multiple source nodes are taken into account, that is, different context dependencies are taken into account, making the prediction result more accurate.

[0087] In some embodiments, the semantic conversion process is implemented by a semantic conversion model. Before applying the semantic conversion model, the semantic conversion model needs to be trained first. Figure 7 , Figure 7 is a flow chart of the training method of the semantic conversion model provided in the embodiment of the present application, which can be Figure 7 The steps 201 to 203 shown are used to train a semantic conversion model:

[0088] In step 201, an initial semantic conversion model and a conversation graph network sample are obtained.

[0089] In practical applications, the initial semantic conversion model can be any neural network model, and the initial neural network model can be trained to use the trained neural network model as the initial semantic conversion model. The network structure of the initial semantic conversion model does not constitute a limitation on the embodiments of the present application. In addition, the structure of the initial semantic conversion model is the same as that of the semantic conversion model obtained by final training. The initial semantic conversion model in the embodiments of the present application is obtained by training based on a conversation graph network sample, wherein the conversation graph network sample includes multiple nodes and edges, each node corresponds to a conversation sample, and each edge is used to characterize the association relationship between conversation samples corresponding to the associated nodes.

[0090] In step 202, based on the association relationship represented by each edge in the conversation graph network sample, a homogeneous graph network sample and a heterogeneous graph network sample are extracted from the conversation graph network sample.

[0091] Among them, the session samples corresponding to the source node and the target node associated with each edge in the homogeneous graph network sample belong to the same session object, and the session samples corresponding to the source node and the target node associated with each edge in the heterogeneous graph network sample belong to different session objects.

[0092] In step 203, the initial semantic conversion model is trained based on the homogeneous graph network samples and the heterogeneous graph network samples to obtain a semantic conversion model.

[0093] Here, after extracting homogeneous graph network samples and heterogeneous graph network samples from the conversation graph network samples, the initial semantic conversion model can be initialized according to the extracted homogeneous graph network samples and heterogeneous graph network samples to train the initialized initial semantic conversion model and obtain the semantic conversion model finally used for semantic feature extraction.

[0094] In some embodiments, the semantic transformation model includes a homogeneous transformation network and a heterogeneous transformation network, see Figure 8 , Figure 8 is a flow chart of a method for training a semantic conversion model provided in an embodiment of the present application, Figure 7 Step 203 shown may be performed by Figure 8 Steps 2031-2033 shown are implemented as follows:

[0095] In step 2031, based on the homogeneous graph network sample, a first loss function of the homogeneous transformation network is constructed.

[0096] In some embodiments, a first loss function of a homogeneous conversion network may be constructed based on homogeneous graph network samples in the following manner: performing sentence vector conversion processing on conversation samples corresponding to source nodes and target nodes associated with each edge in the homogeneous graph network samples to obtain sentence vectors of conversation samples corresponding to source nodes and target nodes associated with each edge in the homogeneous graph network samples; determining semantic features and homogeneous environment vectors of conversation samples corresponding to the source nodes based on the sentence vectors corresponding to conversation samples corresponding to the source nodes, and performing environment feature prediction processing based on the homogeneous environment vectors of conversation samples corresponding to the source nodes to obtain environment vectors of conversation samples corresponding to the target nodes; determining semantic features of conversation samples corresponding to the target nodes based on the environment vectors of conversation samples corresponding to the target nodes, and determining similarity probabilities between semantic features of conversation samples corresponding to the source nodes and semantic features of conversation samples corresponding to the target nodes; obtaining association weights between the source nodes and the target nodes, and constructing a first loss function of the corresponding homogeneous conversion network based on the similarity probabilities and association weights.

[0097] It can be understood that the sentence vector conversion processing method for the conversation sample in the homogeneous graph network sample can refer to the sentence vector conversion processing method for the conversation text mentioned above, and will not be repeated here. After obtaining the sentence vectors corresponding to the conversation samples corresponding to the source node and the target node associated with each edge, the following processing is performed on the source node and the target node associated with each edge in the homogeneous graph network sample: for example, the sentence vector corresponding to the conversation sample corresponding to the source node is initialized to obtain the semantic features of the conversation sample corresponding to the source node (for example, when the source node is the first node in the homogeneous graph network sample, the sentence vector of the conversation sample corresponding to the source node can be used as the semantic feature) and the homogeneous environment vector (for example, obtained by initializing the sentence vector of the conversation sample corresponding to the source node), and the environment feature prediction processing is performed based on the homogeneous environment vector of the conversation sample corresponding to the source node to obtain the environment vector of the conversation sample corresponding to the target node; then, based on the environment vector of the conversation sample corresponding to the target node, the semantic features of the conversation sample corresponding to the target node are determined, for example, when the target node is an intermediate node of the homogeneous graph network sample, the sentence vector and the environment vector of the conversation sample corresponding to the target node are fused to obtain the semantic features of the conversation sample corresponding to the target node; when the target node is a future node of the homogeneous graph network sample, the environment vector of the conversation sample corresponding to the target node can be regarded as the semantic feature of the conversation sample corresponding to the target node.

[0098] When constructing the first loss function of a homogeneous graph network, we can first calculate the source node (v i ) The semantic features of the conversation sample corresponding to and the target node (v j ) The semantic features of the conversation sample corresponding to The similarity probability between them is recorded as: Then, get the association weight w between the source node and the target node ij (used to characterize the association strength between the conversation text corresponding to the source node and the conversation text corresponding to the target node, that is, the relative transfer frequency between the source node and the target node), and based on the association weight w ij and similarity probability p1(v i ,v j ), determine the sub-loss function corresponding to each edge, such as multiplying the association weight by the logarithm of the similarity probability, taking the product as the sub-loss function corresponding to each edge, and then summing the sub-loss functions corresponding to each edge to obtain the first loss function of the corresponding homogeneous conversion network, which is recorded as: Among them, E is a homogeneous graph network sample.

[0099] In step 2032, based on the heterogeneous graph network sample, a second loss function of the heterogeneous transformation network is constructed.

[0100] In some embodiments, a second loss function of a heterogeneous conversion network may be constructed based on heterogeneous graph network samples in the following manner: performing sentence vector conversion processing on conversation samples corresponding to source nodes and target nodes associated with each edge in the heterogeneous graph network samples to obtain sentence vectors of conversation samples corresponding to source nodes and target nodes associated with each edge in the heterogeneous graph network samples; determining semantic features and heterogeneous environment vectors of conversation samples corresponding to source nodes based on sentence vectors corresponding to conversation samples corresponding to source nodes, and performing environment feature prediction processing based on the heterogeneous environment vector to obtain environment vectors of conversation samples corresponding to target nodes; determining semantic features of conversation samples corresponding to target nodes based on environment vectors of conversation samples corresponding to target nodes, and determining similarity probabilities between semantic features of conversation samples corresponding to source nodes and conversation samples corresponding to target nodes; obtaining association weights between source nodes and target nodes, and constructing a second loss function corresponding to the heterogeneous conversion network based on similarity probabilities and the association weights.

[0101] It can be understood that the sentence vector conversion processing method for the conversation samples in the heterogeneous graph network samples can refer to the sentence vector conversion processing method for the conversation text mentioned above, and will not be repeated here. After obtaining the sentence vectors corresponding to the conversation samples corresponding to the source node and the target node associated with each edge, the following processing is performed on the source node and the target node associated with each edge in the heterogeneous graph network sample: for example, the sentence vector corresponding to the conversation sample corresponding to the source node is initialized to obtain the semantic features of the conversation sample corresponding to the source node (for example, when the source node is the first node in the homogeneous graph network sample, the sentence vector of the conversation sample corresponding to the source node can be used as the semantic feature) and the heterogeneous environment vector (for example, obtained by initializing the sentence vector of the conversation sample corresponding to the source node), and the environment feature prediction processing is performed based on the heterogeneous environment vector of the conversation sample corresponding to the source node to obtain the environment vector of the conversation sample corresponding to the target node; then, based on the environment vector of the conversation sample corresponding to the target node, the semantic features of the conversation sample corresponding to the target node are determined, for example, when the target node is an intermediate node of the heterogeneous graph network sample, the sentence vector and the environment vector of the conversation sample corresponding to the target node are fused to obtain the semantic features of the conversation sample corresponding to the target node; when the target node is a future node of the heterogeneous graph network sample, the environment vector of the conversation sample corresponding to the target node can be regarded as the semantic feature of the conversation sample corresponding to the target node.

[0102] When constructing the second loss function of a heterogeneous graph network, we can first calculate the source node (v m ) The semantic features of the conversation sample corresponding to and the target node (v n ) The semantic features of the conversation sample corresponding to The similarity probability between them is recorded as: Then, get the association weight w between the source node and the target node mn (used to characterize the association strength between the conversation text corresponding to the source node and the conversation text corresponding to the target node, that is, the relative transfer frequency between the source node and the target node), and based on the association weight w ij and similarity probability p2(v m ,v n ), determine the sub-loss function corresponding to each edge, such as multiplying the association weight by the logarithm of the similarity probability, taking the product as the sub-loss function corresponding to each edge, and then summing the sub-loss functions corresponding to each edge to obtain the second loss function of the corresponding heterogeneous conversion network, recorded as: Among them, F is a sample of heterogeneous graph network.

[0103] In step 2033, a third loss function of the initial semantic conversion model is constructed by combining the first loss function and the second loss function, and the parameters of the initial semantic conversion model are updated according to the third loss function to obtain a semantic conversion model.

[0104] Here, when constructing the third loss function, after obtaining the first loss function and the second loss function, the first loss function and the second loss function can be combined, such as adding the first loss function to the second loss function to obtain the third loss function, that is: L3=L1+L2; or, the first weight coefficient of the first loss function and the second weight coefficient of the second loss function can be obtained, and based on the first weight coefficient and the second weight coefficient, the second loss function and the first loss function are weightedly summed to obtain the third loss function of the initial semantic conversion model, and the model parameters of the initial semantic conversion model are updated based on the third loss function.

[0105] After constructing the third loss function, determine whether the value of the third loss function exceeds a preset threshold based on the value of the third loss function. When the value of the third loss function exceeds the preset threshold, determine the error signal of the initial semantic transformation model based on the third loss function, backpropagate the error signal in the initial semantic transformation model, and update the model parameters of each network (such as homogeneous transformation network and heterogeneous transformation network) during the propagation process.

[0106] Here, the error is back-propagated from the output layer to the hidden layer until it propagates to the input layer. In the process of back-propagation, back-propagation is explained. The feature sequence of the training sample is input into the input layer of the neural network model, passes through the hidden layer, and finally reaches the output layer and outputs the result. This is the forward propagation process of the neural network model. Since there is an error between the output result of the neural network model and the actual result, the error between the output result and the actual value is calculated, and the value of the model parameter is adjusted according to the error; the above process is continuously iterated until convergence. Among them, the initial semantic transformation model and the semantic transformation model belong to the neural network model.

[0107] It should be noted that after constructing the first loss function of the homogeneous conversion network and the second loss function of the heterogeneous conversion network, the homogeneous conversion network can be trained according to the first loss function, and the heterogeneous conversion network can be trained according to the second loss function. After the training is completed, the trained homogeneous conversion network and the heterogeneous conversion network are combined to obtain a semantic conversion model. When in use, the semantic conversion model can be used to perform different semantic conversion processes according to different application scenarios. For example, in an application scenario where the conversation object may want to input a conversation text next based on the known conversation text, the conversation text that the conversation object may want to input next is input into the homogeneous conversion network of the semantic conversion model, and the semantic features of the conversation text that the conversation object wants to input next are predicted by the homogeneous conversion network, and the predicted semantic features are matched with the semantic features of multiple candidate conversation texts (such as calculating the similarity between the two), and the matching candidate conversation texts are selected as recommended texts.

[0108] For another example, when predicting conversation text between different conversation objects, for example, when the conversation text of conversation object 1 is known, the reply text of conversation object 2 (different from conversation object 1) to the conversation text of conversation object 1 is predicted. In this application scenario, the conversation text of conversation object 1 is input into the heterogeneous conversion network of the semantic conversion model, and the semantic features of the reply text that conversation object 2 wants to input next are predicted through the heterogeneous conversion network. The predicted semantic features are matched with the semantic features of multiple candidate conversation texts respectively (such as calculating the similarity between the two), and the matching candidate conversation texts are selected as the reply text (i.e., the recommended text).

[0109] In step 103, clustering is performed based on the semantic features of the conversation text corresponding to each node to obtain a clustering result, and text recommendations are performed for the target application scenario based on the clustering result.

[0110] Here, clustering processing can be performed based on the semantic features of the conversation text corresponding to each node to obtain a clustering result in the following manner: clustering processing can be performed based on the semantic features of the conversation text corresponding to each node to obtain a clustering result for characterizing the division of multiple conversation texts into a target number of conversation categories; accordingly, text recommendation can be performed for the target application scenario based on the clustering result in the following manner: determining the recommendation priority of each conversation text in each conversation category of the clustering result in the target application scenario, and selecting conversation texts with a recommendation priority higher than a recommendation priority threshold for text recommendation.

[0111] In practical applications, clustering processing can be performed based on the semantic features of the conversation text corresponding to each node and using a clustering algorithm (such as K-means, etc.) to divide multiple conversation texts into a target number of conversation categories. For example, the similarity between the semantic features of the conversation texts corresponding to two nodes is calculated, and the conversation texts whose similarity exceeds a similarity threshold (which can be set according to actual needs) are classified into the same conversation category, that is, the similarity between the semantic features of the conversation texts in the same conversation category exceeds the similarity threshold; in addition, the maximum silhouette coefficient trial method can be used to determine the optimal number of aggregation categories (that is, determine the target number of conversation categories). Generally, the more conversation texts there are, the more polling times there are. According to experimental verification, the silhouette coefficient has the characteristics of increasing first and then decreasing, and there is fluctuation in the process of increasing first and then decreasing. Therefore, when the current silhouette coefficient is greater than the silhouette coefficient of the subsequent N rounds (N can be set according to experience, such as 2 or 3), it can be considered that the current silhouette coefficient is the largest, and the corresponding number of conversation categories (that is, the target number) is optimal, that is, the silhouette coefficient corresponding to the target number is greater than the silhouette coefficients corresponding to other numbers.

[0112] After the conversation texts are aggregated, each conversation category corresponds to the conversation text that is adapted to the conversation category, that is, the semantics of different conversation texts in each conversation category are relatively similar. When making text recommendations, a conversation text can be randomly selected from each conversation category for text recommendation, or a conversation text with a recommendation priority higher than a recommendation priority threshold can be selected for text recommendation. For example, for each conversation category, the conversation text recommendation order is sorted in descending order according to the order of the recommendation priority of the conversation text in the target application scenario from high to low, and the conversation text ranked first is given priority for recommendation, avoiding recommending too many conversation texts with similar semantics, thereby improving the accuracy of text recommendation during text cold start, and thus improving the communication efficiency between users.

[0113] In practical applications, when recommending text to target users, targeted recommendations can also be made based on the target user's relevant features (such as gender, age, education, interests, etc.) or the text features of the user-input conversation text (i.e., semantic features, obtained by fusing the sentence vector and environment vector of the user-input conversation text). For example, for the target user, first determine the conversation category that matches the target user, then match the semantic features of each conversation text in the conversation category with the target user's relevant features or text features, determine the recommendation priority of the conversation text based on the matching results, and recommend the conversation text with the highest recommendation priority to the target user for the target user to choose and use, thereby further improving the targeted nature of the recommendation.

[0114] Through the above method, when recommending text for the target application scenario, based on the association relationship represented by each edge in the conversation graph network, the conversation text corresponding to each node in the conversation graph network is semantically converted to obtain the semantic features of the conversation text corresponding to each node, and clustering is performed based on the semantic features of the conversation text corresponding to each node. Since the meaning of the conversation text corresponding to each node and the association relationship between the conversation texts are combined in the semantic conversion process, a more accurate clustering result can be obtained, so that when recommending text for the target application scenario according to the clustering result, it is possible to avoid recommending too many repeated texts, thereby improving the accuracy of text recommendation and thus improving communication efficiency.

[0115] Next, we will explain the exemplary application of the embodiment of the present application in an actual application scenario. Taking the target application scenario as an out-of-game communication scenario as an example, we will continue to explain the text recommendation method provided by the embodiment of the present application. Next, we will explain the construction of the conversation graph network, the extraction of semantic features, and the text recommendation.

[0116] 1. Build a conversation graph network

[0117] First, multiple conversation texts in the off-game communication scene and the conversation attributes of each conversation text (such as conversation time and the player to whom it belongs) are obtained. Then, according to the chronological order of the conversation times of the conversation texts, it is judged whether the adjacent conversation texts belong to the same player (i.e., the above-mentioned conversation object). When the adjacent conversation texts belong to the same player, a homogeneous graph network is constructed based on the adjacent conversation texts; when the adjacent conversation texts belong to different players, a heterogeneous graph network is constructed based on the adjacent conversation texts; and so on. Finally, the constructed homogeneous graph network is combined with the heterogeneous graph network to obtain a complete conversation graph network, wherein the conversation graph network includes multiple nodes and multiple edges, each node corresponds to a conversation text, and each edge is used to represent the association relationship between the conversation texts corresponding to the associated nodes.

[0118] See also Fig.10 , Fig.10: is an application diagram of the text recommendation method provided by the embodiment of the present application. Taking the communication between players outside the game as an example, the conversation text is extracted from the scene (1) of the communication between players outside the game, as shown in (2), including: Is there anyone else (conversation text 1, corresponding to player 1) -> Hello hello (conversation text 2, corresponding to player 1) -> That’s all (conversation text 3, corresponding to player 2) -> Start (conversation text 4, corresponding to player 1) -> Start (conversation text 5, corresponding to player 2). When the network is constructed for the above multiple conversation texts, the constructed conversation graph network can be represented as: node 1 -> node 2 -> node 3 -> node 4 -> node 5. Among them, node 1 corresponds to conversation text 1, and node 2 corresponds to conversation text 2. Since both conversation text 1 and conversation text 2 correspond to conversation object 1, node 1->node 2 belongs to a homogeneous graph network; and node 3 corresponds to conversation text 3. Since conversation text 3 corresponds to conversation object 2, conversation text 2 and conversation text 3 correspond to different conversation objects, so node 2->node 3 belongs to a heterogeneous graph network. Similarly, node 3->node 4->node 5 belongs to a heterogeneous graph network. The constructed homogeneous graph network and heterogeneous graph network are combined according to the sequence of the conversation time of each conversation text to obtain the conversation graph network (3) when player 1 and player 2 communicate.

[0119] 2. Extracting semantic features

[0120] Based on the association relationship represented by each edge in the conversation graph network, semantic conversion processing is performed on the conversation text corresponding to each node in the conversation graph network. For example, sentence vector conversion processing is first performed on the conversation text corresponding to each node in the conversation graph network to obtain the sentence vector of the conversation text corresponding to each node; then, based on the association relationship represented by each edge in the conversation graph network, environmental feature extraction processing is performed on the conversation text corresponding to each node in the conversation graph network to obtain the environmental vector of the conversation text corresponding to each node, and based on the environmental vector of the conversation text corresponding to each node, the semantic feature of the conversation text corresponding to each node is determined.

[0121] Here, taking the environmental feature extraction of the source node and the target node associated with each edge in the conversation graph network as an example, the target node is the next adjacent node of the source node, and the environmental vector of the conversation text corresponding to the source node is used to predict the environmental vector of the conversation text corresponding to the target node. The environmental vector is used to feedback the contextual features between the conversation texts corresponding to different nodes. Among them, when the source node is the first node in the conversation graph network, the environmental vector of the conversation text corresponding to the source node is obtained by initializing the sentence vector of the conversation text corresponding to the source node. When the source node is not the first node in the conversation graph network, the environmental vector of the conversation text corresponding to the source node is predicted based on the environmental vector of the previous node adjacent to the source node.

[0122] Among them, the environment vector includes a homogeneous environment vector and a heterogeneous environment vector. When predicting the environment vector of the conversation text corresponding to the target node, if the source node and the target node are homogeneous nodes, that is, the conversation text corresponding to the source node and the conversation text corresponding to the target node belong to the same player, since the homogeneous environment vector can better reflect the conversation characteristics of the same player, the environment vector of the conversation text corresponding to the target node can be predicted based on the homogeneous environment vector of the conversation text corresponding to the source node; if the source node and the target node are heterogeneous nodes, that is, the conversation text corresponding to the source node and the conversation text corresponding to the target node belong to different players, since the heterogeneous environment vector can better reflect the conversation characteristics of different players, the environment vector of the conversation text corresponding to the target node can be predicted based on the heterogeneous environment vector of the conversation text corresponding to the source node.

[0123] After the environment vector of the conversation text corresponding to each node is obtained in the above manner, the semantic features of the conversation text corresponding to each node can be determined according to different application scenarios. For example, for the first node in the conversation graph network, since it does not have a previous adjacent node (i.e., there is no referenced previous context relationship), the sentence vector of the conversation text corresponding to the first node can be regarded as the semantic feature of the conversation text; for another example, for an intermediate node in the conversation graph network, since the intermediate node already has a corresponding conversation text, the sentence vector of the conversation text corresponding to the intermediate node and the environment vector (i.e., predicted by the environment vector of the conversation text corresponding to the previous adjacent node of the intermediate node) can be fused, and the fusion result can be used as the semantic feature of the conversation text corresponding to the intermediate node; for another example, for a future node in the conversation graph network (i.e., a node used to predict the next conversation text), since the conversation text corresponding to the future node has not yet been predicted, but the environment vector of the conversation text corresponding to the future node can be predicted by the environment vector of the conversation text corresponding to the previous adjacent node of the future node, the predicted environment vector of the conversation text corresponding to the future node can be used as the semantic feature of the conversation text corresponding to the future node.

[0124] Through the above method, when determining the semantic features corresponding to the conversation text corresponding to each node, since the sentence vector (the representation of the intrinsic meaning of the conversation text) of the conversation text corresponding to the node itself, or the environment vector (context feature) of the conversation text corresponding to the adjacent node is taken into consideration, the semantic features can fully reflect the true meaning and semantic environment information of the conversation text. When clustering is performed based on the semantic features later, more accurate clustering results can be obtained, so that when recommending text for the target application scenario based on the clustering results, it is possible to avoid recommending too many repeated texts, thereby improving the accuracy of text recommendations.

[0125] In practical applications, the above semantic conversion processing operation can be implemented through a semantic conversion model, wherein the semantic conversion model includes a homogeneous conversion network and a heterogeneous conversion network. The homogeneous conversion network is used to predict the semantic features of the conversation texts of the same player in a homogeneous graph network, and the heterogeneous conversion network is used to predict the semantic features of the conversation texts of different players in a heterogeneous graph network. Before applying the semantic conversion model, the semantic conversion model needs to be trained first. The training process of the semantic conversion model is explained below.

[0126] First, a conversation graph network sample is constructed, and homogeneous graph network samples and heterogeneous graph network samples are extracted from the conversation graph network samples. The conversation samples corresponding to the source node and the target node associated with each edge in the homogeneous graph network sample belong to the same player, and the conversation samples corresponding to the source node and the target node associated with each edge in the heterogeneous graph network sample belong to different players.

[0127] After extracting homogeneous graph network samples and heterogeneous graph network samples from the conversation graph network samples, a homogeneous conversion network can be trained according to the extracted homogeneous graph network samples, and a homogeneous conversion network can be trained according to the heterogeneous graph network samples. Specifically, the training process of the homogeneous conversion network is as follows: the conversation samples corresponding to the source node and the target node associated with each edge in the homogeneous graph network samples are subjected to sentence vector conversion processing to obtain the corresponding sentence vector; the sentence vector corresponding to the conversation sample corresponding to the source node is initialized to obtain the semantic features of the conversation sample corresponding to the source node (for example, when the source node is the first node in the homogeneous graph network sample, the sentence vector of the conversation sample corresponding to the source node can be used as the semantic feature) and the homogeneous environment vector (for example, by initializing the sentence vector of the conversation sample corresponding to the source node) The sentence vector of the conversation sample corresponding to the source node is initialized), and the environment feature prediction processing is performed according to the homogeneous environment vector of the conversation sample corresponding to the source node to obtain the environment vector of the conversation sample corresponding to the target node; then, based on the environment vector of the conversation sample corresponding to the target node, the semantic features of the conversation sample corresponding to the target node are determined. For example, when the target node is an intermediate node of the homogeneous graph network sample, the sentence vector and the environment vector of the conversation sample corresponding to the target node are fused to obtain the semantic features of the conversation sample corresponding to the target node; when the target node is a future node of the homogeneous graph network sample, the environment vector of the conversation sample corresponding to the target node can be regarded as the semantic features of the conversation sample corresponding to the target node.

[0128] When constructing the first loss function of a homogeneous graph network, we can first calculate the source node (v i ) The semantic features of the conversation sample corresponding to and the target node (v j ) The semantic features of the conversation sample corresponding to The similarity probability between them is recorded as: Then, get the association weight w between the source node and the target node ij (used to characterize the association strength between the conversation text corresponding to the source node and the conversation text corresponding to the target node, that is, the relative transfer frequency between the source node and the target node), and based on the association weight w ij and similarity probability p1(v i ,v j ), determine the sub-loss function corresponding to each edge, such as multiplying the association weight by the logarithm of the similarity probability, taking the product as the sub-loss function corresponding to each edge, and then summing the sub-loss functions corresponding to each edge to obtain the first loss function of the corresponding homogeneous conversion network, which is recorded as: Wherein, E is a homogeneous graph network sample. After constructing the first loss function of the homogeneous transformation network, the parameters of the homogeneous transformation network can be updated based on the first loss function until convergence.

[0129] The training process of the heterogeneous conversion network is as follows: the conversation samples corresponding to the source node and the target node associated with each edge in the heterogeneous graph network sample are converted into sentence vectors to obtain the corresponding sentence vectors; the sentence vectors corresponding to the conversation samples corresponding to the source node are initialized to obtain the semantic features of the conversation samples corresponding to the source node (for example, when the source node is the first node in the homogeneous graph network sample, the sentence vectors of the conversation samples corresponding to the source node can be used as semantic features) and the heterogeneous environment vector (for example, obtained by initializing the sentence vectors of the conversation samples corresponding to the source node), and the environment feature prediction process is performed based on the heterogeneous environment vectors of the conversation samples corresponding to the source node to obtain the environment vectors of the conversation samples corresponding to the target node; then, based on the environment vectors of the conversation samples corresponding to the target node, the semantic features of the conversation samples corresponding to the target node are determined, for example, when the target node is the middle node of the heterogeneous graph network sample, the sentence vectors and environment vectors of the conversation samples corresponding to the target node are fused to obtain the semantic features of the conversation samples corresponding to the target node; when the target node is the future node of the heterogeneous graph network sample, the environment vectors of the conversation samples corresponding to the target node can be regarded as the semantic features of the conversation samples corresponding to the target node.

[0130] When constructing the second loss function of a heterogeneous graph network, we can first calculate the source node (v m ) The semantic features of the conversation sample corresponding to and the target node (v n ) The semantic features of the conversation sample corresponding to The similarity probability between them is recorded as: Then, get the association weight w between the source node and the target node mn(used to characterize the association strength between the conversation text corresponding to the source node and the conversation text corresponding to the target node, that is, the relative transfer frequency between the source node and the target node), and based on the association weight w ij and similarity probability p2(v m ,v n ), determine the sub-loss function corresponding to each edge, such as multiplying the association weight by the logarithm of the similarity probability, taking the product as the sub-loss function corresponding to each edge, and then summing the sub-loss functions corresponding to each edge to obtain the second loss function of the corresponding heterogeneous conversion network, recorded as: Wherein, F is a sample of a heterogeneous graph network. After constructing the second loss function of the heterogeneous conversion network, the parameters of the heterogeneous conversion network can be updated based on the second loss function until convergence.

[0131] After the homogeneous conversion network and the heterogeneous conversion network are trained, the trained homogeneous conversion network and the heterogeneous conversion network can be combined to obtain a semantic conversion model. In addition, after the first loss function and the second loss function are constructed, the first loss function and the second loss function can be combined, such as adding the first loss function and the second loss function to obtain a third loss function, and the parameters of the semantic conversion model are updated according to the third loss function until convergence.

[0132] 3. Text recommendation

[0133] For the application scenario of cold start of information in the off-game communication scenario (the current player has not yet entered the conversation text), after obtaining the semantic features corresponding to multiple conversation texts in the off-game communication scenario, a clustering algorithm (such as K-means, etc.) can be used to perform clustering processing based on the semantic features of the conversation text corresponding to each node, so as to divide the multiple conversation texts into a target number of conversation categories, such as calculating the similarity between the semantic features of the conversation texts corresponding to each node, and classifying the conversation texts whose similarity exceeds a similarity threshold (which can be set according to actual needs) into the same conversation category, that is, the similarity between the semantic features of the conversation texts in the same conversation category exceeds the similarity threshold.

[0134] In addition, the maximum silhouette coefficient heuristic method can be used to determine the optimal number of aggregation categories (that is, to determine the target number of session categories), see Fig.11 , Fig.11It is a schematic diagram of the change of the silhouette coefficient with the number of categories provided in an embodiment of the present application. Generally, the more conversation texts there are, the more polling times there are, and the silhouette coefficient has the characteristics of first increasing and then decreasing, and fluctuating in the process of first increasing and then decreasing. Therefore, when the current silhouette coefficient is greater than the silhouette coefficient of the subsequent N rounds (N can be set according to experience, such as 2 or 3), it can be considered that the current silhouette coefficient is the largest, and the corresponding number of conversation categories (i.e., the target number) is optimal, that is, the silhouette coefficient corresponding to the target number is greater than the silhouette coefficients corresponding to other numbers.

[0135] After the conversation texts are aggregated, each conversation category corresponds to the conversation text that is adapted to the conversation category, that is, the semantics of different conversation texts in each conversation category are relatively similar. When making text recommendations, a conversation text can be randomly selected from each conversation category for text recommendation, or a conversation text with a recommendation priority higher than a recommendation priority threshold can be selected for text recommendation. For example, for each conversation category, the conversation text recommendation order is sorted in descending order according to the order of the recommendation priority of the conversation text in the target application scenario from high to low, and the conversation text ranked first is given priority for recommendation, avoiding recommending too many conversation texts with similar semantics, thereby improving the accuracy of text recommendation during text cold start, and thus improving the communication efficiency between users.

[0136] See also Fig.12 , Fig.12 1 is an application schematic diagram of the text recommendation method provided in an embodiment of the present application. For example, in an application scenario where the conversation text of player 1 is known and the conversation text of player 2 (different from player 1) to reply to player 1 next is predicted, the conversation text of player 1 is input into the heterogeneous conversion network of the semantic conversion model, and the semantic features of the conversation text to which player 2 may reply to player 1 next are predicted through the heterogeneous conversion network, and the conversation text to which player 2 may reply to player 1 next is clustered based on the predicted semantic features; for another example, in an application scenario where the conversation text that player 1 may want to input next is predicted based on the existing conversation text of player 1, the existing conversation text of player 1 is input into the homogeneous conversion network of the semantic conversion model, and the semantic features of the conversation text that player 1 may want to input next are predicted through the homogeneous conversion network, and the conversation text that player 1 may input next is clustered based on the predicted semantic features.

[0137] After obtaining the clustering results, text recommendations can be made based on the clustering results. For example, Fig.10 In the example, the conversation texts recommended by the text recommendation method provided by the embodiment of the present application are: "Come on", "Do you want to fight", "Wait for me", "Hmm", and these multiple recommended texts belong to different conversation categories, that is, the meanings expressed by the different recommended texts displayed are quite different. Figures 13A-13D , Figures 13A-13Dis an application diagram of the text recommendation method provided in the embodiment of the present application, Fig.13A In the comprehensive channel interface of the out-of-game game, comprehensive recommendation texts are displayed, such as "Assist, add my team!", "Mutual likes on homepage", "Looking for a boy band", "Anyone playing games?", etc. These multiple recommendation texts belong to different conversation categories, that is, the meanings expressed by the different recommended texts displayed are quite different; Fig. 13B In the city channel interface of the out-of-game game, the recommended texts of the player's current city (such as Chengdu) are displayed, such as "Double row!", "Let's meet, single challenge", "Looking for entertainment teammates", "Looking for a master", etc. These multiple recommended texts belong to different conversation categories, and the meanings they express are quite different; Fig. 13C In the friend channel interface of an out-of-game game, recommended texts for conversations between friends are displayed, such as "Have you finished playing?", "Hello?", "Who are you?", "Still playing that?", etc. These multiple recommended texts belong to different conversation categories, and the meanings they express are quite different. Fig.13D In the team channel interface of an out-of-game game, recommended texts for conversations between teams are displayed, such as "Wait a moment", "Play next time", "Wait for someone", "Take me with you", etc. These multiple recommended texts belong to different conversation categories, and the meanings they express are quite different.

[0138] Through the above method, when there are multiple conversation categories, a conversation text is randomly selected from each conversation category as a recommended text for players to choose from, avoiding recommending multiple conversation texts with similar meanings, improving the accuracy of text recommendations, and further improving communication efficiency.

[0139] So far, the text recommendation method provided by the embodiment of the present application has been described in combination with the exemplary application and implementation of the electronic device provided by the embodiment of the present application. The following will continue to describe the control scheme of the virtual object implemented by the various modules in the text recommendation device 255 provided by the embodiment of the present application.

[0140] The network construction module 2551 is used to obtain multiple conversation texts in the target application scenario, and to construct a conversation graph network according to the conversation attributes of each of the conversation texts; wherein the conversation graph network includes multiple nodes and multiple edges, each node corresponds to a conversation text, and each edge is used to represent the association relationship between the conversation texts corresponding to the associated nodes; the semantic conversion module 2552 is used to perform semantic conversion processing on the conversation text corresponding to each node in the conversation graph network based on the association relationship represented by each edge in the conversation graph network, and obtain the semantic features of the conversation text corresponding to each node; the text recommendation module 2553 is used to perform clustering processing based on the semantic features of the conversation text corresponding to each node, obtain a clustering result, and perform text recommendation for the target application scenario according to the clustering result.

[0141] In some embodiments, the network construction module is further used to determine the session attributes of each of the conversation texts, wherein the session attributes include a conversation object and a conversation time; based on the conversation time of each of the conversation texts, a homogeneous graph network corresponding to the conversation texts belonging to the same conversation object and a heterogeneous graph network corresponding to the conversation texts belonging to different conversation objects are constructed; and the constructed homogeneous graph network is combined with the heterogeneous graph network to obtain a conversation graph network.

[0142] In some embodiments, the semantic conversion module is further used to perform sentence vector conversion processing on the conversation text corresponding to each node in the conversation graph network to obtain the sentence vector of the conversation text corresponding to each node; based on the association relationship represented by each edge in the conversation graph network, perform environmental feature extraction processing on the conversation text corresponding to each node in the conversation graph network to obtain the environmental vector of the conversation text corresponding to each node; based on the environmental vector of the conversation text corresponding to each node, determine the semantic feature of the conversation text corresponding to each node.

[0143] In some embodiments, the semantic conversion module is further used to perform the following processing on the source node and the target node associated with each edge in the conversation graph network: determining the environment vector of the conversation text corresponding to the source node, wherein, when the source node is the first node in the conversation graph network, the environment vector of the conversation text corresponding to the source node is obtained by initializing the sentence vector of the conversation text corresponding to the source node; based on the association relationship between the source node and the target node, performing environmental feature prediction processing according to the environment vector of the conversation text corresponding to the source node to obtain the environment vector of the conversation text corresponding to the target node.

[0144] In some embodiments, the environment vector includes a homogeneous environment vector and a heterogeneous environment vector. The semantic conversion module is also used to, when the source node and the target node are homogeneous nodes, perform environment feature prediction processing based on the homogeneous environment vector of the conversation text corresponding to the source node to obtain the environment vector of the conversation text corresponding to the target node; when the source node and the target node are heterogeneous nodes, perform environment feature prediction processing based on the heterogeneous environment vector of the conversation text corresponding to the source node to obtain the environment vector of the conversation text corresponding to the target node.

[0145] In some embodiments, the semantic conversion module is also used to, when there are multiple edges associated with the target node in the conversation graph network and multiple corresponding source nodes, perform environmental vector prediction based on the association relationship between each source node and the target node and according to the environmental vector of the conversation text corresponding to each source node to obtain predicted environmental vectors of the conversation texts corresponding to the multiple target nodes; and perform fusion processing on the predicted environmental vectors of the conversation texts corresponding to the multiple target nodes to obtain the environmental vector of the conversation text corresponding to the target node.

[0146] In some embodiments, the semantic conversion processing is implemented by a semantic conversion model, and the device further includes: a model training module, used to obtain an initial semantic conversion model and a session graph network sample, wherein the session graph network sample includes multiple nodes and edges, each node corresponds to a session sample, and each edge is used to represent the association relationship between the session samples corresponding to the associated nodes; based on the association relationship represented by each edge in the session graph network sample, a homogeneous graph network sample and a heterogeneous graph network sample are extracted from the session graph network sample, wherein the session samples corresponding to the source node and the target node associated with each edge in the homogeneous graph network sample belong to the same session object, and the session samples corresponding to the source node and the target node associated with each edge in the heterogeneous graph network sample belong to different session objects; the initial semantic conversion model is trained based on the homogeneous graph network sample and the heterogeneous graph network sample to obtain the semantic conversion model.

[0147] In some embodiments, the semantic conversion model includes a homogeneous conversion network and a heterogeneous conversion network. The model training module is also used to construct a first loss function of the homogeneous conversion network based on the homogeneous graph network sample; construct a second loss function of the heterogeneous conversion network based on the heterogeneous graph network sample; combine the first loss function and the second loss function to construct a third loss function of the initial semantic conversion model, and update the parameters of the initial semantic conversion model according to the third loss function to obtain the semantic conversion model.

[0148] In some embodiments, the model training module is also used to perform sentence vector conversion processing on the conversation samples corresponding to the source node and the target node associated with each edge in the homogeneous graph network sample to obtain the sentence vector of the conversation samples corresponding to the source node and the target node associated with each edge in the homogeneous graph network sample; based on the sentence vector corresponding to the conversation sample corresponding to the source node, determine the semantic features and homogeneous environment vector of the conversation sample corresponding to the source node, and perform environment feature prediction processing based on the homogeneous environment vector of the conversation sample corresponding to the source node to obtain the environment vector of the conversation sample corresponding to the target node; based on the environment vector of the conversation sample corresponding to the target node, determine the semantic features of the conversation sample corresponding to the target node, and determine the similarity probability between the semantic features of the conversation sample corresponding to the source node and the semantic features of the conversation sample corresponding to the target node; determine the association weight between the source node and the target node, and construct a first loss function corresponding to the homogeneous conversion network based on the similarity probability and the association weight.

[0149] In some embodiments, the model training module is also used to perform sentence vector conversion processing on the conversation samples corresponding to the source node and the target node associated with each edge in the heterogeneous graph network sample to obtain the sentence vector of the conversation samples corresponding to the source node and the target node associated with each edge in the heterogeneous graph network sample; based on the sentence vector corresponding to the conversation sample corresponding to the source node, determine the semantic features and heterogeneous environment vector of the conversation sample corresponding to the source node, and perform environment feature prediction processing based on the heterogeneous environment vector to obtain the environment vector of the conversation sample corresponding to the target node; based on the environment vector of the conversation sample corresponding to the target node, determine the semantic features of the conversation sample corresponding to the target node, and determine the similarity probability between the semantic features of the conversation sample corresponding to the source node and the semantic features of the conversation sample corresponding to the target node; determine the association weight between the source node and the target node, and construct a second loss function corresponding to the heterogeneous conversion network based on the similarity probability and the association weight.

[0150] In some embodiments, the text recommendation module is further used to perform clustering processing based on the semantic features of the conversation text corresponding to each node, and obtain a clustering result for characterizing the division of multiple conversation texts into a target number of conversation categories; wherein the similarity between the semantic features of the conversation texts in a conversation category exceeds a similarity threshold, and the silhouette coefficient corresponding to the target number is greater than the silhouette coefficients corresponding to other numbers; determine the recommendation priority of each conversation text in each conversation category of the clustering result in the target application scenario, and select the conversation text with a recommendation priority higher than the recommendation priority threshold for text recommendation.

[0151] The embodiment of the present application provides a computer program product, which includes a computer program or a computer executable instruction, and the computer program or the computer executable instruction is stored in a computer-readable storage medium. The processor of the electronic device reads the computer executable instruction from the computer-readable storage medium, and the processor executes the computer executable instruction, so that the electronic device performs the text recommendation method described in the embodiment of the present application.

[0152] The present application embodiment provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions or computer programs are stored. When the computer-executable instructions or computer programs are executed by a processor, the processor will be caused to execute the text recommendation method provided by the present application embodiment, for example, Figure 3 The text recommendation method shown.

[0153] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.

[0154] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0155] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file storing other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0156] As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.

[0157] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A text recommendation method, characterized in that: The method comprises: Acquire multiple conversation texts in a target application scenario, and construct a conversation graph network according to conversation attributes of each of the conversation texts; The conversation graph network includes a plurality of nodes and a plurality of edges, each node corresponds to a conversation text, and each edge is used to represent the association relationship between the conversation texts corresponding to the associated nodes; Based on the association relationship represented by each edge in the conversation graph network, a semantic conversion process is performed on the conversation text corresponding to each node in the conversation graph network to obtain the semantic features of the conversation text corresponding to each node; Clustering is performed based on the semantic features of the conversation text corresponding to each node to obtain a clustering result, and text recommendation is performed for the target application scenario based on the clustering result.

2. The method according to claim 1, characterized in that The step of constructing a conversation graph network according to the conversation attributes of each conversation text comprises: Determining session attributes of each of the session texts, wherein the session attributes include a session object and a session time; According to the conversation time of each of the conversation texts, a homogeneous graph network corresponding to the conversation texts belonging to the same conversation object and a heterogeneous graph network corresponding to the conversation texts belonging to different conversation objects are constructed; The constructed homogeneous graph network is combined with the heterogeneous graph network to obtain a session graph network.

3. The method according to claim 1, characterized in that The semantic conversion process is performed on the conversation text corresponding to each node in the conversation graph network based on the association relationship represented by each edge in the conversation graph network to obtain the semantic features of the conversation text corresponding to each node, including: Perform sentence vector conversion processing on the conversation text corresponding to each node in the conversation graph network to obtain the sentence vector of the conversation text corresponding to each node; Based on the association relationship represented by each edge in the conversation graph network, environmental feature extraction processing is performed on the conversation text corresponding to each node in the conversation graph network to obtain an environmental vector of the conversation text corresponding to each node; Based on the environment vector of the conversation text corresponding to each node, the semantic features of the conversation text corresponding to each node are determined.

4. The method according to claim 3, characterized in that The step of performing environmental feature extraction processing on the conversation text corresponding to each node in the conversation graph network based on the association relationship represented by each edge in the conversation graph network to obtain an environmental vector of the conversation text corresponding to each node includes: The following processing is performed for the source node and the target node associated with each edge in the session graph network: Determining an environment vector of the conversation text corresponding to the source node, wherein when the source node is the first node in the conversation graph network, the environment vector of the conversation text corresponding to the source node is obtained by initializing the sentence vector of the conversation text corresponding to the source node; Based on the association relationship between the source node and the target node, environmental feature prediction processing is performed according to the environmental vector of the conversation text corresponding to the source node to obtain the environmental vector of the conversation text corresponding to the target node.

5. The method according to claim 4, characterized in that The environment vector includes a homogeneous environment vector and a heterogeneous environment vector. The environment feature prediction process is performed according to the environment vector of the conversation text corresponding to the source node to obtain the environment vector of the conversation text corresponding to the target node, including: When the source node and the target node are homogeneous nodes, an environmental feature prediction process is performed according to the homogeneous environmental vector of the conversation text corresponding to the source node to obtain the environmental vector of the conversation text corresponding to the target node; When the source node and the target node are heterogeneous nodes, environmental feature prediction processing is performed according to the heterogeneous environmental vector of the conversation text corresponding to the source node to obtain the environmental vector of the conversation text corresponding to the target node.

6. The method according to claim 4, characterized in that The step of predicting an environment vector based on the association relationship between the source node and the target node according to the environment vector of the conversation text corresponding to the source node to obtain the environment vector of the conversation text corresponding to the target node includes: When there are multiple edges associated with the target node in the conversation graph network and multiple corresponding source nodes, based on the association relationship between each source node and the target node, an environment vector prediction is performed according to the environment vector of the conversation text corresponding to each source node to obtain predicted environment vectors of the conversation texts corresponding to the multiple target nodes; The predicted environment vectors of the conversation texts corresponding to the multiple target nodes are fused to obtain the environment vector of the conversation text corresponding to the target node.

7. The method according to claim 3, characterized in that The semantic conversion process is implemented by a semantic conversion model, and the method further includes: Obtaining an initial semantic conversion model and a conversation graph network sample, wherein the conversation graph network sample includes a plurality of nodes and edges, each node corresponds to a conversation sample, and each edge is used to represent an association relationship between conversation samples corresponding to associated nodes; Based on the association relationship represented by each edge in the conversation graph network sample, a homogeneous graph network sample and a heterogeneous graph network sample are extracted from the conversation graph network sample, wherein the conversation samples corresponding to the source node and the target node associated with each edge in the homogeneous graph network sample belong to the same conversation object, and the conversation samples corresponding to the source node and the target node associated with each edge in the heterogeneous graph network sample belong to different conversation objects; The initial semantic conversion model is trained based on the homogeneous graph network samples and the heterogeneous graph network samples to obtain the semantic conversion model.

8. The method according to claim 7, characterized in that The semantic conversion model includes a homogeneous conversion network and a heterogeneous conversion network. The initial semantic conversion model is trained based on the homogeneous graph network sample and the heterogeneous graph network sample to obtain the semantic conversion model, including: Based on the homogeneous graph network sample, constructing a first loss function of the homogeneous transformation network; Based on the heterogeneous graph network sample, constructing a second loss function of the heterogeneous conversion network; In combination with the first loss function and the second loss function, a third loss function of the initial semantic conversion model is constructed, and the parameters of the initial semantic conversion model are updated according to the third loss function to obtain the semantic conversion model.

9. The method according to claim 8, characterized in that The step of constructing a first loss function of the homogeneous transformation network based on the homogeneous graph network sample includes: Perform sentence vector conversion processing on the conversation samples corresponding to the source node and the target node associated with each edge in the homogeneous graph network sample to obtain the sentence vector of the conversation samples corresponding to the source node and the target node associated with each edge in the homogeneous graph network sample; Based on the sentence vector corresponding to the conversation sample corresponding to the source node, the semantic features and homogeneous environment vector of the conversation sample corresponding to the source node are determined, and the environment feature prediction processing is performed according to the homogeneous environment vector of the conversation sample corresponding to the source node to obtain the environment vector of the conversation sample corresponding to the target node; Determine the semantic features of the conversation sample corresponding to the target node based on the environment vector of the conversation sample corresponding to the target node, and determine the similarity probability between the semantic features of the conversation sample corresponding to the source node and the semantic features of the conversation sample corresponding to the target node; The association weight between the source node and the target node is obtained, and a first loss function corresponding to the homogeneous conversion network is constructed based on the similarity probability and the association weight.

10. The method according to claim 8, characterized in that The step of constructing a second loss function of the heterogeneous conversion network based on the heterogeneous graph network sample includes: Perform sentence vector conversion processing on the conversation samples corresponding to the source node and the target node associated with each edge in the heterogeneous graph network sample to obtain the sentence vector of the conversation samples corresponding to the source node and the target node associated with each edge in the heterogeneous graph network sample; Based on the sentence vector corresponding to the conversation sample corresponding to the source node, the semantic features and the heterogeneous environment vector of the conversation sample corresponding to the source node are determined, and the environment feature prediction processing is performed according to the heterogeneous environment vector to obtain the environment vector of the conversation sample corresponding to the target node; Determine the semantic features of the conversation sample corresponding to the target node based on the environment vector of the conversation sample corresponding to the target node, and determine the similarity probability between the semantic features of the conversation sample corresponding to the source node and the semantic features of the conversation sample corresponding to the target node; An association weight between the source node and the target node is obtained, and a second loss function corresponding to the heterogeneous conversion network is constructed based on the similarity probability and the association weight.

11. The method according to claim 1, characterized in that The clustering process is performed based on the semantic features of the conversation text corresponding to each node to obtain a clustering result, including: Performing clustering processing based on the semantic features of the conversation text corresponding to each node to obtain a clustering result for characterizing the division of the plurality of conversation texts into a target number of conversation categories; Wherein, the similarity between the semantic features of the conversation texts in one conversation category exceeds a similarity threshold, and the silhouette coefficient corresponding to the target quantity is greater than the silhouette coefficients corresponding to other quantities; The performing text recommendation for the target application scenario according to the clustering result includes: The recommendation priority of each conversation text in each conversation category of the clustering result in the target application scenario is determined, and conversation texts with a recommendation priority higher than a recommendation priority threshold are selected for text recommendation.

12. A text recommendation device, characterized in that: The device comprises: A network construction module, used to obtain multiple conversation texts in a target application scenario, and construct a conversation graph network according to conversation attributes of each of the conversation texts; The conversation graph network includes a plurality of nodes and a plurality of edges, each node corresponds to a conversation text, and each edge is used to represent the association relationship between the conversation texts corresponding to the associated nodes; A semantic conversion module, configured to perform semantic conversion processing on the conversation text corresponding to each node in the conversation graph network based on the association relationship represented by each edge in the conversation graph network, so as to obtain the semantic features of the conversation text corresponding to each node; The text recommendation module is used to perform clustering processing based on the semantic features of the conversation text corresponding to each node to obtain a clustering result, and to perform text recommendation for the target application scenario based on the clustering result.

13. An electronic device, characterized in that: include: A memory for storing computer executable instructions or computer programs; The processor is used to implement the text recommendation method according to any one of claims 1 to 11 when executing the computer executable instructions or computer programs stored in the memory.

14. A computer-readable storage medium, characterized in that: Computer executable instructions or computer programs are stored, and when the computer executable instructions or computer programs are executed by a processor, the text recommendation method according to any one of claims 1 to 11 is implemented.

15. A computer program product comprising a computer program or computer executable instructions, characterized in that: When the computer program or computer executable instruction is executed by a processor, the text recommendation method according to any one of claims 1 to 11 is implemented.