CN115292464A - Session processing method, device, equipment and medium based on artificial intelligence - Google Patents

Session processing method, device, equipment and medium based on artificial intelligence Download PDF

Info

Publication number
CN115292464A
CN115292464A CN202210949283.9A CN202210949283A CN115292464A CN 115292464 A CN115292464 A CN 115292464A CN 202210949283 A CN202210949283 A CN 202210949283A CN 115292464 A CN115292464 A CN 115292464A
Authority
CN
China
Prior art keywords
user
corpus
class
neural network
network model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210949283.9A
Other languages
Chinese (zh)
Inventor
邓柏伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202210949283.9A priority Critical patent/CN115292464A/en
Publication of CN115292464A publication Critical patent/CN115292464A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/335Filtering based on additional data, e.g. user or group profiles
    • G06F16/337Profile generation, learning or modification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/06Asset management; Financial planning or analysis

Abstract

The invention relates to the technical field of artificial intelligence, in particular to a session processing method, a device, equipment and a medium based on artificial intelligence.A positive sample undirected graph and a negative sample undirected graph are constructed by acquiring user characteristics, corpus characteristics and sequence characteristics of users in any session; taking a positive sample undirected graph and a negative sample undirected graph generated by each session in a session training set as a sample set, and calculating the sum of the areas of all triangles in all the positive sample undirected graphs and the sum of the areas of all triangles in all the negative sample undirected graphs in the sample set; and training the preset neural network model by taking the minimum difference value of the sum of the two areas as a training condition to obtain the trained neural network model, wherein the trained neural network model is used for outputting the target corpus according to the target user characteristics of the target user in the conversation to be processed, so that the corpus recommendation accuracy is improved.

Description

