CN113641897A - Recommendation method and device based on session text, electronic equipment and storage medium - Google Patents

Recommendation method and device based on session text, electronic equipment and storage medium Download PDF

Info

Publication number
CN113641897A
CN113641897A CN202110859016.8A CN202110859016A CN113641897A CN 113641897 A CN113641897 A CN 113641897A CN 202110859016 A CN202110859016 A CN 202110859016A CN 113641897 A CN113641897 A CN 113641897A
Authority
CN
China
Prior art keywords
target
session
candidate
sequence
recommendation
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.)
Granted
Application number
CN202110859016.8A
Other languages
Chinese (zh)
Other versions
CN113641897B (en
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.)
Shanghai Minglue Artificial Intelligence Group Co Ltd
Original Assignee
Shanghai Minglue Artificial Intelligence Group Co 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 Shanghai Minglue Artificial Intelligence Group Co Ltd filed Critical Shanghai Minglue Artificial Intelligence Group Co Ltd
Priority to CN202110859016.8A priority Critical patent/CN113641897B/en
Publication of CN113641897A publication Critical patent/CN113641897A/en
Application granted granted Critical
Publication of CN113641897B publication Critical patent/CN113641897B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • G06F40/35Discourse or dialogue representation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to a recommendation method and device based on a session text, an electronic device and a storage medium, wherein the method comprises the following steps: acquiring a target session text of a target object; determining a first time sequence relation of each target label in the target session text; obtaining a target session sequence corresponding to the target session text according to the first time sequence relation of each label; and inputting the target vector into a target model obtained by pre-training to obtain a target recommendation result of the target object. According to the method provided by the embodiment of the application, the target recommendation result for the target object can be determined based on the session text of the target object under the condition that data such as historical behavior expression of the target object or click records of items cannot be acquired, so that a novel personalized recommendation method is provided, and the problem that the target object cannot be recommended in a memorable manner under the condition of cold start is solved.

Description

Recommendation method and device based on session text, electronic equipment and storage medium
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a recommendation method and apparatus, an electronic device, and a storage medium based on a session text.
Background
In a recommendation scenario, the recommendation strategy can be generally divided into recommendation strategies based on user information and item (item clicked historically), but the two strategies depend on data such as historical behavior of a user or click records of an item to some extent, and a recommendation algorithm can only give play to a better recommendation system to recommend content with high relevance to the user and a tag. However, in the case of cold start, since there is no data such as historical behavior corresponding to the user or click records for the item, the recommendation system cannot recommend the item to the user.
Aiming at the technical problem that project recommendation cannot be performed on a user under the condition of cold start of the user in the related technology, an effective solution is not provided at present.
Disclosure of Invention
In order to solve the technical problem that project recommendation cannot be performed on a user under the condition of cold start of the user, the application provides a recommendation method and device based on a session text, an electronic device and a storage medium.
In a first aspect, an embodiment of the present application provides a recommendation method based on a session text, including:
acquiring a target session text of a target object;
determining a first time sequence relation of each target label in the target session text, wherein the target label is information corresponding to a target information type in the target session text, and the first time sequence relation is used for indicating a front-back order of each target label in the target session text;
obtaining a target session sequence corresponding to the target session text according to the first time sequence relation of each target label, wherein the target session sequence is used for indicating the correlation among the target labels;
generating a target vector corresponding to the target session sequence;
and inputting the target vector into a target model obtained by pre-training to obtain a target recommendation result of the target object.
Optionally, as in the foregoing method, before the target vector is input into a pre-trained target model to obtain a target recommendation result of the target object, the method further includes:
acquiring candidate session texts of at least two candidate objects in a candidate object cluster, wherein the candidate objects are in one-to-one correspondence with the candidate session texts;
generating a training session sequence and a testing session sequence for training according to the candidate session texts;
generating a training vector corresponding to the training session sequence, and generating a testing vector corresponding to the testing session sequence;
training a model to be trained through the training vectors to obtain a trained model;
and under the condition that the test precision obtained by testing the trained model through the test vector reaches the preset requirement, taking the trained model as the target model.
Optionally, as in the foregoing method, the generating a session sequence for training and a session sequence for testing according to the candidate session texts includes:
for each candidate session text, determining a second time sequence relation of each candidate tag in the candidate session text, and obtaining a candidate session sequence corresponding to the candidate session text according to the second time sequence relation of each candidate tag, wherein the candidate tag is information corresponding to the target information type in the candidate session text, and the candidate session sequence is used for indicating correlation among the candidate tags;
determining an association relation between each candidate tag in all the candidate session texts according to a second time sequence relation corresponding to each candidate session text;
determining at least one potential conversation sequence according to the association relationship, wherein the second time sequence relationship between the candidate tags in the potential conversation sequence is different from the second time sequence relationship of any candidate conversation sequence;
and determining the training session sequence and the testing session sequence from all the candidate session sequences and all the potential session sequences.
Optionally, as in the foregoing method, the inputting the target vector into a pre-trained target model to obtain a target recommendation result of the target object includes:
inputting the target vector into the target model to obtain target high-level semantic information corresponding to the target vector;
matching a preset number of candidate recommended session sequences in all candidate session sequences according to the target high-level semantic information, wherein the similarity between the high-level semantic information of the candidate recommended session sequences and the target high-level semantic information meets a preset similarity requirement;
screening target recommendation labels of a target quantity from the candidate recommendation labels of all the candidate recommendation session sequences, wherein the candidate recommendation labels are information which is located in the corresponding candidate recommendation session sequences and corresponds to the target information type;
and querying a target database to obtain the target recommendation result corresponding to the target recommendation label.
Optionally, as in the foregoing method, the screening of the target recommendation tags of the target quantity from the candidate recommendation tags of all the candidate recommendation session sequences includes:
and selecting the target recommendation label from all the candidate recommendation labels according to the matching degree corresponding to each candidate recommendation session sequence and the third time sequence relation of each candidate recommendation label in each candidate recommendation session sequence, wherein the matching degree corresponding to the candidate recommendation session sequence where the target recommendation label is located is higher than or equal to the matching degree corresponding to the candidate recommendation session sequence where other candidate recommendation labels are located, and the time sequence of the target recommendation label is prior to the time sequence of other candidate recommendation labels in the same candidate recommendation session sequence.
Optionally, as in the foregoing method, the determining at least one potential session sequence according to the association relationship includes:
obtaining label association structure information used for indicating the association relation among the candidate labels according to the association relation among the candidate labels;
and inquiring the conversation sequence in the label associated structure information through breadth-first search or depth-first search to obtain the potential conversation sequence.
Optionally, as in the foregoing method, the generating a target vector corresponding to the target session sequence includes:
mapping each target label to a target space to obtain a target sub-vector;
and obtaining the target vector according to the target word vector of each target label in the conversation sequence.
In a second aspect, an embodiment of the present application provides a recommendation device based on a session text, including:
the acquisition module is used for acquiring a target session text of a target object;
a determining module, configured to determine a first time-series relationship of each target tag in the target session text, where the target tag is information corresponding to a target information type in the target session text, and the first time-series relationship is used to indicate a front-back order of each target tag appearing in the target session text;
a sequence module, configured to obtain a target session sequence corresponding to the target session text according to the first time sequence relationship of each target tag, where the target session sequence is used to indicate a correlation between each target tag;
the generating module is used for generating a target vector corresponding to the target session sequence;
and the result module is used for inputting the target vector into a target model obtained by pre-training to obtain a target recommendation result of the target object.
In a third aspect, an embodiment of the present application provides an electronic device, including: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory is used for storing a computer program;
the processor, when executing the computer program, is configured to implement the method according to any of the preceding claims.
In a fourth aspect, the present application provides a computer-readable storage medium, which includes a stored program, where the program is executed to perform the method according to any one of the preceding claims.
The scheme can be applied to prediction and optimization in the technical field of marketing intelligence, and compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
according to the method provided by the embodiment of the application, the target recommendation result for the target object can be determined based on the session text of the target object under the condition that data such as historical behavior expression of the target object or click records of items cannot be acquired, so that a novel personalized recommendation method is provided, and the problem that the target object cannot be recommended in a memorable manner under the condition of cold start is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a recommendation method based on a session text according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a recommendation method based on a session text according to another embodiment of the present application;
fig. 3 is a flowchart illustrating a recommendation method based on a session text according to another embodiment of the present application;
FIG. 4 is a diagram illustrating a second timing relationship in an embodiment of the present application;
FIG. 5 is a diagram illustrating a second timing relationship in another embodiment of the present application;
FIG. 6 is a diagram illustrating a second timing relationship in another embodiment of the present application;
FIG. 7 is a schematic diagram illustrating an association relationship between candidate tags according to an embodiment of the present application;
fig. 8 is a block diagram of a recommendation device based on a session text according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
According to one aspect of the embodiment of the application, a recommendation method based on conversation text is provided. Alternatively, in this embodiment, the above recommendation method based on the session text may be applied to a hardware environment formed by a terminal and a server. The server is connected with the terminal through a network, can be used for providing services (such as advertisement push services, application services, content push services and the like) for the terminal or a client installed on the terminal, and can be provided with a database on the server or independent of the server for providing data storage services for the server.
The network may include, but is not limited to, at least one of: wired networks, wireless networks. The wired network may include, but is not limited to, at least one of: wide area networks, metropolitan area networks, local area networks, which may include, but are not limited to, at least one of the following: WIFI (Wireless Fidelity), bluetooth. The terminal may not be limited to a PC, a mobile phone, a tablet computer, and the like.
The recommendation method based on the session text in the embodiment of the application can be executed by the server, the terminal, or both the server and the terminal. The terminal executing the recommendation method based on the session text according to the embodiment of the present application may also be executed by a client installed thereon.
Taking the server to execute the recommendation method based on the session text in this embodiment as an example, fig. 1 is a recommendation method based on the session text provided in this embodiment, and includes the following steps:
step S101, acquiring a target session text of a target object.
The recommendation method based on the session text in this embodiment may be applied to a scenario in which a user (i.e., an object) needs to be recommended with content, for example: a scene in which a topic is recommended to a user, a scene in which a video is recommended to a user, and the like, and may also be a scene in which other content is recommended. In the embodiment of the present application, a video is taken as an example to describe the recommendation method based on the session text, and the recommendation method based on the session text is also applicable to recommendation of other types of content without contradiction.
Taking a topic recommendation identification scene as an example, the target topic pushed to the target object is determined by performing abnormal identification on the target conversation text of the target object.
After the target object chats with other objects through preset chatting software or components, the chatting records in the corresponding chatting window can be obtained, and then the target conversation text of the target object can be determined according to the chatting records.
The target session text may be directly based on the chat records of the user, or may be a session summary obtained by processing the chat records, for example, only text contents of a required information type are retained or extracted.
For example, based on the conversation data among the internal employees of the enterprise chat system, the conversation text corresponding to each employee is determined, and after the target employee (i.e., the target object) needing to be analyzed is determined, the target conversation text corresponding to the target employee can be obtained, so that the content related to the later recommendation of the target conversation text to the target employee can be provided.
Step S102, determining a first time sequence relation of each target label in the target session text, wherein the target label is information corresponding to the type of the target information in the target session text, and the first time sequence relation is used for indicating the front and back sequence of each target label in the target session text.
After the target session text is determined, the first time sequence relation of each target label can be determined.
The target label can be information corresponding to the target information type in the target session text; for example, when the target session text includes "weather is good today and is suitable for going out and outing", and the target information type is a topic type, it is determined that the target tag includes "weather" and "outing". After the target tags are determined, the first time sequence relation of each target tag can be determined.
The first time sequence relation may be information indicating a front-to-back order in which the respective target tags appear in the target conversation text; for example, since the target label "weather" appears before the target label "outing", the first timing relationship indicates that the target label "weather" precedes the target label "outing".
Step S103, obtaining a target conversation sequence corresponding to the target conversation text according to the first time sequence relation of each target label, wherein the target conversation sequence is used for indicating the correlation among the target labels.
After the first time sequence relation of the target tags is obtained, the target tags can be associated with each other according to the first time sequence relation, and then a target session sequence used for indicating the correlation among the target tags can be obtained.
For example, when a conversation including the target tag B and the target tag E occurs first in the target conversation text I, and then the conversation including the target tag D, the target tag E, and the target tag F occurs at intervals, a target conversation sequence corresponding to the target conversation text I may be as shown in fig. 4.
And step S104, generating a target vector corresponding to the target session sequence.
After the target session sequence is obtained, a target vector corresponding to the target session sequence can be generated, and the target session sequence is encoded into a representation form matched with a target model, so that the target model can be predicted according to the target vector in a later period. For example, the target session sequence may be processed by Word Embedding method, and the Embedding vector representation of the target session sequence is obtained.
And step S105, inputting the target vector into a target model obtained by pre-training to obtain a target recommendation result of the target object.
After the target vector is obtained, the target session sequence is coded into a representation form matched with a target model obtained through pre-training, and then the target vector can be input into the target model to obtain a target recommendation result of the target object.
The target model can be a deep neural network model obtained through pre-training, and a target recommendation result can be obtained based on a result output by the target model.
The target recommendation result can be the content corresponding to the target label, and can also comprise the content of other labels related to the target label; that is, when the target information type is "topic", the target recommendation result is content related to the topic. For example, when the target tag includes "weather" and "outing", the target recommendation result may be obtained according to "weather" and "outing", such as: weather conditions in recent days and scenic spots in outing can also obtain other labels related to 'weather' and 'outing', such as 'clothing', and further obtain target recommendation results related to 'weather', 'outing' and 'clothing'.
By the method in the embodiment, the target recommendation result for the target object can be determined based on the session text of the target object under the condition that data such as historical behavior of the target object or click records of items cannot be acquired, so that a novel personalized recommendation method is provided, and the problem that the target object cannot be recommended in a memorable manner under the condition of cold start is solved.
As shown in fig. 2, as an alternative implementation manner, as the foregoing method, before the step S105 inputs the target vector into the pre-trained target model to obtain the target recommendation result of the target object, the method further includes the following steps:
step S201, obtaining candidate session texts of at least two candidate objects in the candidate object cluster, where the candidate objects and the candidate session texts are in one-to-one correspondence.
The candidate object cluster may be a cluster comprising a plurality of candidate objects, for each candidate object there is a corresponding candidate session text, and thus at least two candidate session texts in the candidate object cluster may be obtained.
For example, a candidate cluster may be all group members in a group chat. Therefore, the candidate object is each group member, and the candidate conversation text may be the conversation text corresponding to each group member.
Step S202, a training session sequence and a testing session sequence for training are generated according to the candidate session texts.
After the candidate session texts are obtained, the session sequence corresponding to each candidate session text can be obtained according to the method in the foregoing embodiment, and a training session sequence and a testing session sequence for training are determined from all the session sequences.
In step S203, a training vector corresponding to the training session sequence is generated, and a test vector corresponding to the test session sequence is generated.
After the training session sequence and the testing session sequence are obtained, a training vector corresponding to the training session sequence and a testing vector corresponding to the testing session sequence can be generated according to the method in the foregoing embodiment; the session sequence for training and the session sequence for testing are coded into a representation form corresponding to the model to be trained.
And step S204, training the model to be trained through the training vectors to obtain a trained model.
And S205, taking the trained model as a target model under the condition that the test precision obtained by testing the trained model through the test vector meets the preset requirement.
After the training vector is obtained, the training vector can be input into the model to be trained for training, so as to obtain the trained model. After the trained model is obtained, the trained model can be tested by using the test vector.
And under the condition that the test precision obtained by testing the trained model through the test vector meets the preset requirement, obtaining a target model for prediction according to the trained model.
The preset requirement may be a preset precision value for indicating that the test precision meets the preset requirement, and the trained model may be used as the target model.
For example, a prediction result obtained by inputting a vector for test into the trained model is obtained, then a matching value between a project corresponding to the prediction result and a project actually clicked by a user corresponding to the vector for test is judged, when the matching value meets a preset requirement, it is judged that the test precision meets the preset requirement, and the trained model is used as a target model.
By the method in the embodiment, the target model for text prediction can be obtained through training, so that the corresponding target recommendation result can be obtained according to target vector prediction in the later period.
As an alternative implementation, as shown in fig. 3, in the foregoing method, the step S202 of generating a session sequence for training and a session sequence for testing according to the candidate session text includes the following steps:
step S301, for each candidate conversation text, determining a second time sequence relation of each candidate tag in the candidate conversation text, and obtaining a candidate conversation sequence corresponding to the candidate conversation text according to the second time sequence relation of each candidate tag, wherein the candidate tag is information corresponding to the target information type in the candidate conversation text, and the candidate conversation sequence is used for indicating the correlation among the candidate tags.
After determining each target session text, for each candidate session text, the second time sequence relationship and the candidate session sequence of each candidate tag in the candidate session text may be determined according to the following method.
The candidate tag can be information corresponding to the candidate information type in the candidate session text; for example, when the candidate conversation text includes "weather is good today and is suitable for going out to the outing", and when the candidate information type is the topic type, it is determined that the candidate tag includes "weather" and "outing". After the candidate tags are determined, the second timing relationship of each candidate tag can be determined.
The second timing relationship may be information indicating a front-to-back order in which the respective candidate tags appear in the candidate conversation text; for example, since the candidate tag "weather" appears before the candidate tag "outing", it is indicated in the second timing relationship that the candidate tag "weather" precedes the candidate tag "outing".
After the second time sequence relation of the candidate tags is obtained, the candidate tags may be associated with each other according to the second time sequence relation, and then a candidate session sequence indicating the correlation between the candidate tags may be obtained.
For example, when the target conversation text II includes the target tag B and the target tag E, the conversation of the target tag D, the target tag E, and the target tag a occurs first, and then occurs at intervals.
Step S302, determining the association relation among all candidate labels in all candidate session texts according to the second time sequence relation corresponding to each candidate session text.
Because each second time sequence relation indicates the correlation between the candidate labels in the corresponding candidate conversation text, after the second time sequence relation corresponding to each candidate conversation text is obtained, the association relation between the candidate labels in all the candidate conversation texts can be determined.
For example, when a second time-series relationship of three users (candidates) is obtained (as shown in the following table):
user' s Second timing relationship
user1 B、E/D、E、F
user2 D、A、B
user3 E、C、B/B、A
That is, for the user1, in the corresponding candidate conversation text, B, E occurs first, and then occurs at intervals of D, E, F, and the corresponding second time sequence relationship is as shown in fig. 4; for the user2, D, A, B occurs in sequence in the corresponding candidate conversation text, and the corresponding second time sequence relationship is as shown in fig. 5; for the user3, in the corresponding candidate conversation text, E, C, B occurs first, and then occurs at intervals of B, A, and the corresponding second time sequence relationship is shown in fig. 6. Therefore, the association relationship between the candidate tags is shown in fig. 7, which is obtained by combining the above three second timing relationships.
Step S303, determining at least one potential conversation sequence according to the association relationship, where a second time sequence relationship between candidate tags in the potential conversation sequence is different from a second time sequence relationship of any candidate conversation sequence.
After the association relationship is obtained, although the correlation between every two candidate tags already exists in one of the candidate session sequences, in the case that the candidate tags are greater than or equal to three, a potential session sequence different from any one of the candidate session sequences is obtained.
The potential conversation sequence may be a conversation sequence that does not actually occur and is inferred from the candidate conversation sequences, for example, as shown in fig. 7, at least three groups of potential conversation sequences A, B, E, F may be obtained as shown below; B. e, C, B, A, respectively; D. a, B, E, F are provided.
In step S304, a training session sequence and a testing session sequence are determined from all the candidate session sequences and all the potential session sequences.
After the candidate session sequences and the potential session sequences are obtained, a session sequence for training and a session sequence for testing can be determined in all the candidate session sequences and all the potential session sequences in a random selection mode; further, each candidate session sequence can only be used for one of the training session sequence or the testing session sequence, and each potential session sequence can only be used for one of the training session sequence or the testing session sequence.
Based on the method, the potential relation among different candidate labels can be discovered, so that the behavior data of the user can be enriched, and the purpose of improving the accuracy of the recommendation result when the user is recommended is achieved.
As an alternative implementation manner, as in the foregoing method, the step S105 inputs the target vector into a target model obtained by pre-training to obtain a target recommendation result of the target object, and includes the following steps:
step S401, target high-level semantic information corresponding to the target vector is obtained by inputting the target vector into the target model.
Step S402, matching candidate recommendation session sequences in all candidate session sequences according to the target high-level semantic information, wherein the similarity between the high-level semantic information of the candidate recommendation session sequences and the target high-level semantic information meets a preset similarity requirement;
step S403, screening target recommendation labels of a target quantity from the candidate recommendation labels of all candidate recommendation session sequences, wherein the candidate recommendation labels are information which is located in the corresponding candidate recommendation session sequences and corresponds to the target information type;
and S404, inquiring in a target database to obtain a target recommendation result corresponding to the target recommendation label.
After the target vector is obtained, the target vector may be input into the target model, and after the target model performs convolution (i.e., feature extraction) on the target vector for several times, the target high-level semantic information (i.e., feature information) corresponding to the target vector is obtained.
After the target high-level semantic information is obtained, in order to obtain a corresponding candidate recommended session sequence based on the target high-level semantic information, the high-level semantic information of each candidate session sequence can be determined in advance; and then, performing similarity calculation between the target high-level semantic information and the high-level semantic information of each candidate session sequence by using collaborative filtering.
After the similarity between the target high-level semantic information and the high-level semantic information of each candidate conversation sequence is obtained, the candidate conversation sequence with the similarity meeting the preset similarity requirement can be selected as the candidate recommendation conversation sequence.
The preset similarity requirement may be a preset minimum value of similarity, and when the similarity corresponding to the candidate conversation sequence is higher than or equal to the preset similarity requirement, the candidate conversation sequence is used as the candidate recommended conversation sequence.
After the candidate recommendation session sequence is obtained, the target recommendation label can be selected and obtained from the candidate recommendation session sequence. Because each candidate recommendation session sequence may include multiple tags, and the same tag may exist in the same candidate recommendation session sequence or different candidate recommendation session sequences, and the number of tags may exceed the target number. Therefore, a target number of target recommendation tags can be selected by de-duplicating each tag, and the target recommendation tags may include target tags in a target conversation series.
After the target recommendation label is obtained, a target recommendation result corresponding to the target recommendation label can be determined in the target database. For example, corresponding tags may be marked on the content in the target database in advance, and then the target content corresponding to each target recommendation tag is matched in the target database one by one in a tag matching manner through the target recommendation tags, so that a target recommendation result may be obtained according to the target content corresponding to all the target recommendation tags.
By the method in the embodiment, the candidate recommendation session sequence is the session sequence corresponding to other candidate objects different from the target object, so that the potential correlation according to sessions between different objects can be achieved by matching the candidate recommendation session sequence, and other tags possibly having correlation with the target tag in the target session sequence in time sequence can be determined based on the candidate recommendation session sequence, so that the purpose of enriching behavior data of the target object can be achieved, and the coverage of the target recommendation result is improved.
As an alternative implementation manner, as in the foregoing method, the step S403 of screening out a target number of target recommendation tags from among the candidate recommendation tags in all candidate recommendation session sequences includes:
and selecting and obtaining a target recommendation label from all candidate recommendation labels according to the matching degree corresponding to each candidate recommendation session sequence and the third time sequence relation of each candidate recommendation label in each candidate recommendation session sequence, wherein the matching degree corresponding to the candidate recommendation session sequence where the target recommendation label is located is higher than or equal to the matching degree corresponding to the candidate recommendation session sequence where other candidate recommendation labels are located, and the time sequence of the target recommendation label is prior to the time sequence of other candidate recommendation labels in the same candidate recommendation session sequence.
After the candidate recommendation labels are determined, the matching degree corresponding to each candidate recommendation session sequence can be obtained at the same time, and a third time sequence relation of each candidate recommendation label in each candidate recommendation session sequence is determined.
When the target number is greater than the total number of the candidate recommended tags in each candidate recommendation session sequence, the target recommended tag needs to be selected from all the candidate recommended tags. And, the selected target recommendation label needs to satisfy: the matching degree corresponding to the candidate recommendation session sequence where the target recommendation label is located is higher than or equal to the matching degree corresponding to the candidate recommendation session sequence where other candidate recommendation labels are located, and the time sequence of the target recommendation label is prior to the time sequences of other candidate recommendation labels in the same candidate recommendation session sequence.
For example, there are candidate recommendation session sequences a (corresponding matching degree is N1, third timing relationship is A, B, E, F), candidate recommendation session sequences b (corresponding matching degree is N2, third timing relationship is B, E, C, B, A), candidate recommendation session sequences c (corresponding matching degree is N3, third timing relationship is D, G, H, E, F), and N1> N2> N3, when the target number is 6; selecting target recommendation tags A, B, E, F from the candidate recommendation session sequence a, continuing to select from the candidate recommendation session sequence b if the number of the target recommendation tags is less than 6, selecting from the candidate recommendation session sequence C if the number of the target recommendation tags is less than 6, and selecting from the candidate recommendation session sequence C if the number of the target recommendation tags is less than 5 because the number of the target recommendation tags is less than A, B, E, F because only C is different from A, B, E, F, selecting only one target recommendation tag because D, G and H are different from A, B, C, E, F, determining the time sequence of D, G and H, and determining that D is the target recommendation tag when the time sequence of D is earlier than the time sequence of G and H, and obtaining the target recommendation tag including A, B, C, and H, wherein the time sequence of D is determined to be the time sequence of G and H, and D is determined to be the time sequence of D to be the target recommendation tag, B. C, D, E, F are provided.
By the method in the embodiment, the target recommendation label with higher matching degree can be selected and obtained, and further a better recommendation effect can be achieved.
As an alternative implementation manner, as in the foregoing method, the step S303 of determining at least one potential session sequence according to the association relationship includes the following steps:
step S601, obtaining label association structure information used for indicating association relation among candidate labels according to association relation among the candidate labels.
Step S602, a conversation sequence is inquired in the label associated structure information through breadth-first search or depth-first search, and a potential conversation sequence is obtained.
After the association relationship between the candidate tags is obtained, tag association structure information can be obtained according to the association relationship.
The tag association structure information may be information indicating an association relationship between all candidate tags, for example: for the user1, in the corresponding candidate conversation text, B, E occurs first, and then occurs at intervals of D, E, F, and the corresponding second time sequence relationship is as shown in fig. 4; for the user2, D, A, B occurs in sequence in the corresponding candidate conversation text, and the corresponding second time sequence relationship is as shown in fig. 5; for the user3, in the corresponding candidate conversation text, E, C, B occurs first, and then occurs at intervals of B, A, and the corresponding second time sequence relationship is shown in fig. 6. Therefore, if the association relationship between the candidate tags is as shown in fig. 7, the tag association structure information is information indicating the association relationship shown in fig. 7.
After the tag association structure information is obtained, a random walk method may be used to construct a potential session sequence, and in practice, the construction may be performed by using one of a breadth-first search method and a depth-first search method.
In the embodiment, by adopting the breadth-first search method or the depth-first search method, the occurrence of infinite session sequences can be avoided, the calculation amount during the later-stage acquisition of the target prediction result can be reduced, and the calculation efficiency can be improved.
As an optional implementation manner, as in the foregoing method, the step S104 of generating a target vector corresponding to a target session sequence includes the following steps:
step S701, mapping each target label to a target space to obtain a target sub-vector;
step S702, a target vector is obtained according to the target word vector of each target label in the conversation sequence.
After the target session sequence is obtained, each target tag in the target session sequence may be determined. The target sub-vector of each target label can be obtained by obtaining the Embedding representation of each target label by using a Word Embedding method.
After each target word vector is obtained, the target vectors can be obtained by adding the target word vectors.
As shown in fig. 8, according to an embodiment of another aspect of the present application, there is also provided a recommendation apparatus based on a conversation text, including:
the acquisition module 1 is used for acquiring a target session text of a target object;
the determining module 2 is configured to determine a first time sequence relationship of each target tag in the target session text, where the target tag is information corresponding to a target information type in the target session text, and the first time sequence relationship is used to indicate a front-back order of each target tag in the target session text;
the sequence module 3 is configured to obtain a target conversation sequence corresponding to the target conversation text according to the first time sequence relation of each target tag, where the target conversation sequence is used to indicate correlation between each target tag;
the generating module 4 is used for generating a target vector corresponding to the target session sequence;
and the result module 5 is used for inputting the target vector into a target model obtained by pre-training to obtain a target recommendation result of the target object.
Specifically, the specific process of implementing the functions of each module in the apparatus according to the embodiment of the present invention may refer to the related description in the method embodiment, and is not described herein again.
According to another embodiment of the present application, there is also provided an electronic apparatus including: as shown in fig. 9, the electronic device may include: the system comprises a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502 and the memory 1503 complete communication with each other through the communication bus 1504.
A memory 1503 for storing a computer program;
the processor 1501 is configured to implement the steps of the above-described method embodiments when executing the program stored in the memory 1503.
The bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
The embodiment of the present application further provides a computer-readable storage medium, where the storage medium includes a stored program, and when the program runs, the method steps of the above method embodiment are executed.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A recommendation method based on session text is characterized by comprising the following steps:
acquiring a target session text of a target object;
determining a first time sequence relation of each target label in the target session text, wherein the target label is information corresponding to a target information type in the target session text, and the first time sequence relation is used for indicating a front-back order of each target label in the target session text;
obtaining a target session sequence corresponding to the target session text according to the first time sequence relation of each target label, wherein the target session sequence is used for indicating the correlation among the target labels;
generating a target vector corresponding to the target session sequence;
and inputting the target vector into a target model obtained by pre-training to obtain a target recommendation result of the target object.
2. The method of claim 1, wherein before the inputting the target vector into a pre-trained target model to obtain a target recommendation of the target object, the method further comprises:
acquiring candidate session texts of at least two candidate objects in a candidate object cluster, wherein the candidate objects are in one-to-one correspondence with the candidate session texts;
generating a training session sequence and a testing session sequence for training according to the candidate session texts;
generating a training vector corresponding to the training session sequence, and generating a testing vector corresponding to the testing session sequence;
training a model to be trained through the training vectors to obtain a trained model;
and under the condition that the test precision obtained by testing the trained model through the test vector reaches the preset requirement, taking the trained model as the target model.
3. The method of claim 2, wherein generating a training session sequence and a testing session sequence for training from the candidate session texts comprises:
for each candidate session text, determining a second time sequence relation of each candidate tag in the candidate session text, and obtaining a candidate session sequence corresponding to the candidate session text according to the second time sequence relation of each candidate tag, wherein the candidate tag is information corresponding to the target information type in the candidate session text, and the candidate session sequence is used for indicating correlation among the candidate tags;
determining an association relation between each candidate tag in all the candidate session texts according to a second time sequence relation corresponding to each candidate session text;
determining at least one potential conversation sequence according to the association relationship, wherein the second time sequence relationship between the candidate tags in the potential conversation sequence is different from the second time sequence relationship of any candidate conversation sequence;
and determining the training session sequence and the testing session sequence from all the candidate session sequences and all the potential session sequences.
4. The method of claim 1, wherein the inputting the target vector into a pre-trained target model to obtain a target recommendation of the target object comprises:
inputting the target vector into the target model to obtain target high-level semantic information corresponding to the target vector;
matching candidate recommendation session sequences in all candidate session sequences according to the target high-level semantic information, wherein the similarity between the high-level semantic information of the candidate recommendation session sequences and the target high-level semantic information meets a preset similarity requirement;
screening target recommendation labels of a target quantity from the candidate recommendation labels of all the candidate recommendation session sequences, wherein the candidate recommendation labels are information which is located in the corresponding candidate recommendation session sequences and corresponds to the target information type;
and querying a target database to obtain the target recommendation result corresponding to the target recommendation label.
5. The method of claim 4, wherein the filtering out a target number of target recommendation tags from among the candidate recommendation tags of all the candidate recommendation session sequences comprises:
and selecting the target recommendation label from all the candidate recommendation labels according to the matching degree corresponding to each candidate recommendation session sequence and the third time sequence relation of each candidate recommendation label in each candidate recommendation session sequence, wherein the matching degree corresponding to the candidate recommendation session sequence where the target recommendation label is located is higher than or equal to the matching degree corresponding to the candidate recommendation session sequence where other candidate recommendation labels are located, and the time sequence of the target recommendation label is prior to the time sequence of other candidate recommendation labels in the same candidate recommendation session sequence.
6. The method of claim 3, wherein the determining at least one potential conversation sequence according to the association comprises:
obtaining label association structure information used for indicating the association relation among the candidate labels according to the association relation among the candidate labels;
and inquiring the conversation sequence in the label associated structure information through breadth-first search or depth-first search to obtain the potential conversation sequence.
7. The method of claim 1, wherein generating the target vector corresponding to the target session sequence comprises:
mapping each target label to a target space to obtain a target sub-vector;
and obtaining the target vector according to the target word vector of each target label in the conversation sequence.
8. A device for recommending a text based on a conversation, comprising:
the acquisition module is used for acquiring a target session text of a target object;
a determining module, configured to determine a first time-series relationship of each target tag in the target session text, where the target tag is information corresponding to a target information type in the target session text, and the first time-series relationship is used to indicate a front-back order of each target tag appearing in the target session text;
a sequence module, configured to obtain a target session sequence corresponding to the target session text according to the first time sequence relationship of each target tag, where the target session sequence is used to indicate a correlation between each target tag;
the generating module is used for generating a target vector corresponding to the target session sequence;
and the result module is used for inputting the target vector into a target model obtained by pre-training to obtain a target recommendation result of the target object.
9. An electronic device, comprising: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory is used for storing a computer program;
the processor, when executing the computer program, implementing the method of any of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the storage medium comprises a stored program, wherein the program when executed performs the method of any of the preceding claims 1 to 7.
CN202110859016.8A 2021-07-28 2021-07-28 Recommendation method and device based on session text, electronic equipment and storage medium Active CN113641897B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110859016.8A CN113641897B (en) 2021-07-28 2021-07-28 Recommendation method and device based on session text, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110859016.8A CN113641897B (en) 2021-07-28 2021-07-28 Recommendation method and device based on session text, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113641897A true CN113641897A (en) 2021-11-12
CN113641897B CN113641897B (en) 2024-04-19

Family

ID=78418654

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110859016.8A Active CN113641897B (en) 2021-07-28 2021-07-28 Recommendation method and device based on session text, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113641897B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116775815A (en) * 2022-03-07 2023-09-19 腾讯科技(深圳)有限公司 Dialogue data processing method and device, electronic equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105045907A (en) * 2015-08-10 2015-11-11 北京工业大学 Method for constructing visual attention-label-user interest tree for personalized social image recommendation
CN109299321A (en) * 2018-08-31 2019-02-01 出门问问信息科技有限公司 A kind of song recommended method and device
CN109977215A (en) * 2019-03-29 2019-07-05 百度在线网络技术(北京)有限公司 Sentence recommended method and device based on association point of interest
CN110188272A (en) * 2019-05-27 2019-08-30 南京大学 A kind of community's question and answer web site tags recommended method based on user context
CN111667067A (en) * 2020-05-28 2020-09-15 平安医疗健康管理股份有限公司 Recommendation method and device based on graph neural network and computer equipment
CN112115249A (en) * 2020-09-27 2020-12-22 支付宝(杭州)信息技术有限公司 Statistical analysis and result display method and device for user intention
CN112580368A (en) * 2020-12-25 2021-03-30 网易(杭州)网络有限公司 Method, device, equipment and storage medium for recognizing intention sequence of conversation text
CN112733018A (en) * 2020-12-31 2021-04-30 哈尔滨工程大学 Session recommendation method based on graph neural network GNN and multi-task learning
CN112989209A (en) * 2021-05-10 2021-06-18 腾讯科技(深圳)有限公司 Content recommendation method, device and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105045907A (en) * 2015-08-10 2015-11-11 北京工业大学 Method for constructing visual attention-label-user interest tree for personalized social image recommendation
CN109299321A (en) * 2018-08-31 2019-02-01 出门问问信息科技有限公司 A kind of song recommended method and device
CN109977215A (en) * 2019-03-29 2019-07-05 百度在线网络技术(北京)有限公司 Sentence recommended method and device based on association point of interest
CN110188272A (en) * 2019-05-27 2019-08-30 南京大学 A kind of community's question and answer web site tags recommended method based on user context
CN111667067A (en) * 2020-05-28 2020-09-15 平安医疗健康管理股份有限公司 Recommendation method and device based on graph neural network and computer equipment
CN112115249A (en) * 2020-09-27 2020-12-22 支付宝(杭州)信息技术有限公司 Statistical analysis and result display method and device for user intention
CN112580368A (en) * 2020-12-25 2021-03-30 网易(杭州)网络有限公司 Method, device, equipment and storage medium for recognizing intention sequence of conversation text
CN112733018A (en) * 2020-12-31 2021-04-30 哈尔滨工程大学 Session recommendation method based on graph neural network GNN and multi-task learning
CN112989209A (en) * 2021-05-10 2021-06-18 腾讯科技(深圳)有限公司 Content recommendation method, device and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
崔超然;马军;: "一种结合相关性和多样性的图像标签推荐方法", 计算机学报, no. 03, 15 March 2013 (2013-03-15) *
彭杰;石永革;高胜保;: "基于对话内容的交互型文本会话主题挖掘", 电信科学, no. 09, 20 September 2016 (2016-09-20) *
窦羚源;王新华;: "一种基于时间和标签上下文的协同过滤推荐算法", 太原理工大学学报, no. 06, 15 November 2015 (2015-11-15) *
郭亮: "面向Twitter的个性化信息推荐技术研究", 面向TWITTER的中国优秀硕士学位论文全文数据库 (信息科技辑), 15 April 2018 (2018-04-15) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116775815A (en) * 2022-03-07 2023-09-19 腾讯科技(深圳)有限公司 Dialogue data processing method and device, electronic equipment and storage medium
CN116775815B (en) * 2022-03-07 2024-04-26 腾讯科技(深圳)有限公司 Dialogue data processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113641897B (en) 2024-04-19

