Cross-language search method, device and electronic device

By using a pre-trained translation model, combining title and abstract features, the ambiguity and inconsistency of title and abstract translation in cross-language retrieval is solved, and the translation accuracy and user experience is improved.

CN113326706BActive Publication Date: 2025-02-11BEIJING SOGOU TECHNOLOGY DEVELOPMENT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110732653.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-29
Publication Date
2025-02-11
Estimated Expiration
2041-06-29

AI Technical Summary

Technical Problem

In cross-language retrieval, there are ambiguity and inconsistency in the translation of titles and abstracts, which affects the user experience.

Method used

The title is translated based on the title and abstract in the second language to generate the title and abstract in the first language. The model uses an encoder and decoder to combine title features and abstract features to filter irrelevant information and improve translation accuracy.

Benefits of technology

Improves translation accuracy, reduces the probability of ambiguity, keeps the title consistent with the translation of the abstract, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113326706B_ABST
    Figure CN113326706B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a cross-language retrieval method and device, the method comprising: obtaining a user's retrieval request; the retrieval request includes a query word in a first language; performing a search based on the query word in the first language to obtain a retrieval result in a second language; the retrieval result includes a title in the second language and an abstract in the second language; using a pre-trained translation model, based on the title in the second language and the abstract in the second language, translating the title in the second language to obtain a title in the first language; and translating the abstract in the second language to obtain an abstract in the first language; returning the title in the first language and the abstract in the first language. The embodiment of the present application can improve the translation accuracy, reduce the probability of ambiguity, and can make the translation of the title and the abstract consistent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a cross-language retrieval method, a cross-language retrieval device and an electronic device. Background Art

[0002] Cross-language search is a scenario where users use search terms in a natural language to search for files expressed in another language. The search results in another language need to be translated into the natural language requested by the user. The search results can include titles and abstracts. When translating titles, since titles are usually short, it is easy to cause translation ambiguity. In addition, since titles and abstracts are translated at the sentence level, the same translation object may have inconsistent translations in the title and abstract, which affects the user experience. Summary of the invention

[0003] In view of the above problems, the embodiments of the present application are proposed to provide a cross-language search method, a cross-language search device and an electronic device that overcome the above problems or at least partially solve the above problems.

[0004] In order to solve the above problems, the present application discloses a cross-language search method, which includes:

[0005] Obtaining a search request from a user; the search request comprising a query term in a first language;

[0006] Searching according to the query term in the first language to obtain search results in the second language; the search results include a title in the second language and an abstract in the second language;

[0007] Using a pre-trained translation model, based on the title in the second language and the summary in the second language, the title in the second language is translated into a title in the first language; and the summary in the second language is translated into a summary in the first language;

[0008] Returns the title in the first language and the summary in the first language.

[0009] Optionally, the translation model includes an encoder and a decoder; the using the pre-trained translation model, based on the title in the second language and the summary in the second language, translating the title in the second language to obtain the title in the first language includes:

[0010] generating input features according to the title in the second language and the abstract in the second language, wherein the input features include title features and abstract features;

[0011] The input features are input into the encoder of the translation model, which performs encoding and filters the intermediate features corresponding to the title features generated during the encoding process to filter out irrelevant information learned based on the summary features and retain relevant information learned based on the summary features, and the target features corresponding to the title features obtained after the encoding are fed back to the decoder for decoding to obtain the title in the first language.

[0012] Optionally, the encoder includes a multi-head attention layer and a filtering unit; the multi-head attention layer encodes the title features and the summary features to obtain intermediate features corresponding to the title features and intermediate features corresponding to the summary features; the filtering unit filters irrelevant information learned based on the summary features in the intermediate features corresponding to the title features.

[0013] Optionally, the input features further include: position features and separator features;

[0014] The position feature is used to learn the order attributes of each word in the title and the abstract; the separator feature is used to distinguish the title feature from the abstract feature.

[0015] Optionally, the translation model is trained in the following manner:

[0016] Get parallel corpus data;

[0017] Determine a title and an abstract in a first language and a title and an abstract in a second language according to the parallel corpus data;

[0018] Using the title and abstract in the first language as input to an encoder of the translation model, using the output of the encoder and the title and abstract in the second language as input to a decoder of the translation model, and training the translation model;

[0019] When it is determined according to the output of the decoder that a preset condition is satisfied, it is determined that the training of the translation model is completed.

[0020] Optionally, taking the title and abstract in the first language as input of an encoder of the translation model, taking the output of the encoder and the title and abstract in the second language as input of a decoder of the translation model, and training the translation model comprises:

[0021] Generate first input features in the first language according to the title and abstract in the first language; the first input features include title features, abstract features, position features, and separator features in the first language;

[0022] Inputting the first input feature into an encoder of the translation model, so that the encoder distinguishes the title feature from the abstract feature based on the separator feature, and learns an intermediate feature corresponding to the title feature based on the title feature, the abstract feature, and the sequence attribute of each word in the title and the abstract determined by the position feature;

[0023] generating second input features in the second language according to the title and abstract in the second language; the second input features comprising title features, abstract features, position features, and separator features in the second language;

[0024] The second input feature is input into the decoder of the translation model so that the decoder distinguishes the title feature and the abstract feature based on the separator feature, and learns the intermediate feature corresponding to the title feature based on the title feature, the abstract feature, and the sequential attributes of each word in the title and the abstract determined by the position feature.

[0025] Optionally, the parallel corpus data includes sentences in the first language and sentences in the second language;

[0026] The determining of the title and abstract in the first language and the title and abstract in the second language according to the parallel corpus data comprises:

[0027] determining a predetermined phrase in a sentence in the first language and a sentence in the second language, and aligning them;

[0028] Align the pre-set phrases in the first language sentence with the second language sentence, and use them as the title in the first language and the title in the second language respectively;

[0029] The sentence where the title in the first language is located is used as the abstract in the first language, and the sentence where the title in the second language is located is used as the abstract in the second language.

[0030] The present application also discloses a cross-language search device, which includes:

[0031] A request acquisition module, used to acquire a search request from a user; the search request includes a query term in a first language;

