Information retrieval method and device, electronic equipment and readable storage medium

By fusing feature vectors and category tag bit vectors of retrieval information to form a target retrieval vector, the problems of low retrieval efficiency and insufficient accuracy in existing technologies are solved, and efficient and accurate information retrieval is achieved.

CN112256730BActive Publication Date: 2025-12-30TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011256814.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-11
Publication Date
2025-12-30
Estimated Expiration
2040-11-11

AI Technical Summary

Technical Problem

Existing technologies suffer from low processing efficiency and inaccurate results when retrieving the most similar information in a target category, especially when filtering target category information from massive amounts of data, which may result in insufficient information or inaccurate results.

Method used

By fusing the feature vector and category tag bit vector of the retrieved information, a target retrieval vector is formed. By using the similarity between this vector and the retrieval vector of the retrieved information, information belonging to the target retrieval category can be directly determined, avoiding an additional filtering process.

Benefits of technology

It improves the accuracy and efficiency of information retrieval, ensures that information belonging to the target search category is retrieved, and reduces additional filtering steps.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112256730B_ABST
    Figure CN112256730B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an information retrieval method and device, electronic equipment and readable storage medium, and relate to the technical field of cloud technology and artificial intelligence. The method comprises: obtaining retrieval information and a target retrieval category corresponding to the retrieval information; obtaining each keyword corresponding to the to-be-retrieved information, and obtaining a feature vector of the retrieval information by fusing word vectors of each keyword; fusing the feature vector of the retrieval information and a category mark bit vector corresponding to the target retrieval category to obtain a target retrieval vector corresponding to the to-be-retrieved information; and determining target information belonging to the target retrieval category from each retrieved information based on the similarity between the target retrieval vector corresponding to the retrieval information and retrieval vectors corresponding to each retrieved information, wherein the retrieval vector of the retrieved information is determined based on a feature vector of the retrieved information and a category mark bit vector corresponding to the information category of the retrieved information. In the present application, it is ensured that information belonging to the target retrieval category can be retrieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of cloud technology and artificial intelligence technology. Specifically, this application relates to an information retrieval method, apparatus, electronic device, and readable storage medium. Background Technology

[0002] Currently, the nearest neighbor algorithm is commonly used for fast retrieval of similar information, enabling rapid searching of similar information from massive datasets. For example, after a user finishes reading a news article A, the nearest neighbor algorithm is typically used to quickly search through massive datasets to find and push similar news articles B to the user, encouraging them to continue reading. However, in practical applications, the retrieval of similar information sometimes requires considering not only the similarity of the content but also the category of the information, in order to retrieve the most similar information within the target category.

[0003] In existing technologies, when retrieving the most similar information within a target category, the common approach is to quickly retrieve N highly similar information items based on the nearest neighbor algorithm, and then filter these N items to obtain the target category information. However, this method requires a filtering process each time the target category information is determined from massive amounts of data, reducing processing efficiency. Furthermore, it may result in insufficient information for the target category, leading to inaccurate search results. For example, when the information is news or informational, the number of such items may be too small, resulting in inaccurate search results. Summary of the Invention

[0004] This application provides an information retrieval method, apparatus, electronic device, and readable storage medium. By taking into account information category factors, it can effectively ensure that information belonging to the information category of the retrieved information is retrieved from each retrieved information, thereby improving the accuracy of information retrieval and eliminating the need for information filtering, thus improving processing efficiency.

[0005] On the one hand, embodiments of this application provide an information retrieval method, which includes:

[0006] Obtain the search information and the target search category corresponding to the search information;

[0007] Obtain the keywords corresponding to the information to be retrieved, and convert each keyword into a word vector. Then, obtain the feature vector of the retrieved information by fusing the word vectors of each keyword.

[0008] Based on the target retrieval category, obtain the category tag bit vector corresponding to the target retrieval category;

[0009] The feature vector and category label bit vector of the retrieved information are fused to obtain the target retrieval vector corresponding to the information to be retrieved;

[0010] Based on the similarity between the target retrieval vector corresponding to the retrieved information and the retrieval vector corresponding to each retrieved information, the target information belonging to the target retrieval category is determined from each retrieved information. For any retrieved information, the retrieval vector of the retrieved information is determined based on the feature vector of the retrieved information and the category label bit vector corresponding to the information category of the retrieved information.

[0011] On the other hand, embodiments of this application provide an information retrieval device, which includes:

[0012] The information acquisition module is used to acquire search information and the target search category corresponding to the search information;

[0013] The feature vector determination module is used to obtain each keyword corresponding to the information to be retrieved, and convert each keyword into a word vector. The feature vector of the retrieved information is obtained by fusing the word vectors of each keyword. Based on the target retrieval category, the category label bit vector corresponding to the target retrieval category is obtained. The feature vector and category label bit vector of the retrieved information are fused to obtain the target retrieval vector corresponding to the information to be retrieved.

[0014] The target information determination module is used to determine the target information belonging to the target retrieval category from each retrieved information based on the similarity between the target retrieval vector corresponding to the retrieved information and the retrieval vector corresponding to each retrieved information. For any retrieved information, the retrieval vector of the retrieved information is determined based on the feature vector of the retrieved information and the category label bit vector corresponding to the information category of the retrieved information.

[0015] In another aspect, embodiments of this application provide an electronic device, including a processor and a memory: the memory is configured to store a computer program, which, when executed by the processor, causes the processor to perform the aforementioned information retrieval method.

[0016] In another aspect, embodiments of this application provide a computer-readable storage medium for storing a computer program, which, when run on a computer, enables the computer to execute the aforementioned information retrieval method.

[0017] The beneficial effects of the technical solutions provided in this application are:

[0018] In this embodiment, a target retrieval vector for the retrieved information can be determined. Then, based on the similarity between the target retrieval vector and the retrieval vectors of each retrieved information, target information belonging to the target retrieval category is determined from each retrieved information. Since the target retrieval vector is obtained by fusing the feature vector of the retrieved information and the category marker bit vector corresponding to the target retrieval category, and the retrieval vector of the retrieved information is also determined based on the feature vector of the retrieved information and the category marker bit vector corresponding to the information category of the retrieved information, it can be seen that the category information is added to both the target retrieval vector and the retrieval vector of the retrieved information in this embodiment. Accordingly, when determining the target information based on the target retrieval vector and the retrieval vector of the retrieved information, the category information factor is taken into consideration. This effectively ensures that information belonging to the target retrieval category is retrieved from each retrieved information, thereby improving the accuracy of information retrieval and eliminating the need for another information filtering process, thus improving processing efficiency. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.

[0020] Figure 1 A flowchart illustrating an information retrieval method provided in an embodiment of this application;

[0021] Figure 2 A schematic diagram illustrating the angle within a two-dimensional space, provided as an embodiment of this application;

[0022] Figure 3a This is a schematic diagram illustrating the determination of target information provided in an embodiment of this application;

[0023] Figure 3b A flowchart illustrating the process of determining target recommendation information provided in an embodiment of this application;

[0024] Figure 4 A schematic diagram illustrating target recommendation information provided in an embodiment of this application;

