CN111291184B - Expression recommendation method, device, equipment and storage medium - Google Patents

Expression recommendation method, device, equipment and storage medium Download PDF

Info

Publication number
CN111291184B
CN111291184B CN202010067850.9A CN202010067850A CN111291184B CN 111291184 B CN111291184 B CN 111291184B CN 202010067850 A CN202010067850 A CN 202010067850A CN 111291184 B CN111291184 B CN 111291184B
Authority
CN
China
Prior art keywords
emotion
expression
user
expressions
text content
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.)
Active
Application number
CN202010067850.9A
Other languages
Chinese (zh)
Other versions
CN111291184A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010067850.9A priority Critical patent/CN111291184B/en
Publication of CN111291184A publication Critical patent/CN111291184A/en
Application granted granted Critical
Publication of CN111291184B publication Critical patent/CN111291184B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/35Clustering; Classification
    • 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/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • 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
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0233Character input methods
    • G06F3/0237Character input methods using prediction or retrieval techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Abstract

The application discloses a method, a device, equipment and a storage medium for recommending expressions, wherein after text content input by a user is acquired, the text content is analyzed and processed to acquire the expressions expressed by the text content and the emotion scores, when the emotion scores are larger than a preset score threshold, at least one expression corresponding to the expressions is acquired, and then the at least one expression is recommended to the user. Based on emotion understanding in the characters, the emotion expressed by the user can be judged, after the emotion reaches a certain degree, emotion association is carried out based on the emotion, emotion expression input by the user is enhanced, direct text content recommendation is avoided, the emotion content is enriched, and the emotion recommendation effect is improved.

Description