[0032] A search module, configured to search based on the query term in the first language to obtain search results in a second language; the search results include a title in the second language and an abstract in the second language;

[0033] a translation module, configured to use a pre-trained translation model to translate the title in the second language into a title in a first language based on the title in the second language and the abstract in the second language; and to translate the abstract in the second language into a abstract in the first language;

[0034] The returning module is used to return the title in the first language and the abstract in the first language.

[0035] Optionally, the translation model includes an encoder and a decoder; the translation module includes:

[0036] An input feature generation submodule, configured to generate input features according to the title in the second language and the abstract in the second language, wherein the input features include title features and abstract features;

[0037] The model translation submodule is used to input the input features into the encoder of the translation model, which is encoded by the encoder, and filter the intermediate features corresponding to the title features generated during the encoding process to filter out irrelevant information learned based on the summary features and retain relevant information learned based on the summary features, and feed back the target features corresponding to the title features obtained after the encoding to the decoder for decoding to obtain the title in the first language.

[0038] Optionally, the encoder includes a multi-head attention layer and a filtering unit; the multi-head attention layer encodes the title features and the summary features to obtain intermediate features corresponding to the title features and intermediate features corresponding to the summary features; the filtering unit filters irrelevant information learned based on the summary features in the intermediate features corresponding to the title features.

[0039] Optionally, the input features further include: position features and separator features;

[0040] The position feature is used to learn the order attributes of each word in the title and the abstract; the separator feature is used to distinguish the title feature from the abstract feature.

[0041] Optionally, the translation model is trained by the following modules:

[0042] A parallel corpus data acquisition module, used to acquire parallel corpus data;

[0043] A corpus data processing module, used for determining a title and an abstract in a first language and a title and an abstract in a second language according to the parallel corpus data;

[0044] a model training module, configured to use the title and abstract in the first language as inputs of an encoder of the translation model, and use the output of the encoder and the title and abstract in the second language as inputs of a decoder of the translation model to train the translation model;

[0045] The model determination module is used to determine that the training of the translation model is completed when it is determined according to the output of the decoder that a preset condition is met.

[0046] Optionally, the model training module includes:

[0047] A first feature generation submodule, configured to generate first input features in the first language according to the title and abstract in the first language; the first input features include title features, abstract features, position features, and separator features in the first language;

[0048] A first training submodule is configured to input the first input feature into an encoder of the translation model, so that the encoder distinguishes the title feature from the abstract feature based on the separator feature, and learns an intermediate feature corresponding to the title feature based on the title feature, the abstract feature, and an order attribute of each word in the title and the abstract determined by the position feature;

[0049] A second feature generation submodule is used to generate second input features in the second language according to the title and abstract in the second language; the second input features include title features, abstract features, position features and separator features in the second language;

[0050] The second training submodule is used to input the second input feature into the decoder of the translation model so that the decoder distinguishes the title feature and the abstract feature based on the separator feature, and learns the intermediate feature corresponding to the title feature based on the title feature, the abstract feature, and the sequential attribute of each word in the title and the abstract determined by the position feature.

[0051] Optionally, the parallel corpus data includes sentences in the first language and sentences in the second language;

[0052] The corpus data processing module comprises:

[0053] a phrase determination submodule, configured to determine preset phrases in the sentence in the first language and the sentence in the second language, and align them;

[0054] a title determination submodule, for aligning the preset phrases in the sentence in the first language with the sentence in the second language as the title in the first language and the title in the second language respectively;

[0055] The summary determination submodule is used to use the sentence where the title in the first language is located as the summary in the first language, and use the sentence where the title in the second language is located as the summary in the second language.

[0056] The embodiment of the present application also discloses an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and when the computer program is executed by the processor, the steps of the cross-language retrieval method described above are implemented.

[0057] The embodiment of the present application further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the cross-language retrieval method described above are implemented.

[0058] The embodiments of the present application include the following advantages:

[0059] In an embodiment of the present application, a user's search request can be obtained; a search is performed based on a query term in a first language in the search request to obtain a search result in a second language; based on a title in a second language and an abstract in a second language in the search result in the second language, the title in the second language is translated to obtain a title in the first language, and the abstract in the second language is translated to obtain an abstract in the first language; and the title in the first language and the abstract in the first language are returned to the user's terminal. By assisting in translating the title in the second language based on the abstract in the second language, the translation accuracy can be improved, the probability of ambiguity can be reduced, and the translation of the title and the abstract can be made consistent. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 is a flowchart of the steps of a cross-language retrieval method in an embodiment of the present application;

[0061] Figure 2 is a flowchart of another cross-language search method according to an embodiment of the present application;

[0062] Figure 3 is a structural block diagram of a cross-language retrieval device according to an embodiment of the present application;

[0063] Figure 4 is a structural block diagram of a cross-language retrieval device in an optional embodiment of the present application;

[0064] Figure 5 A structural block diagram of an electronic device for cross-language retrieval according to an exemplary embodiment;

[0065] Figure 6 It is a structural schematic diagram of an electronic device for cross-language retrieval according to another exemplary embodiment of the present application. DETAILED DESCRIPTION

[0066] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0067] In order to enable those skilled in the art to better understand the embodiments of the present application, examples are provided below. In existing conventional cross-language search scenarios, for example, the Chinese query term input by the user may be "Sharp", and "Sharp" is converted into the English query term "sharp". A search result obtained by searching based on "sharp" may include: Title: "sharp"; Summary: "for sharp Business Solutions, the company focuses on the development of sharp office solutions and visual solutions, to provide commercial customers with a more...". The English search results are translated into Chinese, and the Chinese title is: "Sharp"; the Chinese summary is: "For Sharp Business Solutions, the company decided to focus on the development of sharp office solutions and visual solutions, to provide commercial users with more...".

[0068] In an embodiment of the present application, a user's search request can be obtained; a search is performed based on a query term in a first language in the search request to obtain a search result in a second language; based on a title in a second language and an abstract in a second language in the search result in the second language, the title in the second language is translated to obtain a title in the first language, and the abstract in the second language is translated to obtain an abstract in the first language; and the title in the first language and the abstract in the first language are returned to the user's terminal. By assisting in translating the title in the second language based on the abstract in the second language, the translation accuracy can be improved, the probability of ambiguity can be reduced, and the translation of the title and the abstract can be made consistent.

