Transnational culture Agent consistency content generation method based on retrieval enhancement

By constructing a multi-source text knowledge base and using hybrid retrieval and cross-encoders, the issues of consistency and accuracy in cross-cultural content generation were resolved, and stable generation in multicultural contexts was achieved.

CN121658631APending Publication Date: 2026-03-13LIAONING UNIVERSITY
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-15
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing cross-cultural content generation methods rely on single corpora, resulting in significant cultural biases and a lack of consistency and accuracy in the generated results, making it difficult to maintain the stability and objectivity of the content in multicultural contexts.

Method used

By constructing a knowledge base of multi-source text data, employing a hybrid retrieval strategy and cross-encoder, and combining sparse indexes and dense vector indexes, cultural annotation and semantic slicing are performed to generate culturally consistent content.

Benefits of technology

It significantly improves the stability and consistency of cross-cultural content generation, ensures the matching and timeliness of output content with cultural background, and reduces content conflicts and cultural mismatches.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121658631A_ABST
    Figure CN121658631A_ABST
Patent Text Reader

Abstract

The invention discloses a retrieval enhancement-based transnational culture Agent consistency content generation method, which comprises the following steps of: firstly, processing multi-source text data, constructing a knowledge base capable of supporting culture retrieval, and respectively establishing a sparse index and a dense vector index to support multi-type retrieval; secondly, performing preliminary screening on queries by adopting a hybrid retrieval strategy to obtain candidate documents, generating a hybrid score in a weighted fusion manner, performing refined reordering on a preliminary candidate set by utilizing a cross encoder, then selecting high-confidence document fragments according to target culture, and performing high-confidence document segmentation on the selected high-confidence document fragments; and a cross-culture enhanced context prompt is constructed in combination with a culture constraint template and a soft prompt, so that a specific culture view angle and value preference can be automatically embedded in a large model in a generation process, and culture consistency contents are generated. The technical problem that a traditional large model is difficult to generate contents conforming to different cultural logics and expression habits under the same input is effectively solved, and the cultural logic accuracy and context adaptability of output contents are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention addresses the consistency and reliability issues of content generation for large-scale intelligent agents in multicultural scenarios, solving problems such as reliance on a single corpus, significant cultural bias, insufficient generation stability, and poor cross-cultural consistency in cross-cultural content generation. Specifically, it proposes a retrieval-enhanced cross-cultural agent consistent content generation method. Background Technology

[0002] With the widespread application of large-scale models in fields such as public opinion analysis, international affairs research, and cross-cultural dialogue, the demand for intelligent agents to generate content in different cultural contexts has increased significantly. However, traditional cross-cultural content generation methods still have many shortcomings. Existing methods mostly rely on single-corpus training or limited templates, which often leads to significant content bias and a lack of cultural consistency in the generated results when faced with issues such as differences in cultural values, conflicts in historical backgrounds, and inconsistencies in narratives from multiple countries.

[0003] On the one hand, when dealing with sensitive issues such as international relations, regional conflicts, and social events, the generated content is easily constrained by the inherent biases of the model, making it difficult to guarantee the objectivity and consistency of content expression in multicultural contexts. On the other hand, existing content generation technologies generally lack the ability to retrieve real-world information and cannot automatically obtain the latest content sources, media narrative differences, and cultural context characteristics of various cultural spheres, resulting in outdated output content or content that is out of touch with the cultural background.

[0004] Therefore, there is an urgent need for a cross-cultural content generation method that can combine multi-source information retrieval, cultural background modeling, and dynamic consistency constraints to improve the stability, accuracy, and cultural consistency of the model in different cultural contexts. Summary of the Invention

[0005] This method, based on retrieval enhancement, proposes a cross-cultural agent-consistent content generation approach. First, it processes multi-source text data to construct a knowledge base containing explicit and implicit cultural attributes, and establishes sparse and dense vector indexes to support multi-type retrieval. Then, a hybrid retrieval strategy is used for initial query screening. Candidate documents are obtained in parallel through BM25 keyword matching and vector semantic retrieval, and a weighted fusion is used to generate a hybrid score. A cross-encoder is then used to refine and re-rank the initial candidate set. Subsequently, high-confidence document fragments are selected based on the target culture, and cross-cultural enhanced contextual cues are constructed by combining cultural constraint templates and soft hints. This allows the large model to automatically embed specific cultural perspectives and value preferences during the generation process, generating culturally consistent content.

[0006] To achieve the above objectives, the technical solution adopted by this invention is as follows: The steps of the retrieval-enhanced cross-cultural agent consistency content generation method are as follows: Step 1) Perform cultural annotation and semantic segmentation on multi-source documents to build a knowledge base that supports cultural retrieval, and perform cultural annotation on the documents; Step 2) Construct a hybrid retrieval index system, building separate indexes for sparse and dense retrieval to ensure efficient and searchable hybrid retrieval, consisting of sparse indexes and dense vector indexes; Step 3) Perform a hybrid search, combining BM25 sparse search and vector dense search to obtain a preliminary candidate set. Sparse search ensures accurate keyword matching, while dense search captures deep semantic relevance. Step 4) Use a cross encoder to reorder candidate documents, leveraging deep semantic understanding to improve the contextual relevance and cultural consistency between queries and documents; Step 5) By combining the reordered candidate set with cultural constraints, and fusing the retrieval results and cultural constraint templates, contextual cue words are constructed for use by the generative model (LM) to generate culturally consistent content.

[0007] In step 1), the specific method is as follows: 1.1) Establish a multi-channel document acquisition pipeline to extract candidate documents from multiple sources such as news media, social media, laws and regulations, cultural guidelines, and oral history. Build the initial document collection Perform data cleaning, deduplication, noise filtering, and language detection, and record metadata such as publication time, country / region of origin, language, author, and region tags for cultural annotation.

[0008] 1.2) Direct mapping based on document metadata, utilizing prior knowledge to achieve fast and interpretable cultural annotation, establishing a multi-level cultural annotation system, and realizing the accurate quantification of cultural characteristics.

[0009] 1.3) Using an adaptive document segmentation algorithm based on semantic coherence, the document is divided into several semantic segments according to sentences, paragraphs or semantic boundaries, and cultural tags are inherited to record the position information and confidence level of the segments.

[0010] In step 2), the specific method is as follows: 2.1) For each term It records the list of documents containing the term and their frequency information, establishes a term-document mapping relationship, and constructs a sparse search index.

[0011] 2.2) Based on deep learning, semantic encoding maps text into a dense vector space, and dense retrieval indexing is achieved through vector similarity. The detailed process is as follows: 2.2.1) Using a multilingual pre-trained model as the encoder The formula is as follows:

[0012] in, For encoder The input represents the first [item] in the knowledge base. The document's first A text fragment, Let be a d-dimensional vector, representing the original vector representation of the j-th segment of the i-th document obtained through the encoder.

[0013] 2.2.2) Normalize the vector using the following formula:

[0014] in, For L2 norm, calculate the vector , The length of the mold, Representing vectors The value in the k-th dimension, where d is the vector dimension.

[0015] 2.2.3) An approximate nearest neighbor index is constructed using the FAISS library and the Hierarchical Navigable Small World Graph (HNSM) algorithm. The graph structure is defined as follows:

[0016] Where V is the vertex set, which consists of document vectors from the cultural knowledge base, and E is the edge set, which is established based on a distance metric.

[0017] 2.2.4) The HNSM algorithm adjusts the maximum number of connections. To balance index density and efficiency, and by constructing a candidate set size parameter. To precisely control the quality of the index, the distance metric uses cosine similarity, as shown in the following formula:

[0018] in, For query vector, This is a document vector.

[0019] 2.3) Establish a multi-dimensional metadata index system to support efficient filtering under complex query conditions, and define metadata vectors:

[0020] in, Indicates cultural labels, Represents a timestamp. This indicates the source confidence score. Indicates geographic location code, Indicates topic category tags.

[0021] Define hard filtering to support retrieval, formalized as a set of constraints. The formula is:

[0022] in, Represents a collection of document fragments. For input query, Due to cultural constraints, Due to time constraints, For quality constraints.

[0023] In step 3), the specific method is as follows: 3.1) Use the BM25 algorithm to perform exact matching retrieval based on keyword statistical features. 3.1.1) For queries q and every document fragment in the knowledge base Calculate its BM25 correlation score using the following formula:

[0024] in, Inverse document frequency is used to measure the distinctiveness of terms. For terms w In the document d word frequency in To control the hyperparameters of word frequency saturation, , To control the hyperparameters of document length normalization, , For document d Length, The average document length of the entire document library. This represents the total number of documents in the document library. For terms The number of documents.

[0025] 3.1.2) Sort all document fragments in descending order based on the calculated BM25 scores, and return the top fragments with the highest scores. The documents form a sparse search candidate set. .

[0026] 3.2) Using vector representations generated by deep learning models, semantic similarity retrieval is performed. 3.2.1) Utilizing a pre-trained encoder model , will query q and document fragments Each is mapped to a vector of fixed dimensions. and Furthermore, normalization was performed.

[0027] 3.2.2) Calculate the cosine similarity between the query vector and each document vector, as its relevance score: The formula is as follows:

[0028] in, Let L2 norm be the vector. This is the dot product operation for vectors, which calculates the sum of the products of corresponding dimensions.

[0029] 3.2.3) Sort all document fragments in descending order based on the calculated cosine similarity score, and return the top fragments with the highest similarity. The documents form a dense search candidate set. .

[0030] 3.3) The results of the two retrieval methods are deduplicated and merged to form a unified candidate set, defined as follows:

[0031] 3.4) Merging candidate sets The two scores for each document are standardized separately. Prioritize the use of... method

[0032] in, m Let be the mean of the corresponding scores on the candidate set C0. s Let be the standard deviation of the corresponding scores on the candidate set C0.

[0033] 3.5) Calculate the final mixed score using a weighted summation method.

[0034] in, The linear fusion weight is a key hyperparameter for adjusting whether the search strategy favors keyword matching or semantic similarity. For query, For documentation.

[0035] In step 4), the specific method is as follows: 4.1) Using a cross encoder The model concatenates queries and documents into input. It outputs a scalar fraction or probability.

[0036] 4.2) The output of the Transformer-based bidirectional encoder is connected to a single-layer MLP for scoring, as shown in the following formula:

[0037] in, For trainable weight parameters, The hidden state vector corresponding to the [CLS] label output by the model. For bias terms, This is the activation function.

[0038] 4.3) Use mixed retrieval scores for the candidate set Sort the documents in descending order and select the top ones. The documents constitute the candidate set for fine-tuning. , .

[0039] 4.4) For each query-document pair Correlation scores are calculated using a cross encoder.

[0040] in, i This represents all trainable parameters of the model.

[0041] 4.5) Use the softmax function in conjunction with the temperature parameter to convert the original scores into a probability distribution.

[0042] in, For temperature control probability smoothness.

[0043] 4.6) Use the relevant / irrelevant pairs of the annotation. Minimize the boundary sorting loss, as shown in the following formula:

[0044] in, For query Relevant positive example documents, For irrelevant negative example documents, The boundary margin ensures that the score of positive examples is at least one margin higher than that of negative examples (usually set to 0.2-0.5).

[0045] In step 5), the specific method is as follows: 5.1) From Based on target culture The formula for weighted or hard filtering is as follows:

[0046] in, This represents the cultural preference intensity coefficient. ,when c When =1, it degenerates into hard filtering, retaining only documents that match the culture. As an indicator function, when document culture tags With target culture A value of 1 indicates a match, otherwise a value of 0. The conditional probabilities calculated for the cross-encoder represent the relevance of the document to the query. 5.2) For each target culture Define a set of structured constraint templates Cultural norms are explicitly encoded into prompt words, as follows:

[0047] 5.3) Select from candidates Fragments can be assembled according to confidence level, or an extractive summarizer can be used. Compress the candidates into The concatenation order can be determined based on a combined sorting strategy of time, source credibility, or relevance to the query, as shown in the following formula:

[0048] 5.4) Use learnable soft prompts Prefixes are injected into large models to provide style guidance. In vector form, .

[0049] 5.5) Generate culture-enhanced text based on the constructed context and save the generated results.

[0050] The beneficial effects of this invention are as follows: This invention addresses existing problems by proposing a cross-cultural agent-based content generation method for content consistency based on retrieval enhancement. Firstly, this method effectively ensures the authenticity and timeliness of content sources through multi-source retrieval enhancement technology. The hybrid application of vector retrieval and keyword retrieval comprehensively captures the latest information and authoritative narrative evidence across various cultural backgrounds, significantly avoiding cultural bias and information lag caused by single corpora. Secondly, the system constructs a cultural feature weight matrix and a cultural background consistency constraint model, ensuring that the generated content maintains inherent narrative logic consistency across different cultural contexts, greatly reducing content conflicts and cultural mismatches. Furthermore, this invention designs a cross-cultural multi-round consistency judgment and real-time correction mechanism, which dynamically identifies and corrects cultural expression deviations during content generation, thereby ensuring that the output content meets high standards in terms of cultural accuracy, structural coherence, and stylistic consistency. To objectively evaluate the generation effect, In summary, this invention can systematically solve the key challenges of maintaining consistency, aligning cultural narratives, and quantifying evaluation in cross-cultural content generation, providing important technical support for high-end application scenarios such as international relations analysis, multicultural intelligent question-answering systems, and cultural background reasoning. Attached Figure Description

[0051] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0052] A retrieval-enhanced method for generating cross-cultural agent-consistent content includes the following steps: 1) Perform cultural annotation and semantic segmentation on multi-source documents to build a knowledge base that supports cultural retrieval, and perform cultural annotation on the documents; (1) Establish a multi-channel document collection pipeline to extract candidate documents from multiple sources such as news media, social media, laws and regulations, cultural guidelines, and oral history. Build the initial document collection Perform data cleaning, deduplication, noise filtering, and language detection, and record metadata such as publication time, country / region of origin, language, author, and region tags for cultural annotation.

[0053] (2) Based on the metadata of the document, direct mapping is performed, and prior knowledge is used to achieve fast and interpretable cultural annotation. A multi-level cultural annotation system is established to achieve accurate quantification of cultural characteristics.

[0054] (3) Use an adaptive document segmentation algorithm based on semantic coherence to divide the document into several semantic segments according to sentences, paragraphs or semantic boundaries, and inherit cultural tags to record the position information and confidence of the segments.

[0055] 2) Construct a hybrid retrieval index system, building separate indexes for sparse and dense retrieval to ensure efficient and searchable hybrid retrieval, consisting of sparse indexes and dense vector indexes; (1) For each term It records the list of documents containing the term and their frequency information, establishes a term-document mapping relationship, and constructs a sparse search index.

[0056] (2) Based on deep learning semantic encoding, text is mapped into a dense vector space, and dense retrieval indexing is achieved through vector similarity. The detailed process is as follows: ① Use a multilingual pre-trained model as the encoder The formula is as follows:

[0057] in, For encoder The input represents the first [item] in the knowledge base. The document's first A text fragment, Let be a d-dimensional vector, representing the original vector representation of the j-th segment of the i-th document obtained through the encoder.

[0058] ② Normalize the vector using the following formula:

[0059] in, For L2 norm, calculate the vector , The length of the mold, Representing vectors The value in the k-th dimension, where d is the vector dimension.

[0060] ③ Construct an approximate nearest neighbor index using the FAISS library and the Hierarchical Navigable Small World Graph (HNSM) algorithm. The graph structure is defined as follows:

[0061] Where V is the vertex set, which consists of document vectors from the cultural knowledge base, and E is the edge set, which is established based on a distance metric.

[0062] ④ The HNSM algorithm adjusts the maximum number of connections. To balance index density and efficiency, and by constructing a candidate set size parameter. To precisely control the quality of the index, the distance metric uses cosine similarity, as shown in the following formula:

[0063] in, For query vector, This is a document vector.

[0064] (3) Establish a multi-dimensional metadata index system to support efficient filtering under complex query conditions, and define metadata vectors:

[0065] in, Indicates cultural labels, Represents a timestamp. This indicates the source confidence score. Indicates geographic location code, Indicates topic category tags.

[0066] Define hard filtering to support retrieval, formalized as a set of constraints. The formula is:

[0067] in, Represents a collection of document fragments. For input query, Due to cultural constraints, Due to time constraints, For quality constraints.

[0068] 3) Perform hybrid search, combining BM25 sparse search and vector dense search to obtain an initial candidate set. Sparse search ensures accurate keyword matching, while dense search captures deep semantic relevance. (1) The BM25 algorithm is used to perform precise matching and retrieval based on the statistical features of keywords. ① First, for queries q and every document fragment in the knowledge base Calculate its BM25 correlation score using the following formula:

[0069] in, Inverse document frequency is used to measure the distinctiveness of terms. For terms w In the document d word frequency in To control the hyperparameters of word frequency saturation, , To control the hyperparameters of document length normalization, , For document d Length, The average document length of the entire document library. This represents the total number of documents in the document library. For terms The number of documents.

[0070] ②Then, sort all document fragments in descending order based on the calculated BM25 scores, and return the top-scoring fragments. The documents form a sparse search candidate set. .

[0071] (2) Using vector representations generated by deep learning models, semantic similarity retrieval is performed. ① First, utilize the pre-trained encoder model , will query q and document fragments Each is mapped to a vector of fixed dimensions. and Furthermore, normalization was performed.

[0072] ② Then, calculate the cosine similarity between the query vector and each document vector, as its relevance score: the formula is as follows:

[0073] in, Let L2 norm be the vector. This is the dot product operation for vectors, which calculates the sum of the products of corresponding dimensions.

[0074] ③ Sort all document fragments in descending order based on the calculated cosine similarity score, and return the top fragments with the highest similarity. The documents form a dense search candidate set. .

[0075] (3) The results of the two retrieval methods are deduplicated and merged to form a unified candidate set, defined as follows:

[0076] (4) Merge candidate sets The two scores for each document are standardized separately. Prioritize the use of... method

[0077] in, m Let be the mean of the corresponding scores on the candidate set C0. s Let be the standard deviation of the corresponding scores on the candidate set C0.

[0078] (5) Calculate the final mixed score using a weighted summation method.

[0079] in, The linear fusion weight is a key hyperparameter for adjusting whether the search strategy favors keyword matching or semantic similarity. For query, For documentation.

[0080] 4) Use a cross-encoder to reorder candidate documents and leverage deep semantic understanding to improve the contextual relevance and cultural consistency between queries and documents; (1) Using a cross encoder The model concatenates queries and documents into input. It outputs a scalar fraction or probability.

[0081] (2) The bidirectional encoder based on Transformer is connected to a single-layer MLP at the output end for scoring, as shown in the following formula:

[0082] in, For trainable weight parameters, The hidden state vector corresponding to the [CLS] label output by the model. For bias terms, This is the activation function.

[0083] (3) Use mixed retrieval scores for the candidate set Sort the documents in descending order and select the top ones. The documents constitute the candidate set for fine-tuning. , .

[0084] (4) For each query-document pair Correlation scores are calculated using a cross encoder.

[0085] in, i This represents all trainable parameters of the model.

[0086] (5) Use the softmax function in combination with the temperature parameter to convert the original scores into a probability distribution.

[0087] in, For temperature control probability smoothness.

[0088] (6) Use the relevant / irrelevant pairs of the label Minimize the boundary sorting loss, as shown in the following formula:

[0089] in, For query Relevant positive example documents, For irrelevant negative example documents, The boundary margin ensures that the score of positive examples is at least one margin higher than that of negative examples (usually set to 0.2-0.5).

[0090] 5) By combining the reordered candidate set with cultural constraints, and fusing the retrieval results and cultural constraint templates, contextual cue words are constructed for use by the generative model (LM) to generate culturally consistent content.

[0091] (1) From Based on target culture The formula for weighted or hard filtering is as follows:

[0092] in, This represents the cultural preference intensity coefficient. ,when c When =1, it degenerates into hard filtering, retaining only documents that match the culture. As an indicator function, when document culture tags With target culture A value of 1 indicates a match, otherwise a value of 0. The conditional probabilities calculated for the cross-encoder represent the relevance of the document to the query. (2) For each target culture Define a set of structured constraint templates Cultural norms are explicitly encoded into prompt words, as follows:

[0093] (3) Select from candidates Fragments can be assembled according to confidence level, or an extractive summarizer can be used. Compress the candidates into The concatenation order can be determined based on a combined sorting strategy of time, source credibility, or relevance to the query, as shown in the following formula:

[0094] (4) Use learnable soft prompts Prefixes are injected into large models to provide style guidance. In vector form, .

[0095] (5) Generate culturally enhanced text based on the constructed context and save the generated results.

Claims

1. A method for generating cross-cultural agent-consistent content based on retrieval enhancement, characterized in that: The steps are as follows: Step 1) Perform cultural annotation and semantic segmentation on multi-source documents to build a knowledge base that supports cultural retrieval, and perform cultural annotation on the documents; Step 2) Construct a hybrid retrieval index system, building indexes for sparse and dense retrieval respectively to realize hybrid retrieval queries, which is divided into sparse indexes and dense vector indexes; Step 3) Perform a hybrid search, combining BM25 sparse search and vector dense search to obtain a preliminary candidate set, enabling sparse search to achieve keyword matching and dense search to capture deep semantic relevance. Step 4) Use a cross encoder to reorder candidate documents, leveraging deep semantic understanding to improve the contextual relevance and cultural consistency between queries and documents; Step 5) By combining the reordered candidate set with cultural constraints, and fusing the retrieval results and cultural constraint templates, contextual cue words are constructed for use by the generative model LM to generate culturally consistent content.

2. The cross-cultural agent-based content generation method for search enhancement according to claim 1, characterized in that, In step 1), the specific method is as follows: 1.1) Establish a multi-channel document acquisition pipeline to extract candidate documents from multiple sources of corpora, including news media, social media, laws and regulations, cultural guidelines, and oral history. Build the initial document collection Perform data cleaning, deduplication, noise filtering, and language detection; record metadata such as publication time, country / region of origin, language, author, and region tags for cultural annotation. 1.2) Direct mapping based on document metadata, using prior knowledge to achieve cultural annotation, and establishing a multi-level cultural annotation system; 1.3) Using an adaptive document segmentation algorithm based on semantic coherence, the document is divided into several semantic segments according to sentences, paragraphs or semantic boundaries, and cultural tags are inherited to record the position information and confidence level of the segments.

3. The cross-cultural agent-consistent content generation method based on retrieval enhancement according to claim 1, characterized in that, In step 2), the specific method is as follows: 2.1) For each term Record the list of documents containing the term and its frequency information, establish a term-document mapping relationship, and build a sparse search index; 2.2) Based on deep learning semantic encoding, text is mapped into a dense vector space, and dense retrieval indexing is achieved through vector similarity. The specific process is as follows: 2.2.1) Using a multilingual pre-trained model as the encoder The formula is as follows: in, For encoder The input represents the first [item] in the knowledge base. The document's first A text fragment, Let be a d-dimensional vector, representing the original vector representation of the j-th segment of the i-th document obtained by the encoder; 2.2.2) Normalize the vector using the following formula: in, For L2 norm, calculate the vector , The length of the mold, Representing vectors The value in the k-th dimension, where d is the vector dimension. 2.3) An approximate nearest neighbor index is constructed using the FAISS library and the Hierarchical Navigable Small World Graph (HNSM) algorithm. The graph structure is defined as follows: in, V is the vertex set, consisting of document vectors from the cultural knowledge base, and E is the edge set, established based on a distance metric. 2.2.4) The HNSM algorithm adjusts the maximum number of connections. To balance index density and efficiency, and by constructing a candidate set size parameter. To precisely control the quality of the index, the distance metric uses cosine similarity, as shown in the following formula: in, For query vector, Document vector; 2.3) Establish a multi-dimensional metadata index system to support efficient filtering under complex query conditions, and define metadata vectors: in, Indicates cultural labels, Represents a timestamp. This indicates the source confidence score. Indicates geographic location code, Indicates topic category tags; Define hard filtering to support retrieval, formalized as a set of constraints. The formula is: in, Represents a collection of document fragments. For input query, Due to cultural constraints, Due to time constraints, For quality constraints.

4. The cross-cultural agent-based content generation method for search enhancement according to claim 1, characterized in that, In step 3), the specific method is as follows: 3.1) Use the BM25 algorithm to perform exact matching retrieval based on keyword statistical features. 3.1.1) First, for queries q and every document fragment in the knowledge base Calculate its BM25 correlation score using the following formula: in, Inverse document frequency is used to measure the distinctiveness of terms. For terms w In the document d word frequency in To control the hyperparameters of word frequency saturation, , To control the hyperparameters of document length normalization, , For document d Length, The average document length of the entire document library. This represents the total number of documents in the document library. For terms The number of documents; 3.1.2) Sort all document fragments in descending order based on the calculated BM25 scores, and return the top fragments with the highest scores. The documents form a sparse search candidate set. ; 3.2) Using vector representations generated by deep learning models, semantic similarity retrieval is performed. 3.2.1) Utilizing a pre-trained encoder model , will query q and document fragments Each is mapped to a vector of fixed dimensions. and And it is normalized; 3.2.2) Calculate the cosine similarity between the query vector and each document vector, as its relevance score: The formula is as follows: in, Let L2 norm be the vector. For the dot product operation of vectors, calculate the sum of the products of corresponding dimensions; 3.2.3) Sort all document fragments in descending order based on the calculated cosine similarity score, and return the top fragments with the highest similarity. The documents form a dense search candidate set. ; 3.3) The results of the two retrieval methods are deduplicated and merged to form a unified candidate set, defined as follows: 3.4) Merging candidate sets The two scores for each document are standardized separately, with priority given to the scores from the two categories. method in, μ Let be the mean of the corresponding scores on the candidate set C0. σ Let C0 be the standard deviation of the corresponding scores on the candidate set C0; 3.5) Calculate the final mixed score using a weighted summation method. in, The linear fusion weight is a key hyperparameter for adjusting whether the search strategy favors keyword matching or semantic similarity. For query, For documentation.

5. The cross-cultural agent-consistent content generation method based on retrieval enhancement according to claim 1, characterized in that, In step 4), the specific method is as follows: 4.1) Using a cross encoder The model concatenates queries and documents into input. It outputs a scalar fraction or probability; 4.2) The output of the Transformer-based bidirectional encoder is connected to a single-layer MLP for scoring, as shown in the following formula: in, For trainable weight parameters, The hidden state vector corresponding to the [CLS] label output by the model. For bias terms, For activation functions; 4.3) Use mixed retrieval scores for the candidate set Sort the documents in descending order and select the top ones. The documents constitute the candidate set for fine-tuning. , ; 4.4) For each query-document pair Correlation scores are calculated using a cross encoder. in, θ This represents all trainable parameters of the model; 4.5) Use the softmax function in conjunction with the temperature parameter to convert the original scores into a probability distribution. in, For temperature control probability smoothness; 4.6) Use the relevant / irrelevant pairs of the annotation. Minimize the boundary sorting loss, as shown in the following formula: in, For query Relevant positive example documents, For irrelevant negative example documents, The boundary margin ensures that the score of positive examples is at least one margin higher than that of negative examples.

6. The cross-cultural agent-based content generation method for search enhancement according to claim 1, characterized in that, In step 5), the specific method is as follows: 5.1) From Based on target culture The formula for weighted or hard filtering is as follows: in, This represents the cultural preference intensity coefficient. ,when γ When =1, it degenerates into hard filtering, retaining only documents that match the culture. As an indicator function, when document culture tags With target culture A value of 1 indicates a match, otherwise a value of 0. The conditional probabilities calculated for the cross-encoder represent the relevance of the document to the query. 5.2) For each target culture Define a set of structured constraint templates Cultural norms are explicitly encoded into prompt words, as follows: 5.3) Select from candidates Fragments can be assembled according to confidence level, or an extractive summarizer can be used. Compress the candidates into The concatenation order can be determined based on a combined sorting strategy of time, source credibility, or relevance to the query, as shown in the following formula: 5.4) Use learnable soft prompts Prefixes are injected into large models to provide style guidance. In vector form, ; 5.5) Generate culture-enhanced text based on the constructed context and save the generated results.