Chinese-Vietnamese cross-border ethnic text retrieval method and device integrating domain knowledge graph

By integrating domain knowledge graphs to expand the query text entity representation, and using multi-head attention mechanism and contrastive learning methods to align query document representations, the problems of domain word alignment and semantic alignment difficulties in Chinese-Vietnamese cross-border ethnic text retrieval are solved, and the retrieval efficiency and accuracy are improved.

CN115599888BActive Publication Date: 2025-09-26KUNMING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211350058.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-31
Publication Date
2025-09-26
Estimated Expiration
2042-10-31

AI Technical Summary

Technical Problem

The existing cross-language text retrieval model cannot effectively solve the problems of domain word alignment and semantic alignment difficulties in Chinese-Vietnamese cross-border ethnic text retrieval, resulting in the inability to accurately retrieve corresponding cross-border ethnic documents.

Method used

By integrating domain knowledge graphs, the entity representation of query texts is expanded, the Chinese-Vietnamese knowledge graph is integrated into the query document using a multi-head attention mechanism, and a contrastive learning method is introduced to align the query document representations, and the relevance score is calculated using cosine similarity.

Benefits of technology

It improves the efficiency of Chinese-Vietnamese cross-border ethnic text retrieval, alleviates the problems of uncommon domain entities and diverse entity expressions, enriches cross-border ethnic-related semantic information, and improves the accuracy and efficiency of retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115599888B_ABST
    Figure CN115599888B_ABST
Patent Text Reader

Abstract

The present invention relates to a Chinese-Vietnamese cross-border ethnic text retrieval method and device that integrates domain knowledge graphs, and belongs to the field of natural language processing technology. The characteristics of Chinese-Vietnamese cross-border ethnic field texts are mainly reflected in the existence of a large number of uncommon domain entities and the diverse forms of entity expression. These problems highlight the particularity of the cross-border ethnic field. The present invention proposes a Chinese-Vietnamese cross-border ethnic text retrieval method that integrates domain knowledge graphs, including Chinese-Vietnamese cross-border ethnic text data preprocessing, query document expansion based on Chinese-Vietnamese knowledge graphs, Chinese-Vietnamese cross-border ethnic query document feature fusion, and Chinese-Vietnamese cross-border ethnic text retrieval. According to these four functional modules, a Chinese-Vietnamese cross-border ethnic text retrieval device that integrates domain knowledge graphs is manufactured, which has important theoretical and practical application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a Chinese-Vietnamese cross-border ethnic text retrieval method and device integrating domain knowledge graphs, and belongs to the field of natural language processing technology. Background Art

[0002] Cross-language text retrieval is the task of finding relevant documents in a large-scale text collection to answer a specific query. The core of this task lies in how to learn the latent semantic features between the query and the text and how to measure the similarity between the query and text features. Cross-language retrieval tasks are a research hotspot in information extraction technology. The Chinese-Vietnamese cross-border ethnic text retrieval task aims to use one language as a query and retrieve cross-border ethnic documents such as ethnicity, religion, and cultural customs corresponding to another language. However, in the Chinese-Vietnamese cross-border ethnic field, there are a large number of uncommon domain entities and a variety of entity expressions. These problems highlight the particularity of the cross-border ethnic field. In particular, in Chinese-Vietnamese cross-border ethnic text retrieval, there are also difficulties in domain word alignment and semantic alignment. Therefore, the current general cross-language text retrieval model cannot solve the above problems, resulting in the general model being unable to accurately retrieve the corresponding cross-border ethnic documents.

[0003] The present invention proposes a Chinese-Vietnamese cross-border ethnic text retrieval method that integrates domain knowledge graphs. The cross-border ethnic domain knowledge graph is used to expand the entity representation of the query text and integrate it into the query document. Then, the Chinese-Vietnamese knowledge graph is integrated into the query document using a multi-head attention mechanism to enrich the Chinese-Vietnamese cross-border ethnic entity information related to the query document data. Finally, contrastive learning is introduced to align the query document representations after integrating the cross-border ethnic entities and use cosine similarity calculation as the relevance score, thereby improving the efficiency of text retrieval. Summary of the Invention

[0004] The present invention provides a Chinese-Vietnamese cross-border ethnic text retrieval method and device that integrates domain knowledge graphs, which are used to expand the Chinese-Vietnamese cross-border ethnic query text entities and enrich the cross-border ethnic field entity information related to the query and text, thereby improving the efficiency of text retrieval.

[0005] The technical solution of the present invention is as follows: In the first aspect, the present invention provides a Chinese-Vietnamese cross-border ethnic text retrieval method that integrates a domain knowledge graph. The specific steps of the Chinese-Vietnamese cross-border ethnic text retrieval method that integrates a domain knowledge graph are as follows:

[0006] Step 1. Preprocessing of Chinese-Vietnamese cross-border ethnic text data: After filtering, screening, removing stop words and special symbols, the Chinese-Vietnamese cross-border ethnic text data of six Chinese-Vietnamese cross-border ethnic groups, namely Dai, Thai, Yi, Lao, Assamese, and Shan, were obtained. A total of 135,572 Chinese text data and 109,048 Vietnamese text data were crawled, which played a good supporting role in the training of the Chinese-Vietnamese cross-border ethnic text retrieval model.

[0007] Step 2: Expand the query document based on the Chinese-Vietnamese knowledge graph: Extract Chinese or Vietnamese entities from the query or text, and link these extracted entities with the Chinese-Vietnamese knowledge graph to expand related entities. Furthermore, to expand domain entities uncommon among the Chinese-Vietnamese cross-border ethnic groups, knowledge embedding is performed on the Chinese-Vietnamese cross-border ethnic group knowledge graph to obtain aligned Chinese-Vietnamese entities. Entity linking is performed between the entities extracted from the query or text and these aligned Chinese-Vietnamese entities to expand entities related to the other language.

[0008] Step 3. Fusion of Chinese-Vietnamese cross-border ethnic query document features: Using the multi-head attention mechanism, the vectors in the query and document after being integrated into the Chinese-Vietnamese cross-border ethnic knowledge graph are spliced ​​with the entity set vectors expanded from the knowledge graph to obtain the fused representation vector.

[0009] Step 4. Perform Chinese-Vietnamese cross-border ethnic text retrieval: Introduce contrastive learning to align the query document representations after integrating knowledge graph features, cluster queries and documents of the same type together, and then use the dot product (or cosine similarity) between the query representation and the document representation as the relevance score.

[0010] As a further solution of the present invention, the specific steps of Step 1 are:

[0011] Step 1.1: We used crawler technology to obtain Chinese-Vietnamese cross-border ethnic text data from websites related to Chinese-Vietnamese cross-border ethnic groups. We then performed pre-processing operations such as filtering, screening, and removing stop words and special characters, such as spaces, garbled characters, emoticons, and formula symbols. We crawled 91,899 texts for Chinese cross-border ethnic data and 71,993 texts for Vietnamese cross-border ethnic cultural data.

[0012] Step 1.2: Based on these data, construct Chinese and Vietnamese positive and negative sample pairs respectively. The Chinese positive and negative sample pairs are 43,673 texts, and the Vietnamese positive and negative sample pairs are 37,055 texts, totaling 135,572 text data in Chinese and 109,048 text data in Vietnamese.

[0013] Step 1.3, use the multilingual pre-training model to vectorize the Chinese-Vietnamese cross-border ethnic query text and obtain the vector representation of the query text. The Chinese-Vietnamese cross-border ethnic query and text are regarded as sequences q = {q1, q2, ..., qn} and the sequence d={d1,d2,…,d n}, where q i and d i The i-th word of the query and text respectively. q and d represent the query and text respectively.

[0014] V q =XLM-R(q)

[0015] V d =XLM-R(d)

[0016] Where V q and V d The vector representations of Chinese-Vietnamese cross-border ethnic cultural queries and texts are respectively represented. After multilingual pre-training, the model can better capture the information between Chinese-Vietnamese cross-border ethnic cultural texts.

[0017] As a further solution of the present invention, the specific steps of Step 2 are:

[0018] Step 2.1. Use the cross-border ethnic cultural entity recognition method to extract Chinese entities in the query or text, and link them with the Chinese knowledge graph entities to expand related entities. Vietnamese entities in the query or text are extracted using the Vietnamese entity extraction model, and linked with the Vietnamese knowledge graph entities to expand related entities. In addition, in order to expand the uncommon domain entities in the Sino-Vietnamese cross-border ethnic groups, the multilingual knowledge representation model (MtransE) is used to embed the triple knowledge in the Sino-Vietnamese cross-border ethnic knowledge graph, and the Sino-Vietnamese entities aligned with the Sino-Vietnamese knowledge graph are obtained. The entities extracted from the query or text are linked with the aligned Sino-Vietnamese entities to expand entities related to the other language;

[0019] Step 2.2: Since the expanded entity is composed of many word sets, the query and the entity expanded from the knowledge graph are regarded as a word sequence set. The entities expanded from text and knowledge graph are regarded as a set of word sequences Where V E is an entity in the Chinese-Vietnamese knowledge graph, e q and e d Represent the query and text and the word set expanded from the Chinese-Vietnamese knowledge graph respectively. and is the i-th word in the set of query and text word sequences. and The word vector set representation is obtained through multilingual pre-training models.

[0020]

[0021]

[0022] in, and They represent Chinese-Vietnamese cross-border ethnic queries and entity vector representations expanded from texts respectively.

[0023] As a further solution of the present invention, the specific steps of Step 3 are:

[0024] Step 3.1, use the vectors in the query and text to concatenate with the entity set vectors expanded from the knowledge graph to obtain the fused representation vector. The specific method is to query the vector V q The entity vector obtained by linking the entity in the query with the knowledge graph entity Phase splicing. Text vector V d The entity vector obtained by linking the entity in the text with the knowledge graph entity Phase splicing.

[0025]

[0026]

[0027] in, Indicates vector concatenation, V q ' and V d ' are the query vector and text vector after the query and text are fused with the entities in the knowledge graph.

[0028] Step 3.2. Use the multi-head attention mechanism to take the query and document vectors after integrating into the Chinese-Vietnamese cross-border ethnic knowledge graph as the input of the multi-head attention mechanism. The multi-head attention mechanism enriches the semantic information related to cross-border ethnic groups between the query and the document, paving the way for better alignment of representations in the same space in the next input comparison learning layer.

[0029]

[0030] Among them, Q, K, and V indicate that the query or text input is the same. is a scaling factor that prevents the product from being too large.

[0031] As a further solution of the present invention, the specific steps of Step 4 are:

[0032] Step 4.1, referring to a data augmentation method in the inverse cloze task, can generate two mutually exclusive views of the document. The first view is obtained by randomly sampling a paragraph range from a piece of text, and the complement of the range forms the second view. Specifically, given a sequence of text (w1, w2..., w n ), the span of the intercepted text is (w a ...,wb ), where (1≤a≤b≤n). a ...,w b ) and (w1...,w a-1 ...,w b+1 ,...,w n ) are used as positive samples. In addition, independent cropping is a common independent data augmentation strategy that independently samples two paragraphs from a document to form a positive pair. Both paragraphs correspond to consecutive subsequences of the original data.

[0033] Step 4.2, constructing negative samples is similar to constructing positive samples. The only difference is that the intercepted text paragraphs are replaced with other texts, for example, a sequence text (w1...,w a ...,w b ...,w n ) Randomly replace the paragraph text to get a new sequence text (w1...,n a ...,n b ...,w n ), where (n a ...,n b ) is a random replacement of text. In addition, proper nouns in the Chinese-Vietnamese cross-border ethnic groups are randomly replaced, deleted, or blocked.

[0034] Step 4.3: Use contrastive learning to train the query text to align in the same space. Contrastive learning is a method that relies on the fact that each document is unique to some extent. Contrastive loss is learned by distinguishing between documents. This loss compares positive (from the same document) or negative (from different documents) document representation pairs. The calculation formula is as follows:

[0035]

[0036] Where τ is the temperature parameter, k + Given a query q with relevant positive documents, k i Represents a negative document pool. This loss encourages relevant documents to have higher relevance scores and irrelevant documents to have lower relevance scores.

[0037] Step 4.4: Use a dual encoder architecture to independently encode the query and document. You can calculate the relevance score by taking the dot product (or cosine similarity) between the document representation and the query representation. The calculation formula is shown below.

[0038] s(q,d)= <f θ (q),f θ (d)>

[0039] Where q represents the query and d represents the document. We use the same θ parameter model f θ Each query text is encoded independently. s(q,d) is the relevance score obtained after the dot product of the query text.

[0040] In a second aspect, an embodiment of the present invention further provides a Chinese-Vietnamese cross-border ethnic text retrieval device that integrates a domain knowledge graph, and the device includes a module for executing the method of the first aspect above.

[0041] The beneficial effects of the present invention are:

[0042] 1. This invention expands the entity representation in queries and documents by integrating the Chinese-Vietnamese cross-border ethnic knowledge graph, alleviating the problem of diverse expressions of uncommon domain entities and folk custom entities;

[0043] 2. This invention uses a multi-head attention mechanism to adaptively integrate the knowledge graph of the Chinese-Vietnamese cross-border ethnic domain with queries and documents, thereby enriching the semantic information related to cross-border ethnic groups;

[0044] 3. The present invention introduces a contrastive learning method to achieve domain word representation in Chinese-Vietnamese cross-border ethnic query documents and align the semantic representations of domain words in the two languages ​​​​of Chinese and Vietnamese, and uses cosine similarity calculation as the relevance score, thereby improving the efficiency of text retrieval. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 This is the overall model diagram of the present invention;

[0046] Figure 2 This is a multilingual knowledge embedding model diagram in the present invention;

[0047] Figure 3 This is a diagram of the scale of the data set in the present invention;

[0048] Figure 4 This is the overall flow chart of Chinese-Vietnamese cross-border ethnic text retrieval that integrates the domain knowledge graph in the present invention. DETAILED DESCRIPTION

[0049] Example 1: Figure 1-Figure 4 As shown, in the first aspect, this embodiment provides a Chinese-Vietnamese cross-border ethnic text retrieval method that integrates domain knowledge graphs. The specific steps of the Chinese-Vietnamese cross-border ethnic text retrieval method that integrates domain knowledge graphs are as follows:

[0050] Step 1: After filtering, screening, removing stop words and special symbols, the text data of six Chinese-Vietnamese cross-border ethnic groups, namely Dai, Thai, Yi, Lao, Assamese, and Shan, were obtained. A total of 135,572 Chinese text data and 109,048 Vietnamese text data were crawled, which provided good support for the training of the Chinese-Vietnamese cross-border ethnic text retrieval model.

[0051] The specific steps of Step 1 are:

[0052] Step 1.1: We used crawler technology to obtain Chinese-Vietnamese cross-border ethnic text data from websites related to Chinese-Vietnamese cross-border ethnic groups. We then performed pre-processing operations such as filtering, screening, and removing stop words and special symbols, such as spaces, garbled characters, emoticons, and formula symbols. We crawled 91,899 texts for Chinese cross-border ethnic data and 71,993 texts for Vietnamese cross-border ethnic cultural data.

[0053] Step 1.2: Based on these data, construct Chinese and Vietnamese positive and negative sample pairs respectively. The Chinese positive and negative sample pairs are 43,673 texts, and the Vietnamese positive and negative sample pairs are 37,055 texts, totaling 135,572 text data in Chinese and 109,048 text data in Vietnamese.

[0054] Step 1.3, use the multilingual pre-training model to vectorize the Chinese-Vietnamese cross-border ethnic query text and obtain the vector representation of the query text. The Chinese-Vietnamese cross-border ethnic query and text are regarded as sequences q = {q1, q2, ..., q n} and the sequence d={d1,d2,…,d n}, where q i and d i The i-th word of the query and text respectively. q and d represent the query and text respectively.

[0055] V q =XLM-R(q)

[0056] V d =XLM-R(d)

[0057] Where V q and V d The vector representations of Chinese-Vietnamese cross-border ethnic cultural queries and texts are respectively represented. After multilingual pre-training, the model can better capture the information between Chinese-Vietnamese cross-border ethnic cultural texts.

[0058] Step 2: Extract Chinese or Vietnamese entities from the query or text, and link these extracted entities with the Chinese-Vietnamese knowledge graph to expand related entities. Furthermore, to expand entities in uncommon domains within the Chinese-Vietnamese cross-border ethnic group, this paper also embeds knowledge in the Chinese-Vietnamese cross-border ethnic group knowledge graph to obtain aligned Chinese-Vietnamese entities. Entity linking is then performed between the entities extracted from the query or text and these aligned Chinese-Vietnamese entities to expand entities related to the other language.

[0059] The specific steps of Step 2 are:

[0060] Step 2.1: Use the cross-border ethnic cultural entity recognition method to extract Chinese entities in the query or text, and link them with the Chinese knowledge graph entities to expand related entities. Vietnamese entities in the query or text are extracted using the Vietnamese entity extraction model, and linked with the Vietnamese knowledge graph entities to expand related entities. In addition, in order to expand the uncommon domain entities in the Chinese-Vietnamese cross-border ethnic groups, the multilingual knowledge representation model (MtransE) is used to embed the triple knowledge in the Chinese-Vietnamese cross-border ethnic knowledge graph, and obtain Chinese-Vietnamese entities aligned with the Chinese-Vietnamese knowledge graph. The entities extracted from the query or text are linked with the aligned Chinese-Vietnamese entities to expand entities related to the other language.

[0061] Step 2.2: Since the expanded entity is composed of many word sets, the query and the entity expanded from the knowledge graph are regarded as a word sequence set. The entities expanded from text and knowledge graph are regarded as a set of word sequences Where V E is an entity in the Chinese-Vietnamese knowledge graph, e q and e d Represent the query and text and the word set expanded from the Chinese-Vietnamese knowledge graph respectively. and is the i-th word in the set of query and text word sequences. and The word vector set representation is obtained through multilingual pre-training models.

[0062]

[0063] in, and They represent Chinese-Vietnamese cross-border ethnic queries and entity vector representations expanded from texts respectively.

[0064] Step 3: Use the multi-head attention mechanism to concatenate the vectors in the query and document after integrating into the Sino-Vietnamese cross-border ethnic knowledge graph with the entity set vector expanded from the knowledge graph to obtain the fused representation vector.

[0065] The specific steps of Step 3 are:

[0066] Step 3.1, use the vectors in the query and text to concatenate with the entity set vectors expanded from the knowledge graph to obtain the fused representation vector. The specific method is to query the vector V q The entity vector obtained by linking the entity in the query with the knowledge graph entity Phase splicing. Text vector V d The entity vector obtained by linking the entity in the text with the knowledge graph entity Phase splicing.

[0067]

[0068]

[0069] in, Indicates vector concatenation, V q ' and V d ' are the query vector and text vector after the query and text are fused with the entities in the knowledge graph.

[0070] Step 3.2. Use the multi-head attention mechanism to take the query and document vectors after integrating into the Chinese-Vietnamese cross-border ethnic knowledge graph as the input of the multi-head attention mechanism. The multi-head attention mechanism enriches the semantic information related to cross-border ethnic groups between the query and the document, paving the way for better alignment of representations in the same space in the next input comparison learning layer.

[0071]

[0072] Among them, Q, K, and V indicate that the query or text input is the same. is a scaling factor that prevents the product from being too large.

[0073] Step 4: Introduce contrastive learning to align the query-document representations after integrating knowledge graph features, cluster queries and documents of the same type together, and then use the dot product (or cosine similarity) between the query representation and the document representation as the relevance score.

[0074] The specific steps of Step 4 are:

[0075] Step 4.1, referring to a data augmentation method in the inverse cloze task, can generate two mutually exclusive views of the document. The first view is obtained by randomly sampling a paragraph range from a piece of text, and the complement of the range forms the second view. Specifically, given a sequence of text (w1, w2..., w n ), the span of the intercepted text is (w a ...,w b), where (1≤a≤b≤n). a ...,w b ) and (w1...,w a-1 ...,w b+1 ,...,w n ) are used as positive samples. In addition, independent cropping is a common independent data augmentation strategy that independently samples two paragraphs from a document to form a positive pair. Both paragraphs correspond to consecutive subsequences of the original data.

[0076] Step 4.2, constructing negative samples is similar to constructing positive samples. The only difference is that the intercepted text paragraphs are replaced with other texts, for example, a sequence text (w1...,w a ...,w b ...,w n ) Randomly replace the paragraph text to get a new sequence text (w1...,n a ...,n b ...,w n ), where (n a ...,n b ) is a random replacement of text. In addition, proper nouns in the Chinese-Vietnamese cross-border ethnic groups are randomly replaced, deleted, or blocked.

[0077] Step 4.3: Use contrastive learning to train the query text to align in the same space. Contrastive learning is a method that relies on the fact that each document is unique to some extent. Contrastive loss is learned by distinguishing between documents. This loss compares positive (from the same document) or negative (from different documents) document representation pairs. The calculation formula is as follows:

[0078]

[0079] Where τ is the temperature parameter, k + Given a query q with relevant positive documents, k i Represents a negative document pool. This loss encourages relevant documents to have higher relevance scores and irrelevant documents to have lower relevance scores.

[0080] Step 4.4: Use a dual encoder architecture to independently encode the query and document. You can calculate the relevance score by taking the dot product (or cosine similarity) between the document representation and the query representation. The calculation formula is shown below.

[0081] s(q,d)=<f θ (q),f θ (d)>

[0082] Where q represents the query and d represents the document. We use the same θ parameter model f θ Each query text is encoded independently. s(q,d) is the relevance score obtained after the dot product of the query text.

[0083] To verify the effectiveness of the proposed Chinese-Vietnamese cross-border ethnic text retrieval method that integrates domain knowledge graphs, we conducted the following comparative experiments: 91,899 texts were crawled from Chinese cross-border ethnic cultural data and 71,993 texts were crawled from Vietnamese cross-border ethnic cultural data. Based on these data, positive and negative sample pairs were constructed for Chinese and Vietnamese, with 43,673 positive and negative sample pairs for Chinese and 37,055 positive and negative sample pairs for Vietnamese, totaling 135,572 text data for Chinese and 109,048 text data for Vietnamese.

[0084] Table 1 shows the parameter settings during model training:

[0085] Table 1 Model parameter settings

[0086]

[0087]

[0088] In order to verify the performance of the text ranking proposed in this paper, the evaluation index of the Chinese-Vietnamese cross-border ethnic text retrieval model integrated with the domain knowledge graph mainly adopts MRR (Mean Reciprocal Rank), and the calculation method is as follows:

[0089]

[0090] Among them, |Q| is the number of users, rank i represents the ranking of the first correct answer to the i-th query statement. The accuracy of the standard answer is calculated by taking the inverse of its ranking in the results given by the evaluated system and averaging it over all questions.

[0091] Experiment 1: Baseline model comparison experiment

[0092] In order to verify the effectiveness of the model, this paper selects four baseline models for comparison on the Chinese-Vietnamese cross-border ethnic cultural text data, as shown in Table 2.

[0093] UnsupCLIR model: An unsupervised method based on a shared cross-lingual word embedding space proposed by Litschko et al. in 2018.

[0094] Wasserstein model: A distance-based method for measuring the differences between text paragraphs proposed by Georgios et al. in 2018.

[0095] EncoderCLIR model: A text ranking model based on a multilingual encoder proposed by Chen et al. in 2021.

[0096] mDPR model: A query-text pair computation model based on dual encoders proposed by Akari et al. in 2021.

[0097] Table 2 Comparison of experimental results of different methods

[0098]

[0099] As can be seen from the table, the model corresponding to the method of the present invention improves the MRR index by 26.6%, 20.1%, 12.8%, and 7.9% respectively compared with the other four models. The UnsupCLIR model directly uses a shared cross-language word embedding space to directly measure the semantic similarity of words in the query and text, which is less effective. The cross-language embedding induced by word-level and document-level alignment affects the quality of the model's retrieval performance. The Wasserstein model proposes a new matrix for measuring the differences between text paragraphs, but does not consider the interaction between words and text features, resulting in poor retrieval performance.

[0100] It is worth noting that compared with other baseline models EncoderCLIR mBERT The model and mDPR model showed better retrieval performance, which is because EncoderCLIR mBERT The model uses a multilingual model to encode each vocabulary term separately to induce and introduce it into a static embedding space, and then refines the bilingual space for a specific language pair. It can better capture the correlation between query texts. The mDPR model encodes the query and text separately, and the dense searcher based on neural networks well replaces the classic sparse method based on word frequency, making the model retrieval effect better. However, the reason why the performance of the two is weaker than that of the model in this paper is that the present invention incorporates the Chinese-Vietnamese cross-border ethnic knowledge graph to enhance the "cross-border" correlation between query texts, which also indirectly reflects the correctness of the view that the model in this paper incorporates the Chinese-Vietnamese domain knowledge graph.

[0101] In summary, the model performance corresponding to the Chinese-Vietnamese cross-border ethnic text retrieval method that integrates domain knowledge graphs proposed in the present invention is better than other baseline models, which proves that the integration of Chinese-Vietnamese cross-border ethnic groups in the process of cross-language text retrieval can improve the retrieval and ranking performance, effectively improve the robustness of the model, and actually return documents with a high relevance to the query text when retrieving cross-border ethnic cultural texts, thereby increasing users' search interest.

[0102] Experiment 2: Ablation experiment

[0103] This experiment is to verify the effectiveness of integrating the domain knowledge graph into the model proposed in this invention. The specific results are shown in Table 3.

[0104] Table 3 Comparison of ablation experiment results

[0105]

[0106] As shown in Table 3, the performance of the baseline model using the XLM-R language model is significantly higher than that of the model using the mBERT language model. The proposed method improves the baseline by 4.1%. This is because cross-border ethnic queries and text data contain a large number of domain entities, as well as the same entity with different names. By enhancing the entity semantics of the query and text, the model can better align the query text in the same space, thereby improving the model's retrieval performance.

[0107] Experiment 3: Comparison of model retrieval effects

[0108] The present invention conducted a third experiment to verify the retrieval performance of the model of the present invention, and the specific results are shown in Table 4.

[0109] Table 4 Visualization of model retrieval effect

[0110]

[0111]

[0112] As can be seen from Table 4, the fusion of domain knowledge graphs improves the retrieval effect of Chinese-Vietnamese cross-border ethnic cultural texts (the bold part in the table). The left side of Table 4 shows the retrieval effect of Chinese retrieval of Vietnamese. The retrieval text includes " Tay(Thai)", "Songkran(Songkran Festival)", " Shan (Shan people)", " The right side of Table 4 shows the search results for Chinese in Vietnamese, where the searched texts include "Thai," "Songkran," "Shan," "Buddha's Birthday," "Sangkan Bimai," and "Lenghe Sangkan." This demonstrates that the proposed Chinese-Vietnamese cross-border ethnic text retrieval model, which incorporates a domain knowledge graph, can effectively capture the "cross-border" relationship between queries and documents.

[0113] In a second aspect, an embodiment of the present invention further provides a Chinese-Vietnamese cross-border ethnic text retrieval device that integrates a domain knowledge graph, and the device includes a module for executing the method of the first aspect above.

[0114] like Figure 4 As shown, the following modules may be included:

[0115] The Chinese-Vietnamese cross-border ethnic text data preprocessing module is used to complete the following functions: after filtering, screening, removing stop words and special symbols, the Chinese-Vietnamese cross-border ethnic text data of six Chinese-Vietnamese cross-border ethnic groups, namely Dai, Thai, Yi, Lao, Assamese and Shan, are obtained;

[0116] A module for expanding query documents based on the Chinese-Vietnamese knowledge graph is used to perform the following functions: extract Chinese or Vietnamese entities from queries or texts, and link the extracted entities with the Chinese-Vietnamese knowledge graph entities to expand related entities. In addition, to expand domain entities that are not common in the Chinese-Vietnamese cross-border ethnic groups, knowledge embedding is performed on the Chinese-Vietnamese cross-border ethnic group knowledge graph to obtain aligned Chinese-Vietnamese entities. Entities extracted from queries or texts are then entity-linked with the aligned Chinese-Vietnamese entities to expand entities related to the other language.

[0117] The document feature fusion module for Chinese-Vietnamese cross-border ethnicity queries is used to complete the following functions: using a multi-head attention mechanism, the vectors in the query and document after integrating into the Chinese-Vietnamese cross-border ethnicity knowledge graph are concatenated with the entity set vectors expanded from the knowledge graph to obtain the fused representation vector;

[0118] The Chinese-Vietnamese cross-border ethnic text retrieval module is used to complete the following functions: introduce contrastive learning to align the query document representations after integrating knowledge graph features, cluster queries and documents of the same type together, and then use the dot product or cosine similarity between the query representation and the document representation as the relevance score.

[0119] The Chinese-Vietnamese cross-border ethnic text retrieval model that integrates the domain knowledge graph is saved, and the model is loaded into the memory using Flask technology to avoid the frequent model loading process caused by the request results and improve the running speed of the recognition model; then, the model is deployed as an API interface through Flask technology to realize the function of multiple concurrent requests of the Web port; finally, the text sorting model deployed to the server side is called on the Web side, and the cross-border ethnic cultural text data after retrieval and sorting is obtained by entering the search sentence or search term, and finally the obtained prediction results are displayed on the front-end interface.

[0120] The specific embodiments of the present invention are described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in this field without departing from the scope of the present invention.

Claims

1. A Chinese-Vietnamese cross-border ethnic text retrieval method integrating domain knowledge graphs, characterized by: The specific steps of the method are as follows: Step 1: Preprocessing of Chinese-Vietnamese cross-border ethnic text data: After filtering, screening, removing stop words, and special symbols, the Chinese-Vietnamese cross-border ethnic text data of six Chinese-Vietnamese cross-border ethnic groups, namely Dai, Thai, Yi, Lao, Assamese, and Shan, are obtained; Step 2: Expand the query document based on the Chinese-Vietnamese knowledge graph: Extract Chinese or Vietnamese entities from the query or text, and link the extracted entities with the Chinese-Vietnamese knowledge graph entities to expand related entities. In addition, to expand the domain entities that are not common in the Chinese-Vietnamese cross-border ethnic groups, the Chinese-Vietnamese cross-border ethnic group knowledge graph is also embedded with knowledge to obtain aligned Chinese-Vietnamese entities. Entities extracted from the query or text are then entity-linked with the aligned Chinese-Vietnamese entities to expand entities related to the other language. Step 3: Fusion of Chinese-Vietnamese cross-border ethnic query document features: Using a multi-head attention mechanism, the vectors of the query and document integrated into the Chinese-Vietnamese cross-border ethnic knowledge graph are concatenated with the entity set vectors expanded from the knowledge graph to obtain the fused representation vector. Step 4. Perform Chinese-Vietnamese cross-border ethnic text retrieval: Introduce contrastive learning to align the query document representations after integrating knowledge graph features, cluster queries and documents of the same type together, and then use the dot product or cosine similarity between the query representation and the document representation as the relevance score.

2. The Chinese-Vietnamese cross-border ethnic text retrieval method integrating domain knowledge graph according to claim 1 is characterized by: The specific steps of Step 1 are: Step 1.1: Use crawler technology to obtain Chinese-Vietnamese cross-border ethnic text data from websites related to Chinese-Vietnamese cross-border ethnic groups. Filter, select, remove stop words, and pre-process special characters such as spaces, garbled characters, emoticons, and formula symbols. Step 1.2: Construct Chinese and Vietnamese positive and negative sample pairs based on the preprocessed data; Step 1.3: Use the multilingual pre-training model to perform vector representation on the Chinese-Vietnamese cross-border ethnic query text to obtain the vector representation of the query text; the Chinese-Vietnamese cross-border ethnic query and text are respectively regarded as a sequence q = {q1, q2, ..., q n } and the sequence d={d1,d2,…,d n }, where q i and d i are the i-th word of the query and text, respectively, q and d represent the query and text; V q =XLM-R(q) V d XLM-R(d) Where V q and V d The vector representations of Chinese-Vietnamese cross-border ethnic cultural queries and texts are respectively represented. The multilingual pre-trained model can better capture the information between Chinese-Vietnamese cross-border ethnic cultural texts.

3. The Chinese-Vietnamese cross-border ethnic text retrieval method integrating domain knowledge graph according to claim 1 is characterized by: The specific steps of Step 2 are: Step 2.

1. Use the cross-border ethnic cultural entity recognition method to extract Chinese entities in the query or text, and link them with the Chinese knowledge graph entities to expand related entities. Use the Vietnamese entity extraction model to extract Vietnamese entities in the query or text, and link them with the Vietnamese knowledge graph entities to expand related entities. In addition, to expand the uncommon domain entities in the Chinese-Vietnamese cross-border ethnic groups, use the multilingual knowledge representation model MtransE to embed the triples in the Chinese-Vietnamese cross-border ethnic knowledge graph, and obtain Chinese-Vietnamese entities aligned with the Chinese-Vietnamese knowledge graph. Entities extracted from the query or text are entity linked with the aligned Chinese-Vietnamese entities to expand entities related to the other language. Step 2.2: Since the expanded entity is composed of many word sets, the query and the entity expanded from the knowledge graph are regarded as a word sequence set. The entities expanded from text and knowledge graph are regarded as a set of word sequences Where V E is an entity in the Chinese-Vietnamese knowledge graph, e q and e d Represent the query and text and the word set expanded from the Chinese-Vietnamese knowledge graph respectively; and is the i-th word in the set of query and text word sequences; and The word vector set representation is obtained through multilingual pre-training models respectively; in, and They represent Chinese-Vietnamese cross-border ethnic queries and entity vector representations expanded from texts respectively.

4. The Chinese-Vietnamese cross-border ethnic text retrieval method integrating domain knowledge graph according to claim 1 is characterized by: The specific steps of Step 3 are: Step 3.

1. Use the vectors in the query and text to concatenate with the entity set vectors expanded from the knowledge graph to obtain the fused representation vector; the specific method is to query the vector V q The entity vector obtained by linking the entity in the query with the knowledge graph entity Phase splicing, text vector V d The entity vector obtained by linking the entity in the text with the knowledge graph entity Phase splicing; in, Indicates vector concatenation, V q ' and V d ' are the query vector and text vector after the query and text are fused with the entities in the knowledge graph; Step 3.2: Use a multi-head attention mechanism to take the query and document vectors, which have been integrated into the Chinese-Vietnamese cross-border ethnic knowledge graph, as input to the multi-head attention mechanism. This enriches the cross-border ethnic semantic information between the query and document, paving the way for better alignment of representations in the same space in the next input contrastive learning layer. Among them, Q, K, and V indicate that the query or text input is the same. is a scaling factor that prevents the product from being too large.

5. The Chinese-Vietnamese cross-border ethnic text retrieval method integrating domain knowledge graph according to claim 1 is characterized by: The specific steps of Step 4 are: Step 4.1, referring to a data augmentation method in the inverse cloze task, generates two mutually exclusive views of the document. The first view is obtained by randomly sampling a paragraph range from a piece of text, and the complement of the paragraph range forms the second view. Specifically, given a sequence text (w1, w2..., w n ), the span of the intercepted text is (w a ...,w b ), where (1≤a≤b≤n), the intercepted text span (w a …,w b ) and (w1…,w a-1 ...,w b+1 ,...,w n ) are taken as positive samples; in addition, independent cropping is a common independent data enhancement, which independently samples two paragraphs from the document to form a positive pair, and both paragraphs correspond to continuous subsequences of the original data; Step 4.2: Constructing negative samples is similar to constructing positive samples. The only difference is that the intercepted text paragraphs are replaced with other texts. In addition, the proper nouns of the Chinese-Vietnamese cross-border ethnic groups are randomly replaced, deleted, or blocked. Step 4.3: Use contrastive learning to train the query text to align in the same space. Contrastive learning is a method that relies on the fact that each document is unique to some extent. Contrastive loss is learned by distinguishing between documents. This loss compares positive or negative document representation pairs. The calculation formula is as follows: Where τ is the temperature parameter, k + Given a query q with relevant positive documents, k i Represents a negative document pool. This contrast loss encourages relevant documents to have higher relevance scores, while irrelevant documents have lower relevance scores. Step 4.4: Use a dual encoder architecture to independently encode the query and document. Calculate the relevance score by taking the dot product or cosine similarity between the document representation and the query representation. The calculation formula is as follows: s(q,d)=<f θ (q),f θ (d)> Where q represents the query and d represents the document, using the same θ parameter model f θ Each query text is encoded independently, and s(q,d) is the relevance score obtained after the dot product of the query text.

6. A Chinese-Vietnamese cross-border ethnic text retrieval device integrating domain knowledge graphs, characterized by: The method comprises a module for executing the method according to any one of claims 1 to 5.