[0025] Figure 5 This is a schematic diagram of the structure of an information retrieval device provided in an embodiment of this application;

[0026] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0027] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0028] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this application means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.

[0029] Currently, vector similarity retrieval primarily employs the nearest neighbor algorithm for fast searching, enabling the rapid identification of similar data from massive datasets. However, in practical applications, vector similarity search requires consideration not only of vector similarity but also of their category, in order to retrieve the most similar vectors within a specific category. Existing methods for fast retrieval of vectors within a specific category involve building a Faiss index for each category, or building only one Faiss index, and then filtering the retrieved results for non-category-specific data. However, building a Faiss index for each category requires constructing multiple Faiss indexes, which consumes significant memory. Conversely, building only one Faiss index necessitates filtering the results after each retrieval, and the filtered results may be inaccurate, such as filtering out highly similar vectors that do not belong to the target category.

[0030] Based on this, embodiments of this application provide an information retrieval method, apparatus, electronic device, and readable storage medium, aiming to solve some or all of the technical problems existing in the prior art. The method can be executed by a server or a terminal device. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smartphone, tablet computer, laptop computer, desktop computer, etc., but is not limited thereto. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.

[0031] Optionally, the execution subject of the method provided in this application embodiment can be a server, such as a cloud server.

[0032] In the various optional implementations provided in this application, the data processing and computation involved can be implemented using cloud computing. Cloud computing refers to the delivery and usage model of IT infrastructure, which means obtaining the required resources in an on-demand and easily scalable manner through the network. In a broader sense, cloud computing refers to the delivery and usage model of services, which means obtaining the required services in an on-demand and easily scalable manner through the network. Such services can be IT and software, Internet-related, or other services. Cloud computing is a product of the development and integration of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing. With the development of the Internet, real-time data streams, and the diversification of connected devices, as well as the driving force of demands such as search services, social networks, mobile commerce, and open collaboration, cloud computing has developed rapidly. Unlike previous parallel and distributed computing, the emergence of cloud computing will, conceptually, drive a revolutionary change in the entire Internet model and enterprise management model.

[0033] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of storage devices of various types (storage devices are also called storage nodes) in the network to work together and jointly provide data storage and business access functions to the outside world.

[0034] Currently, the storage method of storage systems is as follows: Logical volumes are created. During the creation of a logical volume, physical storage space is allocated to each logical volume. This physical storage space may consist of a single storage device or the disks of several storage devices. Clients store data on a logical volume, which means storing the data on the file system. The file system divides the data into many parts, each part being an object. Each object contains not only the data but also additional information such as a data identifier (ID, ID entity). The file system writes each object to the physical storage space of that logical volume and records the storage location information of each object. Therefore, when a client requests access to data, the file system can allow the client to access the data based on the storage location information of each object.

[0035] Optionally, the feature vectors and other features involved in the various optional embodiments provided in this application can be implemented using artificial intelligence (AI) technology. AI is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to have perception, reasoning, and decision-making functions. AI technology is a comprehensive discipline involving a wide range of fields, encompassing both hardware and software technologies. Basic AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operating / interactive systems, and mechatronics. AI software technologies mainly include computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0036] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0037] First, we will introduce and explain several terms involved in the embodiments of this application:

[0038] Eigenvector: A geometric object that has both magnitude and direction and satisfies the parallelogram law.

[0039] Embedding (feature vector embedding): In a low-dimensional, dense, continuous feature vector space, each item is mapped to a feature vector in the real number field. Feature vectors that are close in distance correspond to items that are similar in meaning.

[0040] Facebook Faiss: A clustering and similarity search library that uses the KNN (K-Nearest Neighbor) algorithm to provide efficient similarity search and clustering for dense vectors.

[0041] Word2vec (word to vector): A model that converts words into vectors (Embeddings).

[0042] Figure 1 This paper illustrates a flowchart of an information retrieval method provided in an embodiment of this application, using a server as the executing entity as an example. The method may include:

[0043] Step S101: Obtain the search information and the target search category corresponding to the search information.

[0044] In this context, "retrieval information" refers to the baseline information used for information retrieval, while "target retrieval category" refers to the information category to which the desired retrieved information belongs. For example, if you want to retrieve news about application A being disabled, you could use "application A is disabled" as the retrieval information, and "news" as the target retrieval category.

[0045] Step S102: Obtain the keywords corresponding to the information to be retrieved, and convert each keyword into a word vector. By fusing the word vectors of each keyword, obtain the feature vector of the retrieved information.

[0046] Optionally, when determining the feature vector of the retrieved information, the keywords corresponding to the retrieved information can be obtained. These keywords can represent the main content of the retrieved information. The specific content of the keywords may differ for different types of information. For example, when the retrieved information is an article, the keyword could be a word within the article or a tag corresponding to the article; while when the retrieved information is an image, the keyword could be a tag corresponding to the image. Accordingly, after obtaining the keywords corresponding to the retrieved information, each keyword can be converted into a word vector, and then the word vectors of each keyword can be fused to obtain the feature vector of the retrieved information.

[0047] Optionally, the method for converting keywords into word vectors can be pre-configured, and this embodiment of the application is not limited thereto. For example, keywords can be input into the Word2vec model to convert them into corresponding word vectors.

[0048] In optional embodiments of this application, keywords include tag information corresponding to the search information. Each keyword is converted into a word vector, and the feature vector of the search information is obtained by fusing the word vectors of each keyword, including:

[0049] Obtain the tag information corresponding to the search information, and the weight of each tag information;

[0050] Convert each tag information into a word vector;

[0051] Each word vector is weighted based on the weight corresponding to each tag information to obtain the weighted word vectors;

[0052] By fusing and weighting the word vectors, we obtain the feature vector of the retrieved information.

[0053] Optionally, the keywords corresponding to the search information can refer to the tags corresponding to the search information. Since the content referred to by different tags has different impacts on the searched information, the weight corresponding to each tag can be predetermined. Accordingly, after obtaining the tag information, the tag information can be converted into corresponding word vectors. Then, the word vectors are weighted based on the weight corresponding to each tag information to obtain weighted word vectors. The weighted word vectors are then fused, and the fused feature vector is used as the feature vector of the search information. The specific implementation method of weighting and fusing word vectors based on the weights corresponding to each tag information is not limited in this application embodiment. For example, the average weighting method, TF-IDF (term frequency–inverse document frequency) weighting method, SIF (smooth inverse frequency weighting(W)) weighting method, etc., can be used to weight the word vectors. This application embodiment does not limit the specific implementation method.

[0054] (1) Weighted average method: refers to the method of calculating the weighted arithmetic mean of the observations of the same variable by using several past observations arranged in chronological order and weighting them by the chronological order number.

[0055] In one example, suppose the tags for the retrieved information are "Person A" and "Application B". The word vectors for "Person A" are [-0.88, 1.13, 0.29, 0.98, ..., 0.48], and the word vectors for "Application B" are [1.83, 1.13, 0.39, 0.68, ..., 0.40]. When the vector weighting fusion method is average weighting, the feature vector after fusing the word vectors of each tag is [0.475, 1.13, 0.34, 0.83, ..., 0.44].

[0056] (2) TF*IDF method: a commonly used weighting technique for information retrieval and data mining.

