Keyword-based book search method and system, electronic equipment and storage medium
By constructing a book knowledge graph and style keyword library, and using book style clustering and genetic algorithms, the low search accuracy problem caused by users forgetting the book title and author information is solved, and fast and accurate book search is achieved, improving user experience.
Patent Information
- Application Number
- CN202510418853.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-08-15
AI Technical Summary
In the prior art, when a user forgets the book title and author information, the search accuracy of the book based on keywords is low, resulting in low search efficiency and affecting the user's reading experience.
By constructing a book knowledge graph and style keyword library, using book style clustering results and genetic algorithms, quickly find the target book style based on the keywords entered by users, reduce the search range, and improve search accuracy and efficiency.
When users forget the book title and author information, they can quickly find the correct books, save time and improve user reading experience.
Smart Images

Figure CN120492606A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of book search, and in particular to a keyword-based book search method, system, electronic device, and storage medium. Background Art
[0002] Users generally search for the e-books they need from the e-book platform based on the book information. The search information includes information such as title and author. If the user can provide the accurate book name or author, the book the user needs can be obtained relatively quickly and accurately. However, users often tend to forget the title and author information of the book.
[0003] Therefore, to address the issue of users not being able to remember the exact book title and author information, existing technical solutions can search for books based on user-provided keywords. However, these keyword-based searches may fail to find the books the user is looking for. If the search results do not contain the desired book, the user must re-enter the search terms and repeat the search process. This low search accuracy leads to low search efficiency, seriously affecting the user's reading experience. Summary of the Invention
[0004] This application aims to propose a keyword-based book search method, system, electronic device and storage medium, which can improve the accuracy of book search, thereby improving search efficiency and enhancing the user reading experience.
[0005] In a first aspect, an embodiment of the present application provides a keyword-based book search method, the method comprising:
[0006] Obtain the book information of all books in the reading platform and obtain the target book information input by the user;
[0007] Constructing a book knowledge graph based on the book information, and clustering all books by style based on the book information to obtain a style clustering result;
[0008] Constructing a style keyword library about book styles, wherein the style keyword library includes a plurality of keywords for characterizing the style of each book;
[0009] A book search is performed based on the book knowledge graph, the style clustering result, the style keyword library, and the target book information to determine the target book.
[0010] Compared with the prior art, the first aspect of the present application has the following beneficial effects:
[0011] This method obtains the book information of all books in the reading platform and obtains the target book information input by the user; constructs a book knowledge graph based on the book information, and, based on the book information, clusters all books by book style to obtain style clustering results; constructs a style keyword library about book style, which contains multiple keywords used to characterize the style of each book; and performs book search based on the book knowledge graph, style clustering results, style keyword library and target book information to determine the target book. In this way, by constructing the book knowledge graph, the correct book can be searched as quickly as possible through the book information. The purpose of constructing the style keyword library about book style is to find the corresponding book style through the input keywords when the user forgets the book title and book author. There is no need to search all books in the reading platform, only books of the corresponding style need to be searched. This can improve the accuracy of book search and save time, thereby improving search efficiency and enhancing the user's reading experience.
[0012] In some embodiments, constructing a genre keyword library related to book genres includes:
[0013] Preset initial keywords for each book style;
[0014] Extracting the first keyword of the book introduction corresponding to the first book to be stored in the style keyword library;
[0015] Calculating the repetition rate between all first keywords and all second keywords of each book already stored in the genre keyword library;
[0016] When the repetition rate is smaller than a preset threshold, converting the first keyword into a first keyword vector, and converting the initial keyword of each book style into a second keyword vector;
[0017] Calculating the similarity between the first book and each book style based on the first keyword vector and the second keyword vector;
[0018] The first keyword is used as the keyword of the book style category with the greatest similarity to construct a style keyword library about book styles.
[0019] In some implementations, calculating the similarity between the first book and each book style based on the first keyword vector and the second keyword vector includes:
[0020]
[0021] Among them, S1 represents the keyword similarity, A iv represents the v-th dimension vector in the first keyword vector corresponding to the i-th book, B ivIt represents the v-th dimension vector in the second keyword vector corresponding to the j-th book style, and h represents the total dimension of the vector.
[0022] In some embodiments, the target book information includes a complete book title and a complete book author, keywords of the complete book author and the target book title, the complete book title, keywords of the target book introduction, and a sentence describing the target book information. The book search based on the book knowledge graph, the style clustering results, the style keyword library, and the target book information to determine the target book includes:
[0023] If the target book information is any one of a complete book title and a complete book author, a complete book author and keywords of the target book title, and a complete book title, a book search is performed based on the target book information and the book knowledge graph to determine the target book;
[0024] If the target book information is a keyword in a book introduction or a sentence describing the target book information, a book search is performed based on the style clustering result, the style keyword library and the target book information to determine the target book.
[0025] In some embodiments, if the target book information is any one of a complete book title and a complete book author, a complete book author and keywords of the target book title, or a complete book title, performing a book search based on the target book information and the book knowledge graph to determine the target book includes:
[0026] If the target book information is a complete book title or a complete book title and book author, searching for books corresponding to the target book information in the book knowledge graph to perform a book search to determine the target book;
[0027] If the target book information is a complete book author and keywords of the target book title, then all books corresponding to the complete book author are searched in the book knowledge graph according to the complete book author to obtain a book set corresponding to the complete book author; the similarity between the book title of each book in the book set corresponding to the complete book author and the keywords of the target book title is calculated; and the final target book is determined based on the similarity.
[0028] In some implementations, if the target book information is a keyword in a target book introduction, performing a book search based on the style clustering result, the style keyword library, and the target book information to determine the target book includes:
[0029] Finding the book style category of the target book based on the keywords of the target book introduction and the style keyword library;
[0030] Using a genetic algorithm to search for a set of optimal book introductions from the style clustering results corresponding to the book style categories of the target book;
[0031] A group of optimal target books is determined according to the group of optimal book introductions.
[0032] In some embodiments, if the target book information is a sentence describing the target book information, performing a book search based on the style clustering result, the style keyword library, and the target book information to determine the target book includes:
[0033] Extract a group of sentence keywords from a sentence describing target book information;
[0034] Determining the book style category of the target book based on the set of sentence keywords and the style keyword library;
[0035] Using a genetic algorithm to search for a set of optimal book introductions from the style clustering results corresponding to the book style categories of the target book;
[0036] A group of optimal target books is determined according to the group of optimal book introductions.
[0037] In a second aspect, an embodiment of the present application further provides a keyword-based book search system, the system comprising:
[0038] A data acquisition unit, configured to acquire the book information of all books in the reading platform and obtain the target book information input by the user;
[0039] A first construction unit is configured to construct a book knowledge graph based on the book information, and to cluster all books by style based on the book information to obtain a style clustering result;
[0040] A second construction unit is used to construct a style keyword library about book styles, wherein the style keyword library contains a plurality of keywords for characterizing the style of each book;
[0041] A book search unit is used to perform a book search based on the book knowledge graph, the style clustering result, the style keyword library and the target book information to determine the target book.
[0042] In a third aspect, an embodiment of the present application further provides an electronic device comprising at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute a keyword-based book search method as described above.
[0043] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the keyword-based book search method as described above.
[0044] It can be understood that the beneficial effects of the above-mentioned second to fourth aspects compared with the relevant technologies are the same as the beneficial effects of the above-mentioned first aspect compared with the relevant technologies. Please refer to the relevant description in the above-mentioned first aspect and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0046] Figure 1 This is a flowchart of an embodiment of a keyword-based book search method provided by the present application;
[0047] Figure 2 This is a search schematic diagram for inputting target book information in the best embodiment of the keyword-based book search method provided by the present application;
[0048] Figure 3 This is a schematic diagram of the structure of an embodiment of a keyword-based book search system provided by the present application;
[0049] Figure 4 It is a structural diagram of an embodiment of the electronic device provided by this application. DETAILED DESCRIPTION
[0050] The following describes in detail embodiments of the present application. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application and are not to be construed as limiting the present application.
[0051] In the description of this application, if there is a description of first, second, etc., it is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0052] In the description of this application, it should be understood that descriptions involving orientation, such as the orientation or positional relationship indicated by up, down, etc., are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on this application.
[0053] In the description of this application, it should be noted that, unless otherwise clearly defined, terms such as setting, installing, and connecting should be understood in a broad sense, and technical personnel in the relevant technical field can reasonably determine the specific meaning of the above terms in this application based on the specific content of the technical solution.
[0054] First, let’s analyze some of the terms used in this application:
[0055] Clustering: The process of dividing a collection of physical or abstract objects into clusters of similar objects is called clustering. The clusters generated by clustering are a collection of data objects that are similar to objects in the same cluster and different from objects in other clusters.
[0056] Knowledge Graph: Known as knowledge domain visualization or knowledge domain mapping map in the library and information science community, it is a series of various graphs that show the development process and structural relationship of knowledge. It uses visualization technology to describe knowledge resources and their carriers, and to mine, analyze, construct, draw and display knowledge and their interrelationships.
[0057] Word2vec: A family of related models used to generate word embeddings. These models are shallow, two-layer neural networks trained to reconstruct linguistic text. The network is represented by words and is required to guess the adjacent positions of the input words. Under the bag-of-words model in Word2vec, word order is unimportant. After training, the Word2vec model maps each word to a vector that represents the relationship between words. This vector serves as the hidden layer of the neural network.
[0058] TF-IDF: is a commonly used weighting technique for information retrieval and data mining. TF stands for Term Frequency, and IDF stands for Inverse Document Frequency.
[0059] Large Language Models (LLMs) are deep learning models trained using large amounts of text data, enabling them to generate natural language text or understand the meaning of text. These models can be trained on massive datasets to provide in-depth knowledge and language production on a variety of topics. Their core idea is to learn the patterns and structure of natural language through large-scale unsupervised training, simulating, to a certain extent, the human language cognition and generation process.
[0060] Genetic Algorithm (GA): First proposed by John Holland in the 1970s, this algorithm is based on the evolutionary laws of organisms in nature. It is a computational model of biological evolution that simulates the natural selection and genetic mechanisms of Darwin's theory of evolution. It is a method for searching for optimal solutions by simulating the natural evolutionary process. Through mathematical methods and computer simulation, this algorithm transforms the problem-solving process into a process similar to the crossover and mutation of chromosome genes in biological evolution. When solving complex combinatorial optimization problems, it can generally achieve better results faster than conventional optimization algorithms.
[0061] Users generally search for the e-books they need from the e-book platform based on the book information. The search information includes information such as title and author. If the user can provide the accurate book name or author, the book the user needs can be obtained relatively quickly and accurately. However, users often tend to forget the title and author information of the book.
[0062] Therefore, to address the issue of users not being able to remember the exact book title and author information, existing technical solutions can search for books based on user-provided keywords. However, these keyword-based searches may fail to find the books the user is looking for. If the search results do not contain the desired book, the user must re-enter the search terms and repeat the search process. This low search accuracy leads to low search efficiency, seriously affecting the user's reading experience.
[0063] In order to solve the above-mentioned problem of low search efficiency due to low search accuracy, which seriously affects the user's reading experience, the present application proposes a keyword-based book search method, system, electronic device and storage medium.
[0064] Reference Figure 1 The present invention provides a keyword-based book search method, which may include the following steps:
[0065] Step S100: obtaining the book information of all books in the reading platform and obtaining the target book information input by the user;
[0066] Step S200: construct a book knowledge graph based on the book information, and perform book style clustering on all books based on the book information to obtain a style clustering result;
[0067] Step S300: Construct a style keyword library about book styles, where the style keyword library contains multiple keywords used to characterize the style of each book;
[0068] Step S400: performing a book search based on the book knowledge graph, the style clustering results, the style keyword library, and the target book information to determine the target book.
[0069] In this embodiment, the book information of all books in the reading platform is obtained, and the target book information input by the user is obtained; based on the book information, a book knowledge graph is constructed, and, based on the book information, all books are clustered by book style to obtain a style clustering result; a style keyword library about the book style is constructed, and the style keyword library contains multiple keywords for characterizing the style of each book; a book search is performed based on the book knowledge graph, the style clustering result, the style keyword library and the target book information to determine the target book. In this way, by constructing a book knowledge graph, the correct book can be searched as quickly as possible through the book information. The purpose of constructing a style keyword library about the book style is to find the corresponding book style through the input keywords when the user forgets the title of the book and the author of the book. There is no need to search all the books in the reading platform, only books of the corresponding style need to be searched. This can improve the accuracy of the book search and save time, thereby improving the search efficiency and enhancing the user's reading experience.
[0070] The above method constructs a book knowledge graph based on book information, and clusters all books by book style based on the book information to obtain a style clustering result. The book information may include book title, book author, book style and book introduction. According to the book title and book author of all books in the book information, a book knowledge graph about all books is constructed; according to the book style and book introduction of all books in the book information dataset, the book introduction is clustered according to the book style category to which it belongs, and a book dataset corresponding to each book style category is obtained.
[0071] The above-mentioned construction of the style keyword library about book style can be to extract the keywords used to represent the book style from each book in the reading platform to construct the style keyword library. A book has only one style type that best suits the book, that is, a book can only have one book style.
[0072] In some embodiments, constructing a genre keyword library related to book genres includes:
[0073] Preset initial keywords for each book style;
[0074] Extracting the first keyword of the book introduction corresponding to the first book to be stored in the style keyword library;
[0075] Calculate the repetition rate between all first keywords and all second keywords of each book in the existing genre keyword library;
[0076] When the repetition rate is smaller than a preset threshold, the first keyword is converted into a first keyword vector, and the initial keyword of each book style is converted into a second keyword vector;
[0077] Calculating the similarity between the first book and each book style based on the first keyword vector and the second keyword vector;
[0078] The first keyword is used as the keyword of the book style category with the greatest similarity to construct a style keyword library about book styles.
[0079] In this embodiment, a style keyword library for book styles is constructed by presetting initial keywords for each book style; extracting the first keyword from the book introduction corresponding to the first book to be stored in the style keyword library; calculating the repetition rate between all first keywords and all second keywords of each book in the existing style keyword library; when the repetition rate is less than a preset threshold, converting the first keyword into a first keyword vector, and converting the initial keyword for each book style into a second keyword vector; calculating the similarity between the first book and each book style based on the first keyword vector and the second keyword vector; and using the first keyword as the keyword for the book style category with the greatest similarity. In this way, the style keyword library is continuously expanded using the first keyword from the book introduction corresponding to the first book to be stored in the style keyword library. Compared to using only manually constructed initial keywords for each book style, the book style of the target book can be more accurately determined. Constructing a style keyword library for book styles is to enable users to find the corresponding book style by entering keywords when they forget the book title and author. This eliminates the need to search all books in the reading platform, and only requires searching for books of the corresponding style. This improves the accuracy of book searches and saves time, thereby improving search efficiency and enhancing the user reading experience.
[0080] In some implementations, calculating the similarity between the first book and each book genre based on the first keyword vector and the second keyword vector includes:
[0081]
[0082] Among them, S1 represents the keyword similarity, A ivrepresents the v-th dimension vector in the first keyword vector corresponding to the i-th book, B jv It represents the v-th dimension vector in the second keyword vector corresponding to the j-th book style, and h represents the total dimension of the vector.
[0083] In this embodiment, by calculating the similarity between the first keyword vector of each book and the second keyword vector corresponding to each type of book style, since the first keyword vector of each book will perform similarity calculations with the second keyword vectors of all book style types, it is possible to better determine which book style each book belongs to.
[0084] In some embodiments, the target book information includes the complete book title and the complete book author, keywords of the complete book author and the target book title, the complete book title, keywords of the target book introduction, and a sentence describing the target book information. A book search is performed based on the book knowledge graph, the style clustering results, the style keyword library, and the target book information to determine the target book, including:
[0085] If the target book information is any of the following: a complete book title and a complete book author, a complete book author and keywords of the target book title, or a complete book title, a book search is performed based on the target book information and the book knowledge graph to determine the target book;
[0086] If the target book information is a keyword in a book introduction or a sentence describing the target book information, a book search is performed based on the style clustering result, the style keyword library and the target book information to determine the target book.
[0087] In this embodiment, if the target book information is any of the following: a complete book title and a complete book author, keywords of the complete book author and the target book title, or a complete book title, a book search is performed based on the target book information and the book knowledge graph to determine the target book; if the target book information is a keyword in the book introduction or a sentence used to describe the target book information, a book search is performed based on the style clustering results, the style keyword library, and the target book information to determine the target book. In this way, if the user can provide a complete book title and a complete book author, the correct target book can be directly searched through the book knowledge graph. If the user can only provide some keywords or some descriptive sentences, a more complex method is required to search for the correct target book. Therefore, by using different methods to search for books based on different information input by the user, the accuracy of the book search can be better improved, thereby improving the efficiency of the book search.
[0088] In some embodiments, if the target book information is any of the following: a complete book title and a complete book author, a complete book author and keywords of the target book title, or a complete book title, a book search is performed based on the target book information and the book knowledge graph to determine the target book, including:
[0089] If the target book information is a complete book title or a complete book title and book author, then a book search is performed on the book knowledge graph to search for books corresponding to the target book information to determine the target book;
[0090] If the target book information is the complete book author and keywords of the target book title, then search for all books corresponding to the complete book author in the book knowledge graph based on the complete book author to obtain a set of books corresponding to the complete book author; calculate the similarity between the book title of each book in the book set corresponding to the complete book author and the keywords of the target book title; and determine the final target book based on the similarity.
[0091] In this embodiment, if the target book information is a complete book title or a complete book title and book author, then the book knowledge graph is searched for books corresponding to the target book information to perform a book search to determine the target book; if the target book information is a complete book author and keywords of the target book title, then the book knowledge graph is searched for all books corresponding to the complete book author based on the complete book author to obtain a set of books corresponding to the complete book author; the similarity between the book title of each book in the set of books corresponding to the complete book author and the keywords of the target book title is calculated; and the final target book is determined based on the similarity. In this way, since an author may write multiple books, if only the author is provided, the accurate books cannot be obtained. It is necessary to further provide some keywords of the title and search for the correct books based on the keywords.
[0092] In some embodiments, if the target book information is a keyword in the target book introduction, a book search is performed based on the style clustering results, the style keyword library, and the target book information to determine the target book, including:
[0093] Find the target book's genre category based on the keywords in the target book's introduction and the genre keyword library;
[0094] A genetic algorithm is used to search for a set of optimal book descriptions from the style clustering results corresponding to the book style categories of the target book;
[0095] An optimal set of target books is determined based on a set of optimal book introductions.
[0096] In this embodiment, the target book's genre category is found based on keywords in the target book's introduction and a library of genre keywords. A genetic algorithm is then used to search for an optimal set of book introductions from the resulting genre clusters corresponding to the target book's genre category. Finally, an optimal set of target books is determined based on this set of optimal book introductions. This approach first finds the genre corresponding to the target book based on keywords in the target book's introduction, eliminating the need to search all books on the reading platform; only books with the corresponding genre are needed. This improves book search accuracy and saves time, thereby increasing search efficiency and enhancing the user's reading experience.
[0097] In some embodiments, if the target book information is a sentence describing the target book information, a book search is performed based on the style clustering result, the style keyword library, and the target book information to determine the target book, including:
[0098] Extract a group of sentence keywords from a sentence describing target book information;
[0099] Determine the book style category of the target book based on a set of sentence keywords and style keyword libraries;
[0100] A genetic algorithm is used to search for a set of optimal book descriptions from the style clustering results corresponding to the book style categories of the target book;
[0101] An optimal set of target books is determined based on a set of optimal book introductions.
[0102] In this embodiment, a set of sentence keywords is extracted from a sentence describing a target book; the target book's style category is determined based on this set of sentence keywords and a library of style keywords; a genetic algorithm is used to search for an optimal set of book descriptions from the style clustering results corresponding to the target book's style category; and an optimal set of target books is determined based on this set of optimal book descriptions. In this way, the style corresponding to the target book is first found based on the set of sentence keywords. This eliminates the need to search all books on the reading platform, only books with the corresponding style. This improves book search accuracy and saves time, thereby increasing search efficiency and enhancing the user's reading experience.
[0103] To facilitate understanding by those skilled in the art, a set of best embodiments is provided below:
[0104] Since users may input different information, if only one method is used to search for books regardless of the information input by the user, the search efficiency may be affected. Therefore, this embodiment designs different search methods according to the different information input by the user to maximize the search efficiency and accuracy. The specific technical solution is as follows:
[0105] 1. Get book information.
[0106] Obtain the book title, author, genre (genre is divided into multiple genres based on the content of the book), and introduction of all books from the reading platform to construct a book information dataset. Obtain the target book information (i.e., some information about the target book) entered by the user. For example, the complete book title and author, the complete author and incomplete title (if only the author is entered, some keywords related to the title are required), the complete book title, keywords related to the introduction of the target book, and a sentence describing the target book information may be entered.
[0107] 2. Based on the book information dataset, construct a book knowledge graph and a book dataset corresponding to each book style category.
[0108] Based on the book titles and authors of all books in the book information dataset, a book knowledge graph about all books is constructed;
[0109] Based on the book styles and book descriptions of all books in the book information dataset, the book descriptions are clustered according to the book style categories to which they belong, thereby obtaining a book dataset corresponding to each book style category (i.e., each book style category corresponds to a style clustering result, each category contains multiple books, and multiple books are constructed into a book dataset). It should be noted that the clustering method used in this embodiment can be a method well known to those skilled in the art, such as the k-means clustering method. This embodiment will not be described in detail.
[0110] 3. Build a keyword library about book styles.
[0111] Extract keywords used to represent the book style from each book on the reading platform. A book has only one style that best suits the book, that is, a book can only have one style.
[0112] To ensure that the keywords extracted from the book are both unique and can represent a style, the following method is used to construct a keyword library of book style:
[0113] (1) Pre-design some keywords for each book style. This can be done by having staff artificially design representative keywords (i.e., initial keywords) corresponding to each book style based on historical experience.
[0114] (2) Find the repetition rate of the keywords of the first book extracted (i.e., the book that has not yet been stored in the style keyword library and the book that is to be stored in the style keyword library). If the probability of repetition between all the keywords extracted from the first book and all the keywords of a certain book reaches a preset threshold, it is necessary to re-extract the keywords of the first book (keep the non-repeated ones and only re-extract the repeated keywords), and then calculate the keyword repetition rate until the keyword repetition rate is less than the preset threshold. Specifically:
[0115] First, keywords are extracted from the book introduction of each first book on the reading platform using an unsupervised keyword extraction method or a supervised keyword extraction method, and the keywords extracted from the book introduction are used as keywords for the genre of the first book. The number of keywords extracted from each first book is the same.
[0116] It should be noted that the unsupervised keyword extraction method and the supervised keyword extraction method in this embodiment are both technical solutions in the prior art and are not described in detail in this embodiment.
[0117] Then, the repetition rate between the first book keyword and other book keywords in the existing keyword library is calculated using the following formula:
[0118]
[0119] Among them, P represents the keyword repetition rate, AX represents the total number of keywords of book A, AY represents the number of different keywords between book A and book B in the existing keyword library, and BZ represents the total number of keywords of book B in the existing keyword library.
[0120] It should be noted that the preset threshold in this embodiment can be changed according to actual conditions, and this embodiment does not impose any specific limitation.
[0121] (3) While ensuring that the repetition rate between the extracted first book keywords and the keywords of other books already in the keyword library is small enough, construct the first keyword vector of the book based on the keywords of the first book, and construct the second keyword vector of the book style based on the keywords preset by the book style (i.e., the keywords in step (1), i.e., the initial keywords). Based on the first keyword vector and the second keyword vector, calculate the similarity between the first book and each book style, obtain the similarity value corresponding to each book style, and compare the similarity values corresponding to each book style. Take the keywords of the first book as the keywords of the book style with the greatest similarity, and continuously construct keywords for each type of book style in the above manner to obtain a keyword library for each type of book style. Among them, the vector dimensions of the first keyword vector and the second keyword vector are the same.
[0122] The keyword may be converted into the first keyword vector or the second keyword vector by using methods such as word2vec or TF-IDF, and this embodiment does not impose any specific limitation.
[0123] The keyword similarity calculation in this embodiment can be performed in the following manner:
[0124]
[0125] Among them, S1 represents the keyword similarity, A iv represents the v-th dimension vector in the first keyword vector corresponding to the i-th book, B iv It represents the v-th dimension vector in the second keyword vector corresponding to the j-th book style, and h represents the total dimension of the vector.
[0126] 4. Search for books based on the book knowledge graph, book dataset, book style keyword library, and target book information.
[0127] Reference Figure 2 ,Since users may input different target book information, different methods are used to search for books according to the target book information input by users, including the following:
[0128] (1) If the target book information includes any of the following: a complete book title, a complete book author, an incomplete book title, or a complete book title and a complete book author, then it is only necessary to search for books corresponding to the target book information in the book knowledge graph based on the input target book information.
[0129] If the target book information includes a complete book title or a complete book title and book author, the book corresponding to the target book information can be directly searched in the book knowledge graph. It should be noted that the method for searching in the book knowledge graph in this embodiment can adopt methods well known to those skilled in the art and will not be described in detail in this embodiment.
[0130] If the target book information includes a complete book author and an incomplete book title (i.e., the keywords used to describe the target book title), first find all books corresponding to the complete book author in the book knowledge graph to obtain the book set corresponding to the author; then calculate the similarity between the title of each book in the book set corresponding to the author and the keyword of the target book title; and finally obtain the searched books based on the similarity. Specifically:
[0131] First, the title of each book in the book set corresponding to the author of the book is vectorized to obtain the first title vector;
[0132] Vectorize the keywords of the target book title to obtain the second title vector;
[0133] Calculating the similarity between the first question vector and the second question vector to obtain multiple similarity result values;
[0134] Compare multiple similarity result values and select the book corresponding to the maximum similarity result value as the final search book.
[0135] (2) If the target book information includes keywords about the target book introduction, first find the book style category of the target book based on the keywords of the target book introduction and the keyword library of the book style (i.e., the style keyword library); then use the genetic algorithm to find a set of optimal book introductions N from the book data set corresponding to the book style category of the target book, and determine the optimal set of search books based on the set of optimal book introductions. Specifically, it includes the following contents:
[0136] Based on the keywords in the target book's introduction and the book style keyword library, the book style category of the target book (i.e., the book to be searched) is found. This can be achieved by using the book style category and keywords in the book style keyword library to train a large language model. The trained large language model is then input into the trained large language model to predict the target book's book style category.
[0137] After finding the target book's genre, a genetic algorithm is used to find an optimal set of book descriptions from the book dataset corresponding to the target book's genre. Finally, a corresponding set of book titles is found based on the optimal book descriptions, resulting in an optimal set of searched books. The genetic algorithm includes steps such as initializing the population, constructing a fitness function, selection, crossover, and mutation. Specifically, it includes:
[0138] Initialize the population: Take a set of book descriptions of a preset number of books as an individual, and randomly generate an original population based on the book dataset. The original population contains multiple individuals.
[0139] First, obtain the keywords of the book introduction corresponding to each book in the reading platform obtained in step 3; then convert the keywords of the target book introduction into a first introduction vector, and convert the keywords of the book introduction corresponding to each book in the book dataset into a second introduction vector; finally, construct the fitness function of the genetic algorithm based on the first introduction vector and the second introduction vector:
[0140]
[0141] Among them, f1 represents the fitness function of the genetic algorithm, N represents the number of books in a group, P1 kThe k-th dimension vector representing the first introduction vector of the target book, P ik The k-th dimension vector representing the second introduction vector of the i-th book, where m represents the total number of dimensions of the vector.
[0142] Except that the population initialization and fitness function are different from those of the genetic algorithm in the prior art, other steps such as selection, crossover and mutation are the same as those of the genetic algorithm in the prior art and are not described in detail in this embodiment.
[0143] (3) If the target book information includes a sentence describing the target book information, first extract a set of sentence keywords from the sentence describing the target book information; then find the book style category of the target book based on the set of sentence keywords and the keyword library of book style; then use a genetic algorithm to find a set of optimal book introductions N from the book data set corresponding to the book style category of the target book, and determine a set of optimal search books based on the set of optimal book introductions. Specifically, it includes the following contents:
[0144] Based on a set of sentence keywords and a book style keyword library, the book style category of the target book is found. This can be achieved by using the book style category and keywords from the book style keyword library to train a large language model. The trained large language model is then input into the trained large language model to predict the book style category of the target book.
[0145] After finding the target book's genre, a genetic algorithm is used to find an optimal set of book descriptions from the book dataset corresponding to the target book's genre. Finally, a corresponding set of book titles is found based on the optimal book descriptions, resulting in an optimal set of searched books. The genetic algorithm includes steps such as initializing the population, constructing a fitness function, selection, crossover, and mutation. Specifically, it includes:
[0146] Initialize the population: Take a set of book descriptions of a preset number of books as an individual, and randomly generate an original population based on the book dataset. The original population contains multiple individuals.
[0147] First, obtain the keywords of the book introduction corresponding to each book in the reading platform obtained in step 3; then convert a set of sentence keywords into a sentence vector, and convert the keywords of the book introduction corresponding to each book in the book dataset into a second introduction vector; finally, based on the sentence vector and the second target vector, construct the fitness function of the genetic algorithm as follows:
[0148]
[0149] Among them, f2 represents the fitness function of the genetic algorithm, N represents the number of books in a group, and P2 kThe k-th dimension vector representing the sentence vector of the target book, P ik The k-th dimension vector representing the second introduction vector of the i-th book, where m represents the total number of dimensions of the vector.
[0150] Except that the population initialization and fitness function are different from those of the genetic algorithm in the prior art, other steps such as selection, crossover and mutation are the same as those of the genetic algorithm in the prior art and are not described in detail in this embodiment.
[0151] The optimal set of search books N (i.e., target books, which are books corresponding to the target book information input by the user) obtained by the genetic algorithm is used as the search results. Using multiple books as search results is to better match the books needed by the user and improve the accuracy of the book search results.
[0152] Reference Figure 3 The embodiment of the present application further provides a keyword-based book search system, which may include a data acquisition unit 100, a first construction unit 200, a second construction unit 300, and a book search unit 400, wherein:
[0153] The data acquisition unit 100 is used to acquire the book information of all books in the reading platform and obtain the target book information input by the user;
[0154] The first construction unit 200 is used to construct a book knowledge graph based on the book information, and to cluster all books by style based on the book information to obtain a style clustering result;
[0155] The second constructing unit 300 is used to construct a style keyword library about book styles, wherein the style keyword library includes a plurality of keywords used to characterize the style of each book;
[0156] The book search unit 400 is used to perform book search based on the book knowledge graph, the style clustering results, the style keyword library and the target book information to determine the target book.
[0157] In some embodiments, the second building unit 300 can be specifically used to:
[0158] Preset initial keywords for each book style;
[0159] Extracting the first keyword of the book introduction corresponding to the first book to be stored in the style keyword library;
[0160] Calculate the repetition rate between all first keywords and all second keywords of each book in the existing genre keyword library;
[0161] When the repetition rate is smaller than a preset threshold, the first keyword is converted into a first keyword vector, and the initial keyword of each book style is converted into a second keyword vector;
[0162] Calculating the similarity between the first book and each book style based on the first keyword vector and the second keyword vector;
[0163] The first keyword is used as the keyword of the book style category with the greatest similarity to construct a style keyword library about book styles.
[0164] In some embodiments, the second building unit 300 can be specifically used to:
[0165]
[0166] Among them, S1 represents the keyword similarity, A iv represents the v-th dimension vector in the first keyword vector corresponding to the i-th book, B jv It represents the v-th dimension vector in the second keyword vector corresponding to the j-th book style, and h represents the total dimension of the vector.
[0167] In some implementations, the book search unit 400 may be specifically configured to:
[0168] If the target book information is any of the following: a complete book title and a complete book author, a complete book author and keywords of the target book title, or a complete book title, a book search is performed based on the target book information and the book knowledge graph to determine the target book;
[0169] If the target book information is a keyword in a book introduction or a sentence describing the target book information, a book search is performed based on the style clustering result, the style keyword library and the target book information to determine the target book.
[0170] In some implementations, the book search unit 400 may be specifically configured to:
[0171] If the target book information is a complete book title or a complete book title and book author, then a book search is performed on the book knowledge graph to search for books corresponding to the target book information to determine the target book;
[0172] If the target book information is the complete book author and keywords of the target book title, then search for all books corresponding to the complete book author in the book knowledge graph based on the complete book author to obtain a set of books corresponding to the complete book author; calculate the similarity between the book title of each book in the book set corresponding to the complete book author and the keywords of the target book title; and determine the final target book based on the similarity.
[0173] In some implementations, the book search unit 400 may be specifically configured to:
[0174] Find the target book's genre category based on the keywords in the target book's introduction and the genre keyword library;
[0175] A genetic algorithm is used to search for a set of optimal book descriptions from the style clustering results corresponding to the book style categories of the target book;
[0176] An optimal set of target books is determined based on a set of optimal book introductions.
[0177] In some implementations, the book search unit 400 may be specifically configured to:
[0178] Extract a group of sentence keywords from a sentence describing target book information;
[0179] Determine the book style category of the target book based on a set of sentence keywords and style keyword libraries;
[0180] A genetic algorithm is used to search for a set of optimal book descriptions from the style clustering results corresponding to the book style categories of the target book;
[0181] An optimal set of target books is determined based on a set of optimal book introductions.
[0182] It should be noted that, since the keyword-based book search system in this embodiment and the keyword-based book search method described above are based on the same inventive concept, the corresponding contents in the method embodiment are also applicable to the system embodiment and will not be described in detail here.
[0183] Reference Figure 4 , an embodiment of the present application further provides an electronic device, the electronic device comprising:
[0184] at least one memory;
[0185] at least one processor;
[0186] at least one program;
[0187] The programs are stored in the memory, and the processor executes at least one program to implement the above-mentioned keyword-based book search method of the present disclosure.
[0188] The electronic device may be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a car computer, etc.
[0189] The electronic device according to the embodiment of the present application is described in detail below.
[0190] The processor 1600 may be implemented as a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided by the embodiments of the present disclosure.
[0191] Memory 1700 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). Memory 1700 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in memory 1700 and is called by processor 1600 to execute the keyword-based book search method of the embodiments of this disclosure.
[0192] Input / output interface 1800, used for information input and output;
[0193] Communication interface 1900, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);
[0194] Bus 2000 , which transmits information between various components of the device (e.g., processor 1600 , memory 1700 , input / output interface 1800 , and communication interface 1900 );
[0195] The processor 1600 , the memory 1700 , the input / output interface 1800 , and the communication interface 1900 are connected to each other in communication within the device via the bus 2000 .
[0196] An embodiment of the present disclosure further provides a storage medium, which is a computer-readable storage medium and stores computer-executable instructions. The computer-executable instructions are used to enable a computer to execute the above-mentioned keyword-based book search method.
[0197] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0198] The embodiments described in the embodiments of the present disclosure are intended to more clearly illustrate the technical solutions of the embodiments of the present disclosure and do not constitute a limitation on the technical solutions provided by the embodiments of the present disclosure. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present disclosure are also applicable to similar technical problems.
[0199] Those skilled in the art will understand that the technical solutions shown in the drawings do not constitute a limitation on the embodiments of the present disclosure, and may include more or fewer steps than shown in the drawings, or a combination of certain steps, or different steps.
[0200] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0201] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0202] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0203] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0204] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0205] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0206] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0207] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions for enabling an electronic device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk. The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the present application is not limited to the above embodiments. Various changes can be made within the scope of knowledge possessed by ordinary technicians in the relevant technical field without departing from the purpose of the present application.
[0208] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the present application is not limited to the above embodiments. Various changes can be made within the scope of knowledge possessed by ordinary technicians in the relevant technical field without departing from the purpose of the present application.
Claims
1. A keyword-based book search method, characterized in that: The method comprises: Obtain the book information of all books in the reading platform and obtain the target book information input by the user; Constructing a book knowledge graph based on the book information, and clustering all books by style based on the book information to obtain a style clustering result; Constructing a style keyword library about book styles, wherein the style keyword library includes a plurality of keywords for characterizing the style of each book; A book search is performed based on the book knowledge graph, the style clustering result, the style keyword library, and the target book information to determine the target book.
2. The keyword-based book search method according to claim 1, characterized in that: The construction of a style keyword library about book styles includes: Preset initial keywords for each book style; Extracting the first keyword of the book introduction corresponding to the first book to be stored in the style keyword library; Calculating the repetition rate between all first keywords and all second keywords of each book already stored in the genre keyword library; When the repetition rate is smaller than a preset threshold, converting the first keyword into a first keyword vector, and converting the initial keyword of each book style into a second keyword vector; Calculating the similarity between the first book and each book style based on the first keyword vector and the second keyword vector; The first keyword is used as the keyword of the book style category with the greatest similarity to construct a style keyword library about book styles.
3. The keyword-based book search method according to claim 2, characterized in that: Calculating the similarity between the first book and each book style based on the first keyword vector and the second keyword vector includes: Among them, S1 represents the keyword similarity, A iv represents the v-th dimension vector in the first keyword vector corresponding to the i-th book, B jv Represents the v-th dimension vector in the second keyword vector corresponding to the h-th book style, and h represents the total dimension of the vector.
4. The keyword-based book search method according to claim 1, characterized in that: The target book information includes the complete book title and the complete book author, keywords of the complete book author and the target book title, the complete book title, keywords of the target book introduction, and a sentence describing the target book information. The book search based on the book knowledge graph, the style clustering results, the style keyword library, and the target book information to determine the target book includes: If the target book information is any one of a complete book title and a complete book author, a complete book author and keywords of the target book title, and a complete book title, a book search is performed based on the target book information and the book knowledge graph to determine the target book; If the target book information is a keyword in a book introduction or a sentence describing the target book information, a book search is performed based on the style clustering result, the style keyword library and the target book information to determine the target book.
5. The keyword-based book search method according to claim 4, characterized in that: If the target book information is any one of a complete book title and a complete book author, a complete book author and keywords of the target book title, and a complete book title, a book search is performed based on the target book information and the book knowledge graph to determine the target book, including: If the target book information is a complete book title or a complete book title and book author, searching for books corresponding to the target book information in the book knowledge graph to perform a book search to determine the target book; If the target book information is a complete book author and keywords of the target book title, then all books corresponding to the complete book author are searched in the book knowledge graph according to the complete book author to obtain a book set corresponding to the complete book author; the similarity between the book title of each book in the book set corresponding to the complete book author and the keywords of the target book title is calculated; and the final target book is determined based on the similarity.
6. The keyword-based book search method according to claim 4, characterized in that: If the target book information is a keyword of the target book introduction, a book search is performed based on the style clustering result, the style keyword library and the target book information to determine the target book, including: Finding the book style category of the target book based on the keywords of the target book introduction and the style keyword library; Using a genetic algorithm to search for a set of optimal book introductions from the style clustering results corresponding to the book style categories of the target book; A group of optimal target books is determined according to the group of optimal book introductions.
7. The keyword-based book search method according to claim 4, characterized in that: If the target book information is a sentence describing the target book information, performing a book search based on the style clustering result, the style keyword library, and the target book information to determine the target book includes: Extract a group of sentence keywords from a sentence describing target book information; Determining the book style category of the target book based on the set of sentence keywords and the style keyword library; Using a genetic algorithm to search for a set of optimal book introductions from the style clustering results corresponding to the book style categories of the target book; A group of optimal target books is determined according to the group of optimal book introductions.
8. A book search system based on keywords, characterized in that: The system comprises: A data acquisition unit, configured to acquire the book information of all books in the reading platform and obtain the target book information input by the user; A first construction unit is configured to construct a book knowledge graph based on the book information, and to cluster all books by style based on the book information to obtain a style clustering result; A second construction unit is used to construct a style keyword library about book styles, wherein the style keyword library contains a plurality of keywords for characterizing the style of each book; A book search unit is used to perform a book search based on the book knowledge graph, the style clustering result, the style keyword library and the target book information to determine the target book.
9. An electronic device, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to execute the keyword-based book search method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the keyword-based book search method according to any one of claims 1 to 7.