Session processing method, device, equipment and medium based on artificial intelligence
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a session processing method, a session processing device, session processing equipment and a session processing medium based on artificial intelligence.
Background
In the process of insurance sales, it is often necessary to answer customer questions and recommend related knowledge corpora. The traditional method depends on the experience of an insurance agent, has insufficient automation degree and low efficiency; after machine learning and Deep learning methods in recent years are introduced into the industry, insurance knowledge is often recommended by a system through modes such as collaborative filtering, a multilayer neural network (such as Wide & Deep series models) and the like.
The existing method can process various characteristics related to users, knowledge linguistic data and access records to a certain extent, and further automatically gives recommendations. However, in the existing method, users and corpora are assumed to be independent objects, and recommendation is performed by designing and training models according to the objects; in the prior art, a convolutional neural network model based on similarity among text keywords is constructed by training the convolutional neural network model by utilizing a text corpus and the determined convolutional neural network model structure, and finally, automatic question answering is carried out by utilizing the neural network model; the method only considers the similarity between texts and lacks the information connection among multi-dimensional complex structures, thereby reducing the accuracy of realizing dialogue corpus recommendation through a model.
Disclosure of Invention
Therefore, it is necessary to provide a session processing method, device, equipment and medium based on artificial intelligence to solve the problem of low accuracy in implementing dialog corpus recommendation through a model due to lack of information connection among multidimensional complex structures in a recommendation model in the prior art.
In a first aspect, an embodiment of the present invention provides an artificial intelligence based session processing method, where the artificial intelligence based session processing method includes:
acquiring user characteristics of a user in any session, corpus characteristics of each corpus in N corpuses accessed by the user and sequence characteristics representing the sequence of the N corpuses accessed by the user, wherein N is an integer greater than 1;
taking the user features in the session as a first-class vertex, taking the N corpus features as N second-class vertices respectively, sequentially connecting all the second-class vertices according to the sequence characterized in the sequence features, and connecting the first-class vertex with all the second-class vertices to obtain a positive sample undirected graph corresponding to the session;
generating a random sequence for the N corpora, sequentially connecting all the second-class vertexes according to the random sequence, and connecting the first-class vertexes with all the second-class vertexes to obtain a negative sample undirected graph corresponding to the session, wherein the side length of any two vertexes is obtained by processing the characteristics of the two vertexes through a preset neural network model;
taking a positive sample undirected graph and a negative sample undirected graph generated by each session in a session training set as a sample set, and calculating the sum of the areas of all triangles in all the positive sample undirected graphs and the sum of the areas of all triangles in all the negative sample undirected graphs in the sample set;
and training the preset neural network model by taking the minimum difference value of the sum of the two areas as a training condition to obtain a trained neural network model, wherein the trained neural network model is used for outputting target linguistic data according to the target user characteristics of a target user in the conversation to be processed.
In a second aspect, an embodiment of the present invention provides an undirected graph-based insurance corpus recommendation apparatus, where the undirected graph-based insurance corpus recommendation apparatus includes:
the system comprises a feature acquisition module, a feature extraction module and a feature extraction module, wherein the feature acquisition module is used for acquiring user features of a user in any session, corpus features of each accessed N corpuses and sequence features representing the sequence of accessing the N corpuses by the user, and N is an integer greater than 1;
a positive sample construction module, configured to use the user feature in the session as a first-class vertex, use the N corpus features as N second-class vertices, sequentially connect all the second-class vertices according to a sequence represented in the sequence feature, and connect the first-class vertex with all the second-class vertices, to obtain a positive sample undirected graph corresponding to the session;
the negative sample construction module is used for generating a random sequence for the N corpora, sequentially connecting all the second-class vertexes according to the random sequence, and connecting the first-class vertexes with all the second-class vertexes to obtain a negative sample undirected graph corresponding to the session, wherein the side length of any two vertexes is obtained by processing the characteristics of the two vertexes through a preset neural network model;
the area calculation module is used for taking a positive sample undirected graph and a negative sample undirected graph generated by each session in a session training set as a sample set, and calculating the sum of the areas of all triangles in all the positive sample undirected graphs and the sum of the areas of all triangles in all the negative sample undirected graphs in the sample set;
and the corpus output module is used for training the preset neural network model by taking the minimum difference value of the sum of the two areas as a training condition to obtain a trained neural network model, and the trained neural network model is used for outputting the target corpus according to the target user characteristics of the target user in the session to be processed.
In a third aspect, an embodiment of the present invention provides a computer device, where the computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor, when executing the computer program, implements the artificial intelligence based session processing method according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored, and when executed by a processor, the computer program implements the artificial intelligence based session processing method according to the first aspect.
Compared with the prior art, the invention has the following beneficial effects:
the session processing method based on artificial intelligence obtains user characteristics, corpus characteristics and sequence characteristics representing user access corpus sequence in user sessions, constructs a positive sample undirected graph and a negative sample undirected graph, takes the positive sample undirected graph and the negative sample undirected graph generated by each session in a session training set as a sample set, trains a preset neural network model until the sum of the areas of all triangles in the positive sample undirected graph and the sum of the areas of all triangles in the negative sample undirected graph in the training set are minimum to obtain a trained neural network model, and outputs a target corpus through the trained neural network model according to the target user characteristics of a target user; in the undirected graph structure generation and training process, the relevance relationship presented in the existing log and the characteristics of the corpus and the user are combined, the influence of various factors on the recommendation effect is comprehensively considered, and the accuracy of corpus recommendation is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the embodiments or the prior art description will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings may be obtained according to these drawings without inventive labor.
Fig. 1 is a schematic view of an application environment of a session processing method based on artificial intelligence according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a session processing method based on artificial intelligence according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an undirected graph according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an artificial intelligence based session processing apparatus according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a computer device according to a third embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present invention and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present invention. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The embodiment of the invention can acquire and process related data based on an artificial intelligence technology. Among them, artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence base technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
It should be understood that, the sequence numbers of the steps in the following embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
The session processing method based on artificial intelligence provided by the embodiment of the invention can be applied to the application environment shown in fig. 1, wherein the application environment is the session processing environment based on artificial intelligence, and a client communicates with a server. The client includes, but is not limited to, a palm top computer, a desktop computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cloud client, a Personal Digital Assistant (PDA), and other clients. The server can be implemented by an independent server or a server cluster composed of a plurality of servers.
Referring to fig. 2, which is a flowchart illustrating a session processing method based on artificial intelligence according to an embodiment of the present invention, the session processing method based on artificial intelligence may be applied to the client in fig. 1, and a corresponding client is connected to a server through a preset Application Programming Interface (API). The local client acquires access logs of all users through the central server, extracts session records of the users through the access logs, acquires user characteristics, corpus characteristics and sequence characteristics representing the sequence of the user access corpus, and constructs a neural network model for outputting target corpus. As shown in fig. 2, the above-mentioned session processing method based on artificial intelligence may include the following steps:
step S201, obtain the user characteristics of the user in any session, the corpus characteristics of each corpus in the N accessed corpuses, and the sequence characteristics representing the sequence in which the user accesses the N corpuses.
When the application scene of the embodiment is a user session, the corpus which is desired by the user or meets the requirements of the user can be automatically recommended to the user; for example, during the insurance business session, the user may ask some questions related to insurance or search some materials related to insurance, and then the computer may accurately recommend answers to the questions or searched materials for the user through the neural network model according to the characteristics of the user.
In this embodiment, based on the above scenario, a user access log is obtained, a user feature of a user in a user session, a corpus feature of N corpora, and access time corresponding to access of the N corpora are extracted according to the access log, and a sequence feature of a sequence in which the user accesses the N corpora is determined according to the access time, where N is an integer greater than 1.
Specifically, an access log of all users is obtained, wherein the access log comprises user information of all users, relationships of all users accessing the corpora, access sequence, time and duration of accessing each corpus, and sequence characteristics used for representing the sequence of accessing the N corpora by the users are constructed according to the time of accessing the N corpora by the users; according to the information of the user, user characteristics such as age, gender, occupation and the like can be extracted; according to the detailed contents of the linguistic data accessed by the user, the linguistic data characteristics of the N linguistic data, such as information of insurance application, claim settlement, beneficiaries and the like in the insurance service conversation can be extracted, and the N linguistic data are numbered, so that the N linguistic data are distinguished.
For example, the access log in the insurance service session scene includes a session record of zhang san of the user, and if zhang san is male and age is 35 years, the information can be used as feature information of zhang san of the user to form a feature vector of the user according to the session record of zhang san; extracting vocabularies accessed by Zhang III according to the question and answer content and the searched data in the conversation process of Zhang III, wherein the vocabularies accessed by Zhang III comprise the vocabularies of insurance, claim settlement, application and the like, and then taking the insurance, the claim settlement and the application as the corpus characteristics of the corpus accessed by Zhang III; in the session process of zhang san, more than one corpus is accessed, and there is a sequence, so a sequence feature for representing the sequence of zhang san accessing each corpus can be constructed according to the time of zhang san accessing each corpus.
Step S202, the user features in the session are used as first-class vertexes, the N corpus features are respectively used as N second-class vertexes, all the second-class vertexes are sequentially connected according to the sequence characterized in the sequence features, and the first-class vertexes are connected with all the second-class vertexes to obtain a positive sample undirected graph corresponding to the session.
An undirected graph, i.e., a graph with edges without directions, is formulated as G = < V, E >, where V is a non-empty set and is a set of vertices, and E is a set of unordered dyads composed of elements in V, called an edge set.
In this embodiment, the user characteristics of one of the users, the corpus characteristics and the sequence characteristics of each corpus of the N corpuses accessed by the user are obtained through step S201; and constructing a positive sample undirected graph according to the characteristics, wherein the specific construction method comprises the following steps:
adding the visit time of the user visiting the N corpora into the N second-class vertexes, traversing the visit time of the N second-class vertexes, sequentially connecting the N second-class vertexes according to the sequence of the visit time corresponding to the N second-class vertexes, and connecting the first-class vertex with all the second-class vertexes to obtain a positive sample undirected graph corresponding to the conversation.
Referring to fig. 3, an undirected graph provided by the embodiment of the present invention is shown, where a construction process of the undirected graph is as follows:user u i To corpus m i Corpus m j And corpus m k Accessed, user u i Accessed first is corpus m i Then accessed is corpus m j The last accessed corpus is m k Then, the connection order of the edges between the vertices of the corpora corresponding to the three corpora is: corpus apex m i Connecting corpus vertices m as starting points j Top m of corpus j Reconnecting corpus vertices m k Last user vertex u i And corpus vertex m i Chinese corpus apex m j And corpus vertex m k The connections are made separately to obtain the undirected graph of positive samples shown in fig. 3.
For all users in the access log and all corpora accessed by each user, an undirected graph containing all users and all corpora accessed by each user can be constructed according to the method.
Step S203, generating a random sequence for the N corpora, sequentially connecting all the second-class vertexes according to the random sequence, and connecting the first-class vertexes with all the second-class vertexes to obtain a negative sample undirected graph corresponding to the conversation.
In this embodiment, the positive sample undirected graph of any user and the user access corpus is obtained through the step S202, in order to train the neural network model in the later stage, a negative sample undirected graph corresponding to the positive sample undirected graph needs to be constructed, and the negative sample undirected graph is constructed in the following process:
and (3) disordering each time in the sequence by using the sequence characteristics for representing the user access corpus sequence in the step (S202) through a random function, regenerating a new random sequence, rearranging each corpus accessed by the user according to the newly generated sequence characteristics, and connecting each corpus accessed by the user according to the newly generated sequence characteristics to obtain a negative sample undirected graph.
Specifically, the access times in the sequence features of the undirected graph of the positive sample are numbered, each number is uniquely corresponding to each access time, the numbered sequences are randomly sequenced through a rand function in the C language, the corpus vertex sequence in the undirected graph of the positive sample is rearranged according to the randomly sequenced numbered sequences, and the N corpus vertices are sequentially connected according to the rearranged corpus vertex sequence to obtain the undirected graph of the negative sample.
For example, as shown in FIG. 3, for the user vertex u i And corpus vertex m i And the peak m of the corpus j And corpus vertex m k And constructing a negative sample undirected graph according to the positive sample undirected graph: will be the corpus vertex m i Numbered 1, the corpus vertex m j Numbered 2, the corpus vertex m k The number is 3, then the corpus sequence feature ordering of the positive sample is 1, 2, 3, the corpus sequence feature ordering of the positive sample is randomly disordered through the rand random function of the C language to obtain the ordering of 1, 3, 2, then the ordering of the corresponding corpus vertex is m i 、m k 、m j According to the randomly generated sequence, the corpus vertex m is divided into a plurality of parts i Chinese corpus apex m k Chinese corpus apex m j Connected in sequence, user vertex u i Then respectively identify the vertex m of the corpus i And the peak m of the corpus k And the peak m of the corpus j And sequentially connecting to obtain the negative sample undirected graph.
The steps construct a positive sample undirected graph and a negative sample undirected graph, and then define the weight of the edges between the vertexes in the undirected graph, namely the length W of the edges ij =f(v i ,v j ) Wherein v is i Number of vertices in undirected graph, v j The f function is a preset neural network model for the feature vector of the vertex in the undirected graph.
The side length of any two vertexes is obtained by processing the characteristics of the two vertexes through a preset neural network model; specifically, the numbers and the characteristics of any two vertexes are obtained, the numbers and the characteristics of any two vertexes are input into a preset neural network model, the preset neural network model calculates the relevance of any two vertexes according to the initial weight, and the relevance is characterized as the side length between any two vertexes.
In this embodiment, the side length connected between the user vertex and the corpus vertex is negatively correlated with the probability of the user represented by the user vertex accessing the corpus represented by the corpus vertex, and the side length connected between the corpus vertices is negatively correlated with the similarity between the corpuses represented by the corpus vertices; namely: the shorter the side length between the user vertex and the corpus vertex is, the greater the probability that the user represented by the user vertex accesses the corpus represented by the corpus vertex is, the longer the side length between the user vertex and the corpus vertex is, the smaller the probability that the user represented by the user vertex accesses the corpus represented by the corpus vertex is; the shorter the side length of the connection between the corpus vertexes is, the higher the similarity between the corpora represented by the corpus vertexes is, and the longer the side length of the connection between the corpus vertexes is, the lower the similarity between the corpora represented by the corpus vertexes is.
Step S204, taking the positive sample undirected graph and the negative sample undirected graph generated by each session in the session training set as a sample set, and calculating the sum of the areas of all triangles in all the positive sample undirected graphs and the sum of the areas of all triangles in all the negative sample undirected graphs in the sample set.
In the embodiment, an undirected graph is constructed for all users and all corpora accessed by the users, in the undirected graph, each vertex and each edge form a plurality of triangles, and the probability of accessing the corpora represented by the corpus vertex represented by the user vertex is negatively related to the area of the triangle; e.g. undirected graph in FIG. 3, user u i Sequential access to corpora m in a session j And corpus m k Can be regarded as the user vertex u i And the peak m of the corpus j And corpus vertex m k The area of a triangle formed by the three vertexes is inversely related; namely: the smaller the distance between the vertices of the triangle, the smaller the area of the triangle, the greater the probability of the occurrence of this access sequence, the greater the distance between the vertices of the triangle, the greater the area of the triangle, the lesser the probability of the occurrence of this access sequence.
For a training sample set, the sample set comprises a plurality of triangles formed by user vertexes and corpus vertexes, the sum of the areas of all triangles in all positive sample undirected graphs in the sample set is calculated, and the first area is defined; and calculating the sum of the areas of all triangles in the undirected graph of all negative samples in the sample set, and defining the sum as a second area.
In this embodiment, the area of the triangle may be calculated by a heleny formula, which is:
Figure BDA0003788835680000111
Figure BDA0003788835680000112
wherein S is the area of the triangle, a is the length of the first side of the triangle, b is the length of the second side of the triangle, and c is the length of the third side of the triangle.
Step S205, taking the minimum difference value of the sum of the two areas as a training condition, training a preset neural network model to obtain a trained neural network model, wherein the trained neural network model is used for outputting a target corpus according to the target user characteristics of a target user in a conversation to be processed.
In this embodiment, after the training sample set is obtained, the preset neural network model is trained, the weight of the preset neural network model is updated by using a gradient descent method, the difference between the sum of the areas of all triangles in the undirected graph of the positive sample and the sum of the areas of all triangles in the undirected graph of the negative sample is recalculated, and the difference is compared with the last calculation result and is repeatedly executed until the difference is minimum, so that the trained neural network model is obtained.
Updating a positive sample undirected graph according to the trained neural network model, acquiring user information of a conversation user when a conversation is detected, and judging whether the conversation user is an initial user;
and if the user is the initial user, acquiring the characteristics of the initial user, matching user vertexes for the initial user through a trained neural network model according to the user characteristics of the initial user and the updated positive sample undirected graph, and outputting the corpus contained in the corpus class vertex closest to the matched user vertex as the target corpus.
For example, a trained neural networkThe model matches the user vertex u as shown in FIG. 3 for the initial user based on the information of the user i And traversing the trained neural network model to the user vertex u in the undirected graph i Corpus apex m connected by shortest edge i Then, the corpus vertex m i And recommending the corresponding linguistic data serving as the target linguistic data to the user.
And if the user is not the initial user, traversing the updated positive sample undirected graph, constructing a triangle by taking the edge between the user vertex represented by the user and the corpus vertex represented by the currently accessed corpus as a base, and searching the corpus represented by the corpus vertex with the smallest area of the triangle as the target corpus to output.
For example, according to the information of the user, the trained neural network model traverses the updated positive sample undirected graph to the user vertex u corresponding to the user i And the vertex of the corpus accessed by the current conversation of the user is m j At this time, with the user vertex u i And corpus vertex m j Constructing a triangle for the base, and traversing the corpus vertex with the smallest area of the triangle to be m k Then, the corpus corresponding to the corpus vertex mi is recommended to the user as the target corpus.
The session processing method based on artificial intelligence in the embodiment obtains user characteristics, corpus characteristics and sequence characteristics representing user access corpus sequence in user sessions, constructs a positive sample undirected graph and a negative sample undirected graph, takes the positive sample undirected graph and the negative sample undirected graph generated by each session in a session training set as a sample set, trains a preset neural network model until the sum of the areas of all triangles in the positive sample undirected graph and the sum of the areas of all triangles in the negative sample undirected graph in the training set are minimum, obtains a trained neural network model, and outputs a target corpus through the trained neural network model according to target user characteristics of a target user; in the undirected graph structure generation and training process, the relevance relationship presented in the existing log and the characteristics of the corpus and the user are combined, the influence of various factors on the recommendation effect is comprehensively considered, and the accuracy of corpus recommendation is improved.
Fig. 4 shows a block diagram of a session processing apparatus based on artificial intelligence according to a second embodiment of the present invention, where the session processing apparatus based on artificial intelligence is applied to a local client in a session processing environment based on artificial intelligence, and the corresponding client is connected to a server through a preset Application Programming Interface (API). The local client acquires access logs of all users through the central server, extracts session records of the users through the access logs, acquires user characteristics, corpus characteristics and sequence characteristics representing the sequence of the user access corpus, and constructs a neural network model for outputting target corpus. For convenience of explanation, only portions related to the embodiments of the present invention are shown.
Referring to fig. 4, the artificial intelligence based session processing apparatus includes:
a feature obtaining module 41, configured to obtain a user feature of a user in any session, a corpus feature of each corpus of the N visited corpora, and a sequence feature representing a sequence in which the user visits the N corpuses, where N is an integer greater than 1;
the positive sample construction module 42 is configured to use the user features in the session as a first-class vertex, use the N corpus features as N second-class vertices, sequentially connect all the second-class vertices according to the order represented in the sequence features, and connect the first-class vertex with all the second-class vertices, so as to obtain a positive sample undirected graph corresponding to the session;
the negative sample construction module 43 is configured to generate a random order for the N corpora, sequentially connect all the two classes of vertices according to the random order, and connect the one class of vertices with all the two classes of vertices to obtain a negative sample undirected graph corresponding to the session, where a side length of any two vertices connected is obtained by processing features of the two vertices through a preset neural network model;
the area calculation module 44 is configured to use the undirected graph of positive samples and the undirected graph of negative samples generated by each session in the session training set as a sample set, and calculate a sum of areas of all triangles in all the undirected graphs of positive samples and a sum of areas of all triangles in all the undirected graphs of negative samples in the sample set;
and a corpus output module 45, configured to train a preset neural network model by using the minimum difference between the two areas as a training condition, to obtain a trained neural network model, where the trained neural network model is used to output a target corpus according to a target user characteristic of a target user in a session to be processed.
Optionally, the corpus output module 45 includes:
the first user judgment unit is used for updating the undirected graph of the positive sample according to the trained neural network model, acquiring user information of a conversation user when the conversation is detected, and judging whether the conversation user is an initial user;
and the first corpus output unit is used for acquiring the characteristics of the initial user, matching one class of vertexes for the initial user through the trained neural network model according to the user characteristics of the initial user and the updated undirected graph of the positive sample, and outputting the corpus contained in the second class of vertexes closest to the matched class of vertexes as the target corpus.
Optionally, the corpus output module 45 further includes:
the second user judgment unit is used for updating the positive sample undirected graph according to the trained neural network model, acquiring user information of a conversation user when a conversation is detected, and judging whether the conversation user is an initial user;
and the second corpus output unit is used for traversing the updated positive sample undirected graph, constructing a triangle by taking the edge between the first-class vertex represented by the user and the second-class vertex represented by the currently accessed corpus as a base, and searching the corpus represented by the second-class vertex with the smallest area of the triangle as the target corpus to output.
Optionally, the feature obtaining module 41 includes:
and the characteristic acquisition unit is used for acquiring the user access log, extracting the user characteristics of the user in the user session, the corpus characteristics of the N corpuses and the access time corresponding to the access of the N corpuses according to the access log, and determining the sequence characteristics of the sequence of the user access of the N corpuses according to the access time.
Optionally, the positive sample construction module 42 includes:
and the vertex connecting unit is used for adding the access time of the user for accessing the N corpora into the N second-class vertexes, traversing the access time in the N second-class vertexes, and sequentially connecting the N second-class vertexes according to the sequence of the access time corresponding to the N second-class vertexes.
Optionally, the negative example constructing module 43 includes:
and the edge length calculation unit is used for acquiring the numbers and the characteristics of any two vertexes, inputting the numbers and the characteristics of any two vertexes into a preset neural network model, calculating the relevance of any two vertexes according to the initial weight by the preset neural network model, and representing the relevance as the edge length between any two vertexes.
Optionally, the corpus output module 45 further includes:
the area calculation unit is used for updating the weight of the preset neural network model by adopting a gradient descent method, and recalculating the difference value between the sum of the areas of all triangles in all the undirected graphs of the positive samples and the sum of the areas of all triangles in all the undirected graphs of the negative samples;
and the gradient updating unit is used for updating the gradient in the gradient descent method according to the comparison result of the currently calculated difference and the last calculated difference, and returning to execute the step of repeatedly updating the weight of the preset neural network model by adopting the gradient descent method until the minimum difference is obtained, so that the trained neural network model is obtained.
It should be noted that, because the contents of information interaction, execution process, and the like between the modules are based on the same concept as the method embodiment of the present invention, specific functions and technical effects thereof may be referred to specifically in the method embodiment section, and are not described herein again.
Fig. 5 is a schematic structural diagram of a computer device according to a third embodiment of the present invention. As shown in fig. 5, the computer apparatus of this embodiment includes: at least one processor (only one shown in fig. 5), a memory, and a computer program stored in the memory and executable on the at least one processor, the processor when executing the computer program implementing the steps in any of the various artificial intelligence based session processing method embodiments described above.
The terminal device may include, but is not limited to, a processor, a memory. It will be appreciated by those skilled in the art that fig. 5 is merely an example of a computer device and is not intended to limit the computer device, which may include more or fewer components than those shown, or some of the components may be combined, or different components may be included, such as a network interface, a display screen, and input devices, etc.
The Processor may be a CPU, or other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory includes readable storage medium, internal memory, etc., wherein the internal memory may be the internal memory of the client, and the internal memory provides an environment for the operating system and the execution of the computer readable instructions in the readable storage medium. The readable storage medium may be a hard disk of the client, and in other embodiments, may also be an external storage device of the client, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the client. Further, the memory may also include both an internal storage unit of the client and an external storage device. The memory is used for storing an operating system, application programs, a BootLoader (BootLoader), data, and other programs, such as program codes of a computer program, and the like. The memory may also be used to temporarily store data that has been output or is to be output.
It should be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional units and modules is only used for illustration, and in practical applications, the above function distribution may be performed by different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules, so as to perform all or part of the above described functions.
Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only used for distinguishing one functional unit from another, and are not used for limiting the protection scope of the present invention.
The specific working processes of the units and modules in the above-mentioned apparatus may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the method of the embodiments of the present invention can be implemented by a computer program, which can be stored in a computer readable storage medium and can implement the steps of the embodiments of the session processing method based on artificial intelligence when executed by a processor.
Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc.
The computer readable medium may include at least: any entity or device capable of carrying computer program code, recording medium, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier signals, telecommunications signals, and software distribution media. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
The present invention realizes all or part of the processes in the above-mentioned method, and can also be completed by a computer program product, when the computer program product runs on the client, the steps in the above-mentioned session processing method based on artificial intelligence can be realized when the client executes.
In the foregoing embodiments, the descriptions of the respective embodiments have their respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or recited in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/client and method may be implemented in other ways. For example, the above-described apparatus/client embodiments are merely illustrative, and for example, a module or a unit may be divided into only one logical function, and may be implemented in other ways, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above examples are only intended to illustrate the technical solution of the present invention, and not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A session processing method based on artificial intelligence is characterized by comprising the following steps:
acquiring user characteristics of a user in any session, corpus characteristics of each corpus in N corpuses accessed by the user and sequence characteristics representing the sequence of the N corpuses accessed by the user, wherein N is an integer greater than 1;
taking the user features in the session as a first-class vertex, taking the N corpus features as N second-class vertices, sequentially connecting all the second-class vertices according to the sequence characterized in the sequence features, and connecting the first-class vertex with all the second-class vertices to obtain a positive sample undirected graph corresponding to the session;
generating a random sequence for the N corpora, sequentially connecting all the second-class vertexes according to the random sequence, and connecting the first-class vertexes with all the second-class vertexes to obtain a negative sample undirected graph corresponding to the session, wherein the side length of any two vertexes is obtained by processing the characteristics of the two vertexes through a preset neural network model;
taking a positive sample undirected graph and a negative sample undirected graph generated by each session in a session training set as a sample set, and calculating the sum of the areas of all triangles in all the positive sample undirected graphs and the sum of the areas of all triangles in all the negative sample undirected graphs in the sample set;
and training the preset neural network model by taking the minimum difference value of the sum of the two areas as a training condition to obtain a trained neural network model, wherein the trained neural network model is used for outputting target linguistic data according to the target user characteristics of a target user in the conversation to be processed.
2. The artificial intelligence based conversation processing method according to claim 1, wherein the trained neural network model is configured to output the target corpus according to the target user characteristics of the target user in the conversation to be processed, and comprises:
updating the undirected graph of the positive sample according to the trained neural network model, acquiring user information of a conversation user when a conversation is detected, and judging whether the conversation user is an initial user;
and if the user is an initial user, acquiring the characteristics of the initial user, matching the class I vertex for the initial user through the trained neural network model according to the user characteristics of the initial user and the updated positive sample undirected graph, and outputting the corpus contained in the class II vertex closest to the matched class I vertex as the target corpus.
3. The artificial intelligence based conversation processing method according to claim 1, wherein the trained neural network model is configured to output the target corpus according to the target user characteristics of the target user in the conversation to be processed, further comprising:
updating the undirected graph of the positive sample according to the trained neural network model, acquiring user information of a conversation user when a conversation is detected, and judging whether the conversation user is an initial user;
and if the user is not the initial user, traversing the updated positive sample undirected graph, constructing a triangle by taking the edge between the vertex of the first class represented by the user and the vertex of the second class represented by the currently accessed corpus as a base, and searching the corpus represented by the vertex of the second class with the smallest area of the triangle as a target corpus to output.
4. The artificial intelligence based conversation processing method according to claim 1, wherein the obtaining of the user characteristics of the user in any conversation, the corpus characteristics of each of the N corpuses accessed and the sequence characteristics characterizing the sequence of the user accessing the N corpuses comprises:
acquiring a user access log, extracting user characteristics of a user in a user session, corpus characteristics of N corpora and access time corresponding to access of the N corpora according to the access log, and determining sequence characteristics of the sequence of accessing the N corpora by the user according to the access time.
5. The artificial intelligence based conversation processing method according to claim 4, wherein the step of using the user features in the conversation as a class-one vertex, using the N corpus features as N class-two vertices, respectively, and sequentially connecting all class-two vertices according to the sequence characterized in the sequence features comprises:
and adding the visit time of the user visiting the N corpora into the N second-class vertexes, traversing the visit time of the N second-class vertexes, and sequentially connecting the N second-class vertexes according to the sequence of the visit time corresponding to the N second-class vertexes.
6. The artificial intelligence based session processing method according to claim 1, wherein the side length of the connection between any two vertices is obtained by processing the features of the two vertices through a preset neural network model, and the processing comprises:
and acquiring the numbers and the characteristics of any two vertexes, inputting the numbers and the characteristics of any two vertexes into the preset neural network model, calculating the relevance of any two vertexes according to the initial weight by the preset neural network model, and characterizing the relevance as the side length between any two vertexes.
7. The artificial intelligence based session processing method according to claim 1, wherein the training of the preset neural network model with the minimization of the difference between the sums of the two areas as a training condition to obtain the trained neural network model comprises:
updating the weight of the preset neural network model by adopting a gradient descent method, and recalculating the difference value between the sum of the areas of all triangles in all the undirected graphs of the positive samples and the sum of the areas of all triangles in all the undirected graphs of the negative samples;
and updating the gradient in the gradient descent method according to the comparison result of the currently calculated difference and the difference calculated last time, returning to execute the step of repeatedly updating the weight of the preset neural network model by adopting the gradient descent method until the minimum difference is obtained, and obtaining the trained neural network model.
8. An undirected graph-based insurance corpus recommendation apparatus, comprising:
the system comprises a feature acquisition module, a feature extraction module and a feature extraction module, wherein the feature acquisition module is used for acquiring user features of a user in any session, corpus features of each corpus in N corpuses accessed by the user and sequence features representing the sequence of the N corpuses accessed by the user, and N is an integer greater than 1;
a positive sample construction module, configured to use the user feature in the session as a first-class vertex, use the N corpus features as N second-class vertices, sequentially connect all the second-class vertices according to a sequence represented in the sequence feature, and connect the first-class vertex with all the second-class vertices, to obtain a positive sample undirected graph corresponding to the session;
the negative sample construction module is used for generating a random sequence for the N corpora, sequentially connecting all the second-class vertexes according to the random sequence, and connecting the first-class vertexes with all the second-class vertexes to obtain a negative sample undirected graph corresponding to the session, wherein the side length of any two vertexes is obtained by processing the characteristics of the two vertexes through a preset neural network model;
the area calculation module is used for taking the positive sample undirected graph and the negative sample undirected graph generated by each session in the session training set as a sample set, and calculating the sum of the areas of all triangles in all the positive sample undirected graphs and the sum of the areas of all triangles in all the negative sample undirected graphs in the sample set;
and the corpus output module is used for training the preset neural network model by taking the minimum difference value of the sum of the two areas as a training condition to obtain a trained neural network model, and the trained neural network model is used for outputting the target corpus according to the target user characteristics of the target user in the conversation to be processed.
9. A computer device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, the processor implementing the artificial intelligence based session processing method as claimed in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the artificial intelligence based session processing method according to any one of claims 1 to 7.
CN202210949283.9A 2022-08-09 2022-08-09 Session processing method, device, equipment and medium based on artificial intelligence Pending CN115292464A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210949283.9A CN115292464A (en) 2022-08-09 2022-08-09 Session processing method, device, equipment and medium based on artificial intelligence

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210949283.9A CN115292464A (en) 2022-08-09 2022-08-09 Session processing method, device, equipment and medium based on artificial intelligence

