Content query method and content query model training method

By introducing generative decoding units and joint training mechanisms into the dual-tower model, the problems of fine-grained information loss and representation collapse in the traditional dual-tower model are solved, and more accurate content query results are achieved.

CN121765077APending Publication Date: 2026-03-31SHUXING TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-31
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Traditional dual-tower models lose fine-grained, non-thematic details in content queries, resulting in poor query accuracy and the risk of representation collapse.

Method used

We introduce content encoding units, query encoding units, and generation decoding units. By jointly training the sample content summary and generation decoding units, we enhance the semantic integrity of the content vectors. We optimize the model through generation loss and contrastive loss to ensure that the content vectors contain sufficient semantic information.

Benefits of technology

It significantly improves the accuracy and semantic relevance of content query results, alleviates information bottlenecks and representation collapse problems, and generates content query results that are more focused on core themes and key information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121765077A_ABST
    Figure CN121765077A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a content query method and a content query model training method. The content query method comprises the steps of obtaining target query data and to-be-queried content; the content to be queried is input into a content coding unit in a content query model to obtain a content vector, the target query data is input into a query coding unit in the content query model to obtain a query vector, and the content query model comprises the content coding unit, the query coding unit and a generation decoding unit; the content coding unit is obtained by training based on a sample content abstract of the sample content and a predicted content abstract, and the predicted content abstract is obtained by processing a sample content vector of the sample content by the generation decoding unit; and generating a content query result according to the content vector and the query vector. And the content coding unit carries out supervised training through the sample content abstract and the prediction content abstract reconstructed by the generation decoding unit through autoregression by taking the sample content vector as the condition, so that the accuracy of the content query result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of artificial intelligence technology, and in particular to content query methods and content query model training methods. Background Technology

[0002] With the explosive growth of internet content, efficient semantic-based content retrieval has become a core component of applications such as search engines, recommendation systems, and intelligent question answering. Traditional keyword matching methods struggle to capture the deep semantic relationships between user queries and content, prompting researchers to widely adopt the dual-tower model based on dense vectors for semantic retrieval.

[0003] Currently, dual-tower models typically map text to a shared embedding space using independent query encoders and content encoders, leveraging vector similarity for efficient querying. However, in this process, a significant amount of fine-grained, non-topic details are inevitably lost, leading to poor accuracy in content query results. Therefore, a more accurate content querying solution is urgently needed. Summary of the Invention

[0004] In view of this, embodiments of this specification provide a content query method. One or more embodiments of this specification also relate to a content query model training method, a content query device, a content query model training device, a computing device, a computer-readable storage medium, and a computer program product, to address the technical deficiencies existing in the prior art.

[0005] According to a first aspect of the embodiments of this specification, a content query method is provided, including: Retrieve the target query data and the content to be queried; The content to be queried is input into the content encoding unit in the content query model to obtain the content vector, and the target query data is input into the query encoding unit in the content query model to obtain the query vector. The content query model includes a content encoding unit, a query encoding unit, and a generation decoding unit. The content encoding unit is trained based on the sample content summary and the predicted content summary of the sample content. The predicted content summary is obtained by the generation decoding unit by processing the sample content vector of the sample content. Generate content query results based on the content vector and query vector.

[0006] According to a second aspect of the embodiments of this specification, a content query model training method is provided, comprising: Obtain sample data, which includes sample content, a summary of the sample content, and sample query data; Input the sample content into the content encoding unit in the content query model to obtain the sample content vector, and input the sample query data into the query encoding unit in the content query model to obtain the sample query vector; By using the generator-decoder unit in the content query model, the sample content vector is processed to obtain a predicted content summary; Based on the sample content vector, sample query vector, sample content summary, and predicted content summary, the parameters of the content encoding unit, query encoding unit, and generation decoding unit are adjusted to obtain the trained content query model.

[0007] According to a third aspect of the embodiments of this specification, a content query device is provided, comprising: The first acquisition module is configured to acquire the target query data and the content to be queried. The first input module is configured to input the content to be queried into the content encoding unit in the content query model to obtain a content vector, and input the target query data into the query encoding unit in the content query model to obtain a query vector. The content query model includes a content encoding unit, a query encoding unit, and a generation decoding unit. The content encoding unit is trained based on the sample content summary and the predicted content summary of the sample content. The predicted content summary is obtained by the generation decoding unit by processing the sample content vector of the sample content. The generation module is configured to generate content query results based on the content vector and the query vector.

[0008] According to a fourth aspect of the embodiments of this specification, a content query model training apparatus is provided, comprising: The second acquisition module is configured to acquire sample data, wherein the sample data includes sample content, a sample content summary of the sample content, and sample query data. The second input module is configured to input sample content into the content encoding unit in the content query model to obtain a sample content vector, and input sample query data into the query encoding unit in the content query model to obtain a sample query vector; The processing module is configured to use the generation and decoding unit in the content query model to process the sample content vector and obtain a predicted content summary. The first adjustment module is configured to adjust the parameters of the content encoding unit, query encoding unit, and generation decoding unit based on the sample content vector, sample query vector, sample content summary, and predicted content summary, so as to obtain the trained content query model.

[0009] According to a fifth aspect of the embodiments of this specification, a computing device is provided, comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the methods provided in the first or second aspect above.

[0010] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores a computer program / instructions that, when executed by a processor, implement the steps of the method provided in the first or second aspect described above.

[0011] According to a seventh aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the method provided in the first or second aspect described above.

[0012] This specification provides a content query method according to one embodiment, comprising: acquiring target query data and content to be queried; inputting the content to be queried into a content encoding unit in a content query model to obtain a content vector, and inputting the target query data into a query encoding unit in the content query model to obtain a query vector. The content query model includes a content encoding unit, a query encoding unit, and a generation / decoding unit. The content encoding unit is trained based on a sample content summary and a predicted content summary of the sample content. The predicted content summary is obtained by the generation / decoding unit processing the sample content vector of the sample content. Based on the content vector and the query vector, a content query result is generated. Since the content encoding unit not only learns the surface semantics of the sample content but also undergoes supervised training through the sample content summary and the predicted content summary reconstructed by the generation / decoding unit using the sample content vector as a conditional autoregression, the content vector can encode sufficiently rich semantic information that can generate high-quality content summaries. This focuses more on the core theme and key information of the content to be queried, rather than noise or redundant details. Therefore, when generating content query results based on the content vector and the query vector, semantically relevant and high-quality content can be identified more accurately, significantly improving the accuracy of the content query results. Attached Figure Description

[0013] Figure 1 This is a flowchart illustrating a content query method provided in one embodiment of this specification; Figure 2 This is an architecture diagram of a content query system provided in one embodiment of this specification; Figure 3 This is a flowchart illustrating a content query model training method provided in one embodiment of this specification; Figure 4 This is a schematic diagram illustrating the processing procedure of a content query model training method provided in one embodiment of this specification; Figure 5This is a flowchart of a content query method provided in one embodiment of this specification; Figure 6 This is a schematic diagram of the structure of a content query device provided in one embodiment of this specification; Figure 7 This is a schematic diagram of the structure of a content query model training device provided in one embodiment of this specification; Figure 8 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0014] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0015] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items. The term “at least one” in one or more embodiments of this application means “one or more,” and “a plurality of” means “two or more.” The term “comprising” is an open-ended description and should be understood as “including but not limiting,” and may include other content in addition to what has been described.

[0016] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0017] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0018] In one or more embodiments of this specification, a large model refers to a deep learning model with a large number of model parameters, typically containing hundreds of millions, tens of billions, hundreds of billions, trillions, or even tens of trillions of model parameters. A large model can also be called a foundation model. It is pre-trained using large-scale unlabeled corpora to produce a pre-trained model with hundreds of millions of parameters. Such models can adapt to a wide range of downstream tasks and have good generalization ability. Examples include Large Language Models (LLMs) and multi-modal pre-training models.

[0019] In practical applications, large models only require a small number of samples to fine-tune the pre-trained model before they can be applied to different tasks. Large models can be widely used in fields such as Natural Language Processing (NLP) and Computer Vision. Specifically, they can be applied to computer vision tasks such as Visual Question Answering (VQA), Image Captioning (IC), and Image Generation, as well as natural language processing tasks such as text-based sentiment classification, text summarization, and machine translation. The main application scenarios of large models include digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design.

[0020] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0021] The Dual-Tower Model is a deep learning architecture widely used in recommendation systems, information retrieval, and semantic search. Its core idea is to encode two objects to be matched (such as users and items, queries and content) into vectors using two independent neural networks ("towers"), and then perform matching or recall based on similarity calculations within a shared semantic space.

[0022] Representation collapse refers to a situation where, during model training, all inputs (regardless of whether they are positive or negative samples) are mapped to almost the same embedding vector (or highly clustered in a very small subspace), thus superficially satisfying the condition of minimizing contrastive loss, but actually losing semantic discriminative ability.

[0023] Contrastive Estimation (InfoNCE) only requires positive samples to be more similar to negative samples in the current batch, without requiring global discriminative power. If the model compresses all outputs to a single point, then even slightly "slightly closer" positive samples can fool the loss function.

[0024] Notes are text, images, or other forms of content created by individuals or teams in their studies, work, or daily lives for purposes such as recording information, organizing thoughts, and providing reminders. Notes can range from a few simple lines of text to complex electronic content containing charts, links, multimedia files, and other elements. Notes are widely used in various life and work scenarios, such as knowledge point notes and lesson plan notes in learning and education, and dietary records, exercise records, and shopping sharing notes in health and lifestyle scenarios.

[0025] Deep self-attention (Transformer) models are network structures based on multi-head self-attention mechanisms, primarily used for processing sequential data. A Transformer model consists of repeatedly stacked encoder and decoder units. This design allows the Transformer to efficiently learn long-term dependencies, making it suitable for various natural language processing tasks, including machine translation, text summarization, and question answering systems.

[0026] Bidirectional Encoder Representations from Transformers (BERT) is a pre-trained NLP model. By learning from large amounts of unlabeled text data, this model can capture deep semantic information from text and achieves significant performance improvements on numerous NLP tasks.

[0027] Sentence embedding model (SEM): A deep learning model based on the Transformer architecture, specifically designed to encode entire sentences or text paragraphs into fixed-dimensional vector representations (i.e., sentence vectors). These vectors capture the semantic information of sentences, making semantically similar sentences closer together in the vector space, thereby supporting downstream tasks such as semantic search, text clustering, and sentence similarity calculation.

[0028] Autoregressive refers to a process in which a model predicts the next element one by one when generating sequences (such as text, speech, and time series), and uses the already generated parts as input conditions for subsequent predictions, forming a recursive process of "regressing itself".

[0029] In search systems (such as search engines, recommendation systems, or question-answering systems), to efficiently find results relevant to user queries from massive amounts of content (Documents), a "two-tower model" architecture is typically used. This model vectorizes both the queries and documents, and then performs fast retrieval based on vector similarity. This process is an indispensable key component in online services (i.e., systems that respond in real-time after a user's request). In the two-tower model, queries and documents are encoded independently, with no cross-attention or deep interaction mechanisms between the two towers. The goal of each tower is to compress high-dimensional, complex inputs (such as a piece of text or a sequence of user behavior) into a fixed-dimensional vector (embedding), and use contrastive loss functions such as InfoNCE to shorten the distance between semantically positive sample pairs (relevant queries and documents) and widen the distance between negative sample pairs (irrelevant queries and documents).

[0030] However, the above approach has the following drawbacks: First, the information bottleneck problem: In the input compression process of the dual-tower model, in order to retain "general" or "highly discriminative" semantic features (such as topic and intent), the model actively discards fine-grained, non-topic details that it considers "unimportant." This means the model may only learn to match the coarsest-grained topic and fail to perceive more nuanced semantic differences. Second, the risk of representation collapse: In extreme cases, the model may find a "shortcut solution," easily satisfying the constraints of contrastive learning by collapsing into a smaller subspace, leading to highly similar representations and decreased discriminative power. While hard sample mining can alleviate this, it does not fundamentally solve the problem.

[0031] To address the aforementioned issues, this specification proposes a content query method, comprising: acquiring target query data and content to be queried; inputting the content to be queried into a content encoding unit in a content query model to obtain a content vector, and inputting the target query data into a query encoding unit in the content query model to obtain a query vector. The content query model includes a content encoding unit, a query encoding unit, and a generation / decoding unit. The content encoding unit is trained based on a sample content summary and a predicted content summary of the sample content, and the predicted content summary is obtained by the generation / decoding unit processing the sample content vector of the sample content. Based on the content vector and the query vector, a content query result is generated.

[0032] It's worth noting that by appending a "vector-to-text" summarization task (restoring a sample content summary of the sample content) to the sample content vector, a strong semantic constraint is imposed on representation learning. This constraint requires that the final sample content vector must contain enough information to reconstruct the semantic core of the sample content. This effectively guides the content query model to pay more attention to visual / linguistic features that are highly relevant to the text semantics during the contrastive learning process. This implicitly and structurally preserves the rich semantic information of the sample content, enabling the model to learn denser vector representations that are more informative, accurate, and generalizable, further improving the accuracy of content query results.

[0033] This specification provides a content query method, and also relates to a content query model training method, a content query device, a content query model training device, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.

[0034] See Figure 1 , Figure 1 This specification shows a flowchart of a content query method according to an embodiment, which specifically includes the following steps: Step 102: Obtain the target query data and the content to be queried.

[0035] It's important to note that target query data refers to the original query content entered by the user during retrieval, used to express their information needs. Target query data can be used as input to the query encoding unit, and its semantics will be encoded into a query vector for subsequent similarity calculations. Target query data is typically text-based, including but not limited to keywords, natural language questions, or intent descriptions. For example, target query data could be "recommendations for refreshing sunscreens suitable for oily skin." Target query data can also be other modalities, such as voice, video, and images. When encoding target query data using the query encoding unit, the target query data can be converted to text before being input into the query encoding unit.

[0036] The content to be queried refers to the raw content waiting to be matched with the target query data. There can be one or more pieces of content to be queried. This content can be used as input to content encoding units, transformed into content vectors for subsequent sorting. The content to be queried can be unimodal, such as structured or unstructured text data, or multimodal multimedia content, meaning it simultaneously contains information in at least two modalities, such as images, text, video, and audio. Furthermore, the content to be queried can also cover other formats of content from any object within the content sharing platform, such as location information, group chat records, product entries, and virtual resources. The content to be queried can originate from various application scenarios, such as product detail page text and user reviews on e-commerce platforms, recommended notes and interactive comment data under notes on content sharing platforms, as well as other user-generated or system-generated content that integrates multiple media formats.

[0037] In practical applications, there are various ways to obtain the target query data and the content to be queried, and the specific method should be selected according to the actual situation. This specification does not impose any limitations on these methods in the embodiments. In one possible implementation of this specification, the target query data and the content to be queried can be read from the database of the content query system. In another possible implementation of this specification, the target query data and the content to be queried can be received from the user through a client.

[0038] Step 104: Input the content to be queried into the content encoding unit in the content query model to obtain the content vector, and input the target query data into the query encoding unit in the content query model to obtain the query vector. The content query model includes a content encoding unit, a query encoding unit, and a generation decoding unit. The content encoding unit is trained based on the sample content summary and the predicted content summary of the sample content. The predicted content summary is obtained by the generation decoding unit by processing the sample content vector of the sample content.

[0039] It's important to note that a content query model refers to an end-to-end neural network architecture that includes content encoding units, query encoding units, and generative decoding units. For example, a generative decoder can be added after the content encoding tower of a dual-tower model for summary reconstruction, thus constructing a content query model. Alternatively, a content query model can be built upon a larger model. Through content query models, efficient semantic retrieval can be achieved, and representation quality can be improved through the summary reconstruction task. During the training phase, the content query model jointly optimizes the contrastive loss (for retrieval) and the generative loss (for summary generation), while during the inference phase, only the dual-tower components (i.e., content encoding units and query encoding units) are used for fast querying.

[0040] A content encoding unit (CIU) is a neural network module (such as BERT or Sentence Transformer) in a content query model responsible for mapping query content into dense vectors (i.e., content vectors). CIUs generate high-quality content vectors and receive supervised training signals from the generation / decoding unit. The key role of CIUs lies not only in semantic compression but also in forcing content vectors to retain sufficient semantic information to support high-quality text generation through joint training using the difference between the predicted content summary reconstructed by the generation / decoding unit and the actual sample content summary as a supervisory signal. This improves the discriminativeness and generalizability of the representation.

[0041] A query encoding unit (QU) is a neural network module in a content query model responsible for encoding target query data into query vectors. Through the QU, user intent can be accurately characterized in a semantic space aligned with the content vectors. The QU typically shares the same structure or some parameters as the content encoding unit, ensuring consistency in their embedding spaces. For example, the QU can be a BERT model isomorphic to the content encoding unit.

[0042] A generative decoder (GDE) is a generative decoder that generates text based on sample content vectors. During training, the GDE generates predicted content summaries from sample content vectors using an autoregressive approach. The GDE then calculates a generation loss against the actual sample content summaries, serving as a regularizer signal for the content encoding units. This signal inversely constrains the content encoding units to learn more semantically complete representations, effectively alleviating information bottlenecks and representation collapse problems. The GDE does not participate in query inference; it is only used during the training phase to improve the quality of content representations. For example, the GDE can be a 12-layer Transformer Decoder or a 1.5B LLM Decoder.

[0043] Content vectors are low-dimensional dense representations output by content encoding units, representing the semantic embedding of the content to be queried. Query vectors are low-dimensional dense representations output by query encoding units, representing the semantic embedding of the target query data. The semantic relevance of content vectors and query vectors can be calculated using cosine similarity or dot product to determine the content query results (such as a recall ranking list).

[0044] In practical applications, the query encoding unit can be trained based solely on the sample content vector and the sample query vector, or it can be trained by combining the sample content summary and the predicted content summary based on the sample content vector and the sample query vector.

[0045] Step 106: Generate content query results based on the content vector and query vector.

[0046] It's important to note that content query results refer to the results returned after calculation and sorting based on content vectors and query vectors. A content query result can be at least one item from multiple query items that matches the target query data, or it can be a portion of a single query item that matches the target query data. Content query results can support downstream applications such as search, recommendation, and question answering. Content query results can take various forms, such as a list of content matching the target query data, complete content, content summary fragments, or structured responses with relevance scores, etc. Because the semantic integrity of the content vectors is optimized through the summary reconstruction task, content query results are generally more accurate and more topic-focused than the traditional dual-tower model.

[0047] For example, the target query data is "gentle facial cleanser suitable for sensitive skin", and the content query result is "product A: amino acid formula, alcohol-free and fragrance-free, soothing facial cleanser specially designed for sensitive skin".

[0048] It is worth noting that although a generative decoding unit is introduced during the training of the content query model to improve the quality of content representation, only a dual-tower structure (content encoding unit and query encoding unit) is used in the actual inference stage (i.e., generating content query results) to ensure the efficiency of content query. The content query method proposed in the embodiments of this specification can be applied to scenarios such as search engines, e-commerce product recommendations, intelligent customer service question-and-answer matching, and personalized news push.

[0049] In practical applications, there are multiple ways to generate content query results based on content vectors and query vectors. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this approach. One possible implementation of this specification involves calculating the cosine similarity between the query vector and the content vector, and then using the cosine similarity score to recall or rank the content query results. Another possible implementation of this specification uses the dot product of the query vector and the content vector as the relevance score, and then uses the relevance score to recall or rank the content query results. Compared to cosine similarity, the dot product retains the vector magnitude information, which can reflect "confidence" or "importance."

[0050] By applying the scheme of the embodiments of this specification, since the content encoding unit not only learns the surface semantics of the sample content, but also conducts supervised training through the sample content summary and the predicted content summary reconstructed by the generation decoding unit with the sample content vector as a conditional autoregression, the content vector can encode sufficiently rich semantic information that can generate high-quality content summaries, focusing more on the core theme and key information of the content to be queried, rather than noise or redundant details. Therefore, when generating content query results based on the content vector and query vector, semantically relevant and high-quality content can be identified more accurately, significantly improving the accuracy of content query results.

[0051] In one optional embodiment of this specification, generating content query results based on content vectors and query vectors may include the following steps: By comparing the content vector and the query vector, a vector similarity index is obtained, which reflects the degree of similarity between the content vector and the query vector. Content query results are generated based on vector similarity metrics.

[0052] It should be noted that vector similarity metrics are numerical indicators used to quantify the degree of similarity between content vectors and query vectors. Methods for obtaining vector similarity metrics by comparing content vectors and query vectors include, but are not limited to, methods based on cosine similarity, dot product, or Euclidean distance.

[0053] The scheme implemented in this specification generates content query results based on the vector similarity index between content vectors and query vectors, achieving efficient and semantically aware retrieval capabilities. Since the content vector is subject to regularization constraints from the summary reconstruction task of the generation decoding unit during the training phase, its semantic integrity is significantly better than that of the traditional dual-tower model. This allows similarity calculation to not only capture surface keyword matching but also identify deep topic consistency, thereby improving the relevance of the recall results and user satisfaction.

[0054] Regarding the training process of the content query model, in one optional embodiment of this specification, an auxiliary generative reconstruction task can be introduced for the Documents tower (i.e., content encoding unit) based on the Query-Documents contrastive learning loss function. This task requires the content query model to reconstruct a summary of the sample content from the compressed Documents representation vector (i.e., the sample content vector). That is, the training method of the above-mentioned content query model can include the following steps: Obtain sample data, which includes sample content, sample content summary, and sample query data; Input the sample content into the content encoding unit to obtain the sample content vector, and input the sample query data into the query encoding unit to obtain the sample query vector; The sample content vector is processed using the generation and decoding unit to obtain a predicted content summary; Based on the sample content vector, sample query vector, sample content summary, and predicted content summary, the parameters of the content encoding unit, query encoding unit, and generation decoding unit are adjusted to obtain the trained content query model.

[0055] It should be noted that sample data refers to the supervised triplet data used to train the content query model, which includes sample content, a sample content summary of the sample content, and sample query data. There are usually multiple sample data sets. Within the same triplet data set, the sample query data and sample content are correlated, while sample query data and sample content in different triplet data sets may or may not be correlated.

[0056] Sample content refers to labeled content samples used during the training phase of the content query model, typically accompanied by summaries of real sample content. The sample content serves as input to the content encoding units for learning semantic representations. Sample content can be unimodal or multimodal multimedia content. Furthermore, sample content can also encompass other formats of content from any object within the content sharing platform. Sample content can originate from various application scenarios, such as product detail page text and user reviews on e-commerce platforms, recommended notes and interactive comment data under notes on content sharing platforms, as well as other user-generated or system-generated content that integrates multiple media formats.

[0057] Sample query data refers to user query text that is semantically related to the sample content, such as keywords in search logs, natural language questions, or queries corresponding to click behaviors.

[0058] A sample content summary refers to the actual summary text paired with the sample content, usually written manually or extracted automatically with high quality. A sample content summary can also be called a sample content outline or sample content title, representing the core semantics of the sample content and used to measure the "semantic completeness" of the sample content vector.

[0059] Predicted content summarization refers to the summary text generated by the generation decoding unit based on the sample content vector through autoregression. The predicted content summarization is used to compare with the sample content summarization, calculate the generation loss, and inversely optimize the content encoding unit. Higher quality predicted content summarization indicates more complete retention of semantic information from the sample content vector.

[0060] A sample content vector is a vector representation output by a content encoding unit after processing sample content. On one hand, sample content vectors can be used for contrastive learning (calculating similarity with sample query vectors); on the other hand, sample content vectors can serve as input conditions for generating decoding units.

[0061] The trained content query model refers to the content query model that has converged after joint optimization. During the inference phase, only the content encoding units and query encoding units in the trained content query model are used for efficient querying.

[0062] In practical applications, there are multiple ways to adjust the parameters of the content encoding unit, query encoding unit, and generation decoding unit based on the sample content vector, sample query vector, sample content summary, and predicted content summary to obtain a trained content query model. The specific method chosen depends on the actual situation, and this specification does not limit this approach. In one possible implementation, the contrastive loss is calculated based on the sample content vector and sample query vector; the generation loss is calculated based on the sample content summary and predicted content summary; the total loss is calculated based on the contrastive and generation losses; and the parameters of the query encoding unit, content encoding unit, and generation decoding unit are adjusted according to the total loss to obtain the trained content query model. In another possible implementation, after obtaining the total loss, the parameters of the query encoding unit are adjusted using the contrastive loss, and the parameters of the content encoding unit and generation decoding unit are adjusted according to the total loss to obtain the trained content query model.

[0063] By applying the scheme of the embodiments in this specification, a "query-generation" joint training framework is constructed by introducing a summary reconstruction task as an auxiliary supervision task. While optimizing the semantic alignment of the sample query vector and the sample content vector (contrastive loss), the sample content vector is forced to contain complete semantic information sufficient to reconstruct the sample content summary (generation loss), thereby effectively alleviating the information bottleneck and representation collapse problem in the traditional dual-tower model. After training, the content query model can achieve high-precision semantic query in the inference stage with only lightweight dual-tower computation. This not only significantly improves the relevance of the content query results, but also enhances the generalization ability of the representation, and can be seamlessly transferred to downstream tasks such as classification and clustering.

[0064] In one optional embodiment of this specification, the above-described parameter adjustment of the content encoding unit, query encoding unit, and generation decoding unit based on the sample content vector, sample query vector, sample content summary, and predicted content summary to obtain the trained content query model may include the following steps: Calculate the contrastive loss based on the sample content vector and the sample query vector; The generation loss is calculated based on the sample content summary and the predicted content summary. Based on the contrastive loss, the parameters of the query encoding unit are adjusted, and based on the contrastive loss and the generation loss, the parameters of the content encoding unit and the generation decoding unit are adjusted respectively, to obtain the trained content query model.

[0065] It's important to note that contrastive loss (L_contrastive) is a loss value used to measure the semantic matching degree between sample content vectors and sample query vectors. Methods for calculating this loss include, but are not limited to, InfoNCE and the Cross-Entropy loss function (CE). In a batch of sample data, contrastive loss can shorten the vector distance between the sample query vector and relevant sample content, while simultaneously widening the vector distance between the sample query vector and irrelevant sample content. This drives the alignment of query encoding units and content encoding units in the shared semantic space, improving query relevance.

[0066] Generation loss (L_reconstruction), also known as reconstruction loss, is a loss value used to measure the degree of difference between the predicted content summary and the sample content summary. Methods for calculating generation loss include, but are not limited to, the cross-entropy loss function and the negative log-likelihood loss function (NLL). Generation loss can serve as a regularization signal, constraining the sample content vector to contain sufficient semantic information to support accurate summary generation and prevent information loss.

[0067] In practical applications, when adjusting the parameters of the content encoding unit and the generation decoding unit based on the contrastive loss and the generation loss respectively, the contrastive loss and the generation loss can be weighted to obtain the total loss (L_total=L_contrastive+λ*L_reconstruction). Based on the total loss, the parameters of the content encoding unit and the generation decoding unit are then adjusted to obtain the trained content query model. Here, λ is a hyperparameter used to balance the relative importance of the contrastive loss and the generation loss.

[0068] The scheme implemented in this specification allows the parameters of the query encoding unit to be adjusted only by the contrastive loss, while the parameters of the content encoding unit are adjusted by both the contrastive loss and the generation loss. This ensures that the sample query vector focuses on matching and forces the sample content vector to contain complete and structured semantic information sufficient to reconstruct the true summary, thereby effectively alleviating the information bottleneck and representation collapse problems in the traditional dual-tower model.

[0069] In one optional embodiment of this specification, relying solely on unsupervised or weakly supervised similarity matching methods can easily lead to ambiguous or biased representations. Therefore, this embodiment introduces explicit sample association labels to provide clear learning objectives and ensure that sample content vectors and sample query vectors are truly "converged in the same direction and separated in opposite directions" semantically. That is, the calculation of contrastive loss based on sample content vectors and sample query vectors can include the following steps: Obtain sample association tags between sample content and sample query data; By comparing the sample content vector and the sample query vector, a sample similarity index is obtained, which reflects the degree of similarity between the sample content and the sample query data. The contrast loss is calculated based on the sample association labels and sample similarity indicators.

[0070] It should be noted that sample association labels are binary or multivariate labels used to indicate whether there is a correlation between sample content and sample query data (e.g., 1 indicates correlation, 0 indicates no correlation). Sample association labels can provide supervisory signals, clarifying which sample query data-sample content pairs are positive samples and which are negative samples, thereby guiding the calculation of contrastive loss.

[0071] Sample similarity metrics refer to numerical similarity scores between sample content vectors and sample query vectors, calculated using methods such as cosine similarity and dot product. These metrics quantify the semantic matching degree between the sample content vectors and sample query vectors, serving as a relevance score for model predictions and aligning with the true labels.

[0072] The scheme implemented in this specification introduces sample association labels as supervision signals and calculates contrast loss by combining sample similarity indicators. This enables the content query model to clearly distinguish between relevant and irrelevant sample query data-sample content pairs, thereby effectively aligning the semantic space during training. This not only improves the accuracy of content queries but also enhances the robustness of the content query model to noise and irrelevant content.

[0073] In one optional embodiment of this specification, the above-described method of using a generation and decoding unit to process the sample content vector to obtain a predicted content summary may include the following steps: The sample content vector is used as the initial hidden state for generating the decoding unit, and the generating decoding unit is used to process the initial hidden state to obtain the predicted content summary; or, The sample content vector is used as the context vector for generating the decoding unit. The generating decoding unit then performs cross-attention processing based on the context vector to obtain the predicted content summary.

[0074] It should be noted that the initial hidden state refers to the initial hidden layer representation used by the generation and decoding unit when it begins to generate the sequence.

[0075] A context vector is a representation that continuously provides external semantic references during the decoding process of the generation decoding unit. The context vector can be dynamically queried by the cross-attention module of the generation decoding unit at each generation step. If the content encoding unit outputs only a single sample content vector, the sample content vector can be copied into multiple tokens or expanded into a key / value matrix through linear projection, serving as the context input for the cross-attention module.

[0076] Cross-attention refers to a process in each layer of the generative-decoding unit where the currently generated representation is used as a query. By calculating the relevance between this query and the key formed by the context vector, information from the context is weighted and aggregated to generate a context-aware representation that incorporates external semantics. This representation is then fed into subsequent network layers to predict the next token.

[0077] In practical applications, there are various ways to process sample content vectors using the generation decoding unit to obtain predicted content summaries. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this approach. In one possible implementation, the sample content vector can be randomly selected as the initial hidden state of the generation decoding unit, or as the context vector of the generation decoding unit. In another possible implementation, the selection can be based on the content metrics of the sample content, choosing between using the sample content vector as the initial hidden state of the generation decoding unit and using it as the context vector of the generation decoding unit.

[0078] It's worth noting that if the sample content vector is defined as the initial hidden state for generating decoding units, it means that the entire generation process of decoding units starts from the semantic "starting point" of the sample content vector, and the generation of subsequent tokens indirectly depends on the sample content vector. This approach is simple in structure and has low parameter overhead, making it suitable for lightweight decoders. However, since the sample content vector is only injected in the early stages of generation, it is difficult to continuously reference semantic details during the generation of long sequences, which can easily lead to deviations in the summary or omission of key content.

[0079] If the sample content vector is used as the context vector for the generation and decoding unit, it means that the generation and decoding unit can explicitly and dynamically focus on the core semantics of the sample content vector when generating each token. This mechanism achieves fine-grained semantic alignment, significantly improving the fidelity and relevance of the generated content. Especially for long content or complex semantics, cross-attention processing can effectively alleviate the problem of information forgetting, ensuring that the summary always anchors to the main theme of the sample content.

[0080] The scheme implemented in this specification uses sample content vectors as the initial hidden state or as context vectors in cross-attention. This ensures that the sample content vectors contain complete semantics sufficient to support high-quality summary generation, transforming the generation task into a strong supervisory signal for the sample content vectors: if the sample content vectors lack key information, the generated predicted content summary will deviate from the sample content summary; conversely, only semantically rich and structurally clear sample content vectors can reconstruct accurate predicted content summaries. Therefore, this approach effectively alleviates the information bottleneck problem in traditional dual-tower models, upgrading sample content vectors from "only used for matching" to "interpretable and generative" general semantic representations, significantly improving query quality and model robustness without increasing inference overhead.

[0081] In one optional embodiment of this specification, determining the sample content vector as the initial hidden state of the decoding unit and processing the initial hidden state using the decoding unit to obtain the predicted content summary may include the following steps: If the content index of the sample content is less than the preset index threshold, the sample content vector is determined as the initial hidden state of the generation decoding unit. The generation decoding unit is then used to process the initial hidden state to obtain the predicted content summary. The content index is used to reflect the complexity of the sample content.

[0082] It should be noted that content metrics are numerical indicators used to quantify the complexity of sample content. They can be calculated based on factors such as length (e.g., number of tokens), lexical diversity, sentence structure depth, information entropy, or number of topics. Content metrics can serve as a decision-making basis, determining whether to use the sample content vector as the initial hidden state for generating decoding units or as the context vector for generating decoding units, thus achieving a dynamic balance between resources and effectiveness.

[0083] A preset threshold is a critical value for content complexity that is set manually or determined through data statistics. The preset threshold can serve as a boundary between "simple content" and "complex content" in sample content, triggering different generation and decoding mechanisms.

[0084] Applying the scheme of the embodiments in this specification, when the content index of the sample content is less than a preset index threshold, it indicates that the sample content is simple content with concentrated semantics and low information density (such as short text or single-topic content). Its core semantics can be effectively compressed into the sample content vector without introducing a computationally expensive cross-attention mechanism. Therefore, the sample content vector can be used as the initial hidden state for generating the decoding unit to generate the predicted content summary. In this way, training speed can be accelerated, memory usage can be reduced, and the content query model can avoid over-parameterization of simple tasks.

[0085] In one optional embodiment of this specification, determining the sample content vector as the context vector of the generating decoding unit, and using the generating decoding unit to perform cross-attention processing based on the context vector to obtain the predicted content summary, may include the following steps: If the content index of the sample content is greater than or equal to the preset index threshold, the sample content vector is determined as the context vector of the generation decoding unit. The generation decoding unit then performs cross-attention processing based on the context vector to obtain the predicted content summary. The content index is used to reflect the complexity of the sample content.

[0086] Applying the scheme of the embodiments of this specification, when the content index of the sample content is greater than or equal to the preset index threshold, it indicates that the sample content is complex content containing multiple topics, long-distance dependencies, or rich details. If the sample content vector is determined as the initial hidden state of the decoding unit, it may be difficult to fully carry and transmit the semantic information of the sample content. Therefore, the sample content vector can be used as a context vector to participate in the cross-attention calculation at each step, so that the decoding unit can backtrack and focus on the core semantics of the sample content when generating each token, which significantly improves the fidelity, coverage, and coherence of the predicted content summary.

[0087] Considering the large number of parameters in the content query model and the limited computing resources on the client side, the content query method proposed in the embodiments of this specification can be applied to, for example... Figure 2 The content retrieval system shown is not limited to this. See also Figure 2 , Figure 2 This specification illustrates an architecture diagram of a content query system provided in one embodiment of the specification. The content query system may include a client 202 and a server 204. Client 202 is used to send the target query data and the content to be queried to server 204; Server 204 is used to input the content to be queried into the content encoding unit of the content query model to obtain a content vector, and input the target query data into the query encoding unit of the content query model to obtain a query vector. The content query model includes a content encoding unit, a query encoding unit, and a generation decoding unit. The content encoding unit is trained based on the sample content summary and the predicted content summary of the sample content. The predicted content summary is obtained by the generation decoding unit by processing the sample content vector of the sample content. Based on the content vector and the query vector, the server generates the content query result and sends the content query result to the client 202. Client 202 is also used to receive content query results sent by server 204.

[0088] like Figure 2As shown, the content query model is deployed on server 204. Server 204 can connect to one or more clients 202 via LAN, WAN, Internet, or other types of data networks. Data transmitted by client 202 may require encoding, transcoding, compression, or other processing before being published to server 204. Multiple clients 202 can establish communication connections through server 204. In the content query scenario, server 204 provides content query services between multiple clients 202. Each client 202 can act as a sender or receiver, communicating through server 204. Users can interact with server 204 through client 202 to receive data from other clients 202 or send data to other clients 202. In the content query scenario, a user can publish a data stream to server 204 through client 202. Server 204 generates content query results based on this data stream and pushes the results to other communicating clients.

[0089] Client 202 can be a browser, application (APP), web application such as HyperText Markup Language 5 (H5) application, or a lightweight application (also known as a mini-program) or cloud application, etc. Client 202 can be developed based on the software development kit (SDK) of the corresponding service provided by server 204, such as based on the Real-Time Communication (RTC) SDK. Client 202 can be deployed in electronic devices and depends on the device to run or on certain APPs on the device. Electronic devices may have a display screen and support information browsing, such as personal mobile terminals such as mobile phones, tablets, and personal computers (PCs). Various other types of applications can also be configured in electronic devices, such as human-computer interaction applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc. The client 202 can also interact with the user through a graphical user interface to invoke the content query model, thereby implementing the content query method provided in the embodiments of this specification.

[0090] Server-side 204 can include servers providing various services, such as servers providing communication services to multiple clients, servers supporting backend training of models used on clients, and servers processing data sent by clients. It should be noted that server-side 204 can be implemented as a distributed server cluster composed of multiple servers, or as a single server. The server can also be a server in a distributed system, or a server integrated with blockchain. The server can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.

[0091] It is worth noting that the content query method provided in the embodiments of this specification is generally executed by the server. However, in other embodiments of this specification, if the client's runtime resources can meet the deployment and runtime conditions of the content query model, the client can also have similar functions to the server, thereby executing the content query method provided in the embodiments of this specification. In other embodiments, the content query method provided in the embodiments of this specification can also be executed jointly by the client and the server.

[0092] See Figure 3 , Figure 3 This specification illustrates a flowchart of a content query model training method according to an embodiment, which specifically includes the following steps: Step 302: Obtain sample data, which includes sample content, a sample content summary of the sample content, and sample query data.

[0093] Step 304: Input the sample content into the content encoding unit in the content query model to obtain the sample content vector, and input the sample query data into the query encoding unit in the content query model to obtain the sample query vector.

[0094] Step 306: Use the generation and decoding unit in the content query model to process the sample content vector and obtain the predicted content summary.

[0095] Step 308: Based on the sample content vector, sample query vector, sample content summary, and predicted content summary, adjust the parameters of the content encoding unit, query encoding unit, and generation decoding unit to obtain the trained content query model.

[0096] It should be noted that the implementation methods of steps 302 to 308 can refer to the training method of the above content query model, and will not be repeated in the embodiments of this specification.

[0097] The scheme implemented in this specification, on the one hand, utilizes sample query data and sample content to construct a semantic matching signal, enabling precise alignment of the query encoding unit and content encoding unit in the shared embedding space, thereby improving the model's query relevance. On the other hand, it introduces a generative decoding unit to reconstruct the sample content summary using the sample content vector as a condition. This forces the sample content vector to contain complete and structured semantic information sufficient to reproduce the sample content summary, transforming the summary reconstruction task into a regularization mechanism for content encoding quality. This, in turn, drives the content encoding unit to learn richer and more discriminative representations. Ultimately, the trained content query model not only exhibits higher accuracy and robustness in content query tasks, but its learned content vectors also possess stronger generalization ability due to "generative" verification, and can be effectively transferred to various downstream tasks such as classification, clustering, and question answering.

[0098] See Figure 4 , Figure 4 This diagram illustrates the processing steps of a content query model training method according to an embodiment of this specification. The content query model training method can be viewed as a model representation consistency constraint method based on summary reconstruction generation, and can be divided into the following five stages: query encoding stage, content encoding stage, contrastive learning stage, generative reconstruction stage, and model training stage. The following sections will describe each of these five stages.

[0099] Query encoding stage: Input the sample query data into the query encoding unit in the content query model to obtain the sample query vector; Content encoding stage: Input the sample content into the content encoding unit in the content query model to obtain the sample content vector; Contrastive learning phase: Obtain sample association labels between sample content and sample query data; compare sample content vectors and sample query vectors to obtain sample similarity indicators, which reflect the degree of similarity between sample content and sample query data; calculate contrastive loss based on sample association labels and sample similarity indicators; Generative reconstruction stage: The generative decoding unit in the content query model generates a predicted content summary based on the sample content vector in an autoregressive manner; the generation loss is calculated based on the predicted content summary and the sample content summary of the sample content. Model training phase: Calculate the total loss based on contrastive loss and generative loss; adjust the parameters of the query encoding unit according to the contrastive loss, and adjust the parameters of the content encoding unit and the generative decoding unit according to the total loss to obtain the trained content query model.

[0100] Applying the scheme of the embodiments in this specification, a generation-decoding unit conditioned on the sample content vector is introduced at the back end of the content encoding unit. The summary reconstruction task of the generation-decoding unit can serve as a powerful regularization method, forcing the sample content vector to contain sufficient information to reconstruct the content summary. This effectively alleviates the information bottleneck problem in the traditional dual-tower structure, avoids the loss of a large amount of information during compression, and transforms the sample content vector from a "dedicated vector" that only serves matching into a more general "semantically complete vector." At the same time, the summary reconstruction task provides a continuous supervision signal that does not rely on negative samples, even if the contrastive learning gets stuck. Even if the representation collapses, the content query model still needs to accurately complete the summary reconstruction task, thus fundamentally suppressing representation degradation. Furthermore, since summary generation itself requires the content query model to focus on key, discriminative content in the sample content, this process implicitly guides the content encoding unit to learn the core features needed to distinguish difficult negative samples, achieving implicit hard sample learning. Ultimately, the sample content vectors learned by the content query model not only perform better in query or retrieval tasks but also exhibit stronger cross-task generalization ability due to their semantic richness, effectively transferring to downstream tasks such as classification and clustering. It is worth mentioning that, compared to complex dynamic negative sampling strategies, the content query model training method proposed in this specification only requires adding a lightweight generation-decoding unit, with fixed and controllable training overhead, achieving a good balance between performance and efficiency.

[0101] See Figure 5 , Figure 5 The flowchart of a content query method according to an embodiment of this specification is shown. During the content query process, the server and the client interact with each other. The client is used to send sample data to the server. The sample data includes sample content, sample content summary, and sample query data. On the server side, sample content is input into the content encoding unit of the content query model to obtain a sample content vector, and sample query data is input into the query encoding unit of the content query model to obtain a sample query vector. The generation and decoding unit in the content query model is used to process the sample content vector to obtain a predicted content summary. Based on the sample content vector, sample query vector, sample content summary, and predicted content summary, the parameters of the content encoding unit, query encoding unit, and generation and decoding unit are adjusted to obtain the trained content query model. The client is also used to send target query data and query content to the server.

[0102] On the server side, the content to be queried is input into the content encoding unit of the trained content query model to obtain a content vector, and the target query data is input into the query encoding unit of the trained content query model to obtain a query vector. Based on the content vector and the query vector, the content query result is generated and sent to the client.

[0103] Corresponding to the above-described embodiments of the content query method, this specification also provides embodiments of the content query device. Figure 6 A schematic diagram of the structure of a content query device according to one embodiment of this specification is shown. Figure 6 As shown, the device includes: The first acquisition module 602 is configured to acquire the target query data and the content to be queried. The first input module 604 is configured to input the content to be queried into the content encoding unit in the content query model to obtain a content vector, and input the target query data into the query encoding unit in the content query model to obtain a query vector. The content query model includes a content encoding unit, a query encoding unit, and a generation decoding unit. The content encoding unit is trained based on the sample content summary and the predicted content summary of the sample content. The predicted content summary is obtained by the generation decoding unit by processing the sample content vector of the sample content. The generation module 606 is configured to generate content query results based on the content vector and the query vector.

[0104] Optionally, the device further includes: a second adjustment module configured to acquire sample data, wherein the sample data includes sample content, sample content summary, and sample query data; input the sample content into a content encoding unit to obtain a sample content vector, and input the sample query data into a query encoding unit to obtain a sample query vector; process the sample content vector using a generation decoding unit to obtain a predicted content summary; and adjust the parameters of the content encoding unit, the query encoding unit, and the generation decoding unit based on the sample content vector, the sample query vector, the sample content summary, and the predicted content summary to obtain a trained content query model.

[0105] Optionally, the second adjustment module is further configured to calculate the contrast loss based on the sample content vector and the sample query vector; calculate the generation loss based on the sample content summary and the predicted content summary; adjust the parameters of the query encoding unit according to the contrast loss; and adjust the parameters of the content encoding unit and the generation decoding unit according to the contrast loss and the generation loss, respectively, to obtain the trained content query model.

[0106] Optionally, the second adjustment module is further configured to obtain sample association labels between sample content and sample query data; compare the sample content vector and the sample query vector to obtain a sample similarity index, wherein the sample similarity index is used to reflect the degree of similarity between sample content and sample query data; and calculate the contrast loss based on the sample association labels and the sample similarity index.

[0107] Optionally, the second adjustment module is further configured to determine the sample content vector as the initial hidden state of the generating decoding unit, and use the generating decoding unit to process the initial hidden state to obtain a predicted content summary; or, to determine the sample content vector as the context vector of the generating decoding unit, and use the generating decoding unit to perform cross-attention processing based on the context vector to obtain a predicted content summary.

[0108] Optionally, the second adjustment module is further configured to determine the sample content vector as the initial hidden state of the generation decoding unit when the content index of the sample content is less than a preset index threshold, and to process the initial hidden state using the generation decoding unit to obtain a predicted content summary, wherein the content index is used to reflect the complexity of the sample content.

[0109] Optionally, the second adjustment module is further configured to determine the sample content vector as the context vector of the generating decoding unit when the content index of the sample content is greater than or equal to a preset index threshold, and to use the generating decoding unit to perform cross-attention processing based on the context vector to obtain a predicted content summary, wherein the content index is used to reflect the complexity of the sample content.

[0110] Optionally, the generation module 606 is further configured to compare the content vector and the query vector to obtain a vector similarity index, wherein the vector similarity index is used to reflect the degree of similarity between the content vector and the query vector; Content query results are generated based on vector similarity metrics.

[0111] By applying the scheme of the embodiments of this specification, since the content encoding unit not only learns the surface semantics of the sample content, but also conducts supervised training through the sample content summary and the predicted content summary reconstructed by the generation decoding unit with the sample content vector as a conditional autoregression, the content vector can encode sufficiently rich semantic information that can generate high-quality content summaries, focusing more on the core theme and key information of the content to be queried, rather than noise or redundant details. Therefore, when generating content query results based on the content vector and query vector, semantically relevant and high-quality content can be identified more accurately, significantly improving the accuracy of content query results.

[0112] The above is an illustrative scheme of a content query device according to this embodiment. It should be noted that the technical solution of this content query device and the technical solution of the above-described content query method belong to the same concept. For details not described in detail in the technical solution of the content query device, please refer to the description of the technical solution of the above-described content query method.

[0113] Corresponding to the above embodiments of the content query model training method, this specification also provides embodiments of the content query model training apparatus. Figure 7 A schematic diagram of a content query model training apparatus according to one embodiment of this specification is shown. Figure 7 As shown, the device includes: The second acquisition module 702 is configured to acquire sample data, wherein the sample data includes sample content, a sample content summary of the sample content, and sample query data. The second input module 704 is configured to input sample content into the content encoding unit in the content query model to obtain a sample content vector, and input sample query data into the query encoding unit in the content query model to obtain a sample query vector; Processing module 706 is configured to use the generation and decoding unit in the content query model to process the sample content vector and obtain a predicted content summary; The first adjustment module 708 is configured to adjust the parameters of the content encoding unit, the query encoding unit, and the generation decoding unit based on the sample content vector, the sample query vector, the sample content summary, and the predicted content summary, so as to obtain the trained content query model.

[0114] The scheme implemented in this specification, on the one hand, utilizes sample query data and sample content to construct a semantic matching signal, enabling precise alignment of the query encoding unit and content encoding unit in the shared embedding space, thereby improving the model's query relevance. On the other hand, it introduces a generative decoding unit to reconstruct the sample content summary using the sample content vector as a condition. This forces the sample content vector to contain complete and structured semantic information sufficient to reproduce the sample content summary, transforming the summary reconstruction task into a regularization mechanism for content encoding quality. This, in turn, drives the content encoding unit to learn richer and more discriminative representations. Ultimately, the trained content query model not only exhibits higher accuracy and robustness in content query tasks, but its learned content vectors also possess stronger generalization ability due to "generative" verification, and can be effectively transferred to various downstream tasks such as classification, clustering, and question answering.

[0115] The above is an illustrative scheme of a content query model training device according to this embodiment. It should be noted that the technical solution of this content query model training device and the technical solution of the content query model training method described above belong to the same concept. For details not described in detail in the technical solution of the content query model training device, please refer to the description of the technical solution of the content query model training method described above.

[0116] Figure 8 This specification illustrates a structural block diagram of a computing device according to one embodiment. The components of the computing device 800 include, but are not limited to, a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and a database 850 is used to store data.

[0117] The computing device 800 also includes an access device 840, which enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 840 may include one or more of any type of wired or wireless network interface (e.g., Network Interface Card (NIC)), such as an IEEE 802.11 Wireless Local Area Networks (WLAN) interface, a Wi-MAX (World Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0118] In one embodiment of this specification, the above-described components of the computing device 800 and Figure 8 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 8 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0119] The computing device 800 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers. The computing device 800 can also be a mobile or stationary server.

[0120] The processor 820 is used to execute computer programs / instructions, which, when executed by the processor, implement the steps of the above-mentioned content query method or content query model training method.

[0121] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device belongs to the same concept as the technical solutions of the content query method and the content query model training method described above. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solutions of the content query method or the content query model training method described above.

[0122] An embodiment of this specification also provides a computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the above-described content query method or content query model training method.

[0123] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium belongs to the same concept as the technical solutions of the content query method and the content query model training method described above. Details not described in detail in the technical solution of the storage medium can be found in the descriptions of the technical solutions of the content query method or the content query model training method described above.

[0124] An embodiment of this specification also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the above-described content query method or content query model training method.

[0125] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product belongs to the same concept as the technical solutions of the content query method and the content query model training method described above. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solutions of the content query method or the content query model training method described above.

[0126] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0127] Computer instructions include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in computer-readable media can be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0128] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0129] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0130] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A content query method, characterized by, The method comprises: obtaining target query data and to-be-queried content; inputting the to-be-queried content into a content encoding unit in a content query model to obtain a content vector, and inputting the target query data into a query encoding unit in the content query model to obtain a query vector, wherein the content query model comprises the content encoding unit, the query encoding unit and a generation decoding unit, the content encoding unit is trained based on a sample content summary and a predicted content summary of sample content, and the predicted content summary is obtained by processing a sample content vector of the sample content by the generation decoding unit; generating a content query result according to the content vector and the query vector.

