CN109033463B - Community question-answer content recommendation method based on end-to-end memory network - Google Patents
Community question-answer content recommendation method based on end-to-end memory network Download PDFInfo
- Publication number
- CN109033463B CN109033463B CN201811008620.4A CN201811008620A CN109033463B CN 109033463 B CN109033463 B CN 109033463B CN 201811008620 A CN201811008620 A CN 201811008620A CN 109033463 B CN109033463 B CN 109033463B
- Authority
- CN
- China
- Prior art keywords
- title
- vector
- memory
- layer
- matrix
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
- G06Q50/01—Social networking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
Abstract
The invention discloses a community question-answer content recommendation method based on an end-to-end memory network, which comprises the steps of firstly obtaining a title as a data set, preprocessing the data set, and dividing the data set into a training set, a verification set and a test set; then, establishing an end-to-end memory network model according to the data set; finally, a Stochastic Gradient Descent (SGD) optimization model with AdaGrad update rules is used.
Description
Technical Field
The invention relates to the field of content recommendation, in particular to a community question and answer content recommendation method based on an end-to-end memory network.
Background
The network community question-answering is a main use platform for solving problems and sharing knowledge and experience of people at present, for example, knowing that the information range is wide, but not everyone is interested, so that the content which the user is interested in needs to be recommended to the user, and the viscosity of the user is increased.
Disclosure of Invention
The invention aims to solve one or more defects and provides a community question and answer content recommendation method based on an end-to-end memory network.
In order to realize the purpose, the technical scheme is as follows:
a community question-answer content recommendation method based on an end-to-end memory network comprises the following steps:
s1: acquiring a title as a data set, preprocessing the data set, and dividing the data set into a training set, a verification set and a test set;
s2: establishing an end-to-end memory network model according to the data set;
s3: a random gradient descent (SGD) optimization model with AdaGrad update rules was used.
Preferably, the data set of step S1 is divided into training set, verification set and test set on average.
Preferably, the title in step S1 is a content title of the user browsing and historical behavior in the community question and answer.
Preferably, the end-to-end memory model comprises a single layer model and a multilayer model; wherein the single-layer model comprises a memory component, an input component, and an output component;
wherein the memory component represents: title set D ═ x for storing historical behaviors1,x2...xnWill each word w using a matrix A of size dim x V |ij∈xiMemory vector { a) embedded into d-dimensionijIn such a thatij=Awij. Entire sentence set { xiUsing matrix A to convert into memory vector of dimension d { a }i};
The input component represents: the forward browsing title q is converted into vector B by B matrix, B is calculated and a is memorizediThe matching degree between the two formulas is as follows: p is a radical ofi=Softmax(bTai) (ii) a Wherein Softmax (z)i)=eZi/∑jeZjP is the probability vector on the input;
the output component represents: title set of historical behavior D ═ { x ═ x1,x2...xnD, using a matrix C to convert into an output vector C with dimension diThe output o is the output vector ciAnd probability vector weighted sum, formula:
final prediction f ═ Softmax (W (o + b));
the multi-layer model is that the header q of the input element is the sum of the previous-hop input header b and the output o, i.e. the input of the next layer k +1 is the output o from the layer kkAnd input bkThe formula: bk+1=ok+bk;
Wherein each layer has its own embedded matrix ak,CkFor embedding input { xi}。
Preferably, the multi-layer model further comprises a sentence representation, each sentence xi={xi1,xi2,...,xinEmbed each word and sum the resulting vectors, and add a time representation, the word vector being a 0-1 vector of length V, such that ai=∑jAxij+TA(i) (ii) a Wherein T isA(i) Is a special matrix T encoding time informationARow i of (1); all in oneMatrix Tc, ci ═ Σ for output embeddingjCxij+TC(i)。,TAAnd TCAre learned during training.
Preferably, the multilayer model further comprises word similarity, and in the currently browsed title q in the first layer, keywords with similarity exceeding 0.8 in q in memory are added into q by using the word similarity, so that the situation that the weight of the titles with different words is too low while the keywords are similar or similar to the keywords in q in memory is avoided;
selecting keywords of the title being browsed from a corpus consisting of all preprocessed titles, and carrying out similarity calculation between every two words and the rest keywords to calculate a formula:
Preferably, the evaluation criteria for the model are accuracy, recall, and F1 score.
Compared with the prior art, the invention has the beneficial effects that:
the end-to-end memory network can remember a large amount of user behaviors and add time, so that the interest prediction of the user is more accurate and reliable. And reducing supervision items by adopting end-to-end training. The attention mechanism is included, so that different titles have different weights, the predicted interest points can be sequenced, the recommended emphasis points are different, the interest points with large weights are ranked highly, and the recommended content of the interest points is more than that of other interest points. And the word similarity is added, so that the prediction is more accurate.
Drawings
FIG. 1 is a flow chart of the present invention.
Detailed Description
The drawings are for illustrative purposes only and are not to be construed as limiting the patent;
the invention is further illustrated below with reference to the figures and examples.
Example 1
Referring to fig. 1, a community question-answer content recommendation method based on an end-to-end memory network includes the following steps:
s1: acquiring a title as a data set, preprocessing the data set, and dividing the data set into a training set, a verification set and a test set;
s2: establishing an end-to-end memory network model according to the data set;
s3: a random gradient descent (SGD) optimization model with AdaGrad update rules was used.
For example, it is known that questions and their answers are more likely to be shared than known in hundredths, rather than being answered. Each question is short and descriptive, so the question is the title. All the acquired titles need to be preprocessed, each title is firstly subjected to word segmentation, stop words and special characters such as 'a' and 'a' are then deleted, and because many 'reasons', 'how' and 'experiences' in questions are known, the words are also deleted, so that the situation that the weight of common irrelevant words is too large, required key words are covered, the maximum length of sentences is set to be 50, and the exceeding contents need to be cut is avoided. The data set is evenly divided into a training set, a validation set and a test set.
The method comprises the steps of selecting titles of historical behaviors of a user as memory in a model, wherein the historical behaviors comprise removing the latest browsed titles and agreeing titles which are browsed, answering the titles, paying attention to the titles, selecting the latest 5 titles according to time, and recommending the content related to the latest interest of the user, so that the selected titles are sorted according to the operation time of the user to form a title set D, the test effect is better when the embedding dimension of each title is 300-500-.
In this embodiment, the end-to-end memory model includes a single-layer model and a multi-layer model; wherein the single-layer model comprises a memory component, an input component, and an output component;
wherein the memory component represents: title set D ═ x for storing historical behaviors1,x2...xnUsing a matrix of size dim x V |)A will each word wij∈xiMemory vector { a) embedded into d-dimensionijIn such a thatij=Awij. Entire sentence set { xiUsing matrix A to convert into memory vector of dimension d { a }i};
The input component represents: the forward browsing title q is converted into vector B by B matrix, B is calculated and a is memorizediThe matching degree between the two formulas is as follows: p is a radical ofi=Softmax(bTai) (ii) a Wherein Softmax (z)i)=eZi/∑jeZjP is the probability vector on the input;
the output component represents: title set of historical behavior D ═ { x ═ x1,x2...xnD, using a matrix C to convert into an output vector C with dimension diThe output o is the output vector ciAnd probability vector weighted sum, formula:
final prediction f ═ Softmax (W (o + b));
the multi-layer model is that the header q of the input element is the sum of the previous-hop input header b and the output o, i.e. the input of the next layer k +1 is the output o from the layer kkAnd input bkThe formula: bk+1=ok+bk;
Wherein each layer has its own embedded matrix ak,CkFor embedding input { xi}。
In this embodiment, the multi-layer model further includes sentence representations, each sentence xi={xi1,xi2,...,xinEmbed each word and sum the resulting vectors, and add a time representation, the word vector being a 0-1 vector of length V, such that ai=∑jAxij+TA(i) (ii) a Wherein T isA(i) Is a special matrix T encoding time informationARow i of (1); similarly, the matrix Tc, ci ═ Σ for output embeddingjCxij+TC(i)。,TAAnd TCAre all in the training periodAnd (4) learning.
Wherein each matrix such as A, B, C, W is also obtained by training, and the first jump matrix A is used for reducing the number of parameters for convenient training1B, last hop matrix WT=CKThe other memory matrix A of each hop is the same as the output matrix C of the previous hop, namely Ak+1=CkFor the same reason, the matrix T for time representationA,TCThe parameters are reduced in the same way.
In this embodiment, the multi-layer model further includes word similarity, and in the currently-viewed title q in the first layer, the keyword whose similarity in memory with that in q exceeds 0.8 is added to q by using the word similarity, so as to avoid that the title weight which is the same as or similar to that in q in memory but different from words is too low;
selecting keywords of the title being browsed from a corpus consisting of all preprocessed titles, and carrying out similarity calculation between every two words and the rest keywords to calculate a formula:
And the predicted result of the model is used as the nearest interest point of the user, and for each browsing title, the top 5 predicted interest points are selected according to the ranking. And taking the interest points as tags, recommending hot content corresponding to the tags, for example, if a predicted result tag comprises a friend, recommending the hot content with the friend tag.
In this embodiment, the evaluation criteria of the model are accuracy, recall, and F1 score.
It should be understood that the above-described embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the claims of the present invention.
Claims (4)
1. A community question-answer content recommendation method based on an end-to-end memory network is characterized by comprising the following steps:
s1: acquiring a title as a data set, preprocessing the data set, and dividing the data set into a training set, a verification set and a test set;
s2: establishing an end-to-end memory network model according to the data set;
s3: using a Stochastic Gradient Descent (SGD) optimization model with AdaGrad update rules;
the end-to-end memory model comprises a single-layer model and a multi-layer model; wherein the single-layer model comprises a memory component, an input component, and an output component;
wherein the memory component represents: title set D ═ x for storing historical behaviors1,x2...xnWill each word w using a matrix A of size dim x V |ij∈xiMemory vector { a) embedded into d-dimensionijIn such a thatij=AwijEntire sentence set { xiUsing matrix A to convert into memory vector of dimension d { a }i};
The input component represents: the forward browsing title q is converted into vector B by B matrix, B is calculated and a is memorizediThe matching degree between the two formulas is as follows: p is a radical ofi=Softmax(bTai) (ii) a Wherein Softmax (z)i)=eZi/∑jeZjP is the probability vector on the input;
the output component represents: title set of historical behavior D ═ { x ═ x1,x2...xnD, using a matrix C to convert into an output vector C with dimension diThe output o is the output vector ciAnd probability vector weighted sum, formula:
final prediction f ═ Softmax (W (o + b));
the multi-layer model is that the header q of the input element is the sum of the previous-hop input header b and the output o, i.e. the input of the next layer k +1 is the output o from the layer kkAnd input bkThe formula: bk+1=ok+bk;
Wherein each layer has its own embedded matrix ak,CkFor embedding input { xi};
The multi-layer model further includes sentence representations, each sentence xi={xi1,xi2,...,xinEmbed each word and sum the resulting vectors, and add a time representation, the word vector being a 0-1 vector of length V, such that ai=∑jAxij+TA(i) (ii) a Wherein T isA(i) Is a special matrix T encoding time informationARow i of (1); similarly, the matrix Tc, ci ═ Σ for output embeddingjCxij+TC(i),TAAnd TCAre all learned during training;
the multilayer model also comprises word similarity, and in the forward browsing title q at the first layer, the keywords with similarity exceeding 0.8 in the q in memory are added into the q by using the word similarity, so that the situation that the weight of the title with different words is too low while the keywords are the same as or similar to the words in the q in memory is avoided;
selecting keywords of the title being browsed from a corpus consisting of all preprocessed titles, and carrying out similarity calculation between every two words and the rest keywords to calculate a formula:
2. The method for recommending content of a community question and answer based on an end-to-end memory network as claimed in claim 1, wherein said data set of step S1 is averagely divided into a training set, a validation set and a test set.
3. The method as claimed in claim 1, wherein the title in step S1 is a content title of browsing and historical behavior of the user in the community question and answer.
4. The method as claimed in claim 1, wherein the evaluation criteria of the model are accuracy, recall rate and F1 score.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811008620.4A CN109033463B (en) | 2018-08-28 | 2018-08-28 | Community question-answer content recommendation method based on end-to-end memory network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811008620.4A CN109033463B (en) | 2018-08-28 | 2018-08-28 | Community question-answer content recommendation method based on end-to-end memory network |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109033463A CN109033463A (en) | 2018-12-18 |
CN109033463B true CN109033463B (en) | 2021-11-26 |
Family
ID=64625982
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811008620.4A Active CN109033463B (en) | 2018-08-28 | 2018-08-28 | Community question-answer content recommendation method based on end-to-end memory network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109033463B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110134771B (en) * | 2019-04-09 | 2022-03-04 | 广东工业大学 | Implementation method of multi-attention-machine-based fusion network question-answering system |
CN110188272B (en) * | 2019-05-27 | 2023-04-21 | 南京大学 | Community question-answering website label recommendation method based on user background |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106126596A (en) * | 2016-06-20 | 2016-11-16 | 中国科学院自动化研究所 | A kind of answering method based on stratification memory network |
CN106407316A (en) * | 2016-08-30 | 2017-02-15 | 北京航空航天大学 | Topic model-based software question and answer recommendation method and device |
CN108133038A (en) * | 2018-01-10 | 2018-06-08 | 重庆邮电大学 | A kind of entity level emotional semantic classification system and method based on dynamic memory network |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9063975B2 (en) * | 2013-03-15 | 2015-06-23 | International Business Machines Corporation | Results of question and answer systems |
US20140030688A1 (en) * | 2012-07-25 | 2014-01-30 | Armitage Sheffield, Llc | Systems, methods and program products for collecting and displaying query responses over a data network |
US20180165361A1 (en) * | 2016-12-09 | 2018-06-14 | At&T Intellectual Property I, L.P. | Mapping service and resource abstractions to network inventory graph database nodes and edges |
CN107330130B (en) * | 2017-08-29 | 2020-10-20 | 北京易掌云峰科技有限公司 | Method for realizing conversation robot recommending reply content to manual customer service |
-
2018
- 2018-08-28 CN CN201811008620.4A patent/CN109033463B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106126596A (en) * | 2016-06-20 | 2016-11-16 | 中国科学院自动化研究所 | A kind of answering method based on stratification memory network |
CN106407316A (en) * | 2016-08-30 | 2017-02-15 | 北京航空航天大学 | Topic model-based software question and answer recommendation method and device |
CN108133038A (en) * | 2018-01-10 | 2018-06-08 | 重庆邮电大学 | A kind of entity level emotional semantic classification system and method based on dynamic memory network |
Also Published As
Publication number | Publication date |
---|---|
CN109033463A (en) | 2018-12-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11275895B1 (en) | Generating author vectors | |
CN109299396B (en) | Convolutional neural network collaborative filtering recommendation method and system fusing attention model | |
CN108829822B (en) | Media content recommendation method and device, storage medium and electronic device | |
WO2019144892A1 (en) | Data processing method, device, storage medium and electronic device | |
US20160378863A1 (en) | Selecting representative video frames for videos | |
CN111708873A (en) | Intelligent question answering method and device, computer equipment and storage medium | |
CN112119388A (en) | Training image embedding model and text embedding model | |
EP2973038A1 (en) | Classifying resources using a deep network | |
CN112074828A (en) | Training image embedding model and text embedding model | |
CN112307164A (en) | Information recommendation method and device, computer equipment and storage medium | |
WO2020135642A1 (en) | Model training method and apparatus employing generative adversarial network | |
CN109033463B (en) | Community question-answer content recommendation method based on end-to-end memory network | |
WO2011111038A2 (en) | Method and system of providing completion suggestion to a partial linguistic element | |
CN112148831B (en) | Image-text mixed retrieval method and device, storage medium and computer equipment | |
CN112131345B (en) | Text quality recognition method, device, equipment and storage medium | |
CN110222254A (en) | Course recommended method, device, equipment and computer readable storage medium | |
CN112633690A (en) | Service personnel information distribution method, service personnel information distribution device, computer equipment and storage medium | |
CN112380421A (en) | Resume searching method and device, electronic equipment and computer storage medium | |
CN111159242A (en) | Client reordering method and system based on edge calculation | |
Sabnis et al. | Course recommendations in moocs: Techniques and evaluation | |
CN113987161A (en) | Text sorting method and device | |
CN113934835A (en) | Retrieval type reply dialogue method and system combining keywords and semantic understanding representation | |
CN113505307A (en) | Social network user region identification method based on weak supervision enhancement | |
CN115827990B (en) | Searching method and device | |
CN112685656A (en) | Label recommendation method and electronic equipment |
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 |