Publications (1)

Publication Number Publication Date
CN115292464A true CN115292464A (en) 2022-11-04

Family

ID=83827409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210949283.9A Pending CN115292464A (en) 2022-08-09 2022-08-09 Session processing method, device, equipment and medium based on artificial intelligence

Country Status (1)

Country Link
CN (1) CN115292464A (en)

Similar Documents

Publication Publication Date Title
CN108829822B (en) Media content recommendation method and device, storage medium and electronic device
US11227118B2 (en) Methods, devices, and systems for constructing intelligent knowledge base
US20180336193A1 (en) Artificial Intelligence Based Method and Apparatus for Generating Article
CN112487173B (en) Man-machine conversation method, device and storage medium
CN112667794A (en) Intelligent question-answer matching method and system based on twin network BERT model
CN110457708B (en) Vocabulary mining method and device based on artificial intelligence, server and storage medium
CN110276023B (en) POI transition event discovery method, device, computing equipment and medium
CN113283238B (en) Text data processing method and device, electronic equipment and storage medium
CN112183078B (en) Text abstract determining method and device
CN113407677B (en) Method, apparatus, device and storage medium for evaluating consultation dialogue quality
CN113094478B (en) Expression reply method, device, equipment and storage medium
CN114168841A (en) Content recommendation method and device
CN110532562B (en) Neural network training method, idiom misuse detection method and device and electronic equipment
CN116882372A (en) Text generation method, device, electronic equipment and storage medium
CN111368066B (en) Method, apparatus and computer readable storage medium for obtaining dialogue abstract
CN114490926A (en) Method and device for determining similar problems, storage medium and terminal
CN113569018A (en) Question and answer pair mining method and device
CN112307738A (en) Method and device for processing text
CN111428486B (en) Article information data processing method, device, medium and electronic equipment
CN116894498A (en) Training method, strategy identification method, device and equipment of network model
CN116662495A (en) Question-answering processing method, and method and device for training question-answering processing model
CN115080864A (en) Artificial intelligence based product recommendation method and device, computer equipment and medium
CN115292464A (en) Session processing method, device, equipment and medium based on artificial intelligence
CN114281990A (en) Document classification method and device, electronic equipment and medium
CN112541069A (en) Text matching method, system, terminal and storage medium combined with keywords

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination