Content query method, device and computer readable storage medium
By calculating the matching degree and similarity between query information and candidate content, high-quality neighbor content and query information are screened out, which solves the problem of low content query accuracy in the existing technology and achieves more comprehensive semantic capture and accurate matching.
Patent Information
- Application Number
- CN202311228326.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-21
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2043-09-21
AI Technical Summary
Existing content query methods cannot accurately and comprehensively capture the semantic relationship between query information and candidate content, resulting in low content query accuracy.
By obtaining the current query information and candidate content, as well as similar query information and similar content similar to them, calculate the query matching degree and similarity, and filter out the neighbor content and neighbor query information to more comprehensively capture the semantics of the candidate content and query information. , thereby improving the accuracy of content query.
By filtering out high-quality neighbor content and query information, more accurate matching of candidate content and query information is achieved, improving the accuracy of content queries.
Smart Images

Figure CN117725303B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a content query method, device and computer-readable storage medium. Background Art
[0002] With the rapid development of computer technology, a huge amount of content is generated on the Internet every day. In order to allow users to find the desired content in the massive content, it is often necessary to use content query methods to filter out the most matching target content from a large number of candidate contents (doc) based on the query information (query) input by the user. Existing content query methods generally measure the matching degree between query information and candidate contents by calculating the similarity between the query information and the candidate contents.
[0003] In the process of research and practice of existing technologies, it was found that the existing content query method that measures the degree of match between query information and candidate content by calculating the similarity between query information and candidate content cannot accurately and comprehensively capture the semantic relationship between query information and candidate content, and thus cannot accurately query the target content that matches the query information, resulting in low content query accuracy. Summary of the invention
[0004] The embodiments of the present application provide a content query method, device, and computer-readable storage medium, which can improve the accuracy of content query.
[0005] The present application provides a content query method, including:
[0006] Acquire current query information and candidate content, as well as multiple candidate similar query information similar to the current query information, and multiple candidate similar content similar to the candidate content;
[0007] Calculating a first query matching degree between the current query information and the candidate similar content, and a second query matching degree between the candidate content and the candidate similar query information;
[0008] Calculating a first similarity between the current query information and the candidate content;
[0009] Based on the first similarity and the first query matching degree, selecting candidate similar contents matching the current query information from the candidate similar contents as neighbor contents of the candidate contents;
[0010] Based on the first similarity and the second query matching degree, selecting candidate similar query information matching the candidate content from the candidate similar query information as neighbor query information of the current query information;
[0011] At least one target content matching the current query information is screened out from the candidate content according to the neighbor content and the neighbor query information.
[0012] Accordingly, an embodiment of the present application provides a content query device, including:
[0013] An acquisition unit, configured to acquire current query information and candidate content, as well as a plurality of candidate similar query information similar to the current query information, and a plurality of candidate similar content similar to the candidate content;
[0014] A first calculation unit, configured to calculate a first query matching degree between the current query information and the candidate similar content, and a second query matching degree between the candidate content and the candidate similar query information;
[0015] A second calculation unit, configured to calculate a first similarity between the current query information and the candidate content;
[0016] A first screening unit, configured to screen out candidate similar contents matching the current query information from the candidate similar contents as neighbor contents of the candidate contents based on the first similarity and the first query matching degree;
[0017] A second screening unit, configured to screen out candidate similar query information matching the candidate content from the candidate similar query information as neighbor query information of the current query information based on the first similarity and the second query matching degree;
[0018] The third screening unit is configured to screen out at least one target content matching the current query information from the candidate content according to the neighbor content and the neighbor query information.
[0019] In one embodiment, the first computing unit includes:
[0020] A feature extraction subunit, configured to extract current query features, candidate content features, candidate similar query features, and candidate similar content features from the current query information, the candidate content, the candidate similar query information, and the candidate similar content, respectively;
[0021] The matching degree calculation subunit is used to calculate the matching degree between the current query feature and the candidate similar content feature to obtain the first query matching degree between the current query information and the candidate similar content, and to calculate the matching degree between the candidate content feature and the candidate similar query feature to obtain the second query matching degree between the candidate content and the candidate similar query information.
[0022] In one embodiment, the first query matching degree and the second query matching degree are calculated by a similarity calculation model, and the similarity calculation model includes a query information feature extraction module, a content feature extraction module, a fusion module and a similarity calculation module;
[0023] The feature extraction subunit is used to:
[0024] Extracting current query features and candidate similar query features from the current query information and the candidate similar query information respectively by a query information feature extraction module;
[0025] Extracting candidate content features and candidate similar content features from the candidate content and the candidate similar content respectively by a content feature extraction module;
[0026] The matching degree calculation subunit is used to:
[0027] The current query feature and the candidate similar content feature are fused by the fusion module to obtain a first fused feature;
[0028] The candidate content feature and the candidate similar query feature are fused by the fusion module to obtain a second fused feature;
[0029] The fusion module and the similarity calculation module calculate a first query matching degree between the current query information and the candidate similar content, and a second query matching degree between the candidate content and the candidate similar query information based on the first fused feature and the second fused feature.
[0030] In one embodiment, the second computing unit is used to:
[0031] Extracting a first current query feature from the current query information by the query information feature extraction module;
[0032] Extracting a first candidate content feature from the candidate content by the content feature extraction module;
[0033] The first fused feature and the first candidate content feature are fused by the fusion module to obtain a third fused feature;
[0034] The second fused feature and the first current query feature are fused by the fusion module to obtain a fourth fused feature;
[0035] By means of the fusion module and the similarity calculation module, based on the third fused feature and the fourth fused feature, when calculating the first query matching degree and the second query matching degree, the first similarity between the current query information and the candidate content is also calculated.
[0036] In one embodiment, the third screening unit comprises:
[0037] a similarity calculation subunit, configured to calculate a second similarity between the current query information and the candidate content according to the neighbor content and the neighbor query information;
[0038] A similarity comparison subunit, used to obtain a similarity matching threshold, and compare the second similarity with the similarity matching threshold;
[0039] The content determination subunit is used to determine, according to the comparison result, the candidate content whose second similarity is greater than the similarity matching threshold among the candidate content as the target content matching the current query information.
[0040] In one embodiment, the similarity calculation subunit is used to:
[0041] Performing feature extraction on the neighbor content and the neighbor query information to obtain neighbor content features corresponding to the candidate content and neighbor query features corresponding to the current query information;
[0042] Performing feature fusion on the neighbor content features to obtain target neighbor content features, and performing feature fusion on the neighbor query features to obtain target neighbor query features;
[0043] The similarity between the target neighbor content feature and the target neighbor query feature is calculated to obtain a second similarity between the current query information and the candidate content.
[0044] In one embodiment, the first screening unit is used to:
[0045] Comparing the first query matching degree corresponding to the candidate similar content with the first similarity;
[0046] When the first query matching degree corresponding to the candidate similar content is greater than the first similarity, the candidate similar content is determined as a neighbor content of the candidate content.
[0047] In addition, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for a processor to load to execute the steps in any content query method provided in the embodiment of the present application.
[0048] In addition, an embodiment of the present application further provides a computer device, including a processor and a memory, wherein the memory stores an application program, and the processor is used to run the application program in the memory to implement the content query method provided in the embodiment of the present application.
[0049] The embodiment of the present application also provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the content query method provided in the embodiment of the present application.
[0050] The embodiment of the present application obtains current query information and candidate content, as well as multiple candidate similar query information similar to the current query information, and multiple candidate similar content similar to the candidate content; calculates a first query matching degree between the current query information and the candidate similar content, and a second query matching degree between the candidate content and the candidate similar query information; calculates a first similarity between the current query information and the candidate content; based on the first similarity and the first query matching degree, screens out candidate similar content matching the current query information from the candidate similar content as neighbor content of the candidate content; based on the first similarity and the second query matching degree, screens out candidate similar query information matching the candidate content from the candidate similar query information as neighbor query information of the current query information; and based on the neighbor content and the neighbor query information, screens out at least one target content matching the current query information from the candidate content. In this way, by screening out content matching the current query information from the candidate similar content as the neighbor content of the candidate content, and screening out query information matching the candidate content from the candidate similar query information as the neighbor query information of the current query information based on the first similarity, the first query matching degree and the second query matching degree, the semantics of the candidate content can be more comprehensively captured based on the neighbor content, the semantics of the current query information can be more comprehensively captured based on the neighbor query information, and then the target content matching the current query information can be more accurately screened out from the candidate content based on the neighbor content and the current query information, thereby improving the accuracy of content query. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0052] Figure 1This is a schematic diagram of an implementation scenario of a content query method provided in an embodiment of the present application;
[0053] Figure 2 It is a flowchart of a content query method provided by an embodiment of the present application;
[0054] Figure 3 It is a schematic diagram of a model architecture of a content query method provided in an embodiment of the present application;
[0055] Figure 4 is a schematic diagram of the structure of a content query device provided in an embodiment of the present application;
[0056] Figure 5 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0058] The present application provides a content query method, device and computer-readable storage medium, wherein the content query device can be integrated in a computer device, which can be a server or a terminal.
[0059] Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. Terminals may include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc. Terminals and servers can be directly or indirectly connected via wired or wireless communications, and this application does not limit this.
[0060] See also Figure 1 , taking the case where the content query device is integrated into a computer device, Figure 1A schematic diagram of an implementation scenario of the content query method provided in an embodiment of the present application, wherein the computer device can be a server or a terminal, and the computer device can obtain current query information and candidate content, as well as multiple candidate similar query information similar to the current query information, and multiple candidate similar content similar to the candidate content; calculate a first query matching degree between the current query information and the candidate similar content, and a second query matching degree between the candidate content and the candidate similar query information; calculate a first similarity between the current query information and the candidate content; based on the first similarity and the first query matching degree, filter out candidate similar content matching the current query information from the candidate similar content as neighbor content of the candidate content; based on the first similarity and the second query matching degree, filter out candidate similar query information matching the candidate content from the candidate similar query information as neighbor query information of the current query information; based on the neighbor content and the neighbor query information, filter out at least one target content matching the current query information from the candidate content.
[0061] It should be noted that Figure 1 The implementation environment scenario diagram of the content query method shown is only an example. The implementation environment scenario of the content query method described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided by the embodiment of the present application. It is known to those skilled in the art that with the evolution of data processing and the emergence of new business scenarios, the technical solution provided by the present application is also applicable to similar technical problems.
[0062] The solutions provided by the embodiments of the present application are specifically described by the following embodiments. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0063] This embodiment will be described from the perspective of a content query device. The content query device may be integrated into a computer device, which may be a server. This application does not limit this.
[0064] See also Figure 2 , Figure 2 : is a flow chart of a content query method provided in an embodiment of the present application. The content query method includes:
[0065] In step 101, current query information and candidate content, as well as a plurality of candidate similar query information similar to the current query information, and a plurality of candidate similar content similar to the candidate content are obtained.
[0066] Among them, the current query information may be the query information currently used for content query, and the query information (query) may be information used for query, for example, the query information may be input through a search engine, such as query information such as "summer outfit recommendation", so that some content about recommended summer outfits can be queried, etc. The candidate content may be content to be matched with a query, such as notes, posts, articles, etc. The candidate similar query information may be query information similar to the current query information, for example, query information semantically related to the current query information to a certain extent, and the candidate similar content may be content similar to the candidate content, for example, content semantically related to the candidate content to a certain extent, or content associated with the content.
[0067] In search engines, the relevance between query information (query) and content (doc) needs to be constrained to improve the reliability of search results. However, the traditional similarity calculation model for calculating the relevance between query information and content is designed with an end-to-end architecture that directly calculates the relevance between query information and content. This method is simple and direct, but it cannot accurately and comprehensively capture the semantic relationship between query information and candidate content, so it cannot accurately query the target content that matches the query information, resulting in low accuracy of content query. In addition, although the existing content query method also uses neighbor samples similar to the query information and content to enhance the semantic association between query and doc, the selection of extended samples is not instructive, and there are problems of redundant neighbor samples and low quality, and thus it is impossible to accurately and comprehensively capture the semantic relationship between query information and candidate content, so it is impossible to accurately query the target content that matches the query information, resulting in low accuracy of content query. In order to solve the above problems, the embodiment of the present application provides a content query method, which obtains efficient and high-quality neighbor samples without changing the similarity calculation model architecture and increasing the amount of calculation and prediction time, thereby achieving more accurate and comprehensive capture of the semantic relationship between the current query information and the candidate content, thereby improving the accuracy of content query. Please continue to refer to the following content for the specific implementation process.
[0068] In step 102, a first query matching degree between the current query information and the candidate similar content, and a second query matching degree between the candidate content and the candidate similar query information are calculated.
[0069] The first query matching degree may be information measuring the matching degree between the current query information and the candidate similar content, and the second query matching degree may be information measuring the matching degree between the candidate content and the candidate similar query information. Optionally, the matching degree may be measured by similarity.
[0070] There are many ways to calculate the first query matching degree between the current query information and the candidate similar content, and the second query matching degree between the candidate content and the candidate similar query information. For example, the current query features, candidate content features, candidate similar query features, and candidate similar content features can be extracted from the current query information, candidate content, candidate similar query information, and candidate similar content, respectively, and the matching degree between the current query features and the candidate similar content features is calculated to obtain the first query matching degree between the current query information and the candidate similar content, and the matching degree between the candidate content features and the candidate similar query features is calculated to obtain the second query matching degree between the candidate content and the candidate similar query information.
[0071] Among them, the previous query feature can be information characterizing the current query information, for example, it can be a feature vector characterizing the current query information, the candidate content feature can be information characterizing the candidate content, for example, it can be a feature vector characterizing the candidate content, the candidate similar query feature can be information characterizing the candidate similar query information, for example, it can be a feature vector characterizing the candidate similar query information, and the candidate similar content feature can be information characterizing the candidate similar content, for example, it can be a feature vector characterizing the candidate similar content.
[0072] Optionally, the first query matching degree and the second query matching degree may be calculated by a similarity calculation model, and the similarity calculation model may include a query information feature extraction module, a content feature extraction module, a fusion module, and a similarity calculation module. The query information feature extraction module may be a module for extracting features from query information, the content feature extraction module may be a module for extracting features from content, the fusion module may be a module for fusing features extracted from the query information feature extraction module and the content feature extraction module, and the similarity calculation module may be a module for calculating similarity. For example, please refer to Figure 3 , Figure 3It is a model architecture diagram of a content query method provided in an embodiment of the present application. The current query information (query) and candidate similar query information (query.1, ..., query.N) can be input into a query information feature extraction module for feature extraction processing, and the candidate content (doc) and candidate similar content (Doc.1, ..., Doc.N) can be input into a content feature advance module for feature extraction processing. Optionally, the query information feature extraction module and the content feature extraction module can use a bidirectional encoder representation from a transformer (Bidirectional Encoder Representations from Transformers, abbreviated as BERT, or Bert) model for feature extraction processing. Optionally, the query information feature extraction module and the content feature extraction module may include multiple feature extraction units, each feature extraction unit may perform feature extraction processing on the current query information, candidate content, candidate similar query information and candidate similar content respectively, and each feature extraction unit may adopt the Bert model structure to perform feature extraction processing, so that the first query matching degree and the second query matching degree corresponding to all candidate similar query information and candidate similar content can be processed and calculated simultaneously in one step in the similarity calculation model, thereby improving data processing efficiency and thereby improving content query efficiency.
[0073] Among them, there can be multiple ways to respectively extract current query features, candidate content features, candidate similar query features, and candidate similar content features from the current query information, candidate content, candidate similar query information, and candidate similar content. For example, the current query features and candidate similar query features can be respectively extracted from the current query information and candidate similar query information by a query information feature extraction module, and the candidate content features and candidate similar content features can be respectively extracted from the candidate content and candidate similar content by a content feature extraction module.
[0074] Correspondingly, for the steps of calculating the matching degree between the current query feature and the candidate similar content feature to obtain the first query matching degree between the current query information and the candidate similar content, and calculating the matching degree between the candidate content feature and the candidate similar query feature to obtain the second query matching degree between the candidate content and the candidate similar query information, the current query feature and the candidate similar content feature can be fused through a fusion module to obtain a first fused feature, the candidate content feature and the candidate similar query feature can be fused through a fusion module to obtain a second fused feature, and the first query matching degree between the current query information and the candidate similar content, and the second query matching degree between the candidate content and the candidate similar query information can be calculated based on the first fused feature and the second fused feature through a fusion module and a similarity calculation module.
[0075] The first fused feature may be a feature obtained by fusing the current query feature and the candidate similar content feature, and the second fused feature may be a feature obtained by fusing the candidate content feature and the candidate similar query feature.
[0076] Among them, there are many ways to fuse the current query feature and the candidate similar content feature through the fusion module to obtain the first fused feature, and to fuse the candidate content feature and the candidate similar query feature through the fusion module to obtain the second fused feature. For example, the current query feature and the candidate similar content feature can be spliced, and the candidate content feature and the candidate similar query feature can be spliced. For example, assuming that the vector of the current query feature is represented by (q1, q2, ..., qk), and the vector of a candidate similar content feature is represented by (d1, d2, ..., dk), then the first fused feature can be represented by (q1, q2, ..., qk, d1, d2, ..., dk), etc. Optionally, the current query feature and the candidate similar content feature may be fused through a fusion module, and the candidate content feature and the candidate similar query feature may be fused. For example, assuming that the vector of the current query feature is represented by (q1, q2, ..., qk), and the vector of the candidate similar content feature is represented by (d1, d2, ..., dk), the first fused feature may be represented as:
[0077]
[0078] In one embodiment, after obtaining the first query matching degree and the second query matching degree, the candidate similar contents can be sorted from high to low according to the first query matching degree, and the candidate similar query information can be sorted from high to low according to the second query matching degree, so that the importance of each candidate similar content and candidate similar query information can be measured according to the sorting results, and then the candidate similar contents and candidate similar query information with lower rankings can be deleted according to the sorting results, thereby further reducing the computational complexity of subsequent calculation processes and improving resource utilization.
[0079] In one embodiment, an attention mechanism may be used to calculate a first query matching degree between current query information and candidate similar content, and a second query matching degree between candidate content and candidate similar query information.
[0080] In step 103, a first similarity between the current query information and the candidate content is calculated.
[0081] The first similarity may be information measuring the similarity between the current query information and the candidate content, that is, information measuring the semantic matching degree between the current query information and the candidate content.
[0082] Optionally, the first query matching degree and the second query matching degree may be similarities, and the accuracy of the calculation method of the first similarity may be higher than the accuracy of the calculation method of the first query matching degree and the second query matching degree. For example, a relatively rough similarity calculation model may be used to calculate the first query matching degree and the second query matching degree, and a high-quality similarity calculation module may be used to calculate the first similarity.
[0083] Optionally, in the similarity calculation model, a feature extraction unit with high feature extraction accuracy in the query information feature extraction module and the content feature extraction module can be used to perform feature extraction processing on the current query information and the candidate content, and a fusion unit with higher accuracy in the fusion module can be used to fuse the features of the current query information and the candidate content. Then, a similarity calculation unit with higher accuracy in the similarity calculation module can be used to perform similarity calculation on the fused features, thereby obtaining the first similarity between the current query information and the candidate content. Accordingly, a feature extraction unit with lower feature extraction accuracy in the query information feature extraction module and the content feature extraction module can be used. A fusion unit with lower accuracy in the fusion module and a similarity calculation unit with lower accuracy in the similarity calculation module can be used to calculate the first query matching degree between the current query information and the candidate similar content, and the second query matching degree between the candidate content and the candidate similar query information.
[0084] There are many ways to calculate the first similarity between the current query information and the candidate content. For example, please continue to refer to Figure 3 , a first current query feature can be extracted from the current query information through a query information feature extraction module, a first candidate content feature can be extracted from the candidate content through a content feature extraction module, the first fused feature and the first candidate content feature can be fused through a fusion module to obtain a third fused feature, the second fused feature and the first current query feature can be fused through a fusion module to obtain a fourth fused feature, and the first similarity between the current query information and the candidate content can be calculated based on the third fused feature and the fourth fused feature when calculating the first query matching degree and the second query matching degree through a fusion module and a similarity calculation module.
[0085] Among them, the first current query feature can be information characterizing the current query information, the first candidate content feature can be information representing the candidate content, the third fused feature can be a feature obtained by fusing the first fused feature and the first candidate content feature, and the fourth fused feature can be a feature obtained by fusing the second fused feature and the first current query feature.
[0086] Among them, when the first current query feature is extracted from the current query information through the query information feature extraction module, and the first candidate content feature is extracted from the candidate content through the content feature extraction module, the feature extraction unit with higher precision in the query information feature extraction module can be used to extract the first current query feature from the current query information, and the first candidate content feature is extracted from the candidate content through the feature extraction unit with higher precision in the content feature extraction module. The accuracy can also be the same as that of the feature extraction unit used when calculating the first query matching degree and the second query matching degree, and can be specifically set according to actual needs.
[0087] After the query information feature extraction module extracts the first current query feature from the current query information, and the content feature extraction module extracts the first candidate content feature from the candidate content, the first fused feature and the first candidate content feature can be fused through the fusion module to obtain a third fused feature, and the second fused feature and the first current query feature can be fused through the fusion module to obtain a fourth fused feature. There are many ways to fuse the first fused feature and the first candidate content feature through the fusion module, and to fuse the second fused feature and the first current query feature through the fusion module. For example, the first fused feature and the first candidate content feature can be spliced through the fusion module to obtain a third fused feature, and the second fused feature and the first current query feature can be spliced through the fusion module to obtain a fourth fused feature.
[0088] After obtaining the third fused feature and the fourth fused feature, the fusion module and the similarity calculation module can be used to calculate the first query matching degree and the second query matching degree based on the third fused feature and the fourth fused feature, and also calculate the first similarity between the current query information and the candidate content. There are many ways to calculate the first similarity between the current query information and the candidate content based on the third fused feature and the fourth fused feature when calculating the first query matching degree and the second query matching degree through the fusion module and the similarity calculation module. For example, the third fused feature can be expressed as (Q1, ..., QN, Q, D), and the fourth fused feature can be expressed as (D1, ..., DN, D, Q), where Q1, ..., QN can be candidate similar query features, Q can be current query features, D can be candidate content features, and D1, ..., DN can be candidate similar content features. In this way, according to the preset calculation method, through the fusion module and the similarity calculation module, the corresponding features can be obtained in the third fused features and the fourth fused features for similarity calculation. When calculating the first query matching degree and the second query matching degree, the first similarity between the current query information and the candidate content can also be calculated. In this way, the first query matching degree, the second query matching degree and the first similarity can be processed and calculated simultaneously in one step in the similarity calculation model, thereby improving data processing efficiency and thereby improving content query efficiency.
[0089] In step 104, based on the first similarity and the first query matching degree, candidate similar contents matching the current query information are screened out from the candidate similar contents as neighbor contents of the candidate contents.
[0090] Among them, the neighbor content can be the content of the neighbor of the candidate content in the candidate similar content, which can be used to assist in representing the semantics of the candidate content. There are differences in the semantic information that needs to be extracted between different query information and content, that is, the determination of the neighbor query information of the current query information and the neighbor content of the candidate content needs to be affected by the current query information and content. Therefore, the determination of the neighbor content needs to rely on the current query information, so that when performing content query processing based on the current query information, the semantics of the candidate content can be captured more accurately and comprehensively, and the target content that matches the current query information can be more accurately screened out from the candidate content, thereby improving the accuracy of content query.
[0091] Among them, based on the first similarity and the first query matching degree, there are many ways to select candidate similar contents that match the current query information from the candidate similar contents as the neighboring contents of the candidate contents. For example, since the introduction of the neighbor feature should be able to strengthen the correlation between the current query information and the candidate contents, if the first query matching degree between the selected candidate similar contents and the current query information can exceed the first similarity between the current query information and the candidate contents, the quality of the current candidate similar contents as neighboring contents will undoubtedly be high. In this way, the first query matching degree corresponding to the candidate similar contents can be compared with the first similarity. When the first query matching degree corresponding to the candidate similar contents is greater than the first similarity, the candidate similar contents are determined as the neighboring contents of the candidate contents.
[0092] In one embodiment, the candidate similar content whose first query matching degree is greater than a first matching degree threshold may be directly used as the neighbor content of the candidate content. The first matching degree threshold may be a preset critical value of matching degree. When the first query matching degree is greater than the first matching degree threshold, the current candidate similar content may be considered as a neighbor content with higher quality. When the first query matching degree is not greater than the first matching degree threshold, the current candidate similar content may be considered as less matching with the current query information.
[0093] In step 105, based on the first similarity and the second query matching degree, candidate similar query information matching the candidate content is screened out from the candidate similar query information as neighbor query information of the current query information.
[0094] Among them, the neighbor query information can be the query information of the neighbor of the current query information in the candidate similar query information, which can be used to assist in representing the semantics of the current query information. There are differences in the semantic information that needs to be extracted between different query information and content, that is, the determination of the neighbor query information of the current query information needs to be affected by the current query information and content. Therefore, the determination of the neighbor query information needs to rely on the candidate content, so that when performing content query processing based on the current query information, the semantics of the current query information can be captured more accurately and comprehensively, and the target content matching the current query information can be more accurately screened out from the candidate content, thereby improving the accuracy of content query.
[0095] Among them, there can be multiple ways to screen out candidate similar query information that matches the candidate content from the candidate similar query information as the neighbor query information of the current query information based on the first similarity and the second query matching degree. For example, since the introduction of neighbor features should be able to enhance the correlation between the current query information and the candidate content, if the selected candidate similarity is based on the first similarity and the second query matching degree, and the candidate similar query information that matches the candidate content is screened out from the candidate similar query information as the neighbor query information of the current query information, the second query matching degree between the query information and the candidate content can exceed the first similarity between the current query information and the candidate content. Then the current candidate similarity is based on the first similarity and the second query matching degree, and the candidate similar query information that matches the candidate content is screened out from the candidate similar query information as the neighbor query information of the current query information. The quality of the neighbor query information that matches the candidate content is undoubtedly high. In this way, the second query matching degree corresponding to the candidate similar query information can be compared with the first similarity. When the second query matching degree corresponding to the candidate similar query information is greater than the first similarity, the candidate similar query information can be determined as the neighbor query information of the current query information.
[0096] In one embodiment, the candidate similar query information whose second query matching degree is greater than the second matching degree threshold can be directly used as the neighbor query information of the current query information. The second matching degree threshold can be a preset critical value of the matching degree. When the second query matching degree is greater than the second matching degree threshold, the current candidate similar query information can be considered as the neighbor query information of higher quality. When the second query matching degree is not greater than the second matching degree threshold, the current candidate similar query information can be considered to be less matched with the current candidate content, and the current candidate similar query information is not used as the neighbor query information of the current query information.
[0097] In step 106, at least one target content matching the current query information is screened out from the candidate content according to the neighbor content and the neighbor query information.
[0098] The target content may be candidate content that matches the current query information among the candidate content, that is, when performing content query based on the current query information, at least one target content that semantically matches the current query information may be found among the candidate content and recommended.
[0099] Among them, there may be multiple ways to filter out at least one target content that matches the current query information from the candidate content based on the neighbor content and the neighbor query information. For example, the second similarity between the current query information and the candidate content may be calculated based on the neighbor content and the neighbor query information, and a similarity matching threshold may be obtained. The second similarity may be compared with the similarity matching threshold, and based on the comparison result, the candidate content in the candidate content whose second similarity is greater than the similarity matching threshold may be determined as the target content that matches the current query information.
[0100] The second similarity may be information that is determined based on the neighbor content and the neighbor query information and measures the degree of similarity between the current query information and the candidate content. The similarity matching threshold may be a threshold used to measure whether the current query information and the candidate content are semantically matched. When the second similarity is greater than the similarity matching threshold, it can be considered that there is a semantic matching relationship between the current query information and the candidate content. When the second similarity is not greater than the similarity matching threshold, it can be considered that there is a semantic mismatch between the current query information and the candidate content. The comparison result may be the result of comparing the second similarity with the similarity matching threshold, and may include results such as greater than, greater than, and less than.
[0101] Among them, there can be multiple ways to calculate the second similarity between the current query information and the candidate content based on the neighbor content and the neighbor query information. For example, feature extraction can be performed on the neighbor content and the neighbor query information to obtain the neighbor content features corresponding to the candidate content and the neighbor query features corresponding to the current query information, the neighbor content features can be feature fused to obtain the target neighbor content features, the neighbor query features can be feature fused to obtain the target neighbor query features, the similarity between the target neighbor content features and the target neighbor query features can be calculated, and the second similarity between the current query information and the candidate content can be obtained.
[0102] The neighbor content feature may be information representing the neighbor content, the neighbor query feature may be information representing the neighbor query information, and a semantic representation model (such as BERT) may be used to extract features of the neighbor content and the neighbor query information to obtain a neighbor content feature representing the neighbor content and a neighbor query feature representing the neighbor query information. The target neighbor content feature may be a feature obtained by fusion of neighbor content features, and the target neighbor query feature may be a feature obtained by fusion of neighbor query features.
[0103] There are many ways to fuse neighbor content features and neighbor query features. For example, neighbor content features can be spliced to obtain target neighbor content features, and neighbor query features can be spliced to obtain target neighbor query features. In addition, attention mechanisms can be used to fuse neighbor content features and neighbor query features.
[0104] After the target neighbor content feature and the target neighbor query feature are obtained by fusion, the similarity between the target neighbor content feature and the target neighbor query feature can be calculated. There are many ways to calculate the similarity between the target neighbor content feature and the target neighbor query feature. For example, the cosine similarity between the target neighbor content feature and the target neighbor query feature can be calculated to obtain the second similarity between the current query information and the candidate content.
[0105] In one embodiment, there are multiple ways to calculate the second similarity between the current query information and the candidate content based on the neighbor content and the neighbor query information. For example, the neighbor content feature corresponding to the neighbor content and the neighbor query feature corresponding to the neighbor query information can be obtained, so that the similarity between each neighbor content feature and the current query feature corresponding to the current query information can be calculated. Then, the similarity corresponding to each neighbor content can be summed to obtain the first total similarity corresponding to the neighbor content. At the same time, the similarity between each neighbor query feature and the candidate content can be calculated. Then, the similarity corresponding to each neighbor query information is summed to obtain the second total similarity corresponding to the neighbor query information. The first total similarity and the second total similarity are summed to obtain the total similarity corresponding to each candidate content. The total similarity can measure the matching degree between each candidate content and the current query information based on the neighbor content and the neighbor query information. A higher total similarity can indicate a higher matching degree between the candidate content and the current query information. Therefore, the candidate contents can be sorted from high to low according to the total similarity, and then the candidate contents with higher rankings among the candidate contents can be determined as the target content according to the sorting result.
[0106] As can be seen from the above, the embodiments of the present application obtain the current query information and candidate content, as well as multiple candidate similar query information similar to the current query information, and multiple candidate similar content similar to the candidate content; calculate the first query matching degree between the current query information and the candidate similar content, and the second query matching degree between the candidate content and the candidate similar query information; calculate the first similarity between the current query information and the candidate content; based on the first similarity and the first query matching degree, filter out the candidate similar content that matches the current query information from the candidate similar content as the neighbor content of the candidate content; based on the first similarity and the second query matching degree, filter out the candidate similar query information that matches the candidate content from the candidate similar query information as the neighbor query information of the current query information; based on the neighbor content and the neighbor query information, filter out at least one target content that matches the current query information from the candidate content. In this way, by screening out content matching the current query information from the candidate similar content as the neighbor content of the candidate content, and screening out query information matching the candidate content from the candidate similar query information as the neighbor query information of the current query information based on the first similarity, the first query matching degree and the second query matching degree, the semantics of the candidate content can be more comprehensively captured based on the neighbor content, the semantics of the current query information can be more comprehensively captured based on the neighbor query information, and then the target content matching the current query information can be more accurately screened out from the candidate content based on the neighbor content and the current query information, thereby improving the accuracy of content query.
[0107] In order to better implement the above method, an embodiment of the present invention further provides a content query device, which can be integrated in a computer device, and the computer device can be a server.
[0108] For example, Figure 4 As shown, it is a schematic diagram of the structure of the content query device provided in an embodiment of the present application. The content query device may include an acquisition unit 201, a first calculation unit 202, a second calculation unit 203, a first screening unit 204, a second screening unit 205 and a third screening unit 206, as follows:
[0109] The acquisition unit 201 is used to acquire the current query information and the candidate content, as well as a plurality of candidate similar query information similar to the current query information, and a plurality of candidate similar content similar to the candidate content;
[0110] A first calculation unit 202, used to calculate a first query matching degree between the current query information and the candidate similar content, and a second query matching degree between the candidate content and the candidate similar query information;
[0111] A second calculation unit 203, used to calculate a first similarity between the current query information and the candidate content;
[0112] A first screening unit 204 is used to screen out candidate similar contents matching the current query information from the candidate similar contents as neighbor contents of the candidate contents based on the first similarity and the first query matching degree;
[0113] The second screening unit 205 is used to screen out candidate similar query information matching the candidate content from the candidate similar query information as neighbor query information of the current query information based on the first similarity and the second query matching degree;
[0114] The third screening unit 206 is configured to screen out at least one target content matching the current query information from the candidate content according to the neighbor content and the neighbor query information.
[0115] In one embodiment, the first computing unit 202 includes:
[0116] A feature extraction subunit, for extracting current query features, candidate content features, candidate similar query features, and candidate similar content features from current query information, candidate content, candidate similar query information, and candidate similar content, respectively;
[0117] The matching degree calculation subunit is used to calculate the matching degree between the current query feature and the candidate similar content feature to obtain the first query matching degree between the current query information and the candidate similar content, and to calculate the matching degree between the candidate content feature and the candidate similar query feature to obtain the second query matching degree between the candidate content and the candidate similar query information.
[0118] In one embodiment, the first query matching degree and the second query matching degree are calculated by a similarity calculation model, and the similarity calculation model includes a query information feature extraction module, a content feature extraction module, a fusion module and a similarity calculation module;
[0119] Feature extraction subunit, used to:
[0120] The query information feature extraction module extracts the current query feature and the candidate similar query feature from the current query information and the candidate similar query information respectively;
[0121] Extracting candidate content features and candidate similar content features from the candidate content and the candidate similar content respectively through a content feature extraction module;
[0122] The matching degree calculation subunit is used to:
[0123] The current query feature and the candidate similar content feature are fused through a fusion module to obtain a first fused feature;
[0124] The candidate content features and the candidate similar query features are fused through a fusion module to obtain a second fused feature;
[0125] The fusion module and the similarity calculation module calculate the first query matching degree between the current query information and the candidate similar content and the second query matching degree between the candidate content and the candidate similar query information based on the first fused feature and the second fused feature.
[0126] In one embodiment, the second calculation unit 203 is used to:
[0127] Extracting a first current query feature from the current query information by a query information feature extraction module;
[0128] Extracting a first candidate content feature from the candidate content by a content feature extraction module;
[0129] The first fused feature and the first candidate content feature are fused by a fusion module to obtain a third fused feature;
[0130] The second fused feature and the first current query feature are fused by a fusion module to obtain a fourth fused feature;
[0131] Through the fusion module and the similarity calculation module, based on the third fused feature and the fourth fused feature, when calculating the first query matching degree and the second query matching degree, the first similarity between the current query information and the candidate content is also calculated.
[0132] In one embodiment, the third screening unit 206 includes:
[0133] A similarity calculation subunit, configured to calculate a second similarity between the current query information and the candidate content according to the neighbor content and the neighbor query information;
[0134] A similarity comparison subunit, used to obtain a similarity matching threshold, and compare the second similarity with the similarity matching threshold;
[0135] The content determination subunit is used to determine, according to the comparison result, candidate content whose second similarity is greater than a similarity matching threshold among the candidate content as target content matching the current query information.
[0136] In one embodiment, the similarity calculation subunit is used to:
[0137] Extract features of neighbor content and neighbor query information to obtain neighbor content features corresponding to the candidate content and neighbor query features corresponding to the current query information;
[0138] Perform feature fusion on neighbor content features to obtain target neighbor content features, and perform feature fusion on neighbor query features to obtain target neighbor query features;
[0139] The similarity between the target neighbor content feature and the target neighbor query feature is calculated to obtain a second similarity between the current query information and the candidate content.
[0140] In one embodiment, the first screening unit 204 is used to:
[0141] Comparing the first query matching degree corresponding to the candidate similar content with the first similarity;
[0142] When the first query matching degree corresponding to the candidate similar content is greater than the first similarity, the candidate similar content is determined as a neighbor content of the candidate content.
[0143] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.
[0144] As can be seen from the above, the embodiment of the present application obtains the current query information and candidate content, as well as multiple candidate similar query information similar to the current query information, and multiple candidate similar content similar to the candidate content through the acquisition unit 201; the first calculation unit 202 calculates the first query matching degree between the current query information and the candidate similar content, and the second query matching degree between the candidate content and the candidate similar query information; the second calculation unit 203 calculates the first similarity between the current query information and the candidate content; the first screening unit 204 screens out the candidate similar content matching the current query information from the candidate similar content as the neighbor content of the candidate content based on the first similarity and the first query matching degree; the second screening unit 205 screens out the candidate similar query information matching the candidate content from the candidate similar query information as the neighbor query information of the current query information based on the first similarity and the second query matching degree; the third screening unit 206 screens out at least one target content matching the current query information from the candidate content according to the neighbor content and the neighbor query information. In this way, by screening out content matching the current query information from the candidate similar content as the neighbor content of the candidate content, and screening out query information matching the candidate content from the candidate similar query information as the neighbor query information of the current query information based on the first similarity, the first query matching degree and the second query matching degree, the semantics of the candidate content can be more comprehensively captured based on the neighbor content, the semantics of the current query information can be more comprehensively captured based on the neighbor query information, and then the target content matching the current query information can be more accurately screened out from the candidate content based on the neighbor content and the current query information, thereby improving the accuracy of content query.
[0145] The present application also provides a computer device, such as Figure 5As shown, it shows a schematic diagram of the structure of a computer device involved in an embodiment of the present application, and the computer device may be a server, specifically:
[0146] The computer device may include one or more processing core processors 301, one or more computer readable storage media memories 302, a power supply 303, an input unit 304 and other components. Those skilled in the art will appreciate that Figure 5 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:
[0147] The processor 301 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. It executes various functions of the computer device and processes data by running or executing software programs and / or modules stored in the memory 302, and calling data stored in the memory 302. Optionally, the processor 301 may include one or more processing cores; preferably, the processor 301 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 301.
[0148] The memory 302 can be used to store software programs and modules. The processor 301 executes various functional applications and data processing by running the software programs and modules stored in the memory 302. The memory 302 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 302 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302.
[0149] The computer device also includes a power supply 303 for supplying power to various components. Preferably, the power supply 303 can be logically connected to the processor 301 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 303 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0150] The computer device may further include an input unit 304, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0151] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 301 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 302 according to the following instructions, and the processor 301 will run the application programs stored in the memory 302, thereby realizing various functions, as follows:
[0152] Acquire current query information and candidate content, as well as multiple candidate similar query information similar to the current query information, and multiple candidate similar content similar to the candidate content; calculate a first query matching degree between the current query information and the candidate similar content, and a second query matching degree between the candidate content and the candidate similar query information; calculate a first similarity between the current query information and the candidate content; based on the first similarity and the first query matching degree, filter out candidate similar content matching the current query information from the candidate similar content as neighbor content of the candidate content; based on the first similarity and the second query matching degree, filter out candidate similar query information matching the candidate content from the candidate similar query information as neighbor query information of the current query information; filter out at least one target content matching the current query information from the candidate content according to the neighbor content and the neighbor query information.
[0153] The specific implementation of each of the above operations can be found in the previous embodiments, which will not be described in detail here. It should be noted that the computer device provided in the embodiment of the present application and the content query method in the above embodiment belong to the same concept, and its specific implementation process is detailed in the above method embodiment, which will not be described in detail here.
[0154] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0155] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any content query method provided in the embodiment of the present application. For example, the instructions can execute the following steps:
[0156] Acquire current query information and candidate content, as well as multiple candidate similar query information similar to the current query information, and multiple candidate similar content similar to the candidate content; calculate a first query matching degree between the current query information and the candidate similar content, and a second query matching degree between the candidate content and the candidate similar query information; calculate a first similarity between the current query information and the candidate content; based on the first similarity and the first query matching degree, filter out candidate similar content matching the current query information from the candidate similar content as neighbor content of the candidate content; based on the first similarity and the second query matching degree, filter out candidate similar query information matching the candidate content from the candidate similar query information as neighbor query information of the current query information; filter out at least one target content matching the current query information from the candidate content according to the neighbor content and the neighbor query information.
[0157] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0158] Since the instructions stored in the computer-readable storage medium can execute the steps in any content query method provided in the embodiments of the present application, the beneficial effects that can be achieved by any content query method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0159] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the various optional implementations provided in the above embodiments.
[0160] The above is a detailed introduction to a content query method, device and computer-readable storage medium provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A content query method, characterized in that: include: Acquire current query information and candidate content, as well as multiple candidate similar query information similar to the current query information, and multiple candidate similar content similar to the candidate content; Calculating a first query matching degree between the current query information and the candidate similar content, and a second query matching degree between the candidate content and the candidate similar query information; Calculating a first similarity between the current query information and the candidate content; Based on the first similarity and the first query matching degree, selecting candidate similar contents matching the current query information from the candidate similar contents as neighbor contents of the candidate contents; Based on the first similarity and the second query matching degree, selecting candidate similar query information matching the candidate content from the candidate similar query information as neighbor query information of the current query information; Calculating the second similarity between the current query information and the candidate content according to the neighbor content and the neighbor query information, wherein the method specifically includes: extracting features from the neighbor content and the neighbor query information to obtain neighbor content features corresponding to the candidate content and neighbor query features corresponding to the current query information, fusing the neighbor content features to obtain target neighbor content features, fusing the neighbor query features to obtain target neighbor query features, calculating the similarity between the target neighbor content features and the target neighbor query features to obtain the second similarity between the current query information and the candidate content, or calculating the similarity between the neighbor content features corresponding to each neighbor content and the current query features corresponding to the current query information, summing the similarities corresponding to each neighbor content to obtain the first total similarity corresponding to the neighbor content, and calculating the similarity between the neighbor query features corresponding to each neighbor query information and the candidate content, summing the similarities corresponding to each neighbor query information to obtain the second total similarity corresponding to the neighbor query information, and summing the first total similarity and the second total similarity to obtain the second similarity between the current query information and the candidate content; Obtaining a similarity matching threshold, and comparing the second similarity with the similarity matching threshold; According to the comparison result, candidate content in the candidate content whose second similarity is greater than the similarity matching threshold is determined as target content matching the current query information.
2. The content query method according to claim 1, characterized in that: The calculating of the first query matching degree between the current query information and the candidate similar content, and the second query matching degree between the candidate content and the candidate similar query information includes: Extracting current query features, candidate content features, candidate similar query features, and candidate similar content features from the current query information, the candidate content, the candidate similar query information, and the candidate similar content, respectively; The matching degree between the current query feature and the candidate similar content feature is calculated to obtain a first query matching degree between the current query information and the candidate similar content, and the matching degree between the candidate content feature and the candidate similar query feature is calculated to obtain a second query matching degree between the candidate content and the candidate similar query information.
3. The content query method according to claim 2, characterized in that: The first query matching degree and the second query matching degree are calculated by a similarity calculation model, wherein the similarity calculation model includes a query information feature extraction module, a content feature extraction module, a fusion module and a similarity calculation module; The extracting of current query features, candidate content features, candidate similar query features, and candidate similar content features from the current query information, the candidate content, the candidate similar query information, and the candidate similar content respectively includes: Extracting current query features and candidate similar query features from the current query information and the candidate similar query information respectively by a query information feature extraction module; Extracting candidate content features and candidate similar content features from the candidate content and the candidate similar content respectively by a content feature extraction module; The calculating the matching degree between the current query feature and the candidate similar content feature to obtain a first query matching degree between the current query information and the candidate similar content, and the calculating the matching degree between the candidate content feature and the candidate similar query feature to obtain a second query matching degree between the candidate content and the candidate similar query information, include: The current query feature and the candidate similar content feature are fused by the fusion module to obtain a first fused feature; The candidate content feature and the candidate similar query feature are fused by the fusion module to obtain a second fused feature; The fusion module and the similarity calculation module calculate a first query matching degree between the current query information and the candidate similar content, and a second query matching degree between the candidate content and the candidate similar query information based on the first fused feature and the second fused feature.
4. The content query method according to claim 3, characterized in that: The calculating the first similarity between the current query information and the candidate content includes: Extracting a first current query feature from the current query information by the query information feature extraction module; Extracting a first candidate content feature from the candidate content by the content feature extraction module; The first fused feature and the first candidate content feature are fused by the fusion module to obtain a third fused feature; The second fused feature and the first current query feature are fused by the fusion module to obtain a fourth fused feature; By means of the fusion module and the similarity calculation module, based on the third fused feature and the fourth fused feature, when calculating the first query matching degree and the second query matching degree, the first similarity between the current query information and the candidate content is also calculated.
5. The content query method according to any one of claims 1 to 4, characterized in that: The step of selecting, based on the first similarity and the first query matching degree, candidate similar contents matching the current query information from the candidate similar contents as neighboring contents of the candidate contents includes: Comparing the first query matching degree corresponding to the candidate similar content with the first similarity; When the first query matching degree corresponding to the candidate similar content is greater than the first similarity, the candidate similar content is determined as a neighbor content of the candidate content.
6. A content query device, characterized in that: include: An acquisition unit, configured to acquire current query information and candidate content, as well as a plurality of candidate similar query information similar to the current query information, and a plurality of candidate similar content similar to the candidate content; A first calculation unit, configured to calculate a first query matching degree between the current query information and the candidate similar content, and a second query matching degree between the candidate content and the candidate similar query information; A second calculation unit, configured to calculate a first similarity between the current query information and the candidate content; A first screening unit, configured to screen out candidate similar contents matching the current query information from the candidate similar contents as neighbor contents of the candidate contents based on the first similarity and the first query matching degree; A second screening unit, configured to screen out candidate similar query information matching the candidate content from the candidate similar query information as neighbor query information of the current query information based on the first similarity and the second query matching degree; The third screening unit is used to calculate the second similarity between the current query information and the candidate content according to the neighbor content and the neighbor query information, which specifically includes: extracting features from the neighbor content and the neighbor query information to obtain neighbor content features corresponding to the candidate content and neighbor query features corresponding to the current query information, fusing the neighbor content features to obtain target neighbor content features, fusing the neighbor query features to obtain target neighbor query features, calculating the similarity between the target neighbor content features and the target neighbor query features to obtain the second similarity between the current query information and the candidate content, or calculating the neighbor content features corresponding to each neighbor content and the neighbor query features corresponding to the current query information. The similarity between the current query features is calculated, the similarities corresponding to each neighbor content are summed to obtain the first total similarity corresponding to the neighbor content, and the similarity between the neighbor query feature corresponding to each neighbor query information and the candidate content is calculated, the similarities corresponding to each neighbor query information are summed to obtain the second total similarity corresponding to the neighbor query information, the first total similarity and the second total similarity are summed to obtain the second similarity between the current query information and the candidate content; a similarity matching threshold is obtained, and the second similarity is compared with the similarity matching threshold; and according to the comparison result, the candidate content in the candidate content whose second similarity is greater than the similarity matching threshold is determined as the target content matching the current query information.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the content query method according to any one of claims 1 to 5.
8. A computer device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the content query method according to any one of claims 1 to 5 when executing the computer program.
Citation Information
Patent Citations
Short text query expansion and indexing method based on word vector
CN104765769A
Information query method and device
CN108304444A
Called content determination method and device, equipment and storage medium
CN113010752A
Query request response method and device
CN115114424A
Method for recommending content based on user preference and profile of content
KR1020120049551A