2. The method of claim 1, wherein, The training method of the content query model comprises: obtaining sample data, wherein the sample data comprises the sample content, the sample content summary and sample query data; inputting the sample content into the content encoding unit to obtain the sample content vector, and inputting the sample query data into the query encoding unit to obtain a sample query vector; processing the sample content vector by the generation decoding unit to obtain the predicted content summary; adjusting parameters of the content encoding unit, the query encoding unit and the generation decoding unit based on the sample content vector, the sample query vector, the sample content summary and the predicted content summary to obtain a trained content query model.

3. The method of claim 2, wherein, The method of adjusting parameters of the content encoding unit, the query encoding unit and the generation decoding unit based on the sample content vector, the sample query vector, the sample content summary and the predicted content summary to obtain a trained content query model comprises: calculating a comparison loss based on the sample content vector and the sample query vector; calculating a generation loss based on the sample content summary and the predicted content summary; adjusting parameters of the query encoding unit according to the comparison loss, and adjusting parameters of the content encoding unit and the generation decoding unit according to the comparison loss and the generation loss respectively to obtain the trained content query model.

4. The method of claim 3, wherein, The method of calculating a comparison loss based on the sample content vector and the sample query vector comprises: obtaining a sample association label between the sample content and the sample query data; comparing the sample content vector and the sample query vector to obtain a sample similarity index, wherein the sample similarity index is used to reflect a similarity between the sample content and the sample query data; calculating the comparison loss according to the sample association label and the sample similarity index.

5. The method of claim 2, wherein, The method of processing the sample content vector by the generation decoding unit to obtain the predicted content summary comprises: determining the sample content vector as an initial hidden state of the generation decoding unit, and processing the initial hidden state by the generation decoding unit to obtain the predicted content summary; or The sample content vector is determined as a context vector of the generation decoding unit, and cross-attention processing is performed on the context vector by using the generation decoding unit to obtain the predicted content summary.

6. The method of claim 5, wherein, The sample content vector is determined as an initial hidden state of the generation decoding unit, and the initial hidden state is processed by using the generation decoding unit to obtain the predicted content summary. In a case where a content index of the sample content is less than a preset index threshold, the sample content vector is determined as an initial hidden state of the generation decoding unit, and the initial hidden state is processed by using the generation decoding unit to obtain the predicted content summary, wherein the content index is used to reflect a complexity of the sample content.

7. The method of claim 5, wherein, The sample content vector is determined as a context vector of the generation decoding unit, and cross-attention processing is performed on the context vector by using the generation decoding unit to obtain the predicted content summary. In a case where a content index of the sample content is greater than or equal to a preset index threshold, the sample content vector is determined as a context vector of the generation decoding unit, and cross-attention processing is performed on the context vector by using the generation decoding unit to obtain the predicted content summary, wherein the content index is used to reflect a complexity of the sample content.

8. The method of claim 1, wherein, The content query result is generated according to the content vector and the query vector, including: A vector similarity index is obtained by comparing the content vector and the query vector, wherein the vector similarity index is used to reflect a similarity between the content vector and the query vector; The content query result is generated based on the vector similarity index.

9. A content query model training method, characterized in that, Including: Obtaining sample data, wherein the sample data includes sample content, a sample content summary of the sample content, and sample query data; Inputting the sample content into a content encoding unit in a content query model to obtain a sample content vector, and inputting the sample query data into a query encoding unit in the content query model to obtain a sample query vector; Processing the sample content vector by using a generation decoding unit in the content query model to obtain a predicted content summary; Adjusting parameters of the content encoding unit, the query encoding unit, and the generation decoding unit based on the sample content vector, the sample query vector, the sample content summary, and the predicted content summary to obtain a trained content query model.

10. A computing device, comprising: Including: A memory and a processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which realize the steps of the method in any one of claims 1 to 9 when executed by the processor.

11. A computer readable storage medium characterized by, The memory has stored computer programs / instructions, which realize the steps of the method in any one of claims 1 to 9 when executed by the processor.

12. A computer program product, characterised in that, The computer programs / instructions realize the steps of the method in any one of claims 1 to 9 when executed by the processor.