Expression recommendation method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computers, and in particular, to a method, an apparatus, a device, and a storage medium for recommending expressions in the field of data recommendation.
Background
With the development of internet technology, in the present text input scene (such as feed comments and chat conversations), more and more users are willing to use emoticons to enrich the expression of information, especially in social type Application (APP), the user communicates with other users through social APP, and the requirement of performing emotion recommendation according to the content input by the user is also accompanied by the communication of emotion (also called emotion package or emotion image).
In the process of inputting characters by a user, the system recommends proper expressions, so that the operation cost of the user for finding a picture can be reduced, at present, a common expression recommendation method is based on associative recommendation of keywords of the characters input by the user, namely, the user inputs the characters such as 'today' weather true good 'and' weather 'true good', the system recommends expression pictures such as 'today' and 'weather' or directly takes the characters input by the user as search values, finds expressions related to the characters, and recommends the expressions to the user.
However, keyword association is performed based on the text input by the user, and the content related to the text is represented by the expression graph, so that the user has low using desire for the expression and poor expression recommendation effect.
Disclosure of Invention
The embodiment of the application provides an expression recommendation method, device, equipment and storage medium, which are used for solving the problems that in the prior art, keyword association is carried out based on characters input by a user, content related to the characters is represented by an expression graph, so that the use desire of the user for the expression is low, and the expression recommendation effect is poor.
In a first aspect, the present application provides a method for recommending expressions, including:
acquiring text content input by a user;
Analyzing and processing the text content to obtain emotion expressed by the text content and emotion scores;
when the emotion score is larger than a preset score threshold, acquiring at least one expression corresponding to the emotion;
recommending the at least one expression to the user.
In a possible implementation manner, the acquiring at least one expression corresponding to the emotion includes:
generalizing the emotion to obtain at least one emotion word representing the emotion;
and carrying out expression retrieval by adopting the at least one emotion word to obtain the at least one expression.
In one possible embodiment, the at least one mood word includes: synonyms representing the emotion, as well as hypernyms and hyponyms.
In a possible implementation manner, the performing expression retrieval by using the at least one emotion word to obtain the at least one expression includes;
according to the at least one emotion word, retrieving from an expression database to obtain a retrieval result, wherein the retrieval result comprises a plurality of expressions;
processing and scoring the expressions in the search result by adopting a semantic matching model, and acquiring the at least one expression with the score larger than a preset value in the search result; the semantic matching model is obtained based on deep learning training and can score the similarity degree between the semantic expressed in the expression and the at least one emotion word.
In a possible implementation manner, the performing expression retrieval by using the at least one emotion word to obtain the at least one expression includes;
according to the at least one emotion word, retrieving a first retrieval result from an emotion database, wherein the first retrieval result comprises a plurality of expressions;
processing and scoring the expressions in the first search result by adopting a semantic matching model, and acquiring at least one first expression with the score larger than a first preset value in the first search result; the semantic matching model is obtained based on deep learning training and can score the similarity degree between the semantic expressed in the expression and the at least one emotion word;
according to the first expression, searching from an expression database by adopting a picture similarity technology to obtain a second search result, wherein the second search result comprises a plurality of expressions;
analyzing the expressions in the second search result by adopting an emotion understanding technology, obtaining the emotion represented by each expression, and obtaining at least one second expression with similarity between the emotion represented in the second search result and the emotion expressed by the text content being larger than a second preset value;
And obtaining the at least one expression recommended to the user according to the at least one first expression and the at least one second expression.
In one possible implementation manner, the analyzing the text content to obtain the emotion expressed by the text content and the emotion score includes:
inputting the text content into an emotion classification model for emotion classification processing to obtain the emotion expressed by the text content and the emotion score;
the emotion classification model is a model which is obtained based on deep learning training and can be used for carrying out emotion classification processing on characters to obtain emotion and corresponding emotion scores.
In one possible implementation manner, the acquiring text content input by the user includes:
receiving the text content input by a user and sent by a user terminal through an application client;
correspondingly, the recommending the at least one expression to the user comprises the following steps:
and sending the at least one expression to the user terminal for display through the application client.
In a second aspect, the present application provides a recommendation device for expressions, including:
the acquisition module is used for acquiring text content input by a user;
The processing module is used for analyzing and processing the text content to obtain emotion expressed by the text content and emotion scores;
the processing module is further configured to obtain at least one expression corresponding to the emotion when the emotion score is greater than a preset score threshold;
and the recommending module is used for recommending the at least one expression to the user.
In a possible implementation manner, the processing module is specifically configured to:
generalizing the emotion to obtain at least one emotion word representing the emotion;
and carrying out expression retrieval by adopting the at least one emotion word to obtain the at least one expression.
Optionally, the at least one mood word includes: synonyms representing the emotion, as well as hypernyms and hyponyms.
In one possible embodiment, the processing module is specifically configured to;
according to the at least one emotion word, retrieving from an expression database to obtain a retrieval result, wherein the retrieval result comprises a plurality of expressions;
processing and scoring the expressions in the search result by adopting a semantic matching model, and acquiring the at least one expression with the score larger than a preset value in the search result; the semantic matching model is obtained based on deep learning training and can score the similarity degree between the semantic expressed in the expression and the at least one emotion word.
In one possible embodiment, the processing module is specifically configured to;
according to the at least one emotion word, retrieving a first retrieval result from an emotion database, wherein the first retrieval result comprises a plurality of expressions;
processing and scoring the expressions in the first search result by adopting a semantic matching model, and acquiring at least one first expression with the score larger than a first preset value in the first search result; the semantic matching model is obtained based on deep learning training and can score the similarity degree between the semantic expressed in the expression and the at least one emotion word;
according to the first expression, searching from an expression database by adopting a picture similarity technology to obtain a second search result, wherein the second search result comprises a plurality of expressions;
analyzing the expressions in the second search result by adopting an emotion understanding technology, obtaining the emotion represented by each expression, and obtaining at least one second expression with similarity between the emotion represented in the second search result and the emotion expressed by the text content being larger than a second preset value;
and obtaining the at least one expression recommended to the user according to the at least one first expression and the at least one second expression.
In a possible implementation manner, the processing module is further specifically configured to:
inputting the text content into an emotion classification model for emotion classification processing to obtain the emotion expressed by the text content and the emotion score;
the emotion classification model is a model which is obtained based on deep learning training and can be used for carrying out emotion classification processing on characters to obtain emotion and corresponding emotion scores.
In one possible implementation manner, the acquiring module is specifically configured to:
receiving the text content input by a user and sent by a user terminal through an application client;
correspondingly, the recommendation module is specifically configured to:
and sending the at least one expression to the user terminal for display through the application client.
In a third aspect, the present application provides an electronic device, comprising:
at least one processor, a memory, and a communication interface to communicate with a user terminal;
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the recommended method of expression provided by any one of the first aspects.
In a fourth aspect, the present application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the recommendation method of the expression provided in any one of the first aspects.
In a fifth aspect, the present application further provides a data processing method, including:
acquiring emotion of a user expressed by text content based on the text content input by the user;
and recommending at least one expression to the user according to the emotion of the user.
One embodiment of the above application has the following advantages or benefits: after text content input by a user is acquired, analyzing and processing the text content to acquire emotion expressed by the text content and emotion scores, acquiring at least one emotion corresponding to the emotion when the emotion scores are larger than a preset score threshold, and recommending the at least one emotion to the user. Based on emotion understanding in the characters, the emotion expressed by the user can be judged, after the emotion reaches a certain degree, emotion association is carried out based on the emotion, emotion expression input by the user is enhanced, direct text content recommendation is avoided, the emotion content is enriched, and the emotion recommendation effect is improved.
Other effects of the above alternative will be described below in connection with specific embodiments.
Drawings
The drawings are for better understanding of the present solution and do not constitute a limitation of the present application. Wherein:
fig. 1 is an application scenario of a method for recommending expressions provided in the present application;
fig. 2 is a further application scenario of the expression recommendation method provided in the present application;
FIG. 3 is a flowchart of a first embodiment of a method for recommending expressions provided in the present application;
fig. 4 is a flowchart of a second embodiment of a recommendation method for expressions provided in the present application;
fig. 5 is a schematic structural diagram of a first embodiment of a recommending apparatus for expression provided in the present application;
fig. 6 is a block diagram of an electronic device for implementing a recommendation method for expressions according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present application to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The expression recommendation mode used in the current industry is based on simple keyword association of the user input characters, the user input characters are not understood, the recommendation effect is poor, and the use desire of the user is low. The result of expression recommendation has a larger optimization space. Specifically, the following problems exist in the existing schemes:
1) Part of the user's needs are not met. Under the sending scene of the text-to-picture, the user not only wants to convert the input text into a picture without any change, but also through investigation and analysis, 60% of users hope to enhance the emotion of the input text by the expression in the comment input scene (for example, the user inputs 'weather really good to today' and then matches with an 'happy' expression picture to set off the emotion of the user), and the expression association of keywords based on the input text is difficult to achieve;
2) The information is repeated. The characters input by the user are the same as the characters on the system recommended expression, namely the input characters are 'weather true good to today', and the characters on the expression can be 'weather true good to today', so that when the images and texts are sent together, the high repetition of the expression information content can be caused, and the expression of the user information is not enriched;
3) The surprise is lacking. Based on the expression recommendation in the text input by the user, the user has a relatively stable result expectation and lacks unexpected result recommendation, so that the product is mediocre;
4) The recommendation frequency is high, and users are disturbed. Any trigger control is not performed on the expression recommendation, any input content can be used for recommending expressions, the display frequency is high, the user is disturbed, and the user experience is poor.
In summary, in the scheme of performing expression recommendation based on association word association of text input by a user, the recommended expression is also content related to the text, so that the user has low using desire and poor expression recommendation effect.
Based on the problems in the prior art, the application provides a method for recommending expressions, which is a new idea in view of the fact that the meaning specifically expressed in the characters and the emotion of the user are not analyzed in the current mode of recommending only according to the characters, and the method is used for analyzing and processing text content input by the user to obtain the emotion of the user, and recommending the expressions according to the emotion when the emotion reaches a certain degree. Specifically, the emotion expressed by the user may be obtained based on the text content input by the user, and then one or more emotions may be recommended to the user according to the emotion. The recommended words adopted in the specific recommending process are synonyms or near-meaning words and the like which are obtained according to emotion generalization processing and represent the emotion, so that the problem that expressions obtained by directly adopting keywords in text contents for searching are repeated only by characters is avoided, and the expression recommending effect is improved.
Fig. 1 is an application scenario of a method for recommending expressions provided in the present application; as shown in fig. 1, the expression recommendation method provided by the present application may be implemented on a user terminal, that is, the user terminal device stores an expression database in advance and has a data processing function, and after a user inputs text content, the user terminal analyzes the text content by itself, and performs expression recommendation according to the scheme of the present application.
Fig. 2 is a further application scenario of the expression recommendation method provided in the present application; as shown in fig. 2, in this scenario, the expression recommendation method provided in the present application is applied between a user terminal and a server, where a user inputs text content through the user terminal, and after receiving the text content, the server performs analysis processing, recalls related expressions, and recommends the text content to the user through the user terminal.
In at least two of the above scenarios, the user terminal may be a mobile phone, a notebook computer, a personal computer PC or the like of the user, and an intelligent terminal capable of installing an Application (APP) to perform text content input, and the server refers to a device capable of performing data analysis processing and including searching in other storage devices or storing an expression database in itself, for example, a cloud server, an input method server, a server of an application program, and the like, which is not limited in this scheme.
The following describes a recommendation method of expressions provided in the present application through a specific embodiment.
Fig. 3 is a flowchart of an embodiment one of a method for recommending expressions provided in the present application, and as shown in fig. 3, the method for recommending expressions provided in the present embodiment specifically includes the following steps:
s101: text content input by a user is acquired.
In this step, the expression recommendation is generally applied to the process that the user communicates with other users through characters, and for the execution subject for performing expression recommendation, the text content input by the user needs to be acquired first, and the text content input by the user may be specifically input by directly editing characters or by inputting voice, and the system converts the voice into text after acquiring the voice, which is not limited in this scheme. In the specific time limit of the scheme, the user can input the text in the pre-installed APP, can also input the text in the self-installed social APP, can specifically edit the text or input the voice by adopting a system input method or other input methods capable of downloading and installing, and finally obtains the text in the input content, and the method is not limited.
If the text content is in the first scene, the text content input by the user can be directly acquired, and if the text content is in the second scene, the server needs to acquire the text content input by the user through an application client such as an application program or an input method, namely the user terminal sends the text content to the server through an interface provided by the application client.
S102: and analyzing and processing the text content to obtain emotion expressed by the text content and emotion scores.
In this step, the text contents need to be analyzed, and the emotion expressed by the text contents and the degree of the emotion input by the user are analyzed, for example: "today weather is good" indicates that the emotion of the user is relatively positive, and "today weather is good" indicates that the emotion of the user is general, and the state is relatively common.
The condition and emotion score expressed in the text content can be obtained by means of semantic understanding, and the text content can be analyzed by means of a model for emotion classification of a special user.
In a specific implementation of the scheme, the obtained text content can be input into an emotion classification model for emotion classification processing, and the model can directly input the emotion expressed in the text content and the score of the emotion.
The emotion classification model is a model capable of performing emotion classification processing on characters to obtain emotion and corresponding emotion scores, and can be generally obtained based on deep learning training. Specifically, a server or a device for training a model constructs a massive query-project_tag corpus by grabbing and cleaning; the corpus is combined with deep learning models such as textcnn, bert and the like to produce emotion classification models with multiple classifications, for example, emotion classification models capable of carrying out 25 emotion classifications can be obtained, and the emotions comprise: happy, angry, sad … …, etc. In this scenario application, only the text content (i.e., query) entered by the user needs to be fed into the emotion classification model, which can output the emotion classification of the text content as well as the emotion score.
S103: and when the emotion score is larger than a preset score threshold value, acquiring at least one expression corresponding to the emotion.
In this step, whether the emotion is recommended or not is determined according to the emotion degree, and when the emotion degree represented by the text input by the user is smaller than a certain value, the emotion recommendation process is not performed, that is, after the emotion of the user is acquired in the scheme, the emotion is required to meet a certain condition to perform the emotion recommendation, and whether the user needs to use the emotion is further determined.
In a specific implementation manner, when the emotion score is greater than a preset score threshold, the emotion of the user is considered to be reached to a certain degree, and at this time, the emotion can be further expressed by means of the expression, and then the emotion recommendation process is performed. Unlike the prior art, the method does not perform expression retrieval according to text content, but obtains at least one expression capable of representing the emotion according to the obtained emotion (namely emotion classification) to perform recommendation.
Specifically, when the emotion is happy, all expressions representing happiness can be retrieved from the expression database, and then ordered according to a certain rule, wherein one or more of the expressions ranked in the front are selected as expressions to be recommended to the user. The ordering rule can be that the similarity degree of the expression and the emotion is from big to small, the frequency of the expression being used is from high to low, or the expression creating time is ordered from near to far, and the scheme is not limited.
S104: at least one expression is recommended to the user.
In the step, the obtained at least one expression is sent to the user terminal or is directly displayed on the user terminal to carry out expression recommendation.
In the method for recommending expressions provided by the embodiment, after text content input by a user is acquired, the text content is analyzed and processed to obtain the emotion expressed by the text content and the emotion score, when the emotion score is greater than a preset score threshold, at least one expression corresponding to the emotion is acquired, and then the at least one expression is recommended to the user. Based on emotion understanding in the characters, the emotion expressed by the user can be judged, after the emotion reaches a certain degree, emotion association is carried out based on the emotion, emotion expression input by the user is enhanced, direct text content recommendation is avoided, the emotion content is enriched, and the emotion recommendation effect is improved.
Fig. 4 is a flowchart of a second embodiment of the expression recommendation method provided in the present application, and as shown in fig. 4, the expression recommendation method provided in the present embodiment specifically includes the following steps:
s201: and receiving text content input by a user and sent by the user terminal through the application client.
In the scheme, the execution subject is a server, and the server acquires text content input by a user through an application client installed on a user terminal. At the user terminal side, after the user terminal acquires text content input by the user, the text content is sent to the server through an application client, wherein the application client can be a client of a social software application, a client of an input method application and the like.
S202: inputting the text content into an emotion classification model for emotion classification processing to obtain emotion expressed by the text content and emotion scores.
In this step, the server acquires an emotion classification model in advance, inputs the received text content into the emotion classification model, and outputs a corresponding emotion classification and emotion score.
For example: the user inputs the words of "weather today" to "that is, the text content is" weather today "to" and judges that the emotion is "forward" > > "happy".
Further, in the implementation of the scheme, the judgment degree of emotion needs to be judged, namely the judgment step can be triggered, and only associative triggering is carried out on the input content with emotion.
Specifically, the emotion classification model outputs not only the emotion classification, but also the emotion correspondence score, i.e., the emotion score, which is a representation of the emotion intensity. The threshold is determined through a number of experiments and emotions exceeding the threshold are considered as emotion seed words that can be triggered by association. For example: the emotion score of the user input text of 'today weather really good to' is higher than the set emotion score threshold value, the system judges that the text is suitable for making expression recommendation, a subsequent processing process is carried out, and otherwise, the expression recommendation is not carried out.
S203: and generalizing the emotion to obtain at least one emotion word representing the emotion.
In this step, the generalizing the at least one mood word includes: synonyms representing the emotion, as well as hypernyms and hyponyms.
In order to meet the requirement of recall diversification, each emotion (also called as emotion word, emotion seed word) generalizes synonyms similar to emotion semantics and upper and lower position words closely related to emotion words through word2vec, crf and other machine learning technologies, and a search word, namely at least one emotion word is reconstructed.
For example: the user inputs the words of 'today weather really good to' and the emotion words are 'happy', and the emotion words of 'nice', 'happy', 'excited' and the like are generalized through the 'happy'.
S204: and carrying out expression retrieval by adopting at least one emotion word to obtain at least one expression.
In the step, according to one or more emotion words obtained through generalization processing, carrying out expression retrieval on an expression database or a network to obtain a plurality of expressions matched with the emotion words, and then selecting at least one expression which is required to be recommended to a user from the expressions.
Specifically, this step at least includes the following implementation manners:
in a first implementation, all expressions representing happiness may be retrieved from an expression database and then ordered according to certain rules, with one or more of the top ranked expressions being selected as expressions to be recommended to the user. The ordering rule can be that the similarity degree of the expression and the emotion is from big to small, the frequency of the expression being used is from high to low, or the expression creating time is ordered from near to far, and the scheme is not limited.
According to a second implementation manner, retrieving from an expression database according to the at least one emotion word to obtain a retrieval result, wherein the retrieval result comprises a plurality of expressions, then processing and scoring the expressions in the retrieval result by adopting a semantic matching model, and obtaining the at least one expression with the score larger than a preset value in the retrieval result; wherein the semantic matching model is a model capable of scoring the similarity degree between the semantic expressed in the expression and the at least one emotion word, and can be generally obtained based on deep learning training.
In the method, a new search word (namely at least one emotion word) consisting of the generalized synonym and the hypernym is used for initiating search, a search result is recalled through a classical information search method (inverted index+BM 25), then the recall result is scored and ordered by using a semantic matching model based on deep learning, and one or more expressions with highest semantic similarity are selected as expressions recommended to a user.
According to a third implementation manner, according to the at least one emotion word, a first search result is obtained from an emotion database in a search mode, wherein the first search result comprises a plurality of expressions; processing and scoring the expressions in the first search result by adopting a semantic matching model, and acquiring at least one first expression with the score larger than a first preset value in the first search result; the semantic matching model is obtained based on deep learning training and can score the similarity degree between the semantic expressed in the expression and the at least one emotion word.
Then, according to the first expression, searching from an expression database by adopting a picture similarity technology to obtain a second search result, wherein the second search result comprises a plurality of expressions; and analyzing the expressions in the second search result by adopting an emotion understanding technology, obtaining the emotion represented by each expression, and obtaining at least one second expression with similarity between the emotion represented in the second search result and the emotion expressed by the text content being larger than a second preset value.
And finally, according to at least one first expression and at least one second expression, obtaining the at least one expression recommended to the user.
In the implementation manner, a new search word composed of the generalized synonym and the upper/lower level word is used for initiating search, a search result is recalled through a classical information search mode (inverted index+bm 25), then a semantic matching model based on deep learning is used for scoring and sorting the recall result, and one or more expressions with highest semantic similarity are selected as a first part of a returned result, namely at least one first expression is selected.
And then, based on the first expressions, adopting a picture similarity technology to initiate secondary searching in an expression database or a network, and searching out pictures similar to the first expressions, namely other expressions. And identifying the emotion of the text around the similar picture by using an emotion understanding technology, judging the matching degree of the emotion of the picture and the emotion of the text content input by the user, and taking one or more expressions with the highest emotion matching degree as a second part of a return result, namely the obtained at least one second expression. Finally, the result of integrating the first part and the second part is returned to the user, namely, at least one first expression and at least one second expression are collected to obtain at least one expression to be recommended to the user finally.
The method of selecting the last expression to be recommended according to the first expression and the second expression can select a part of each of the two sets, and can also reselect one or more expressions with the highest similarity with the emotion from the whole, so that the scheme is not limited.
For example: recalling emotion words such as happy, happy and excited, and then carrying out overall sorting and recommending to a user.
S205: and sending the at least one expression to the user terminal for display through the application client.
In this embodiment, since the user uses the user terminal, after the server obtains the expression to be recommended, the expression needs to be returned to the user terminal for display through the client of the application program, where the application program may be a client of a social software application, or may be a client of an input method application.
According to the expression recommendation method provided by the embodiments of the application, the emotion of the user is considered when the expression recommendation is carried out, the emotion can be accurately judged based on emotion understanding of the input text content, and then the emotion is mapped, so that the emotion expression input by the user is enhanced.
The medium recommendation mode can enrich information expression, and in specific implementation, based on emotion expression association, the recommended expression content only carries out emotion association with the original input text, has larger difference with the original input text content, and does not have the condition of the same text, thereby enriching the information content of the user when in image-text transmission. And a trigger control link is newly added in the scheme, and the accurate recommendation of the expression graph can be realized by triggering and adjusting the judged emotion threshold value, so that the user is prevented from being disturbed too much, and the recommendation frequency is controlled.
In addition, the expression recommendation method provided by the application has surprise feeling, a specific user does not have stable expectation of results on expression recommendation, unexpected expression results are recommended more easily through accurate judgment of the emotion of the user, and product surprise feeling experience in the input process is increased.
Fig. 5 is a schematic structural diagram of a first embodiment of a recommending apparatus for expression provided in the present application. As shown in fig. 5, the expression recommending apparatus may be integrated in or implemented by an electronic device, and the electronic device may be a server, a cloud server, a computer, a mobile phone, or the like, which is not limited thereto. The expression recommendation device 10 includes:
an obtaining module 11, configured to obtain text content input by a user;
the processing module 12 is used for analyzing and processing the text content to obtain emotion expressed by the text content and emotion scores;
the processing module 12 is further configured to obtain at least one expression corresponding to the emotion when the emotion score is greater than a preset score threshold;
and a recommending module 13, configured to recommend the at least one expression to the user.
In a specific implementation, the processing module 12 is specifically configured to:
Generalizing the emotion to obtain at least one emotion word representing the emotion;
and carrying out expression retrieval by adopting the at least one emotion word to obtain the at least one expression.
Optionally, the at least one mood word includes: synonyms representing the emotion, as well as hypernyms and hyponyms.
In a specific implementation, the processing module 12 is specifically configured to;
according to the at least one emotion word, retrieving from an expression database to obtain a retrieval result, wherein the retrieval result comprises a plurality of expressions;
processing and scoring the expressions in the search result by adopting a semantic matching model, and acquiring the at least one expression with the score larger than a preset value in the search result; wherein the semantic matching model is a model capable of scoring a degree of similarity between the semantic expressed in the expression and the at least one mood word.
Optionally, the processing module 12 is specifically configured to;
according to the at least one emotion word, retrieving a first retrieval result from an emotion database, wherein the first retrieval result comprises a plurality of expressions;
processing and scoring the expressions in the first search result by adopting a semantic matching model, and acquiring at least one first expression with the score larger than a first preset value in the first search result; wherein the semantic matching model is a model capable of scoring a degree of similarity between the semantic expressed in the expression and the at least one mood word;
According to the first expression, searching from an expression database by adopting a picture similarity technology to obtain a second search result, wherein the second search result comprises a plurality of expressions;
analyzing the expressions in the second search result by adopting an emotion understanding technology, obtaining the emotion represented by each expression, and obtaining at least one second expression with similarity between the emotion represented in the second search result and the emotion expressed by the text content being larger than a second preset value;
and obtaining the at least one expression recommended to the user according to the at least one first expression and the at least one second expression.
Optionally, the processing module 12 is further specifically configured to:
inputting the text content into an emotion classification model for emotion classification processing to obtain the emotion expressed by the text content and the emotion score;
the emotion classification model is a model which is obtained based on deep learning training and can be used for carrying out emotion classification processing on characters to obtain emotion and corresponding emotion scores.
Optionally, the acquiring module 11 is specifically configured to:
receiving the text content input by a user and sent by a user terminal through an application client;
Correspondingly, the recommendation module 13 is specifically configured to:
and sending the at least one expression to the user terminal for display through the application client.
The expression recommending device provided in the above embodiments is used for implementing the technical scheme of the data provider in any of the foregoing method embodiments, and the implementation principle and the technical effect are similar, and are not repeated herein.
It should be noted that, the division of the respective modules of the apparatus provided in the above embodiments is merely a division of logic functions, and may be integrated in whole or in part into one physical entity or may be physically separated. And these modules may all be implemented in software in the form of calls by the processing element; or can be realized in hardware; the method can also be realized in a form of calling software by a processing element, and the method can be realized in a form of hardware by a part of modules. For example, the processing module may be a processing element that is set up separately, may be implemented in a chip of the above-mentioned apparatus, or may be stored in a memory of the above-mentioned apparatus in the form of program codes, and the functions of the above-mentioned processing module may be called and executed by a processing element of the above-mentioned apparatus. The implementation of the other modules is similar. In addition, all or part of the modules can be integrated together or can be independently implemented. The processing element described herein may be an integrated circuit having signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in a software form.
Further, the application provides an electronic device, which may be a user device or a server.
Fig. 6 is a block diagram of an electronic device for implementing a recommendation method for expressions according to an embodiment of the present application. As shown in fig. 6, a block diagram of an electronic device according to a method for recommending expressions according to an embodiment of the present application is shown. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the application described and/or claimed herein.
As shown in fig. 6, the electronic device includes: one or more processors 101, memory 102, and interfaces for connecting the components, including high-speed and low-speed interfaces, and a communication interface 103 for communicating with other electronic devices. The various components are interconnected using different buses 104 and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In other embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple electronic devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). In fig. 6, a processor 101 is taken as an example.
Memory 102 is a non-transitory computer-readable storage medium provided herein. The memory stores instructions executable by the at least one processor to enable the at least one processor to execute the recommended method of any expression corresponding to the execution subject provided by the application. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the methods provided herein.
The memory 102 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may then store data, such as expression databases and the like. In addition, the memory 102 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 102 may optionally include memory located remotely from processor 1001, which may be connected to the data processing electronics via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Furthermore, the electronic device may further include: input means and output means. The processor 101, memory 102, input devices, and output devices may be connected by a bus or otherwise, for example in fig. 6.
The input device may receive input numeric or character information and generate key signal inputs related to user settings and function control of the data processing electronic device, such as a touch screen, keypad, mouse, trackpad, touchpad, pointer stick, one or more mouse buttons, trackball, joystick, and like input devices. The output means may include a display device, auxiliary lighting means (e.g., LEDs), tactile feedback means (e.g., vibration motors), and the like. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASIC (application specific integrated circuit), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
These computing programs (also referred to as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
Further, the application further provides a non-transitory computer readable storage medium storing computer instructions, where the computer instructions are configured to implement the technical solution provided by any of the foregoing method embodiments after being executed by a processor.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions disclosed in the present application can be achieved, and are not limited herein.
The above embodiments do not limit the scope of the application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (14)

1. A method for recommending expressions, comprising:
acquiring text content input by a user;
inputting the text content into an emotion classification model for emotion classification processing to obtain emotion expressed by the text content and emotion scores;
the emotion classification model is a model which is obtained based on deep learning training and can carry out emotion classification processing on characters to obtain emotion and corresponding emotion scores;
When the emotion score is larger than a preset score threshold, acquiring at least one expression corresponding to the emotion;
recommending the at least one expression to the user.
2. The method of claim 1, wherein the obtaining at least one expression corresponding to the emotion comprises:
generalizing the emotion to obtain at least one emotion word representing the emotion;
and carrying out expression retrieval by adopting the at least one emotion word to obtain the at least one expression.
3. The method of claim 2, wherein the at least one mood word comprises: synonyms representing the emotion, as well as hypernyms and hyponyms.
4. The method according to claim 2, wherein said employing said at least one emotional word for expression retrieval results in said at least one expression, comprising;
according to the at least one emotion word, retrieving from an expression database to obtain a retrieval result, wherein the retrieval result comprises a plurality of expressions;
processing and scoring the expressions in the search result by adopting a semantic matching model, and acquiring the at least one expression with the score larger than a preset value in the search result; wherein the semantic matching model is a model capable of scoring a degree of similarity between the semantic expressed in the expression and the at least one mood word.
5. The method according to claim 2, wherein said employing said at least one emotional word for expression retrieval results in said at least one expression, comprising;
according to the at least one emotion word, retrieving a first retrieval result from an emotion database, wherein the first retrieval result comprises a plurality of expressions;
processing and scoring the expressions in the first search result by adopting a semantic matching model, and acquiring at least one first expression with the score larger than a first preset value in the first search result; wherein the semantic matching model is a model capable of scoring a degree of similarity between the semantic expressed in the expression and the at least one mood word;
according to the first expression, searching from an expression database by adopting a picture similarity technology to obtain a second search result, wherein the second search result comprises a plurality of expressions;
analyzing the expressions in the second search result by adopting an emotion understanding technology, obtaining the emotion represented by each expression, and obtaining at least one second expression with similarity between the emotion represented in the second search result and the emotion expressed by the text content being larger than a second preset value;
And obtaining the at least one expression recommended to the user according to the at least one first expression and the at least one second expression.
6. The method according to any one of claims 1 to 5, wherein the obtaining text content entered by a user comprises:
receiving the text content input by a user and sent by a user terminal through an application client;
correspondingly, the recommending the at least one expression to the user comprises the following steps:
and sending the at least one expression to the user terminal for display through the application client.
7. An expression recommendation device, characterized by comprising:
the acquisition module is used for acquiring text content input by a user;
a processing module for
Inputting the text content into an emotion classification model for emotion classification processing to obtain emotion expressed by the text content and emotion scores;
the emotion classification model is a model which is obtained based on deep learning training and can carry out emotion classification processing on characters to obtain emotion and corresponding emotion scores;
the processing module is further configured to obtain at least one expression corresponding to the emotion when the emotion score is greater than a preset score threshold;
And the recommending module is used for recommending the at least one expression to the user.
8. The apparatus of claim 7, wherein the processing module is specifically configured to:
generalizing the emotion to obtain at least one emotion word representing the emotion;
and carrying out expression retrieval by adopting the at least one emotion word to obtain the at least one expression.
9. The apparatus of claim 8, wherein the at least one mood word comprises: synonyms representing the emotion, as well as hypernyms and hyponyms.
10. The apparatus of claim 8, wherein the processing module is specifically configured to;
according to the at least one emotion word, retrieving from an expression database to obtain a retrieval result, wherein the retrieval result comprises a plurality of expressions;
processing and scoring the expressions in the search result by adopting a semantic matching model, and acquiring the at least one expression with the score larger than a preset value in the search result; wherein the semantic matching model is a model capable of scoring a degree of similarity between the semantic expressed in the expression and the at least one mood word.
11. The apparatus of claim 8, wherein the processing module is specifically configured to;
According to the at least one emotion word, retrieving a first retrieval result from an emotion database, wherein the first retrieval result comprises a plurality of expressions;
processing and scoring the expressions in the first search result by adopting a semantic matching model, and acquiring at least one first expression with the score larger than a first preset value in the first search result; wherein the semantic matching model is a model capable of scoring a degree of similarity between the semantic expressed in the expression and the at least one mood word;
according to the first expression, searching from an expression database by adopting a picture similarity technology to obtain a second search result, wherein the second search result comprises a plurality of expressions;
analyzing the expressions in the second search result by adopting an emotion understanding technology, obtaining the emotion represented by each expression, and obtaining at least one second expression with similarity between the emotion represented in the second search result and the emotion expressed by the text content being larger than a second preset value;
and obtaining the at least one expression recommended to the user according to the at least one first expression and the at least one second expression.
12. The apparatus according to any one of claims 7 to 11, wherein the acquisition module is specifically configured to:
Receiving the text content input by a user and sent by a user terminal through an application client;
correspondingly, the recommendation module is specifically configured to:
and sending the at least one expression to the user terminal for display through the application client.
13. An electronic device, comprising:
at least one processor, a memory, and a communication interface to communicate with a user terminal;
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the recommended method of expression of any one of claims 1 to 6.
14. A non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the expression recommendation method of any one of claims 1 to 6.
CN202010067850.9A 2020-01-20 2020-01-20 Expression recommendation method, device, equipment and storage medium Active CN111291184B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010067850.9A CN111291184B (en) 2020-01-20 2020-01-20 Expression recommendation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010067850.9A CN111291184B (en) 2020-01-20 2020-01-20 Expression recommendation method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111291184A CN111291184A (en) 2020-06-16
CN111291184B true CN111291184B (en) 2023-07-18

Family

ID=71026543

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010067850.9A Active CN111291184B (en) 2020-01-20 2020-01-20 Expression recommendation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111291184B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148133B (en) * 2020-09-10 2024-01-23 北京百度网讯科技有限公司 Method, device, equipment and computer storage medium for determining recommended expression
CN113010784B (en) * 2021-03-17 2024-02-06 北京十一贝科技有限公司 Method, apparatus, electronic device and medium for generating prediction information

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110580899A (en) * 2019-10-12 2019-12-17 上海上湖信息技术有限公司 Voice recognition method and device, storage medium and computing equipment

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104063427A (en) * 2014-06-06 2014-09-24 北京搜狗科技发展有限公司 Expression input method and device based on semantic understanding
US9483768B2 (en) * 2014-08-11 2016-11-01 24/7 Customer, Inc. Methods and apparatuses for modeling customer interaction experiences
US9547763B1 (en) * 2015-03-31 2017-01-17 EMC IP Holding Company LLC Authentication using facial recognition
CN107423277A (en) * 2016-02-16 2017-12-01 中兴通讯股份有限公司 A kind of expression input method, device and terminal
EP3695583A4 (en) * 2017-10-13 2021-07-07 Midea Group Co., Ltd. Method and system for providing personalized on-location information exchange
CN108038102B (en) * 2017-12-08 2021-05-04 北京小米移动软件有限公司 Method and device for recommending expression image, terminal and storage medium
CN108549681B (en) * 2018-04-03 2023-09-01 Oppo广东移动通信有限公司 Data processing method and device, electronic equipment and computer readable storage medium
US20190325201A1 (en) * 2018-04-19 2019-10-24 Microsoft Technology Licensing, Llc Automated emotion detection and keyboard service
CN110321477B (en) * 2019-05-24 2022-09-09 平安科技(深圳)有限公司 Information recommendation method and device, terminal and storage medium
CN110297928A (en) * 2019-07-02 2019-10-01 百度在线网络技术(北京)有限公司 Recommended method, device, equipment and the storage medium of expression picture

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110580899A (en) * 2019-10-12 2019-12-17 上海上湖信息技术有限公司 Voice recognition method and device, storage medium and computing equipment

Also Published As

Publication number Publication date
CN111291184A (en) 2020-06-16

Similar Documents

Publication Publication Date Title
CN111221984B (en) Multi-mode content processing method, device, equipment and storage medium
CN112507715B (en) Method, device, equipment and storage medium for determining association relation between entities
US11200269B2 (en) Method and system for highlighting answer phrases
EP3876114A2 (en) Method for recommending a search term, method for training a target model, apparatus for recommending a search term, apparatus for training a target model, electronic device and program product
CN111563385B (en) Semantic processing method, semantic processing device, electronic equipment and medium
US10521484B1 (en) Typeahead using messages of a messaging platform
CN111967262A (en) Method and device for determining entity tag
US20210200813A1 (en) Human-machine interaction method, electronic device, and storage medium
KR102475235B1 (en) Method for resource sorting, method for training sorting model and corresponding apparatuses
CN110717340B (en) Recommendation method, recommendation device, electronic equipment and storage medium
CN113553414B (en) Intelligent dialogue method, intelligent dialogue device, electronic equipment and storage medium
CN111949814A (en) Searching method, searching device, electronic equipment and storage medium
CN111651578B (en) Man-machine conversation method, device and equipment
JP7139028B2 (en) Target content determination method, apparatus, equipment, and computer-readable storage medium
CN113746874B (en) Voice package recommendation method, device, equipment and storage medium
CN111984774B (en) Searching method, searching device, searching equipment and storage medium
CN111563198B (en) Material recall method, device, equipment and storage medium
CN111291184B (en) Expression recommendation method, device, equipment and storage medium
CN111382256B (en) Information recommendation method and device
CN111984775A (en) Question and answer quality determination method, device, equipment and storage medium
CN111523019B (en) Method, apparatus, device and storage medium for outputting information
CN111611364B (en) Intelligent response method, device, equipment and storage medium
CN111666417B (en) Method, device, electronic equipment and readable storage medium for generating synonyms
CN111385188A (en) Recommendation method and device for dialog elements, electronic equipment and medium
CN112148133B (en) Method, device, equipment and computer storage medium for determining recommended expression

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