[0057] Here, TF (term frequency) refers to the frequency of word occurrence, such as the number of times a tag appears in an article, and can usually be set to 1;

[0058] IDF (Inverse Document Frequency): The inverse document frequency of a word, which can be determined by the following formula:

[0059] IDF = log((1+N) / (1+N_word))

[0060] Where N represents the total number of articles, N_word represents the number of articles in which the word appears, and the fewer times a word appears, the higher its importance is. The fused feature vector can be determined by the following formula:

[0061] item_vector=∑IDF*word_vector

[0062] Where item_vector is the fused feature vector, IDF is the inverse document frequency (also known as IDF weight), and word_vector represents the word vector.

[0063] Continuing with the previous example, assuming fewer articles contain the tag "Person A", then the tag "Person A" is more important and has a higher weight. For example, if the IDF weight of the tag "Application B" is calculated to be 0.1, while the IDF weight of the tag "Person A" is 0.4, then the word vector fusion vector for each tag is [0.82, 0.565, 0.305, ..., 0.408].

[0064] (3) SIF method: A method for constructing sentence embeddings. The specific feature vector weighting formula is shown below:

[0065]

[0066] Where item_vector is the fused feature vector, word_vector represents the word vector, α represents the hyperparameter, which can usually be set to 10e-3, and p(word) represents the probability of a word appearing in the article. It is similar to the TF*IDF weighting method. When a word appears less frequently in the article, it indicates that its importance is higher, and the weight of the word is higher.

[0067] Step S103: Based on the target retrieval category, obtain the category tag bit vector corresponding to the target retrieval category.

[0068] Optionally, a category tag bit vector corresponding to each possible information category can be pre-constructed. Accordingly, when determining the category tag bit vector corresponding to the target retrieval category, it can be directly obtained based on the pre-constructed feature vector.

[0069] In the process of pre-constructing the category label bit vectors corresponding to each potentially involved information category, n feature vectors with different directions but whose pairwise angles are all greater than a degree α can be constructed, and each feature vector can be used as the category label bit vector for information category 1, 2, ..., n. Optionally, the category label bit vectors for information category 1, 2, ..., n can be feature vectors in two-dimensional space, in which case the angles between the category label bit vectors of each information category can be as follows: Figure 2 As shown, Figure 2 The figure shows the angle between the category marker bit vectors of two information categories in two-dimensional space, which may correspond to degrees (e.g., 0°, ..., 30°, ..., 330° or 360°, etc.). Of course, the category marker bit vectors of information categories 1, 2, ..., n can also be feature vectors in multi-dimensional space, and this application does not limit this.

[0070] Step S104: The feature vector and category tag bit vector of the retrieved information are fused to obtain the target retrieval vector corresponding to the information to be retrieved;

[0071] Optionally, the feature vector of the retrieved information and the category tag bit vector corresponding to the target retrieval category can be fused, and the fused feature vector can be used as the target retrieval vector corresponding to the information to be retrieved. The method of fusing the feature vector of the retrieved information and the category tag bit vector corresponding to the target retrieval category can be pre-configured and is not limited in this embodiment. As an optional implementation, in this embodiment, fusing the feature vector of the retrieved information and the category tag bit vector to obtain the target retrieval vector corresponding to the information to be retrieved may include:

[0072] The feature vector and category label bit vector of the retrieved information are concatenated to obtain the target retrieval vector corresponding to the retrieved information.

[0073] Optionally, after knowing the feature vector of the retrieved information and the category label bit vector of the target retrieved category, the feature vector of the retrieved information and the category label bit vector of the target retrieved category can be concatenated to obtain the target feature vector of the retrieved information.

[0074] In one example, suppose the category label bit vectors for information categories 1, 2, ..., n are [z 1k ,z 2k,…,z lk ], where l represents the dimension of the category label bit vector, and k represents the k-th information category among 1 to n information categories. For any retrieved information, the feature vector x1 corresponding to the retrieved information can be represented as: x1=[a1,a2,…,a n If the target retrieval category of the retrieved information is k, then the target retrieval vector of the retrieved information is [a1, a2, ..., a]. n ,z 1k ,z 2k ,…,z lk ].

[0075] Optionally, when there are only two categories of information that may be involved (such as category 1 and category 2), feature vectors with lower dimensions can be used, such as category label bit vectors [1] and [-1] representing category 1 and category 2 respectively. Since the category label bit vectors corresponding to the information categories have fewer dimensions, the amount of data processing can be effectively reduced when performing data calculations based on the category label bit vectors corresponding to the information categories.

[0076] In one example, for any retrieved information, suppose the feature vector corresponding to that retrieved information can be represented as: [a1, a2, ..., a n If the target retrieval category for this information is category 2, then the retrieval vector for this information is [a1, a2, ..., a...]. n If the target retrieval category of this information is category 1, then the retrieval volume of this information is [a1, a2, ..., a1]. n ,1].

[0077] It is understandable that when determining the similarity between the category label bit vectors of two information categories, since there is an angle between the category label bit vectors of different categories, if the two categories are the same, the similarity between the category label bit vectors of the two information categories will be greater than the similarity when the two categories are different.

[0078] Step S105: Based on the similarity between the target retrieval vector corresponding to the retrieval information and the retrieval vector corresponding to each retrieved information, the target information belonging to the target retrieval category is determined from each retrieved information. For any retrieved information, the retrieval vector of the retrieved information is determined based on the feature vector of the retrieved information and the category label bit vector corresponding to the information category of the retrieved information.

[0079] Optionally, a retrieval vector can be obtained for each piece of retrieved information. The retrieval vector for each piece of retrieved information is determined based on its feature vector and the category marker bit vector corresponding to its information category. The method for determining the retrieval vector for each piece of retrieved information is the same as determining the target retrieval vector corresponding to the retrieval vector. That is, for any piece of retrieved information, the keywords corresponding to it can be obtained and converted into word vectors. The feature vector of the retrieved information is obtained by fusing the word vectors of the keywords. Then, the category marker bit vector corresponding to the information category of the retrieved information is obtained, and the feature vector and the category marker bit vector are fused to obtain the retrieval vector corresponding to the retrieved information.

[0080] Accordingly, the similarity between the target retrieval vector corresponding to the retrieved information and the retrieval vector corresponding to each retrieved information can be determined. Then, based on the similarity between the target retrieval vector and the retrieval vector of each retrieved information, the target information can be determined from each retrieved information. For example, the retrieved information corresponding to the N retrieval vectors that have a high similarity to the target retrieval vector of the retrieved information can be determined as the target information.

[0081] The method for determining the similarity between the target retrieval vector of the retrieved information and the retrieval vector of each retrieved information is not limited in this embodiment of the application. For example, it can be determined using the following formula:

[0082]

[0083] Where sim represents the similarity between the target retrieval vector and the retrieval vector of the retrieved information, and a i v represents the feature vector corresponding to the retrieved information. i ∑ represents the feature vector corresponding to the retrieved information. n a i ·c i a represents the similarity between the feature vector corresponding to the retrieved information and the feature vector corresponding to the retrieved information. flag and c flag These represent the category tag bit vectors corresponding to the target retrieval category and the information category of the retrieved information, respectively. l a flag ·c flag This represents the similarity between the category tag bit vector corresponding to the target retrieval category and the category tag bit vector corresponding to the information category of the retrieved information.

[0084] In one example, suppose the feature vector x1 corresponding to the retrieved information 1 is: x1 = [a1, a2, ..., a nThe category tag bit vector for the corresponding information category k is [z]. 2k ,…,z lk At this point, the retrieval vector corresponding to the retrieved information 1 is [a1, a2, ..., a...]. n ,z 1k ,z 2k ,…,z lk The feature vector x2 corresponding to the retrieved information 2 is: x2 = [b1, b2, ..., b n The category label bit vector for category j is [z]. 2j ,…,z lj At this point, the retrieval vector corresponding to the retrieved information 2 is [b1, b2, ..., b]. n ,z 1j ,z 2j ,…,z lj Assume the feature vector y corresponding to the retrieved information is: y = [c1, c2, ..., c2]. n When the information category is k (i.e., the target retrieval category), the target retrieval vector [c1, c2, ..., c] of the retrieved information is... n ,z 1k ,z 2k ,…,z lk At this point, the similarity between the target retrieval vector and the retrieval vector of the retrieved information 1 is:

[0085]

[0086] The similarity between the target retrieval vector of the retrieved information and the retrieval vector of the retrieved information 2 is:

[0087]

[0088] In this context, it is assumed that the magnitude of the category label bit vector corresponding to each information category is t. Since there is an angle θ between the category label bit vectors corresponding to different information categories, and the information category of the retrieved information is the same as the information category of retrieved information 1 (in which case the angle θ is 0 degrees), while the target retrieval category and the information category of retrieved information 2 are different, the similarity sim between the category label bit vector corresponding to the information category of retrieved information 1 and the category label bit vector corresponding to the information category of retrieved information 1 is... cat_kk For t 2 The similarity between the category tag bit vector corresponding to the information category of retrieved information 1 and the category tag bit vector corresponding to the information category of retrieved information 2 is sim. cat_kj For t 2cosθ, and to ensure that the target retrieval category and the information category of the retrieved information are the same (k category), then it is only necessary to ensure sim news1 +sim cat_kk >sim news2 +sim cat_kj , i.e. t 2 +sim news1 >t 2 cosθ+sim news2 That is sufficient, and since -1 ≤ sim news ≤1, therefore we can get -2≤sim news1 -sim news2 ≤2, meaning that in practical applications, as long as t is ensured 2 >t 2 cosθ+sim news1 -sim news2 That is, t 2 >t 2 cosθ+2 ensures that the similarity between the target retrieval vector and the retrieval vector of the retrieved information belonging to the same information category is greater than the similarity between the target retrieval vector and the retrieval vector of the retrieved information belonging to different information categories. For example, when t is 6 and cosθ = 0.8, the above condition is satisfied.

[0089] It can be understood that when there are only two categories of information that may be involved (such as category 1 and category 2) and category label bit vectors [1] and [-1] are used to represent category 1 and category 2 respectively, the dimensionality of the category label bit vector corresponding to the information category is reduced accordingly, and the above formula for determining similarity can be as follows:

[0090]

[0091] Among them, due to Σ n a i ·c i The value ranges from -1 to 1 (typically, unit vector similarity ranges from -1 to 1). Therefore, when the information category of the retrieved information and the target retrieval category of the retrieved information are the same, such as both being category 1, a flag ·c flag When the value is 1, the similarity between the target retrieval vector and the retrieval vector of the retrieved information will be between 0 and 2. When the information category of the retrieved information and the information category of the retrieved information are different, such as category 1 and category 2 respectively, a flag ·c flagThe value is -1, meaning the similarity between the target retrieval vector and the retrieved information's retrieval vector will be between -2 and 0. It's clear that the similarity between a target retrieval vector belonging to the same information category and the retrieved information's retrieval vector is greater than the similarity between a target retrieval vector belonging to different information categories and the retrieved information's retrieval vector. This ensures that the retrieved information's information category matches the target retrieval category.

[0092] In optional embodiments of this application, the retrieval information includes retrieval news, and each piece of retrieved information includes news to be recommended;

[0093] Based on the similarity between the target retrieval vector corresponding to the retrieved information and the retrieval vectors corresponding to each retrieved information, target information belonging to the target retrieval category is determined from each retrieved information, including:

[0094] Based on the similarity between the target retrieval vector corresponding to the retrieved information and the retrieval vector corresponding to each piece of information to be recommended, at least one piece of information belonging to the target retrieval category is determined from each piece of information to be recommended.

[0095] Recommend relevant information to users.

[0096] Optionally, the retrieval information may include retrieval information, while the retrieved information may include information to be recommended. In this case, based on the similarity between the target retrieval vector corresponding to the retrieval information and the retrieval vector corresponding to each piece of information to be recommended, at least one target recommended information belonging to the target retrieval category can be determined from each piece of information to be recommended.

[0097] Optionally, after obtaining at least one target recommendation information, the at least one target recommendation information can also be recommended to the user. The method of providing the at least one target recommendation information to the user can be pre-configured and is not limited in this embodiment. For example, each target recommendation information can be directly recommended to the user. Alternatively, to reduce data transmission, only keywords from each target recommendation information can be recommended to the user, and when the user selects a keyword, the recommendation information corresponding to that keyword can then be recommended to the user.

[0098] In this embodiment, a target retrieval vector for the retrieved information can be determined. Then, based on the similarity between the target retrieval vector and the retrieval vectors of each retrieved information, target information belonging to the target retrieval category is determined from each retrieved information. Since the target retrieval vector is obtained by fusing the feature vector of the retrieved information and the category tag bit vector corresponding to the target retrieval category, and the retrieval vector of the retrieved information is also determined based on the retrieved information and its information category, it can be seen that the target retrieval vector and the retrieval vector of the retrieved information in this embodiment both include the information category to which they belong. Accordingly, when determining the target information based on the target retrieval vector and the retrieval vector of the retrieved information, the information category factor is taken into consideration. This effectively ensures that information belonging to the target retrieval category is retrieved from each retrieved information, thereby improving the accuracy of information retrieval and eliminating the need for another information filtering process, thus improving processing efficiency.

[0099] In optional embodiments of this application, the method may further include:

[0100] Obtain the information identifiers of each retrieved piece of information;

[0101] Based on the retrieval vectors corresponding to each retrieved piece of information, construct an index of the retrieval vectors corresponding to each retrieved piece of information;

[0102] The index of the retrieval vector corresponding to each retrieved piece of information is associated and stored with the information identifier of each retrieved piece of information;

[0103] Based on the similarity between the target retrieval vector corresponding to the retrieved information and the retrieval vectors corresponding to each retrieved information, target information belonging to the target retrieval category is determined from each retrieved information, including:

[0104] Based on the target retrieval vector, determine the index of the target retrieval vector;

[0105] Based on the similarity between the index of the target retrieval vector and the index of the retrieval vector corresponding to each piece of retrieved information, the target index corresponding to the target retrieval vector is queried in the index of the retrieval vector corresponding to each piece of retrieved information.

[0106] Determine the target information identifier corresponding to the target index;

[0107] The retrieved information corresponding to the target information identifier is identified as the target information.

[0108] Optionally, for each piece of retrieved information, an information identifier can be obtained to identify each piece of retrieved information. Furthermore, when obtaining the retrieval vector corresponding to each piece of retrieved information, an index for the retrieval vector corresponding to each piece of retrieved information can be constructed. Then, the index of the retrieval vector corresponding to each piece of retrieved information is associated and stored with the information identifier of each piece of retrieved information. At this point, the index of the retrieval vector corresponding to the retrieved information corresponds to the information identifier of the retrieved information. In other words, the corresponding retrieved information can be determined based on the index of the retrieval vector. Optionally, the index of the retrieval vector corresponding to the retrieved information can be the Faiss index of the Faiss tool.

[0109] Faiss is a clustering and similarity search library that provides efficient similarity search and clustering for dense vectors, supporting searches on the order of billions of vectors. It includes various algorithms for searching vector sets of arbitrary sizes, as well as support code for algorithm evaluation and parameter tuning. Essentially, Faiss is a vector database. Its main function is similarity search. Taking image search as an example, similarity search involves finding the K most similar images to a given target from a set of images. The most commonly used feature in Faiss is the Faiss index (e.g., Index), followed by PCA (Principal Component Analysis) dimensionality reduction and PQ (Product Quantization). The Faiss index is a data structure designed for feature indexing within Faiss.

[0110] Optionally, when identifying target information belonging to the target retrieval category from the retrieved information, the index corresponding to the target retrieval vector can be determined. Then, the index of the retrieval vector for each retrieved information can be obtained. Next, the similarity between the index of the target retrieval vector and the index of the retrieval vector corresponding to each retrieved information can be determined. Based on the determined similarities, the target index corresponding to the target retrieval vector is queried from the index of the retrieval vector corresponding to each retrieved information. The number of target indexes obtained may be one or more. Further, based on the correspondence between the index of the retrieval vector of the retrieved information and the information identifier of the retrieved information, the target information identifier corresponding to the target index can be determined, and the retrieved information corresponding to the target information identifier is identified as the target information.

[0111] In this embodiment, only one index can be established for the retrieved information of various information categories. Since the retrieval vector of the indexed retrieved information is determined based on the retrieved information and its information category (i.e., the index includes information category weights), determining the target information from each retrieved information based on the index ensures that information belonging to the target retrieval category is retrieved first, while effectively reducing memory consumption. Furthermore, since the dimension of the index is lower than the dimension of the retrieval vectors of each retrieved information, querying the target index corresponding to the target retrieval vector of the retrieved information within the index of the retrieval vectors of each retrieved information effectively reduces data processing volume and improves processing efficiency compared to directly calculating based on the feature vectors of the retrieved information.

[0112] In optional embodiments of this application, an index for the retrieval vector corresponding to each retrieved piece of information is constructed based on the information identifier of each retrieved piece of information and the corresponding retrieval vector, including:

[0113] Cluster the retrieval vectors corresponding to each retrieved piece of information to obtain several cluster categories;

[0114] For each category, the category vector is determined based on the retrieval vector of the retrieved information belonging to that category;

[0115] For each retrieval vector of the retrieved information, the index of the retrieval vector of each retrieval information is determined based on the similarity between the retrieval vector and the category vectors of each category;

[0116] Based on the target retrieval vector, determine the index of the target retrieval vector, including:

[0117] The index of the target retrieval vector is determined based on the similarity between the target retrieval vector and the vectors of each category.

[0118] Optionally, when constructing the index of the retrieval vectors corresponding to each retrieved information, a clustering algorithm (such as the KNN (K-Nearest Neighbor) algorithm) can be used to cluster the retrieval vectors corresponding to each retrieved information, resulting in several cluster categories. For each category, the category vector can be determined based on the retrieval vectors of the retrieved information belonging to that category obtained through clustering. The specific implementation method for determining the category vector of each category based on the retrieval vectors of the retrieved information belonging to each category obtained through clustering is not limited in this application embodiment. For example, for any category, the average of the retrieval vectors of each retrieved information in that category can be calculated, and the calculated feature vector can be used as the category vector of that category.

[0119] Optionally, after obtaining the category vectors for each category, for each retrieved information's retrieval vector, the index of the retrieval vector for each retrieved information can be determined based on the similarity between the retrieval vector and the category vectors for each category, and then according to the identifiers of the N most similar category vectors. Similarly, after obtaining the target retrieval vector, the similarity between the target retrieval vector and each category vector can be determined, and the index of the target retrieval vector can be determined by the identifiers of the N most similar category vectors. It is understood that, assuming there are M clustering categories, the value of N is less than or equal to M. Optionally, in practical applications, the identifiers of the most similar category vectors can also be mapped to feature vectors with fewer dimensions to reduce the amount of data processing.

[0120] In optional embodiments of this application, based on the similarity between the target retrieval vector corresponding to the retrieved information and the retrieval vectors corresponding to each retrieved information, target information belonging to the target retrieval category is determined from each retrieved information, including:

[0121] Cluster the retrieval vectors corresponding to each retrieved piece of information to obtain several cluster categories;

[0122] For each category, the category vector is determined based on the retrieval vector corresponding to the retrieved information belonging to each category;

[0123] Determine the similarity between the target retrieval vector and each category vector, and determine the target category based on the categories corresponding to the larger set number of similarities in descending order of similarity.

[0124] Based on the similarity between the target retrieval vector and the retrieval vectors corresponding to each retrieved information belonging to the target category, the target information is determined from each retrieved information corresponding to the target category.

[0125] Optionally, when determining target information belonging to the target retrieval category from the retrieved information, a clustering algorithm can be used to cluster the retrieval vectors corresponding to each retrieved information, resulting in several clustering categories. Then, based on the retrieval vectors corresponding to the retrieved information belonging to each category, a category vector for each category can be determined. For example, for any category, the average of the retrieval vectors of each retrieved information in that category can be calculated, and the calculated feature vector can be used as the category vector for that category. Correspondingly, the similarity between the target retrieval vector and each category vector can be determined. Then, the determined similarity can be ordered from largest to smallest, and the categories corresponding to the largest set number of similarities can be determined as the target categories. For each target category, the similarity between the target retrieval vector and the retrieval vectors corresponding to each retrieved information belonging to that target category can be calculated, and the retrieved information corresponding to the largest similarity can be determined as the target information, or the retrieved information corresponding to the N largest similarities can be determined as the target information.

[0126] To better understand the methods provided in the embodiments of this application, the following combines... Figure 3a The information retrieval method provided in this application embodiment will be described in detail. In this example, keywords include tag information. It can be understood that the method provided in this application embodiment may specifically include constructing a feature vector of the retrieved information, adding category marker bits to the retrieved information, constructing an index, and retrieving the target information.

[0127] When constructing the feature vector of the retrieved information, for each retrieved information, we can obtain the tag information of each retrieved information (i.e., obtain the tag information of the retrieved information), then we can convert each keyword of each retrieved information into a word vector (i.e., convert multiple tag information into word vectors), and then obtain the feature vector of each retrieved information by fusing the word vectors of each keyword (i.e., vector weighting). For example, we can use... Figure 3a The method described above uses at least one of the following weighting methods—average weighting, TF-IDF weighting, and SIF weighting—to weight each word vector. The weighted word vectors are then fused to obtain the feature vector of each retrieved information (i.e., the feature vector of the output retrieved information). A category label can then be added to each retrieved information, specifically including:

[0128] Obtain the information category to which each retrieved information belongs (i.e., the category corresponding to the input retrieved information). If the information categories involved only include two categories (i.e., binary classification), the category label bit vector corresponding to each category can be represented by 0 and 1 respectively (i.e., construct 0 / 1 label bits). Then, for any retrieved information, determine the category label bit vector corresponding to the information category of the retrieved information (i.e., whether it is 0 or 1). Then, concatenate the category label bit vector corresponding to the category of the retrieved information with the feature vector of the retrieved information to obtain the retrieval vector of the retrieved information (i.e., add 0 / 1 label bits to the retrieved information); optional, If the categories involved include at least three categories (i.e., multi-class classification), a category label vector can be constructed for each category (i.e., vector labeling). For any retrieved information, the category label vector corresponding to the information category of the retrieved information is determined. Then, the category label vector corresponding to the information category of the retrieved information is concatenated with the feature vector of the retrieved information to obtain the retrieval vector of the retrieved information (i.e., adding vector labeling to the retrieved information). Correspondingly, after obtaining the retrieval vector of each retrieved information (i.e., outputting the retrieval vector of the retrieved information), an index can be constructed and the target information can be retrieved, which may specifically include:

[0129] The process involves obtaining the information identifiers of each retrieved piece of information, then constructing an index of the retrieval vector corresponding to each retrieved piece of information (i.e., building an index); further, it involves obtaining the retrieval information and the target retrieval category corresponding to the retrieval information, and determining the target retrieval vector corresponding to the information to be retrieved (i.e., inputting the information to be retrieved and the target category); then, based on the input target retrieval vector, determining the index of the target retrieval vector, and according to the similarity between the index of the target retrieval vector and the index of the retrieval vector corresponding to each retrieved piece of information, querying the Top N target indexes corresponding to the target retrieval vector in the index of the retrieval vector corresponding to each retrieved piece of information, and determining the retrieved information corresponding to the target information identifiers of the Top N target indexes as the target information belonging to the target retrieval category (outputting the Top N most similar retrieval information under the target category).

[0130] To better understand the information retrieval method provided in the embodiments of this application, the method is described below in conjunction with a specific application scenario. In this example, the retrieved information refers to the retrieved news, the retrieved information refers to the news to be recommended, the tag information refers to the tag, and the determined target information is the news that needs to be recommended to the user (i.e., the target recommended news). Figure 3b As shown, the method may specifically include:

[0131] Step S301: Obtain the tag corresponding to each piece of information to be recommended, and determine the feature vector corresponding to each tag;

[0132] Optionally, each piece of information to be recommended can typically have a tag to represent the main content of the information to be recommended. In this case, the tag corresponding to each piece of information to be recommended can be obtained, and for each tag, the tag can be converted into the corresponding word vector.

[0133] Step S302: For each piece of information to be recommended, the feature vectors of the tag corresponding to the information to be recommended are weighted and fused to obtain the feature vector of the information to be recommended.

[0134] Optionally, for each piece of information to be recommended, after converting each tag corresponding to the information to be recommended into word vectors, the weight corresponding to each tag can be obtained. Then, the vectors of each tag are weighted and fused according to the weight of each tag, and the fused feature vector is used as the feature vector corresponding to the information to be recommended. The feature vector weighting and fusion method can include average weighting, TF-IDF weighting, SIF weighting, etc., and the weight corresponding to each tag can be determined according to the probability of each tag appearing in the information.

[0135] Step S303: For each piece of information to be recommended, determine the category tag bit vector corresponding to the information category to which the information to be recommended belongs;

[0136] Optionally, a category label bit vector corresponding to each possible information category can be pre-constructed. When the category label bit vector corresponding to the information category of the information to be recommended is determined, it can be directly obtained according to the information category of the information to be recommended. Among them, when the possible information categories include only two categories, the category label bit vectors of the two categories can be represented by simple [1] and [-1] respectively. When the possible information categories include multiple categories, feature vectors in the same direction but with an angle greater than degree α between each pair can be pre-constructed as category label bit vectors for each category.

[0137] Step S304: For each piece of information to be recommended, the retrieval vector of the information to be recommended is obtained based on the feature vector corresponding to the information to be recommended and the category tag bit vector corresponding to the information category of the information to be recommended.

[0138] Optionally, for each piece of information to be recommended, the keywords corresponding to the information to be recommended can be converted into word vectors. The feature vector of the information to be recommended can be obtained by fusing the word vectors of each keyword. Then, the feature vector of the information to be recommended and the category tag bit vector corresponding to the information category of the information to be recommended can be concatenated to obtain the retrieval vector of the information to be recommended.

[0139] Optionally, for each piece of information to be recommended, the corresponding identifier and retrieval vector can be obtained. Then, based on the information identifier and the corresponding retrieval vector of each piece of information to be retrieved, a Faiss index of the retrieval vector corresponding to each piece of information to be retrieved is constructed and stored. The Faiss index of the retrieval vector corresponding to the retrieval information can be used to quickly obtain information with high similarity during the retrieval stage.

[0140] Step S305: Obtain the search information and the target search category of the search information, and determine the target search vector of the search information based on the search information and the target search category of the search information;

[0141] Optionally, you can obtain the tags corresponding to the search information, convert each tag into a word vector, and obtain the feature vector of the search information by fusing the word vectors of each tag. Then, you can concatenate the feature vector of the search information with the category tag bit vector corresponding to the target search category to obtain the target search vector of the search information.

[0142] Step S306: Based on the similarity between the target retrieval vector of the retrieved information and the retrieval vector of each piece of information to be recommended, determine the target recommended information belonging to the target retrieval category from each piece of information to be recommended;

[0143] Optionally, the index of the target retrieval vector can be determined based on the target retrieval vector. Then, based on the similarity between the index of the target retrieval vector and the index of the retrieval vector of each piece of information to be recommended, the target retrieval vector corresponding to the target retrieval vector can be queried in the faiss index of the retrieval vector corresponding to each piece of information to be recommended. The information to be recommended corresponding to the target information identifier corresponding to the target faiss index is then determined as the target recommended information.

[0144] In practical applications, Facebook's Faiss tool stores the Faiss index of the retrieval vectors for each piece of information to be recommended. At this time, the target retrieval vector of the information to be retrieved can be input into Facebook's Faiss tool. The Faiss tool can determine the Top N most similar pieces of information to be recommended, and the Top N most similar pieces of information output by the Faiss tool will be used as the target recommended information.

[0145] Step S307: Recommend the target information to the user.

[0146] Optionally, assume the determined target recommendation information is as follows: Figure 4 The video information shown can then be used to recommend relevant information to the user.

[0147] It is understood that the methods provided in the embodiments of this application can be applied to various information retrieval scenarios, including but not limited to information recommendation scenarios. Specifically, when the application scenario is information recommendation, it can be applied to information recommendation in various scenarios, such as in-application information recommendation and in-application spam information recommendation scenarios.

[0148] This application provides an information retrieval device, such as... Figure 5 As shown, the information retrieval device 60 may include: an information acquisition module 601, a feature vector determination module 602, and a target information determination module 603, wherein,

[0149] The information acquisition module 601 is used to acquire search information and the target search category corresponding to the search information;

[0150] The feature vector determination module 602 is used to obtain each keyword corresponding to the information to be retrieved, and convert each keyword into a word vector. The feature vector of the retrieved information is obtained by fusing the word vectors of each keyword. Based on the target retrieval category, the category label bit vector corresponding to the target retrieval category is obtained. The feature vector and the category label bit vector of the retrieved information are fused to obtain the target retrieval vector corresponding to the information to be retrieved.

[0151] The target information determination module 603 is used to determine the target information belonging to the target retrieval category from each retrieved information based on the similarity between the target retrieval vector corresponding to the retrieved information and the retrieval vector corresponding to each retrieved information. For any retrieved information, the retrieval vector of the retrieved information is determined based on the feature vector of the retrieved information and the category label bit vector corresponding to the information category of the retrieved information.

[0152] Optionally, when the feature vector determination module fuses the feature vector and category tag bit vector of the retrieved information to obtain the target retrieval vector corresponding to the information to be retrieved, it is specifically used for:

[0153] The feature vector and category label bit vector of the retrieved information are concatenated to obtain the target retrieval vector corresponding to the retrieved information.

[0154] Optionally, keywords include the tag information corresponding to the search information. When the feature vector determination module converts each keyword into a word vector and obtains the feature vector of the search information by fusing the word vectors of each keyword, it is specifically used for:

[0155] Obtain the tag information corresponding to the search information, and the weight of each tag information;

[0156] Convert each tag information into a word vector;

[0157] Each word vector is weighted based on the weight corresponding to each tag information to obtain the weighted word vectors;

[0158] By fusing and weighting the word vectors, we obtain the feature vector of the retrieved information.

[0159] Optionally, the device also includes an index building module for:

[0160] Based on the retrieval vectors corresponding to each retrieved piece of information, construct an index of the retrieval vectors corresponding to each retrieved piece of information;

[0161] The index of the retrieval vector corresponding to each retrieved piece of information is associated and stored with the information identifier of each retrieved piece of information.

[0162] Optionally, when the target information determination module determines target information belonging to the target retrieval category from each retrieved information based on the similarity between the target retrieval vector corresponding to the retrieved information and the retrieval vectors corresponding to each retrieved information, it is specifically used for:

[0163] Based on the target retrieval vector, determine the index of the target retrieval vector;

[0164] Based on the similarity between the index of the target retrieval vector and the index of the retrieval vector corresponding to each piece of retrieved information, the target index corresponding to the target retrieval vector is queried in the index of the retrieval vector corresponding to each piece of retrieved information.

[0165] Determine the target information identifier corresponding to the target index;

[0166] The retrieved information corresponding to the target information identifier is identified as the target information.

[0167] Optionally, when constructing the index for each retrieved piece of information based on its information identifier and corresponding retrieval vector, the index building module is specifically used for:

[0168] Cluster the retrieval vectors corresponding to each retrieved piece of information to obtain several cluster categories;

[0169] For each category, determine the category vector based on the retrieval vector of the retrieved information belonging to each category;

[0170] For each retrieval vector of the retrieved information, the index of the retrieval vector of each retrieval information is determined based on the similarity between the retrieval vector and the category vectors of each category;

[0171] When determining the index of the target retrieval vector based on the target retrieval vector, the target information determination module is specifically used for:

[0172] The index of the target retrieval vector is determined based on the similarity between the target retrieval vector and the vectors of each category.

[0173] Optionally, when the target information determination module determines target information belonging to the target retrieval category from each retrieved information based on the similarity between the target retrieval vector corresponding to the retrieved information and the retrieval vectors corresponding to each retrieved information, it is specifically used for:

[0174] Cluster the retrieval vectors corresponding to each retrieved piece of information to obtain several cluster categories;

[0175] For each category, the category vector is determined based on the retrieval vector corresponding to the retrieved information belonging to that category;

[0176] Determine the similarity between the target retrieval vector and each category vector, and determine the target category based on the categories corresponding to the larger set number of similarities in descending order of similarity.

[0177] Based on the similarity between the target retrieval vector and the retrieval vectors corresponding to each retrieved information belonging to the target category, the target information is determined from each retrieved information corresponding to the target category.

[0178] Optionally, the search information includes search results, and each searched information includes information to be recommended.

[0179] The target information determination module, when determining target information belonging to the target retrieval category from each retrieved information based on the similarity between the target retrieval vector corresponding to the retrieved information and the retrieval vectors corresponding to each retrieved information, is specifically used for:

[0180] Based on the similarity between the target retrieval vector corresponding to the retrieved information and the retrieval vector corresponding to each piece of information to be recommended, at least one piece of information belonging to the target retrieval category is determined from each piece of information to be recommended.

[0181] Recommend relevant information to users.

[0182] The information retrieval device of this application embodiment can execute an information retrieval method provided in this application embodiment, and its implementation principle is similar, so it will not be described again here.

[0183] This application provides an electronic device, such as... Figure 6 As shown, Figure 6 The illustrated electronic device 2000 includes a processor 2001 and a memory 2003. The processor 2001 and the memory 2003 are connected, for example, via a bus 2002. Optionally, the electronic device 2000 may also include a transceiver 2004. It should be noted that in practical applications, the transceiver 2004 is not limited to one type, and the structure of this electronic device 2000 does not constitute a limitation on the embodiments of this application.

[0184] In this embodiment, the processor 2001 is used to implement... Figure 5 The functions of each module are shown.

[0185] Processor 2001 may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA, or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 2001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0186] Bus 2002 may include a pathway for transmitting information between the aforementioned components. Bus 2002 may be a PCI bus or an EISA bus, etc. Bus 2002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0187] The memory 2003 may be ROM or other type of static storage device capable of storing static information and computer programs, RAM or other type of dynamic storage device capable of storing information and computer programs, or EEPROM, CD-ROM or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing or storing desired computer programs in the form of data structures and accessible by a computer, but not limited thereto.

[0188] The memory 2003 stores computer programs for executing the application scheme of this application, and its execution is controlled by the processor 2001. The processor 2001 executes the computer programs for the application scheme stored in the memory 2003 to implement… Figure 5 The operation of the information retrieval device provided in the illustrated embodiment.

[0189] This application provides an electronic device including a processor and a memory: the memory is configured to store a computer program, which, when executed by the processor, causes the processor to perform any of the methods described in the above embodiments.

[0190] This application provides a computer-readable storage medium for storing a computer program that, when run on a computer, enables the computer to perform any of the methods described in the above embodiments.

[0191] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various alternative implementations described above.

[0192] The specific terms and implementation principles of the computer-readable storage medium mentioned in this application can be found in an information retrieval method in the embodiments of this application, and will not be repeated here.

[0193] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0194] The above are only some embodiments of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. An information retrieval method, characterized by, The method comprises: obtaining search information; determining a target search category corresponding to the search information in a plurality of preset information categories; obtaining each keyword corresponding to the search information, and converting each keyword into a word vector to obtain a feature vector of the search information by fusing the word vectors of each keyword; based on the target search category, obtaining a category marker bit vector corresponding to the target search category; concatenating the feature vector of the search information and the category marker bit vector to obtain a target search vector corresponding to the search information; determining the similarity between the target search vector and the category vectors of each clustering category, and determining the index of the target search vector according to the identifiers of the N category vectors with the highest corresponding similarity, wherein N is greater than or equal to 1, each clustering category is obtained by clustering the search vectors of each searched information, and the category vector of each clustering category is determined according to the search vectors of each searched information belonging to the clustering category, and the search vector of each searched information is obtained by concatenating the feature vector of the searched information and the category marker bit vector corresponding to the information category of the searched information; determining at least one target index corresponding to the target search vector from the indexes of the search vectors of each searched information according to the similarity between the index of the target search vector and the index of each searched information, wherein the index of the search vector of each searched information is determined according to the identifiers of the N clustering category vectors with the highest similarity to the search vector; determining the searched information corresponding to each target index as target information.