Similar Documents

Publication Publication Date Title
CN110309427B (en) Object recommendation method and device and storage medium
CN109033229B (en) Question and answer processing method and device
CN107797984B (en) Intelligent interaction method, equipment and storage medium
CN108810642B (en) Bullet screen display method and device and electronic equipment
CN110717099B (en) Method and terminal for recommending film
US20150379087A1 (en) Apparatus and method for replying to query
CN107305611B (en) Method and device for establishing model corresponding to malicious account and method and device for identifying malicious account
CN110321291A (en) Test cases intelligent extraction system and method
CN112417207B (en) Video recommendation method, device, equipment and storage medium
CN109597874B (en) Information recommendation method, device and server
CN110597965B (en) Emotion polarity analysis method and device for article, electronic equipment and storage medium
CN110532469B (en) Information recommendation method, device, equipment and storage medium
CN110020022B (en) Data processing method, device, equipment and readable storage medium
CN111125521A (en) Information recommendation method, device, equipment and storage medium
CN110598109A (en) Information recommendation method, device, equipment and storage medium
CN110377733A (en) A kind of text based Emotion identification method, terminal device and medium
CN108319628B (en) User interest determination method and device
CN113641897B (en) Recommendation method and device based on session text, electronic equipment and storage medium
CN108710682B (en) Object recommendation method, device and equipment
CN116756576B (en) Data processing method, model training method, electronic device and storage medium
CN113869931A (en) Advertisement putting strategy determining method and device, computer equipment and storage medium
CN115730217A (en) Model training method, material recalling method and device
CN111353052B (en) Multimedia object recommendation method and device, electronic equipment and storage medium
CN112115300A (en) Text processing method and device, electronic equipment and readable storage medium
CN112818084A (en) Information interaction method, related device, equipment and computer readable medium

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
GR01 Patent grant
GR01 Patent grant