[0069] Reference Figure 1 , shows a flow chart of the steps of a cross-language search method in an embodiment of the present application, which may specifically include the following steps:

[0070] Step 101: obtaining a search request from a user; the search request includes a query term in a first language.

[0071] The cross-language search method of the embodiment of the present application can be applied to the scenario where the server performs cross-language search on the search request submitted by the user through the terminal. The search request can include a query term in a first language and information for specifying a second language for cross-language search.

[0072] For example, a user opens a search client through a terminal and inputs a Chinese query word into the search client. The search client may display an option box for the user to select a second language, and the user may specify an option in the option box to perform an English search. The search client sends a search request containing a Chinese query word to the server. The server may call a search engine to perform a search based on the Chinese query word to obtain one or more English search results, and the search results may include text content, title, and a summary corresponding to the text content. The summary may be obtained by summarizing the text content or by extracting information from the text.

[0073] Step 102: perform a search based on the query term in the first language to obtain a search result in the second language; the search result includes a title in the second language and an abstract in the second language.

[0074] Specifically, the query word in the first language is translated into a translated query word in the second language, and a search is performed on the translated query word in the second language to obtain a search result in the second language. The search result in the second language may include at least one search result item in the second language, and each search result item includes a title in the second language and an abstract in the second language corresponding to the result item.

[0075] In the embodiment of the present application, the description of the first language and the second language is to distinguish two different languages, and does not represent only two types of languages. The first language and the second language can be any two different languages.

[0076] Step 103: Using a pre-trained translation model, based on the title in the second language and the summary in the second language, translate the title in the second language to obtain the title in the first language.

[0077] The pre-trained translation model can be a document-level translation model. The document-level translation model can use the summary to help translate the title. Since the summary can include contextual information beyond the sentence in which the title is located, the document-level translation model has higher translation accuracy than the sentence-level translation model.

[0078] When translating a title in a second language into a title in the first language, an abstract in the second language can be introduced to assist the translation. The abstract serves as contextual information in the text content. Translating the title based on the contextual information can improve translation accuracy, reduce the probability of ambiguity, and ensure that the translation of the title and the abstract are consistent.

[0079] In an optional embodiment of the present application, the translation model may include an encoder and a decoder. The number of layers of the encoder and the decoder may include one or more layers. It is necessary to ensure that the number of layers of the encoder corresponds to the number of layers of the decoder. Exemplarily, the number of layers of the encoder and the decoder may be 6 layers.

[0080] The step 103 may include the following sub-steps S11-S12:

[0081] Sub-step S11, generating input features according to the title in the second language and the abstract in the second language, wherein the input features include title features and abstract features.

[0082] The input features of the encoder include title features and summary features. The input features can be feature vectors, and the text can be converted into feature vectors through the feature vector generation model. For example, embedding is a way to represent text, speech, and image features with binary vectors, and the text can be converted into embedding features through the model.

[0083] For example, the title feature can be expressed as emb src , which enables the encoder to learn the information of the title; the summary feature can be expressed as emb ctx , which allows the encoder to learn the summary information.

[0084] Sub-step S12, inputting the input features into the encoder of the translation model, the encoder performs encoding, and filtering the intermediate features corresponding to the title features generated during the encoding process to filter out irrelevant information learned based on the summary features and retain relevant information learned based on the summary features, and feeding back the target features corresponding to the title features obtained after the encoding to the decoder for decoding to obtain the title in the first language.

[0085] The encoder can encode according to the input feature information. The encoder can include one or more sub-layers. Each sub-layer can encode and output features according to the features input to the sub-layer. Features that do not belong to the output of the last sub-layer can be called intermediate features. Features output by the last sub-layer can be called target features. Exemplarily, if the encoder includes two sub-layers, the first sub-layer can encode the intermediate features based on the features input to the sub-layer; the second sub-layer can encode the target features based on the features input to the sub-layer.

[0086] In an optional embodiment of the present application, the input feature may further include a position feature and a separator feature.

[0087] For example, the position feature can be expressed as emb pos , which enables the encoder to learn the sequential properties of each word in the title and summary; the separator feature can be represented as emb seg , which allows the encoder to learn to distinguish between title features and summary features.

[0088] In an optional embodiment of the present application, the encoder can distinguish the title feature from the abstract feature based on the separator feature, and will not mix the title feature with the abstract feature. If there is no separator feature, it will be difficult for the encoder to distinguish the title feature from the abstract feature.

[0089] The encoder can learn the order attributes of each word in the title and abstract based on the positional features, so as to better distinguish each word in the title and abstract. For example, for the sentences "The weather is good today" and "The weather is changeable", for the former sentence, the order attribute of "today" is represented as the first word in the sentence; the order attribute of "weather" is represented as the second word in the sentence; the order attribute of "good" is represented as the third word in the sentence. For the latter sentence, the order attribute of "weather" is represented as the first word in the sentence, and the order attribute of "changeable" is represented as the second word in the sentence. Although "weather" exists in both sentences, the "weather" in the two sentences has different order attributes. The order attribute allows the encoder to better distinguish words in multiple sentences. Without the positional feature, the encoder will not be able to distinguish the same words in different sentences.

[0090] The encoder can learn the intermediate features corresponding to the title features and the intermediate features corresponding to the abstract features based on the title features, the abstract features, and the sequential attributes of each word in the title and the abstract.

[0091] Since the input features include summary features, the intermediate features corresponding to the title features will learn information about the summary features, and the information about the summary features may include relevant information and irrelevant information for the title features, wherein the relevant information can help to better translate the title, so that the same translation object in the title and the summary remains consistent; while irrelevant information will affect the translation effect. Therefore, in an embodiment of the present application, the encoder can filter the intermediate features corresponding to the title features to filter out irrelevant information learned based on the summary features, and retain relevant information learned based on the summary features. The target features finally output by the encoder include: target features corresponding to the title features and target features corresponding to the summary features. The target features corresponding to the title features are fed back to the decoder for decoding, and the translation result of the title is obtained, while the target features corresponding to the summary features are discarded and not used.

[0092] The translation model described in the embodiment of the present application includes an encoder and a decoder. The architecture of the encoder may include a multi-head attention layer (Self-Attention), a filtering unit (Gating), a concatenation layer (Concat), a residual and normalization processing layer (Add&Norm) and a feedforward network (Feed Forward). The multi-head attention layer is the first sublayer, and the feedforward network is the second sublayer. The multi-head attention layer can be encoded based on the input features to obtain intermediate features corresponding to the title features and intermediate features corresponding to the summary features. In the case where the input features include title features, summary features, position features and separator features, the multi-head attention layer can reduce the maximum path length between remote dependencies to O(1) space complexity and determine the relative importance of different positions. The filtering unit filters the irrelevant information learned based on the summary features in the intermediate features corresponding to the title features output by the multi-head attention layer. The filtering unit can be a threshold unit (Gating). The threshold mechanism is a relatively mature mechanism in neural networks, and filtering is achieved by linear interpolation of neuron activation results.

[0093] The splicing layer splices the intermediate features corresponding to the filtered title features and the intermediate features corresponding to the summary features. The spliced ​​intermediate features are processed by the residual and normalization processing layers and the feedforward network in turn, and are output as target features by the feedforward network; the target features include target features corresponding to the title features and target features corresponding to the summary features. In the embodiment of the present application, the focus is on the target features corresponding to the title features, and the focus is not on the target features corresponding to the summary features. The inter-target features corresponding to the title features are fed back to the decoder, while the target features corresponding to the summary features are discarded.

[0094] The decoder can include three sublayers. The first sublayer is the multi-head attention layer (Self-Attention); the second sublayer is the encoder-decoder attention layer (Encoder-Decoder Attention), which allows the decoder to learn the position information of the input features; the third sublayer is the feed-forward network (Feed Forward). The input features generated from the title and summary of the second language (emb tgt ) can be input into the multi-head attention layer of the decoder; the target features corresponding to the title features of the encoder output can be input into the encoder-decoder attention layer of the decoder. After the output of the feedforward network is regressed through the Softmax layer, the candidate translation results and the corresponding probability values ​​can be obtained, and the final translation result can be determined based on the candidate translation results and the corresponding probability values.

[0095] Step 104: translate the abstract in the second language to obtain an abstract in the first language.

[0096] For the summary in the second language, the corresponding document-level translation model can be used to translate it into the summary in the first language.

[0097] Step 105: Return the title in the first language and the summary in the first language.

[0098] The server may return the translated title in the first language and the abstract in the first language to the user's terminal for display.

[0099] In an embodiment of the present application, a user's search request can be obtained; a search is performed based on a query term in a first language in the search request to obtain a search result in a second language; a pre-trained translation model is used to translate the title in the second language based on the title in the second language and the abstract in the second language to obtain the title in the first language, and the abstract in the second language is translated to obtain the abstract in the first language; and the title in the first language and the abstract in the first language are returned to the user's terminal. By using a translation model to assist in translating the title in the second language based on the abstract in the second language, the translation accuracy can be improved, the probability of ambiguity can be reduced, and the translation of the title and the abstract can be made consistent.

[0100] Reference Figure 2 Shown is a flowchart of the steps of the translation model training method in an embodiment of the present application.

[0101] Step 201, obtaining parallel corpus data.

[0102] Parallel corpus data may include texts that are aligned and translated between two languages. For example, it includes texts that are aligned and translated between Chinese and English. For example, "Today is a good day" constitutes a parallel sentence.

[0103] Step 202: Determine the title and abstract in the first language and the title and abstract in the second language according to the parallel corpus data.

[0104] The parallel corpus data may include a text in a first language and a text in a second language. A title and an abstract in the first language may be determined from the text in the first language; and a title and an abstract in the second language may be determined from the text in the second language.

[0105] In an optional embodiment of the present application, the parallel corpus data is parallel sentences, which may include sentences in a first language and sentences in a second language; the step 202 may include the following sub-steps S21-S23:

[0106] Sub-step S21 : determining preset phrases in the sentence in the first language and the sentence in the second language, and aligning them.

[0107] Sub-step S22, using the preset phrases aligned in the sentence in the first language and the sentence in the second language as the title in the first language and the title in the second language respectively.

[0108] A preset phrase in the first language in a sentence in the first language may be used as a title in the first language; and a preset phrase in the second language in a sentence in the second language that is aligned with the preset phrase in the first language may be used as a title in the second language.

[0109] Sub-step S23: taking the sentence where the title in the first language is located as a summary in the first language, and taking the sentence where the title in the second language is located as a summary in the second language.

[0110] The preset phrases may be phrases of preset parts of speech. For example, the preset phrases may be noun phrases and verb phrases. The Berkeley analyzer may be used to analyze the sentences of the first language and the sentences of the second language respectively to obtain the noun phrases and verb phrases therein. Then, the phrases are aligned according to the word alignment results generated by the alignment model, and finally, the aligned phrase pairs are used as titles, and the source sentences where the phrase pairs are located are used as abstracts.

[0111] By using the aligned phrase pairs as titles and the source sentences containing the phrase pairs as summaries, training data for the translation model can be constructed, solving the problem of difficulty in obtaining training data.

[0112] Step 203: Taking the title and abstract in the first language as input of the encoder of the translation model, taking the output of the encoder and the title and abstract in the second language as input of the decoder of the translation model, and training the translation model.

[0113] In the present application, input features for the encoder can be generated according to the title and abstract in the first language, and input features for the decoder can be generated according to the title and abstract in the second language; the input features generated according to the title and abstract in the first language are input into the encoder to obtain the output of the encoder, which is the target feature corresponding to the title feature; the output of the encoder and the input features generated according to the title and abstract in the second language are input into the encoder to train the translation model.