2. The method of claim 1, wherein, The keywords include each label information corresponding to the search information, and the conversion of each keyword into a word vector and the obtaining of the feature vector of the search information by fusing the word vectors of each keyword comprises: obtaining each label information corresponding to the search information and the weight corresponding to each label information; converting each label information into a word vector; weighting each word vector based on the weight corresponding to each label information to obtain a weighted word vector; obtaining the feature vector of the search information by fusing the weighted word vectors.

3. The method of claim 1, wherein, The method further comprises: obtaining the information identifier of each searched information; determining the similarity between the search vector of each searched information and the category vector of each clustering category, and constructing the index of the search vector of each searched information according to the identifiers of the N category vectors with the highest corresponding similarity for each searched information; storing the indexes of the search vectors of each searched information and the information identifiers of each searched information in association; the determination of the searched information corresponding to each target index as target information comprises: determining the target information identifier of the searched information corresponding to each target index; determining the searched information corresponding to each target information identifier as target information.

4. The method of claim 1, wherein, The search information comprises search information, and the searched information comprises to-be-recommended information; The method comprises the following steps: The target information determination module is configured to determine at least one target index corresponding to the target retrieval vector from the retrieval vector indexes of each of the searched information according to the similarity between the index of the target retrieval vector and the retrieval vector index of each of the searched information, wherein the retrieval vector index of each of the searched information is determined according to the indexes of the N cluster vectors with the highest similarity to the retrieval vector; and determine the target information corresponding to each of the target indexes. The target information determination module is configured to determine at least one target index corresponding to the target retrieval vector from the retrieval vector indexes of each of the searched information according to the similarity between the index of the target retrieval vector and the retrieval vector index of each of the searched information, wherein the retrieval vector index of each of the searched information is determined according to the indexes of the N cluster vectors with the highest similarity to the retrieval vector; and determine the target information corresponding to each of the target indexes. The target information determination module is configured to determine at least one target index corresponding to the target retrieval vector from the retrieval vector indexes of each of the searched information according to the similarity between the index of the target retrieval vector and the retrieval vector index of each of the searched information, wherein the retrieval vector index of each of the searched information is determined according to the indexes of the N cluster vectors with the highest similarity to the retrieval vector; and determine the target information corresponding to each of the target indexes.

