CN110413888B - Book recommendation method and device - Google Patents
Book recommendation method and device Download PDFInfo
- Publication number
- CN110413888B CN110413888B CN201910672030.XA CN201910672030A CN110413888B CN 110413888 B CN110413888 B CN 110413888B CN 201910672030 A CN201910672030 A CN 201910672030A CN 110413888 B CN110413888 B CN 110413888B
- Authority
- CN
- China
- Prior art keywords
- book
- behavior
- different
- acquiring
- books
- 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
- 238000000034 method Methods 0.000 title claims abstract description 47
- 230000006399 behavior Effects 0.000 claims abstract description 326
- 239000013598 vector Substances 0.000 claims abstract description 93
- 238000012512 characterization method Methods 0.000 claims abstract description 59
- 238000012549 training Methods 0.000 claims abstract description 55
- 230000006870 function Effects 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 11
- 238000005070 sampling Methods 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 10
- 230000009471 action Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011478 gradient descent method Methods 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9535—Search customisation based on user profiles and personalisation
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention discloses a book recommendation method and device, comprising the following steps: acquiring different books corresponding to different user historic behaviors to obtain different book behavior doublets; acquiring a plurality of training samples, and respectively inputting the plurality of training samples into a preset model for training to obtain different characterization vectors; respectively storing book behavior tuples or books corresponding to a plurality of different characterization vectors meeting preset conditions into a similar database; acquiring historical data of a terminal, acquiring a target book behavior binary group or a target book from the similar database according to the historical data, and recommending books corresponding to the target book behavior binary group or the target book to the terminal. By adopting the means, through acquiring multiple behaviors and forming different book behavior binary groups, constraint is carried out from multiple dimensions during training, so that accuracy is higher during accurate recommendation, and user experience is improved.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a book recommendation method and device.
Background
Embedding policy describes the idea of an entity by using a vector, and the idea describes entity information by using a vector, which not only includes attribute information of the entity itself, but also includes association information between the entities and association information between the entity and a final target task.
In the prior art, when the embedded learning method of Listing-Embedding is used, a sequence of the tuples < Listing > clicked by a user is acquired, and then a learning vector representation is performed for each tuple < Listing >. Because the acquired behaviors are only clicked one, only vector representation of < Listing > can be finally learned, and the method is not suitable for scenes with various behaviors, for example, in a scene similar to a reading scene, the behaviors of a user comprise the behaviors of clicking (checking details), collecting, adding a bookshelf (shopping cart), commenting, reading (purchasing) books, reading and the like, and when the prior art is adopted for recommendation, the recommendation accuracy is lower because only a single behavior is considered.
Disclosure of Invention
The embodiment of the application provides a book recommendation method and device, which can realize book recommendation with higher accuracy.
A first aspect of an embodiment of the present application provides a book recommendation method, including:
acquiring different books corresponding to different user historic behaviors to obtain different book behavior doublets;
obtaining a plurality of training samples from the two groups of different book behaviors, and respectively inputting the plurality of training samples into a preset model for training to obtain different characterization vectors;
Obtaining the similarity between the different characterization vectors, and respectively storing book behavior tuples or books corresponding to the different characterization vectors meeting preset conditions into a similar database;
Acquiring historical data of a terminal, acquiring a target book behavior binary group or a target book from the similar database according to the historical data, and recommending books corresponding to the target book behavior binary group or the target book to the terminal.
Optionally, the acquiring a plurality of training samples from the different book behavior tuples includes:
acquiring a first book behavior binary group corresponding to a first preset behavior from the different book behavior binary groups, and acquiring a second book behavior binary group corresponding to a second preset behavior;
acquiring a first book corresponding to the first book behavior binary group and a second book corresponding to the second book behavior binary group, taking the first book as a global positive sample, and taking the second book as a global negative sample;
Acquiring a third book behavior binary group from the different book behavior binary groups, and acquiring at least two book behavior binary groups adjacent to the third book behavior binary group;
And taking the third book behavior tuple, the at least two book behavior tuples, the global positive sample, the global negative sample and a third book corresponding to the third book behavior tuple as training samples.
Optionally, the different token vectors include respective corresponding tuple token vectors of the different book behavior tuples, the similarity database includes a first database, the similarity between the different token vectors is obtained, and a plurality of respective corresponding book behavior tuples or books of the different token vectors satisfying a preset condition are stored in the similarity database, respectively, including:
and obtaining the similarity between the different binary group characterization vectors, and storing book behavior binary groups corresponding to the binary group characterization vectors with the similarity larger than a first preset threshold value into a first database.
Optionally, the historical data of the terminal includes a historical behavior of the terminal and a book corresponding to the historical behavior, the acquiring, according to the historical data, a target book behavior tuple or a target book from the similar database, and recommending the target book behavior tuple or the book corresponding to the target book to the terminal includes:
Obtaining a book behavior binary group of the terminal according to the historical behavior of the terminal and the books corresponding to the historical behavior;
And acquiring a target book behavior binary group from the first database, and recommending books corresponding to the target book behavior binary group to the terminal.
Optionally, the different characterization vectors include book characterization vectors corresponding to the different books respectively, the similarity database includes a second database, the similarity between the different characterization vectors is obtained, a plurality of book behavior tuples or books corresponding to the different characterization vectors meeting a preset condition are respectively stored in the similarity database, and the method includes:
and obtaining the similarity between the different book characterization vectors, and storing books corresponding to the book characterization vectors with the similarity larger than a second preset threshold value into a second database.
Optionally, the historical data of the terminal includes a historical book of the terminal, the acquiring, according to the historical data, a target book behavior tuple or a target book from the similar database, and recommending a book corresponding to the target book behavior tuple or the target book to the terminal includes:
and acquiring a target book from the second database, and recommending the target book to the terminal.
Further, after obtaining the different book behavior of the different user history behavior and the different book corresponding to the different user history behavior to obtain the different book behavior doublet, before obtaining a plurality of training samples from the different book behavior doublet, determining a training loss function, wherein the loss function is expressed as:
Wherein < a i,bi > represents a binary group; < a, b > in 2k represents the other 2k tuples within the tuple < a, b > window; bp in gp represents a global positive sample; bn in gn represents the global negative sample; < a n,bn > in ns represents a random sampling binary negative sample; θ represents an argument parameter.
A second aspect of an embodiment of the present application provides a book recommendation apparatus, including:
The acquisition module is used for acquiring different historical behaviors of the user and different books corresponding to the different historical behaviors of the user to obtain different book behavior doublets;
The training module is used for acquiring a plurality of training samples from the two groups of different book behaviors and respectively inputting the training samples into a preset model for training to obtain different characterization vectors;
the computing module is used for acquiring the similarity between the different characterization vectors and storing book behavior tuples or books respectively corresponding to the different characterization vectors meeting the preset conditions into a similar database;
And the recommending module is used for acquiring historical data of the terminal, acquiring a target book behavior binary group or a target book from the similar database according to the historical data, and recommending books corresponding to the target book behavior binary group or the target book to the terminal.
A third aspect of the embodiment of the present application provides a book recommendation server, including a processor, an input device, an output device, and a memory, where the processor, the input device, the output device, and the memory are connected to each other, and the memory is configured to store a computer program, where the computer program includes program instructions, and where the processor is configured to invoke the program instructions to execute the method.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium storing a computer program for execution by a processor to implement the method.
The embodiment of the application has at least the following beneficial effects:
According to the embodiment of the application, different book behavior tuples are obtained by obtaining different user historic behaviors and different books corresponding to the different user historic behaviors, and the training sample is obtained from the different book behavior tuples to train so as to obtain the tuple representation vectors respectively corresponding to the different book behavior tuples and the book representation vectors corresponding to the books; by calculating the similarity between different characterization vectors, intelligent recommendation can be performed when the historical behavior of the terminal and books corresponding to the historical behavior are acquired. Compared with single behaviors and tuples in the prior art, the method has the advantages that multiple behaviors are obtained and the tuples of different book behaviors are formed, constraint is conducted from multiple dimensions during training, accuracy is higher during accurate recommendation, and user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Wherein:
fig. 1 is a schematic diagram of a network architecture according to an embodiment of the present invention;
fig. 2 is a schematic view of a scenario of a book recommendation method according to an embodiment of the present invention;
fig. 3 is an interaction schematic diagram of a book recommendation method according to an embodiment of the present invention;
FIG. 4 is a schematic illustration of a model provided by an embodiment of the present invention;
fig. 5 is a schematic flow chart of a book recommendation method according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a book recommendation server according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a book recommendation device according to an embodiment of the present invention;
FIG. 8a is a schematic diagram of a similar tuple in accordance with an embodiment of the application;
fig. 8b provides a schematic diagram of a similar book according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms first, second and the like in the description and in the claims and in the above-described figures are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the described embodiments of the application may be combined with other embodiments.
Referring to fig. 1, fig. 1 is a schematic diagram of a network architecture according to an embodiment of the present application. The network architecture may include a plurality of servers and a plurality of terminal devices, as shown in fig. 1, specifically includes a terminal device 100a, a terminal device 100b, a terminal device 100c, a server 200a, and a server 200b, where the server 200a may perform data transmission with each terminal device through a network, each terminal device may install a book reading application (such as a micro-letter reading application), the server 200a may be a background server corresponding to the book reading application, so each terminal device may perform data transmission with the server 200a through a client corresponding to the book reading application, such as the server 200a may send recommended book information to each terminal device, the server 200b may be a data processing server, or may be referred to as a book recommendation server, that is, may determine different book recommendation data for each terminal device, and the server 200b may perform data transmission with the plurality of terminal devices through the server 200 a. The terminal device may include a cell phone, tablet computer, notebook computer, palm top computer, mobile Internet Device (MID) INTERNET DEVICE, wearable device (e.g., smart watch, smart bracelet, etc.). Each terminal device can display the recommended information stream, namely the recommended books, in the client corresponding to the book reading application.
The information contained in the recommended information stream displayed in each terminal device may be different, and specific information contained in the recommended information stream may be determined by a user history behavior corresponding to the terminal device, where the user history behavior may be represented as operations of clicking, reading time, downloading, purchasing, finishing reading, joining a bookshelf and the like each time in a client corresponding to the book reading application before the current time. Referring to fig. 2, a schematic view of a scenario of a book recommendation method according to an embodiment of the present invention is shown. As shown in fig. 2, taking the terminal device 100a in the embodiment corresponding to fig. 1 as an example, the server 200 may include the server 200a and the server 200b in the embodiment corresponding to fig. 1, after the terminal device 100a opens the reading book application interface, first, a default first page of the reading book application may be displayed in the terminal display interface, in the first page, several function options may be displayed, such as a "ranking list" option, "a" category "option," an "audio" option, and when the user selects the "recommendation" option 400, a jump may be made to a presentation page corresponding to the "recommendation" option 400, where no recommendation information is displayed in the display area 300a in the presentation page, so that the terminal device 100a may respond to the user selection operation for the "recommendation" option 400, and send an information stream access request to the server 200 to request to obtain the book recommendation. The server 100 may determine, according to the information flow access request, a device number or user identification information corresponding to the requesting terminal device 100a, that is, determine a user to be requested, further obtain historical behavior data corresponding to the user, and determine, according to the historical behavior data, a plurality of types of historical behavior-books corresponding to the user, respectively, so that a similar book corresponding to the historical behavior-book of the user in a similar database calculated by the server 200 may be recommended to the terminal, where the obtained similar book generation recommendation column may include displaying the corresponding book name 301a and the author information 302a in the display area 300 a.
Referring to fig. 3, fig. 3 is an interaction schematic diagram of a book recommendation method according to an embodiment of the present application. As shown in fig. 3, it may include steps 301-304, which are specifically as follows:
301. Acquiring different books corresponding to different user historic behaviors to obtain different book behavior doublets;
Optionally, the server obtains a large number of historical behavior logs of the user, where the historical behavior logs include historical behavior-book information of the user, and specifically may include information such as downloading a first book, purchasing a second book, adding a third book to a bookshelf, viewing details of a fourth book, and the like, corresponding to the user.
The server may obtain the historical behavior log of the user from a data source, such as viewing historical data of hundred-degree libraries of detail information of various books, or obtaining the books of interest from a search log in a QQ browser, a search log in a TT browser, or any other browser or search engine, or from a social platform, which may include microblogs, bar sticks, discussion groups, etc., which is specifically determined according to an actual application scenario, and is not limited herein.
Specifically, the server obtains behavior-book data of different users from the behavior-book database, which may be behavior-book data of a large number of users in a preset time period, such as the last three months, or a year, etc., so as to obtain historical behavior-book data of different users, and then obtains book behavior tuples according to the historical behavior-book data of different users, such as building a plurality of book behavior tuples of different users according to time sequence, and forming a tuple sequence from the plurality of book behavior tuples. The behavior-book database contains a large number of user's historical behavior-book data, such as download information including corresponding books, or view detail information, or purchase information, or browsing duration information, browsing times information, and device numbers, etc.
302. Obtaining a plurality of training samples from the two groups of different book behaviors, and respectively inputting the plurality of training samples into a preset model for training to obtain different characterization vectors;
The different characterization vectors can be the two-tuple characterization vectors respectively corresponding to the two-tuple of the different books, and can also obtain the book characterization vectors respectively corresponding to the different books;
The preset model may be a Skip-Gram model, where Skip-Gram model refers to initializing a vector representation for each feature randomly for a feature sequence, and for a vector vc corresponding to a feature fc of a position c, using the vector vc should predict k features, i.e., set f,k={fc-k,fc-k+1,fc-k+2,…,fc-1,fc+1,fc+2,…,fc+k, of window sizes around fc as accurately as possible. The mathematical expression is that the likelihood probability is maximized:
Where p f = softmax (vc x w+b), W and b are spatially transformed, vc is mapped to the full feature space, and the probability of each word is given by softmax. The Skip-Gram model adopted in the embodiment of the present application is shown in fig. 4, where the training sample includes a book behavior binary group :<ac,bc>,<ac-k,bc-k>···<ac-2,bc-2><ac-1,bc-1><ac+1,bc+1><ac+2,bc+2>···<ac+k,bc+k>;, and the training sample further includes a global positive sample, a global negative sample, and the same book, where the same book is a book corresponding to the target book behavior binary group. Wherein < a c,bc > is a target book behavior tuple ,<ac-k,bc-k>···<ac-2,bc-2><ac-1,bc-1><ac+1,bc+1><ac+2,bc+2>···<ac+k,bc+k> is 2K book behavior tuples with a left and right window size of K. The global positive sample is a book meeting a first preset condition in all the obtained book behavior tuples, and the first preset condition can be that the behavior is complete or purchase, for example, the book corresponding to the book behavior tuple of which the corresponding behavior is complete or purchase and the like in all the book behavior tuples; if a user purchases or reads a book in a sequence of actions, any one of the actions in the sequence of actions maximizes the probability of occurrence of a global positive sample, whether or not the global positive sample is within a window of size 2 k. The global negative sample is each user of the books meeting the second preset condition in all book behavior tuples, and the second preset condition can be that the reading time length is smaller than the preset time length, for example, if the statistical reading time length of a book is smaller than 60s, the book is taken as the global negative sample, and the occurrence probability of the book is minimized.
And the training model is sequentially input into the obtained training samples to train, so that the binary group characterization vectors respectively corresponding to the binary groups of different book behaviors are obtained.
As a preferred implementation manner, the obtaining a plurality of training samples from the different book behavior tuples may include:
acquiring a first book behavior binary group corresponding to a first preset behavior from the different book behavior binary groups, and acquiring a second book behavior binary group corresponding to a second preset behavior;
the first preset behavior comprises that the purchasing or reading progress reaches a preset progress, and the second preset behavior comprises that the reading duration is smaller than the preset duration.
Acquiring a first book corresponding to the first book behavior binary group and a second book corresponding to the second book behavior binary group, taking the first book as a global positive sample, and taking the second book as a global negative sample;
Acquiring a third book behavior binary group from the different book behavior binary groups, and acquiring at least two book behavior binary groups adjacent to the third book behavior binary group;
the size of the window is set, so that a book behavior binary group with left and right 2k adjacent book behavior binary groups taking the Four Books th book behavior binary group as a center can be obtained, and k is a positive integer.
And taking the third book behavior tuple, the at least two book behavior tuples, the global positive sample, the global negative sample and a third book corresponding to the third book behavior tuple as training samples.
According to the embodiment of the application, the relation between Book behavior tuples and the relation between the Book behavior tuples and Book < Book > tuples are learned, and the constraint of the Book behavior tuples and the Book ensures that the tuples containing the same Book are all surrounded on the same Book; and the book behavior binary group is related to the global positive example by constructing the relation between the book behavior binary group and the global positive example or the global negative example. By setting the model, compared with the prior art of single-element representation, the book behavior binary group is constructed, the behavior representation is richer, more specific, the basis of recommending books is based on multidimensional data, and the recommendation precision is improved.
303. Obtaining the similarity between the different characterization vectors, and respectively storing book behavior tuples or books corresponding to the different characterization vectors meeting preset conditions into a similar database;
It may specifically include:
The different characterization vectors include the corresponding binary group characterization vectors of the different book behavior binary groups, the similarity database includes a first database, the similarity between the different characterization vectors is obtained, the book behavior binary groups or books corresponding to the different characterization vectors meeting the preset conditions are respectively stored in the similarity database, and the method includes:
and obtaining the similarity between the different binary group characterization vectors, and storing book behavior binary groups corresponding to the binary group characterization vectors with the similarity larger than a first preset threshold value into a first database.
Further, the different characterization vectors include book characterization vectors corresponding to the different books respectively, the similarity database includes a second database, the similarity between the different characterization vectors is obtained, book behavior tuples or books corresponding to the different characterization vectors satisfying a preset condition are stored in the similarity database respectively, and the method includes:
and obtaining the similarity between the different book characterization vectors, and storing books corresponding to the book characterization vectors with the similarity larger than a second preset threshold value into a second database.
The similarity calculation may be a cosine similarity calculation to obtain the similarity, and a preset threshold may be set to obtain similar books with higher similarity, for example, the preset threshold may be set to 70%,80%, or the like.
Further, when the book behavior tuples corresponding to the similarity exceeding the first preset threshold are stored in the first database, the book behavior tuples may be stored in order from large to small based on the similarity, for example, the book behavior tuples may be stored in different storage positions, for example, the book behavior tuples may be sequentially stored from a first area, a second area, and the like, wherein the similarity of the first area is higher than that of the second area.
Or acquiring book behavior tuples corresponding to the similarity exceeding a first preset threshold value, and confirming whether the number of the book behavior tuples exceeds the preset number; if the similarity is exceeded, 5 book behavior tuples are selected from high to low according to the similarity, and are stored in a similar tuple library and the like. Of course, the above forms are not limited thereto.
304. Acquiring historical data of a terminal, acquiring a target book behavior binary group or a target book from the similar database according to the historical data, and recommending books corresponding to the target book behavior binary group or the target book to the terminal.
The historical data of the terminal comprises historical behaviors of the terminal and books corresponding to the historical behaviors, the target book behavior doublet or target books are obtained from the similar database according to the historical data, and the books corresponding to the target book behavior doublet or target books are recommended to the terminal, and the method comprises the following steps:
Obtaining a book behavior binary group of the terminal according to the historical behavior of the terminal and the books corresponding to the historical behavior;
And acquiring a target book behavior binary group from the first database, and recommending books corresponding to the target book behavior binary group to the terminal.
Further, the historical data of the terminal includes a historical book of the terminal, the obtaining a target book behavior tuple or a target book from the similar database according to the historical data, and recommending the book corresponding to the target book behavior tuple or the target book to the terminal includes:
and acquiring a target book from the second database, and recommending the target book to the terminal.
The acquiring the historical behavior of the terminal and the book corresponding to the historical behavior obtain a first book behavior binary group, and when at least two historical behaviors corresponding to the terminal exist, the method may include:
acquiring a first historical behavior of the terminal at a first preset time and books corresponding to the first historical behavior to obtain a first initial book behavior binary group, and acquiring a second historical behavior and books corresponding to the second historical behavior to obtain a second initial book behavior binary group;
Confirming whether the first historical behavior is prior to the second historical behavior or not from a preset behavior grade table;
and if so, taking the first initial book behavior binary group corresponding to the first historical behavior as the first book behavior binary group of the terminal.
Namely, the book behavior binary groups corresponding to the behaviors with higher grades are selected by determining the behavior grades.
When there are a plurality of similar book behavior tuples, then it includes:
obtaining P book behavior tuples similar to the book behavior tuples of the terminal and P books corresponding to the P book behavior tuples respectively from the similar tuple library, wherein P is an integer greater than 1;
Acquiring historical behaviors of the terminal at a second preset time and books corresponding to the historical behaviors; confirming whether books corresponding to the second preset time exist in the P books or not;
if yes, recommending the book to the terminal as a first book.
By acquiring the historical behaviors of the terminal at other times, books which are read more than 5 times and have not reached half of the reading progress can be selected, books which are interested by the user are confirmed, and the books are recommended to the terminal by confirming that the books exist in similar books, so that the books are very intelligent.
When a recommendation request of the terminal is received, the historical behavior of the terminal can be preprocessed, for example, the behavior with shorter browsing duration can be filtered out, or the behavior in preset time can be obtained.
According to the embodiment of the application, different book behavior tuples are obtained by obtaining different user historic behaviors and different books corresponding to the different user historic behaviors, and the training sample is obtained from the different book behavior tuples to train so as to obtain the tuple representation vectors respectively corresponding to the different book behavior tuples and the book representation vectors corresponding to the books; by calculating the similarity between different characterization vectors, intelligent recommendation can be performed when the historical behavior of the terminal and books corresponding to the historical behavior are acquired. Compared with single behaviors and tuples in the prior art, the method has the advantages that multiple behaviors are obtained and the tuples of different book behaviors are formed, constraint is conducted from multiple dimensions during training, accuracy is higher during accurate recommendation, and user experience is improved.
Referring to fig. 5, fig. 5 is a schematic flow chart of a book recommendation method according to an embodiment of the application. As shown, it may include steps 501-508, which are specifically as follows:
501. Acquiring different books corresponding to different user historic behaviors to obtain different book behavior doublets;
specifically, the server obtains behavior-book data of different users from the behavior-book database, which may be behavior-book data of a large number of users in a preset time period, such as the last three months, or a year, etc., so as to obtain historical behavior-book data of different users, and then obtains book behavior tuples according to the historical behavior-book data of different users, such as building a plurality of book behavior tuples of different users according to time sequence, and forming a tuple sequence from the plurality of book behavior tuples. The behavior-book database contains a large number of user's historical behavior-book data, such as download information including corresponding books, or view detail information, or purchase information, or browsing duration information, browsing times information, and device numbers, etc.
502. Acquiring a first book behavior binary group corresponding to a first preset behavior from the different book behavior binary groups, and acquiring a second book behavior binary group corresponding to a second preset behavior;
503. Acquiring a first book corresponding to the first book behavior binary group and a second book corresponding to the second book behavior binary group, taking the first book as a global positive sample, and taking the second book as a global negative sample;
The global positive sample can be a book corresponding to a book behavior binary group with the corresponding behavior of buying or reading out and the like in all book behavior binary groups; the global negative sample may be books corresponding to book behavior tuples, where the corresponding behavior in all book behavior tuples is a behavior with a statistical reading duration of less than 60s.
504. Acquiring a third book behavior binary group from the different book behavior binary groups, and acquiring at least two book behavior binary groups adjacent to the third book behavior binary group;
505. Taking the third book behavior tuple, the at least two book behavior tuples, the global positive sample, the global negative sample and a third book corresponding to the third book behavior tuple as training samples;
506. Respectively inputting the training samples into a preset model for training to obtain book characterization vectors respectively corresponding to different books;
wherein prior to training, further comprising determining a trained loss function, the loss function being representable as:
Wherein < a i,bi > represents a binary group; < a, b > in 2k represents the other 2k tuples within the tuple < a, b > window; bp in gp represents a global positive sample; bn in gn represents the global negative sample; < a n,bn > in ns represents a random sampling binary negative sample; θ represents an argument parameter.
And when the minimum value of the loss function is solved, the minimum value of the loss function and the model parameter value can be obtained by carrying out one-step iterative solution through a gradient descent method.
The constraint relation representation model not only learns the relation between Book behavior tuples < Action and Book > and the relation between Book behavior tuples and Book < Book > tuples, but also ensures that the Book behavior tuples and the constraint of the Book ensure that the tuples containing the same Book are all surrounded by the same Book; and the book behavior binary group is related to the global positive example by constructing the relation between the book behavior binary group and the global positive example or the global negative example.
507. Respectively calculating the similarity between the different book characterization vectors, and storing books corresponding to the similarity exceeding a second preset threshold value into a second database;
508. And when receiving a recommendation request sent by a terminal, acquiring a historical book of the terminal, and recommending books similar to the historical book acquired from the second database to the terminal.
According to the embodiment of the application, different book behavior tuples are obtained by obtaining different user historic behaviors and different books corresponding to the different user historic behaviors, and the training sample is obtained from the different book behavior tuples to train so as to obtain the tuple representation vectors respectively corresponding to the different book behavior tuples and the book representation vectors corresponding to the books; by calculating the similarity between different characterization vectors, intelligent recommendation can be performed when the historical behavior of the terminal and books corresponding to the historical behavior are acquired. According to the embodiment of the application, the relation between Book behavior tuples and the relation between the Book behavior tuples and Book < Book > tuples are learned, and the constraint of the Book behavior tuples and the Book ensures that the tuples containing the same Book are all surrounded on the same Book; and the book behavior binary group is related to the global positive example by constructing the relation between the book behavior binary group and the global positive example or the global negative example. By setting the model, compared with the prior art of single-element representation, the book behavior binary group is constructed, the behavior representation is richer, more specific, the basis of recommending books is based on multidimensional data, and the recommendation precision is improved.
In accordance with the foregoing embodiments, referring to fig. 6, fig. 6 is a schematic structural diagram of a book recommendation server according to an embodiment of the present application, as shown in the drawing, including a processor, an input device, an output device, and a memory, where the processor, the input device, the output device, and the memory are connected to each other, and the memory is configured to store a computer program, where the computer program includes program instructions, where the processor is configured to invoke the program instructions, and where the program includes instructions for executing the following steps;
acquiring different books corresponding to different user historic behaviors to obtain different book behavior doublets;
obtaining a plurality of training samples from the two groups of different book behaviors, and respectively inputting the plurality of training samples into a preset model for training to obtain different characterization vectors;
Obtaining the similarity between the different characterization vectors, and respectively storing book behavior tuples or books corresponding to the different characterization vectors meeting preset conditions into a similar database;
Acquiring historical data of a terminal, acquiring a target book behavior binary group or a target book from the similar database according to the historical data, and recommending books corresponding to the target book behavior binary group or the target book to the terminal.
According to the embodiment of the application, different book behavior tuples are obtained by obtaining different user historic behaviors and different books corresponding to the different user historic behaviors, and the training sample is obtained from the different book behavior tuples to train so as to obtain the tuple representation vectors respectively corresponding to the different book behavior tuples and the book representation vectors corresponding to the books; by calculating the similarity between different characterization vectors, intelligent recommendation can be performed when the historical behavior of the terminal and books corresponding to the historical behavior are acquired. Compared with single behaviors and tuples in the prior art, the method has the advantages that multiple behaviors are obtained and the tuples of different book behaviors are formed, constraint is conducted from multiple dimensions during training, accuracy is higher during accurate recommendation, and user experience is improved.
The foregoing description of the embodiments of the present application has been presented primarily in terms of a method-side implementation. It will be appreciated that, in order to achieve the above-mentioned functions, the terminal includes corresponding hardware structures and/or software modules for performing the respective functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The embodiment of the application can divide the functional units of the terminal according to the method example, for example, each functional unit can be divided corresponding to each function, and two or more functions can be integrated in one processing unit. The integrated units may be implemented in hardware or in software functional units. It should be noted that, in the embodiment of the present application, the division of the units is schematic, which is merely a logic function division, and other division manners may be implemented in actual practice.
In accordance with the foregoing, referring to fig. 7, fig. 7 is a schematic structural diagram of a book recommendation device according to an embodiment of the present application. The system comprises an acquisition module 701, a training module 702, a calculation module 703 and a recommendation module 704, and is specifically as follows:
an obtaining module 701, configured to obtain different user history behaviors and different books corresponding to the different user history behaviors to obtain different book behavior tuples;
the training module 702 is configured to obtain a plurality of training samples from the two-tuple of book behaviors, and input the plurality of training samples to a preset model for training respectively, so as to obtain different characterization vectors;
The computing module 703 is configured to obtain the similarity between the different token vectors, and store book behavior tuples or books corresponding to the different token vectors that satisfy the preset condition respectively to a similarity database;
And the recommending module 704 is configured to obtain historical data of a terminal, obtain a target book behavior tuple or a target book from the similar database according to the historical data, and recommend a book corresponding to the target book behavior tuple or the target book to the terminal.
It can be seen that, according to the embodiment of the application, different book behavior tuples are obtained by obtaining different user history behaviors and different books corresponding to the different user history behaviors, and the tuple characterization vector and the book characterization vector corresponding to the book respectively corresponding to the different book behavior tuples are obtained by obtaining training samples from the different book behavior tuples for training; by calculating the similarity between different characterization vectors, intelligent recommendation can be performed when the historical behavior of the terminal and books corresponding to the historical behavior are acquired. Compared with single behaviors and tuples in the prior art, the method has the advantages that multiple behaviors are obtained and the tuples of different book behaviors are formed, constraint is conducted from multiple dimensions during training, accuracy is higher during accurate recommendation, and user experience is improved.
Referring to fig. 8 a-8 b, by adopting the book recommendation method and the book recommendation device provided by the embodiment of the application, a plurality of book behavior tuples with extremely high similarity can be obtained by inputting the book behavior tuples READINGTIME-the fan-the transmission of the repair, as shown in fig. 8 a. When books are input, the earth is fluctuated, a plurality of books with extremely high similarity are also obtained as shown in fig. 8 b.
The embodiment of the present application also provides a computer storage medium storing a computer program for electronic data exchange, where the computer program causes a computer to execute part or all of the steps of any one of the book recommendation methods described in the above method embodiments.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer-readable storage medium storing a computer program that causes a computer to perform some or all of the steps of any of the book recommendation methods described in the method embodiments above.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present application is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, such as the division of the units, merely a logical function division, and there may be additional manners of dividing the actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present invention may be integrated in one processing unit, each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units described above may be implemented either in hardware or in software program modules.
The integrated units, if implemented in the form of software program modules, may be stored in a computer-readable memory for sale or use as a stand-alone product. Based on this understanding, the technical solution of the present application may be embodied essentially or partly in the form of a software product, or all or part of the technical solution, which is stored in a memory, and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned memory includes: a U-disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the above embodiments may be implemented by a program that instructs associated hardware, and the program may be stored in a computer readable memory, which may include: flash disk, read-only memory, random access memory, magnetic or optical disk, etc.
The foregoing has outlined rather broadly the more detailed description of embodiments of the application, wherein the principles and embodiments of the application are explained in detail using specific examples, the above examples being provided solely to facilitate the understanding of the method and core concepts of the application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.
Claims (9)
1. A book recommendation method, comprising:
acquiring different books corresponding to different user historic behaviors to obtain different book behavior doublets;
acquiring a first book behavior binary group corresponding to a first preset behavior from the different book behavior binary groups, and acquiring a second book behavior binary group corresponding to a second preset behavior;
acquiring a first book corresponding to the first book behavior binary group and a second book corresponding to the second book behavior binary group, taking the first book as a global positive sample, and taking the second book as a global negative sample;
Acquiring a third book behavior binary group from the different book behavior binary groups, and acquiring at least two book behavior binary groups adjacent to the third book behavior binary group;
Taking the third book behavior tuple, the at least two book behavior tuples, the global positive sample, the global negative sample and a third book corresponding to the third book behavior tuple as training samples, and respectively inputting the training samples into a preset model for training to obtain different characterization vectors;
Obtaining the similarity between the different characterization vectors, and respectively storing book behavior tuples or books corresponding to the different characterization vectors meeting preset conditions into a similar database;
Acquiring historical data of a terminal, acquiring a target book behavior binary group or a target book from the similar database according to the historical data, and recommending books corresponding to the target book behavior binary group or the target book to the terminal.
2. The method according to claim 1, wherein the different token vectors include respective corresponding doublet token vectors of the different book behavior doublets, the similarity database includes a first database, the obtaining the similarity between the different token vectors, and storing respective corresponding book behavior doublets or books of the plurality of different token vectors satisfying a preset condition in the similarity database includes:
and obtaining the similarity between the corresponding binary group representation vectors of the different book behavior binary groups, and storing the book behavior binary groups corresponding to the binary group representation vectors with the similarity larger than a first preset threshold value into a first database.
3. The method according to claim 2, wherein the historical data of the terminal includes historical behaviors of the terminal and books corresponding to the historical behaviors, the obtaining a target book behavior tuple or a target book from the similar database according to the historical data, and recommending the target book behavior tuple or the books corresponding to the target book to the terminal includes:
Obtaining a book behavior binary group of the terminal according to the historical behavior of the terminal and the books corresponding to the historical behavior;
And acquiring a target book behavior binary group from the first database, and recommending books corresponding to the target book behavior binary group to the terminal.
4. The method according to claim 1, wherein the different token vectors include book token vectors corresponding to the different books, the similarity database includes a second database, the obtaining the similarity between the different token vectors, and storing book behavior tuples or books corresponding to the different token vectors satisfying a preset condition in the similarity database, respectively, includes:
and obtaining the similarity between the different book characterization vectors, and storing books corresponding to the book characterization vectors with the similarity larger than a second preset threshold value into a second database.
5. The method according to claim 4, wherein the historical data of the terminal includes historical books of the terminal, the obtaining a target book behavior tuple or a target book from the similar database according to the historical data, and recommending the book corresponding to the target book behavior tuple or the target book to the terminal includes:
and acquiring a target book from the second database, and recommending the target book to the terminal.
6. The method according to any one of claims 1 to 5, wherein after obtaining different user historic behaviors and different books corresponding to the different user historic behaviors to obtain different book behavior tuples, before inputting the training samples into a preset model for training, respectively, determining a trained loss function, wherein the loss function is expressed as:
Wherein < a i,bi > represents a book behavior binary group, a i is a user history behavior, b i is a book corresponding to the user history behavior a i, A vector is characterized for the doublet of < a i,bi >/>A book characterization vector for b i; < a, b > in 2k represents the other 2k tuples within the tuple < a, b > window, v a,b is the token vector of the other 2k tuples within the < a, b > window; bp in gp represents a global positive sample,/>A characterization vector for any positive sample within the global positive sample; bn in gn represents a global negative sample,A token vector that is any positive sample within the global negative sample; < a n,bn > in ns represents a random sampling binary negative sample,A characterization vector that is a random sampling binary negative sample; θ represents an argument parameter.
7. A book recommendation device, comprising:
The acquisition module is used for acquiring different historical behaviors of the user and different books corresponding to the different historical behaviors of the user to obtain different book behavior doublets;
The training module is used for acquiring a first book behavior binary group corresponding to a first preset behavior from the different book behavior binary groups and acquiring a second book behavior binary group corresponding to a second preset behavior; acquiring a first book corresponding to the first book behavior binary group and a second book corresponding to the second book behavior binary group, taking the first book as a global positive sample, and taking the second book as a global negative sample; acquiring a third book behavior binary group from the different book behavior binary groups, and acquiring at least two book behavior binary groups adjacent to the third book behavior binary group; taking the third book behavior tuple, the at least two book behavior tuples, the global positive sample, the global negative sample and a third book corresponding to the third book behavior tuple as training samples, and respectively inputting the training samples into a preset model for training to obtain different characterization vectors;
the computing module is used for acquiring the similarity between the different characterization vectors and storing book behavior tuples or books respectively corresponding to the different characterization vectors meeting the preset conditions into a similar database;
And the recommending module is used for acquiring historical data of the terminal, acquiring a target book behavior binary group or a target book from the similar database according to the historical data, and recommending books corresponding to the target book behavior binary group or the target book to the terminal.
8. A terminal comprising a processor, an input device, an output device and a memory, the processor, the input device, the output device and the memory being interconnected, wherein the memory is adapted to store a computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method of any of claims 1 to 6.
9. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program, which is executed by a processor to implement the method of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910672030.XA CN110413888B (en) | 2019-07-24 | 2019-07-24 | Book recommendation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910672030.XA CN110413888B (en) | 2019-07-24 | 2019-07-24 | Book recommendation method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110413888A CN110413888A (en) | 2019-11-05 |
CN110413888B true CN110413888B (en) | 2024-05-10 |
Family
ID=68362891
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910672030.XA Active CN110413888B (en) | 2019-07-24 | 2019-07-24 | Book recommendation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110413888B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111079039B (en) * | 2019-11-20 | 2024-02-09 | 上海连尚网络科技有限公司 | Method and equipment for collecting books |
CN111143682A (en) * | 2019-12-27 | 2020-05-12 | 联想(北京)有限公司 | Data processing method, device and storage medium |
CN111008349B (en) * | 2020-03-09 | 2020-06-02 | 深圳博士创新技术转移有限公司 | Big data information pushing processing method and system |
CN112417290A (en) * | 2020-11-30 | 2021-02-26 | 掌阅科技股份有限公司 | Training method of book sorting push model, electronic equipment and storage medium |
CN113239282A (en) * | 2021-06-22 | 2021-08-10 | 平安国际智慧城市科技股份有限公司 | Recommendation method, device, medium and equipment based on sequence similarity calculation |
CN114595384A (en) * | 2022-02-25 | 2022-06-07 | 北京字节跳动网络技术有限公司 | Book recommendation method and device, electronic equipment and storage medium |
CN114625876B (en) * | 2022-03-17 | 2024-04-16 | 北京字节跳动网络技术有限公司 | Method for generating author characteristic model, method and device for processing author information |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107203518A (en) * | 2016-03-16 | 2017-09-26 | 阿里巴巴集团控股有限公司 | Method, system and device, the electronic equipment of on-line system personalized recommendation |
CN107943871A (en) * | 2017-11-10 | 2018-04-20 | 深圳市华阅文化传媒有限公司 | Recommended user reads the method and device of the books of hobby |
CN108509573A (en) * | 2018-03-27 | 2018-09-07 | 陕西科技大学 | Book recommendation method based on matrix decomposition collaborative filtering and system |
CN108520076A (en) * | 2018-04-19 | 2018-09-11 | 掌阅科技股份有限公司 | E-book recommends method, electronic equipment and computer storage media |
CN109190044A (en) * | 2018-09-10 | 2019-01-11 | 北京百度网讯科技有限公司 | Personalized recommendation method, device, server and medium |
-
2019
- 2019-07-24 CN CN201910672030.XA patent/CN110413888B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107203518A (en) * | 2016-03-16 | 2017-09-26 | 阿里巴巴集团控股有限公司 | Method, system and device, the electronic equipment of on-line system personalized recommendation |
CN107943871A (en) * | 2017-11-10 | 2018-04-20 | 深圳市华阅文化传媒有限公司 | Recommended user reads the method and device of the books of hobby |
CN108509573A (en) * | 2018-03-27 | 2018-09-07 | 陕西科技大学 | Book recommendation method based on matrix decomposition collaborative filtering and system |
CN108520076A (en) * | 2018-04-19 | 2018-09-11 | 掌阅科技股份有限公司 | E-book recommends method, electronic equipment and computer storage media |
CN109190044A (en) * | 2018-09-10 | 2019-01-11 | 北京百度网讯科技有限公司 | Personalized recommendation method, device, server and medium |
Also Published As
Publication number | Publication date |
---|---|
CN110413888A (en) | 2019-11-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110413888B (en) | Book recommendation method and device | |
US10958748B2 (en) | Resource push method and apparatus | |
CN107515909B (en) | Video recommendation method and system | |
CN111784455B (en) | Article recommendation method and recommendation equipment | |
US9348898B2 (en) | Recommendation system with dual collaborative filter usage matrix | |
CN110008397B (en) | Recommendation model training method and device | |
CN108108821A (en) | Model training method and device | |
CN111061946A (en) | Scenario content recommendation method and device, electronic equipment and storage medium | |
CN105095279B (en) | File recommendation method and device | |
WO2014043655A2 (en) | System and method for ranking creator endorsements | |
CN111782947A (en) | Search content display method and device, electronic equipment and storage medium | |
CN116821475B (en) | Video recommendation method and device based on client data and computer equipment | |
CN116108267A (en) | Recommendation method and related equipment | |
CN112100221A (en) | Information recommendation method and device, recommendation server and storage medium | |
WO2015153240A1 (en) | Directed recommendations | |
US20150278907A1 (en) | User Inactivity Aware Recommendation System | |
CN108959550A (en) | User's focus method for digging, device, equipment and computer-readable medium | |
CN111680213B (en) | Information recommendation method, data processing method and device | |
CN116764236A (en) | Game prop recommending method, game prop recommending device, computer equipment and storage medium | |
US9779460B2 (en) | Systems, methods and non-transitory computer readable storage media for tracking and evaluating predictions regarding relationships | |
CN116467591A (en) | Multi-target model training method and device, electronic equipment and storage medium | |
WO2023069330A1 (en) | Searching for products through a social media platform | |
CN115186750A (en) | Model training method, device, equipment and storage medium | |
CN114529399A (en) | User data processing method, device, computer equipment and storage medium | |
CN109408725B (en) | Method and apparatus for determining user interest |
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 | ||
TG01 | Patent term adjustment |