[0114] In an optional embodiment of the present application, the input feature may further include: a position feature and a separator feature, and the corresponding step 203 may further include the following sub-steps S31-S34:

[0115] Sub-step S31, generating first input features in the first language according to the title and abstract in the first language; the first input features include title features, abstract features, position features and separator features.

[0116] Sub-step S32, inputting the first input feature into the encoder of the translation model, so that the encoder distinguishes the title feature and the abstract feature based on the separator feature, and learns the intermediate feature corresponding to the title feature based on the title feature, the abstract feature, and the order attribute of each word in the title and the abstract determined by the position feature. Sub-step S33, generating the second input feature of the second language according to the title and the abstract in the second language; the first input feature includes the title feature, the abstract feature, the position feature and the separator feature.

[0117] Sub-step S34, inputting the second input feature into the decoder of the translation model, so that the decoder distinguishes the title feature and the abstract feature based on the separator feature, and learns the intermediate feature corresponding to the title feature based on the title feature, the abstract feature, and the sequential attributes of each word in the title and the abstract determined by the position feature.

[0118] In an optional embodiment of the present application, before using the constructed training data to train the translation model, the translation model may also be pre-trained, and the pre-training process may include: using the sentence in the first language as the input of the encoder of the translation model, and using the output of the encoder and the sentence in the second language as the input of the decoder of the translation model, to pre-train the translation model.

[0119] Pre-training can use a large number of sentence-level parallel sentences for training to obtain a powerful basic translation model, and then fine-tune the basic translation model using constructed data.

[0120] Step 204: When the output of the decoder is determined to meet a preset condition, it is determined that the training of the translation model is completed.

[0121] The loss function can be calculated based on the output of the decoder. When the value of the loss function meets the preset loss function judgment condition, it can be determined that the translation model training is completed. If the value of the loss function does not meet the loss function judgment condition, the parameters of the translation model are adjusted and trained again.

[0122] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

[0123] Reference Figure 3, shows a structural block diagram of a cross-language search device according to an embodiment of the present application, which may specifically include the following modules: a request acquisition module 301, used to acquire a user's search request; the search request includes a query term in a first language;

[0124] A search module 302, configured to search based on the query term in the first language to obtain search results in the second language; the search results include a title in the second language and an abstract in the second language;

[0125] A translation module 303 is configured to use a pre-trained translation model to translate the title in the second language into a title in the first language based on the title in the second language and the abstract in the second language; and to translate the abstract in the second language into a abstract in the first language;

[0126] The returning module 304 is configured to return the title in the first language and the abstract in the first language.

[0127] Reference Figure 4 Shown is a structural block diagram of a cross-language retrieval device in an optional embodiment of the present application.

[0128] In an optional embodiment of the present application, the translation model includes an encoder and a decoder; the translation module 303 may include:

[0129] An input feature generating submodule 3031 is used to generate input features according to the title in the second language and the abstract in the second language, wherein the input features include title features and abstract features;

[0130] The model translation submodule 3032 is used to input the input features into the encoder of the translation model, which is encoded by the encoder, and filter the intermediate features corresponding to the title features generated during the encoding process to filter out irrelevant information learned based on the summary features and retain relevant information learned based on the summary features, and feed back the target features corresponding to the title features obtained after the encoding to the decoder for decoding to obtain the title in the first language.

[0131] In an optional embodiment of the present application, the encoder includes a multi-head attention layer and a filtering unit; the multi-head attention layer encodes based on the title features and the summary features to obtain intermediate features corresponding to the title features and intermediate features corresponding to the summary features; the filtering unit filters irrelevant information learned based on the summary features in the intermediate features corresponding to the title features.

[0132] In an optional embodiment of the present application, the input feature further includes: a position feature and a separator feature;

[0133] The position feature is used to learn the order attributes of each word in the title and the abstract; the separator feature is used to distinguish the title feature from the abstract feature.

[0134] In an optional embodiment of the present application, the translation model is obtained by training the following modules:

[0135] A parallel corpus data acquisition module 305 is used to acquire parallel corpus data;

[0136] A corpus data processing module 306, configured to determine a title and an abstract in a first language and a title and an abstract in a second language according to the parallel corpus data;

[0137] A model training module 307, configured to use the title and abstract in the first language as inputs to an encoder of the translation model, and use the output of the encoder and the title and abstract in the second language as inputs to a decoder of the translation model to train the translation model;

[0138] The model determination module 308 is used to determine that the training of the translation model is completed when it is determined according to the output of the decoder that a preset condition is met.

[0139] In an optional embodiment of the present application, the model training module 307 may include:

[0140] A first feature generation submodule 3071 is used to generate first input features in the first language according to the title and abstract in the first language; the first input features include title features, abstract features, position features and separator features in the first language;

[0141] A first training submodule 3072 is used to input the first input feature into the encoder of the translation model, so that the encoder distinguishes the title feature from the abstract feature based on the separator feature, and learns the intermediate feature corresponding to the title feature based on the title feature, the abstract feature, and the sequence attribute of each word in the title and the abstract determined by the position feature;

[0142] A second feature generation submodule 3073 is used to generate second input features in the second language according to the title and abstract in the second language; the second input features include title features, abstract features, position features and separator features in the second language;

[0143] The second training submodule 3074 is used to input the second input feature into the decoder of the translation model so that the decoder distinguishes the title feature and the abstract feature based on the separator feature, and learns the intermediate feature corresponding to the title feature based on the title feature, the abstract feature, and the sequential attributes of each word in the title and the abstract determined by the position feature.

[0144] In an optional embodiment of the present application, the parallel corpus data includes sentences in the first language and sentences in the second language;

[0145] The corpus data processing module 306 may include:

[0146] A phrase determination submodule 3061 is used to determine preset phrases in the sentence in the first language and the sentence in the second language, and align them;

[0147] A title determination submodule 3062 is used to align the preset phrases in the sentence in the first language with the sentence in the second language as the title in the first language and the title in the second language respectively;

[0148] The summary determination submodule 3063 is configured to use the sentence where the title in the first language is located as the summary in the first language, and use the sentence where the title in the second language is located as the summary in the second language.

[0149] In an embodiment of the present application, a user's search request can be obtained; a search is performed based on a query term in a first language in the search request to obtain a search result in a second language; based on a title in a second language and an abstract in a second language in the search result in the second language, the title in the second language is translated to obtain a title in the first language, and the abstract in the second language is translated to obtain an abstract in the first language; and the title in the first language and the abstract in the first language are returned to the user's terminal. By assisting in translating the title in the second language based on the abstract in the second language, the translation accuracy can be improved, the probability of ambiguity can be reduced, and the translation of the title and the abstract can be made consistent.

[0150] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0151] Figure 5 8 is a block diagram of an electronic device 800 for cross-language retrieval according to an exemplary embodiment. For example, the electronic device 500 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, a smart wearable device, etc.

[0152] Reference Figure 5 , the electronic device 500 may include one or more of the following components: a processing component 502 , a memory 504 , a power component 506 , a multimedia component 508 , an audio component 510 , an input / output (I / O) interface 512 , a sensor component 514 , and a communication component 516 .

[0153] The processing component 502 generally controls the overall operation of the electronic device 500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 502 may include one or more processors 520 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 502 may include one or more modules to facilitate the interaction between the processing component 502 and other components. For example, the processing component 502 may include a multimedia module to facilitate the interaction between the multimedia component 508 and the processing component 502.

[0154] The memory 504 is configured to store various types of data to support operations on the electronic device 500. Examples of such data include instructions for any application or method operating on the electronic device 500, contact data, phone book data, messages, pictures, videos, etc. The memory 504 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0155] The power component 506 provides power to the various components of the electronic device 500. The power component 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 500.

[0156] The multimedia component 508 includes a screen that provides an output interface between the electronic device 500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 508 includes a front camera and / or a rear camera. When the electronic device 500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0157] The audio component 510 is configured to output and / or input audio signals. For example, the audio component 510 includes a microphone (MIC), and when the electronic device 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 504 or sent via the communication component 516. In some embodiments, the audio component 510 also includes a speaker for outputting audio signals.

[0158] I / O interface 512 provides an interface between processing component 502 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0159] The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the electronic device 500. For example, the sensor assembly 514 can detect the open / closed state of the electronic device 500, the relative positioning of components, such as the display and keypad of the electronic device 500, and the sensor assembly 514 can also detect the position change of the electronic device 500 or a component of the electronic device 500, the presence or absence of user contact with the electronic device 500, the orientation or acceleration / deceleration of the electronic device 500, and the temperature change of the electronic device 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 514 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0160] The communication component 516 is configured to facilitate wired or wireless communication between the electronic device 500 and other devices. The electronic device 500 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 514 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 514 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0161] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0162] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 504 including instructions, and the instructions can be executed by a processor 520 of an electronic device 500 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0163] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform a cross-language retrieval method, the method comprising:

[0164] Obtaining a search request from a user; the search request comprising a query term in a first language;

[0165] Searching according to the query term in the first language to obtain search results in the second language; the search results include a title in the second language and an abstract in the second language;

[0166] Using a pre-trained translation model, based on the title in the second language and the summary in the second language, the title in the second language is translated into a title in the first language; and the summary in the second language is translated into a summary in the first language;

[0167] Returns the title in the first language and the summary in the first language.

[0168] Optionally, the translation model includes an encoder and a decoder; the using the pre-trained translation model, based on the title in the second language and the summary in the second language, translating the title in the second language to obtain the title in the first language includes:

[0169] generating input features according to the title in the second language and the abstract in the second language, wherein the input features include title features and abstract features;

[0170] The input features are input into the encoder of the translation model, which performs encoding and filters the intermediate features corresponding to the title features generated during the encoding process to filter out irrelevant information learned based on the summary features and retain relevant information learned based on the summary features, and the target features corresponding to the title features obtained after the encoding are fed back to the decoder for decoding to obtain the title in the first language.

[0171] Optionally, the encoder includes a multi-head attention layer and a filtering unit; the multi-head attention layer encodes the title features and the summary features to obtain intermediate features corresponding to the title features and intermediate features corresponding to the summary features; the filtering unit filters irrelevant information learned based on the summary features in the intermediate features corresponding to the title features.

[0172] Optionally, the input features further include: position features and separator features;

[0173] The position feature is used to learn the order attributes of each word in the title and the abstract; the separator feature is used to distinguish the title feature from the abstract feature.

[0174] Optionally, the translation model is trained in the following manner:

[0175] Get parallel corpus data;

[0176] Determine a title and an abstract in a first language and a title and an abstract in a second language according to the parallel corpus data;

[0177] Using the title and abstract in the first language as input to an encoder of the translation model, using the output of the encoder and the title and abstract in the second language as input to a decoder of the translation model, and training the translation model;

[0178] When it is determined according to the output of the decoder that a preset condition is satisfied, it is determined that the training of the translation model is completed.

[0179] Optionally, taking the title and abstract in the first language as input of an encoder of the translation model, taking the output of the encoder and the title and abstract in the second language as input of a decoder of the translation model, and training the translation model comprises:

[0180] Generate first input features in the first language according to the title and abstract in the first language; the first input features include title features, abstract features, position features, and separator features in the first language;

[0181] Inputting the first input feature into an encoder of the translation model, so that the encoder distinguishes the title feature from the abstract feature based on the separator feature, and learns an intermediate feature corresponding to the title feature based on the title feature, the abstract feature, and the sequence attribute of each word in the title and the abstract determined by the position feature;

[0182] generating second input features in the second language according to the title and abstract in the second language; the second input features comprising title features, abstract features, position features, and separator features in the second language;

[0183] The second input feature is input into the decoder of the translation model so that the decoder distinguishes the title feature and the abstract feature based on the separator feature, and learns the intermediate feature corresponding to the title feature based on the title feature, the abstract feature, and the sequential attributes of each word in the title and the abstract determined by the position feature.

[0184] Optionally, the parallel corpus data includes sentences in the first language and sentences in the second language;

[0185] The determining of the title and abstract in the first language and the title and abstract in the second language according to the parallel corpus data comprises:

[0186] determining a predetermined phrase in a sentence in the first language and a sentence in the second language, and aligning them;

[0187] Align the pre-set phrases in the first language sentence with the second language sentence, and use them as the title in the first language and the title in the second language respectively;

[0188] The sentence where the title in the first language is located is used as the abstract in the first language, and the sentence where the title in the second language is located is used as the abstract in the second language.

[0189] Figure 6: This is a structural diagram of an electronic device 600 for cross-language retrieval shown in accordance with another exemplary embodiment of the present application. The electronic device 600 may be a server, which may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 622 (for example, one or more processors) and a memory 632, and one or more storage media 630 (for example, one or more mass storage devices) storing application programs 642 or data 644. Among them, the memory 632 and the storage medium 630 may be temporary storage or permanent storage. The program stored in the storage medium 630 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processor 622 may be configured to communicate with the storage medium 630 and execute a series of instruction operations in the storage medium 630 on the server.

[0190] The server may also include one or more power supplies 626, one or more wired or wireless network interfaces 650, one or more input and output interfaces 658, one or more keyboards 6656, and / or one or more operating systems 641, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0191] In an exemplary embodiment, the server is configured to execute one or more programs including instructions for performing the following operations by one or more central processors 622:

[0192] Obtaining a search request from a user; the search request comprising a query term in a first language;

[0193] Searching according to the query term in the first language to obtain search results in the second language; the search results include a title in the second language and an abstract in the second language;

[0194] Using a pre-trained translation model, based on the title in the second language and the summary in the second language, the title in the second language is translated into a title in the first language; and the summary in the second language is translated into a summary in the first language;

[0195] Returns the title in the first language and the summary in the first language.

[0196] Optionally, the translation model includes an encoder and a decoder; the using the pre-trained translation model, based on the title in the second language and the summary in the second language, translating the title in the second language to obtain the title in the first language includes:

[0197] generating input features according to the title in the second language and the abstract in the second language, wherein the input features include title features and abstract features;

[0198] The input features are input into the encoder of the translation model, which performs encoding and filters the intermediate features corresponding to the title features generated during the encoding process to filter out irrelevant information learned based on the summary features and retain relevant information learned based on the summary features, and the target features corresponding to the title features obtained after the encoding are fed back to the decoder for decoding to obtain the title in the first language.

[0199] Optionally, the encoder includes a multi-head attention layer and a filtering unit; the multi-head attention layer encodes the title features and the summary features to obtain intermediate features corresponding to the title features and intermediate features corresponding to the summary features; the filtering unit filters irrelevant information learned based on the summary features in the intermediate features corresponding to the title features.

[0200] Optionally, the input features further include: position features and separator features;

[0201] The position feature is used to learn the order attributes of each word in the title and the abstract; the separator feature is used to distinguish the title feature from the abstract feature.

[0202] Optionally, the method further comprises instructions for performing the following training of the translation model:

[0203] Get parallel corpus data;

[0204] Determine a title and an abstract in a first language and a title and an abstract in a second language according to the parallel corpus data;

[0205] Using the title and abstract in the first language as input to an encoder of the translation model, using the output of the encoder and the title and abstract in the second language as input to a decoder of the translation model, and training the translation model;

[0206] When it is determined according to the output of the decoder that a preset condition is satisfied, it is determined that the training of the translation model is completed.

[0207] Optionally, taking the title and abstract in the first language as input of an encoder of the translation model, taking the output of the encoder and the title and abstract in the second language as input of a decoder of the translation model, and training the translation model comprises:

[0208] Generate first input features in the first language according to the title and abstract in the first language; the first input features include title features, abstract features, position features, and separator features in the first language;

[0209] Inputting the first input feature into an encoder of the translation model, so that the encoder distinguishes the title feature from the abstract feature based on the separator feature, and learns an intermediate feature corresponding to the title feature based on the title feature, the abstract feature, and the sequence attribute of each word in the title and the abstract determined by the position feature;

[0210] generating second input features in the second language according to the title and abstract in the second language; the second input features comprising title features, abstract features, position features, and separator features in the second language;

[0211] The second input feature is input into the decoder of the translation model so that the decoder distinguishes the title feature and the abstract feature based on the separator feature, and learns the intermediate feature corresponding to the title feature based on the title feature, the abstract feature, and the sequential attributes of each word in the title and the abstract determined by the position feature.

[0212] Optionally, the parallel corpus data includes sentences in the first language and sentences in the second language;

[0213] The determining of the title and abstract in the first language and the title and abstract in the second language according to the parallel corpus data comprises:

[0214] determining a predetermined phrase in a sentence in the first language and a sentence in the second language, and aligning them;

[0215] Align the pre-set phrases in the first language sentence with the second language sentence, and use them as the title in the first language and the title in the second language respectively;

[0216] The sentence where the title in the first language is located is used as the abstract in the first language, and the sentence where the title in the second language is located is used as the abstract in the second language.

[0217] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned cross-language retrieval method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0218] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0219] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more machine-readable media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0220] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0221] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0222] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0223] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0224] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0225] The above is a detailed introduction to a cross-language retrieval method and a cross-language retrieval device provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A cross-language retrieval method, characterized in that: The method comprises: Obtaining a search request from a user; the search request comprising a query term in a first language; Searching according to the query term in the first language to obtain search results in the second language; the search results include a title in the second language and an abstract in the second language; generating input features according to the title in the second language and the abstract in the second language, wherein the input features include title features and abstract features; the translation model includes an encoder and a decoder; The input feature is input into the encoder of the translation model, and the encoder performs encoding, and the intermediate feature corresponding to the title feature generated during the encoding process is filtered to filter irrelevant information learned based on the summary feature and retain relevant information learned based on the summary feature, and the target feature corresponding to the title feature obtained after the encoding is fed back to the decoder for decoding to obtain the title in the first language; the target feature corresponding to the summary feature obtained after the encoding is discarded and not used; and the summary in the second language is translated to obtain a summary in the first language; Returns the title in the first language and the summary in the first language.