5. An information retrieval apparatus characterized by comprising: The target information determination module is configured to determine at least one target index corresponding to the target retrieval vector from the retrieval vector indexes of each of the searched information according to the similarity between the index of the target retrieval vector and the retrieval vector index of each of the searched information, wherein the retrieval vector index of each of the searched information is determined according to the indexes of the N cluster vectors with the highest similarity to the retrieval vector; and determine the target information corresponding to each of the target indexes. The information acquisition module is configured to acquire searched information and determine a target retrieval category corresponding to the searched information in a plurality of preset information categories. The feature vector determination module is configured to acquire each keyword corresponding to the searched information, convert each keyword into a word vector, obtain a feature vector of the searched information by fusing the word vectors of each keyword, acquire a category marker vector corresponding to the target retrieval category based on the target retrieval category, and splice the feature vector of the searched information and the category marker vector to obtain a target retrieval vector corresponding to the searched information. The index construction module is configured to determine the similarity between the target retrieval vector and the category vectors of each cluster category, and determine the index of the target retrieval vector according to the indexes of the N category vectors with the highest similarity, wherein N is greater than or equal to 1; each cluster category is obtained by clustering the retrieval vectors of each searched information; the category vector of each cluster category is determined according to the retrieval vectors of each searched information belonging to the cluster category; and the retrieval vector of each searched information is obtained by splicing the feature vector of the searched information and the category marker vector corresponding to the information category of the searched information. The target information determination module is configured to determine at least one target index corresponding to the target retrieval vector from the retrieval vector indexes of each of the searched information according to the similarity between the index of the target retrieval vector and the retrieval vector index of each of the searched information, wherein the retrieval vector index of each of the searched information is determined according to the indexes of the N cluster vectors with the highest similarity to the retrieval vector; and determine the target information corresponding to each of the target indexes.