2. The method according to claim 1, characterized in that The encoder includes a multi-head attention layer and a filtering unit; the multi-head attention layer encodes the title features and the summary features to obtain intermediate features corresponding to the title features and intermediate features corresponding to the summary features; the filtering unit filters irrelevant information learned based on the summary features in the intermediate features corresponding to the title features.

3. The method according to claim 1, characterized in that The input features also include: position features and separator features; The position feature is used to learn the order attributes of each word in the title and the abstract; the separator feature is used to distinguish the title feature from the abstract feature.

4. The method according to claim 1, characterized in that: The translation model is trained in the following way: Get parallel corpus data; Determining a title and an abstract in a first language and a title and an abstract in a second language according to the parallel corpus data; Using the title and abstract in the first language as input to an encoder of the translation model, using the output of the encoder and the title and abstract in the second language as input to a decoder of the translation model, and training the translation model; When it is determined according to the output of the decoder that a preset condition is satisfied, it is determined that the training of the translation model is completed.

5. The method according to claim 4, characterized in that The using the title and abstract in the first language as inputs of an encoder of the translation model, using the output of the encoder and the title and abstract in the second language as inputs of a decoder of the translation model, and training the translation model, comprises: Generate first input features in the first language according to the title and abstract in the first language; the first input features include title features, abstract features, position features, and separator features in the first language; Inputting the first input feature into an encoder of the translation model, so that the encoder distinguishes the title feature from the abstract feature based on the separator feature, and learns an intermediate feature corresponding to the title feature based on the title feature, the abstract feature, and the sequence attribute of each word in the title and the abstract determined by the position feature; generating second input features in the second language according to the title and abstract in the second language; the second input features comprising title features, abstract features, position features, and separator features in the second language; The second input feature is input into the decoder of the translation model so that the decoder distinguishes the title feature and the abstract feature based on the separator feature, and learns the intermediate feature corresponding to the title feature based on the title feature, the abstract feature, and the sequential attributes of each word in the title and the abstract determined by the position feature.

6. The method according to claim 4, characterized in that The parallel corpus data includes sentences in the first language and sentences in the second language; The determining of the title and abstract in the first language and the title and abstract in the second language according to the parallel corpus data comprises: determining a predetermined phrase in a sentence in the first language and a sentence in the second language, and aligning them; Align the pre-set phrases in the first language sentence with the second language sentence, and use them as the title in the first language and the title in the second language respectively; The sentence where the title in the first language is located is used as the abstract in the first language, and the sentence where the title in the second language is located is used as the abstract in the second language.

7. A cross-language search device, characterized in that: The device comprises: A request acquisition module, used to acquire a search request from a user; the search request includes a query term in a first language; A search module, configured to search based on the query term in the first language to obtain search results in a second language; the search results include a title in the second language and an abstract in the second language; A translation module, configured to use a pre-trained translation model, based on the title in the second language and the summary in the second language, to translate the title in the second language into the title in the first language; and to translate the summary in the second language into the summary in the first language; the translation model includes an encoder and a decoder; A returning module, used for returning a title in the first language and a summary in the first language; Wherein, the translation module includes: An input feature generation submodule, configured to generate input features according to the title in the second language and the abstract in the second language, wherein the input features include title features and abstract features; The model translation submodule is used to input the input features into the encoder of the translation model, which is encoded by the encoder, and filter the intermediate features corresponding to the title features generated during the encoding process to filter out irrelevant information learned based on the summary features and retain relevant information learned based on the summary features, and feed back the target features corresponding to the title features obtained after the encoding to the decoder for decoding to obtain the title in the first language; the target features corresponding to the summary features obtained after the encoding are discarded and not used.

8. The device according to claim 7, characterized in that The encoder includes a multi-head attention layer and a filtering unit; the multi-head attention layer encodes the title features and the summary features to obtain intermediate features corresponding to the title features and intermediate features corresponding to the summary features; the filtering unit filters irrelevant information learned based on the summary features in the intermediate features corresponding to the title features.

9. The device according to claim 7, characterized in that The translation model is trained by the following modules: A parallel corpus data acquisition module, used to acquire parallel corpus data; A corpus data processing module, used for determining a title and an abstract in a first language and a title and an abstract in a second language according to the parallel corpus data; a model training module, configured to use the title and abstract in the first language as inputs of an encoder of the translation model, and use the output of the encoder and the title and abstract in the second language as inputs of a decoder of the translation model to train the translation model; The model determination module is used to determine that the training of the translation model is completed when it is determined according to the output of the decoder that a preset condition is met.

10. The device according to claim 9, characterized in that The model training module includes: A first feature generation submodule, configured to generate first input features in the first language according to the title and abstract in the first language; the first input features include title features, abstract features, position features, and separator features in the first language; A first training submodule is configured to input the first input feature into an encoder of the translation model, so that the encoder distinguishes the title feature from the abstract feature based on the separator feature, and learns an intermediate feature corresponding to the title feature based on the title feature, the abstract feature, and an order attribute of each word in the title and the abstract determined by the position feature; A second feature generation submodule is used to generate second input features in the second language according to the title and abstract in the second language; the second input features include title features, abstract features, position features and separator features in the second language; The second training submodule is used to input the second input feature into the decoder of the translation model so that the decoder distinguishes the title feature and the abstract feature based on the separator feature, and learns the intermediate feature corresponding to the title feature based on the title feature, the abstract feature, and the sequential attribute of each word in the title and the abstract determined by the position feature.

11. The device according to claim 10, characterized in that The parallel corpus data includes sentences in the first language and sentences in the second language; The corpus data processing module comprises: a phrase determination submodule, configured to determine preset phrases in the sentence in the first language and the sentence in the second language, and align them; a title determination submodule, for aligning the preset phrases in the sentence in the first language with the sentence in the second language as the title in the first language and the title in the second language respectively; The summary determination submodule is used to use the sentence where the title in the first language is located as the summary in the first language, and to use the sentence where the title in the second language is located as the summary in the second language.

12. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the cross-language search method according to any one of claims 1 to 6 are implemented.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the cross-language search method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Cross-language search method and device and device for cross-language search

    CN108304412A