6. The apparatus of claim 5, wherein, The keywords include each label information corresponding to the searched information. The feature vector determination module is configured to: acquire each label information corresponding to the searched information and a weight corresponding to each label information; convert each label information into a word vector; weight each word vector based on the weight corresponding to each label information to obtain a weighted word vector; obtain the feature vector of the searched information by fusing the weighted word vectors.

7. The apparatus of claim 5, wherein, The index construction module is further configured to: acquire the information identifier of each searched information; determining a similarity between a retrieval vector of each of the searched information and a category vector of each of the clustering categories, and constructing an index of the retrieval vector of each of the searched information according to an identification of N category vectors with the highest similarity corresponding to the searched information; storing the index of the retrieval vector corresponding to each of the searched information and an information identification of each of the searched information in association; the target information determination module is configured to: determine a target information identification of the searched information corresponding to each of the target indexes; determine the searched information corresponding to each of the target information identifications as the target information.

8. The apparatus of claim 5, wherein, The searched information includes search information, and the searched information includes to-be-recommended information. The target information determination module is configured to: determine at least one target index corresponding to the target retrieval vector from the index of the retrieval vector of each of the to-be-recommended information based on a similarity between the index of the target retrieval vector of the search information and the index of the retrieval vector of each of the to-be-recommended information; determine the to-be-recommended information corresponding to each of the target indexes as target recommended information, and recommend the target recommended information to a user.

9. An electronic device, comprising: comprising a processor and a memory: The memory is configured to store a computer program, which, when executed by the processor, causes the processor to execute the method of any one of claims 1-4.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium is used to store a computer program, which, when running on a computer, causes the computer to execute the method of any one of claims 1-4.

Citation Information

Patent Citations

  • Integrated similarity calculation method based on natural language retrieval

    CN108090077A