Text processing method and device, equipment, readable storage medium and program product

By combining the first and second prediction models to predict and filter the similarity between the target text and related texts, the problem of low text ranking accuracy in content search scenarios is solved, and more efficient and accurate text ranking results are achieved.

CN120994819APending Publication Date: 2025-11-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410619563.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-17
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

In existing technologies, the accuracy of text ranking in content search scenarios is low, and it is difficult to effectively utilize information such as access rate, publication time and content relevance of multiple texts for accurate ranking.

Method used

A method combining a first prediction model and a second prediction model is adopted. By predicting the similarity between the target text and related texts, texts with high similarity are filtered out, and the final ranking result is determined by the combined similarity of the two models. The first prediction model has a simple structure and is used for fast filtering, while the second prediction model has a complex structure and is used to improve accuracy.

Benefits of technology

It improves the accuracy and efficiency of text sorting in content search scenarios, ensuring more accurate sorting results for filtered text and enhancing the content search experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994819A_ABST
    Figure CN120994819A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a text processing method and device, equipment, a readable storage medium and a program product, which can be applied to the fields of cloud technology, artificial intelligence, large models and the like, and the method comprises the following steps: respectively performing similarity prediction processing on a target text and a plurality of associated texts of the target text by utilizing a first prediction model to obtain a first prediction result; the first prediction result comprises a first similarity between the target text and each associated text of the target text; determining a plurality of screening texts from a plurality of associated texts of the target text according to the first prediction result, and performing similarity prediction processing on the target text and the plurality of screening texts by using a second prediction model to obtain a second prediction result; the second prediction result comprises a second similarity between the target text and each screening text; and according to the first similarity and the second similarity of the plurality of screened texts, determining a sorting result of the plurality of screened texts. According to the embodiment of the invention, the accuracy of text sorting in a content search scene can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to text processing methods, text processing apparatus, computer equipment, computer-readable storage media, and computer program products. Background Technology

[0002] In content search scenarios, it's necessary to retrieve search text such as keywords and determine the ranking of the retrieved texts so that they can be displayed in a sorted manner. However, the ranking is usually determined based on information such as the access rate, publication time, and content relevance of the retrieved texts, leading to low accuracy in text ranking. Therefore, improving the accuracy of text ranking in content search scenarios is a pressing issue that needs to be addressed. Summary of the Invention

[0003] This application provides a text processing method, apparatus, device, readable storage medium, and program product that can improve the accuracy of text sorting in content search scenarios.

[0004] On one hand, embodiments of this application provide a text processing method, which includes:

[0005] The first prediction model is used to perform similarity prediction on the target text and multiple associated texts of the target text to obtain the first prediction result; the first prediction result includes the first similarity between the target text and each associated text of the target text; wherein, the first prediction model is obtained by training the first initial model using the similarity prediction results of multiple first training text pairs output by the second prediction model, and each first training text pair includes the first training text and one associated text of the first training text;

[0006] Based on the first prediction result, multiple filter texts are determined from multiple related texts of the target text. The second prediction model is then used to perform similarity prediction processing on the target text and the multiple filter texts respectively to obtain the second prediction result. The second prediction result includes the second similarity between the target text and each filter text.

[0007] The ranking of multiple selected texts is determined based on the first and second similarity scores of the selected texts. The second prediction model is trained on the second initial model using the first and second difference data. The first difference data is determined based on the labeled similarity of multiple second training text pairs, the similarity prediction results of multiple second training text pairs output by the second initial model, and the ranking information of multiple second training text pairs. The second difference data is determined based on the labeled similarity and similarity prediction results of multiple second training text pairs. Each second training text pair includes the second training text and a related text of the second training text.

[0008] On the other hand, embodiments of this application provide a text processing apparatus, which includes:

[0009] The processing unit is used to perform similarity prediction processing on the target text and multiple associated texts of the target text using a first prediction model to obtain a first prediction result; the first prediction result includes a first similarity between the target text and each associated text of the target text; wherein, the first prediction model is obtained by training a first initial model using the similarity prediction results of multiple first training text pairs output by a second prediction model, and each first training text pair includes a first training text and an associated text of the first training text;

[0010] The processing unit is further configured to determine multiple filter texts from multiple associated texts of the target text based on the first prediction result, and to perform similarity prediction processing on the target text and the multiple filter texts respectively using the second prediction model to obtain the second prediction result; the second prediction result includes the second similarity between the target text and each filter text.

[0011] The ranking unit is used to determine the ranking result of multiple selected texts based on the first similarity and the second similarity of multiple selected texts. The second prediction model is obtained by training the second initial model using the first difference data and the second difference data. The first difference data is determined based on the labeled similarity of multiple second training text pairs, the similarity prediction results of multiple second training text pairs output by the second initial model, and the ranking information of multiple second training text pairs. The second difference data is determined based on the labeled similarity and the similarity prediction results of multiple second training text pairs. Each second training text pair includes the second training text and a related text of the second training text.

[0012] In one possible implementation, the sorting unit, when determining the sorting result of multiple filtered texts based on a first similarity and a second similarity, specifically performs the following:

[0013] Obtain the first weighted parameter and the second weighted parameter;

[0014] The first similarity and second similarity of each screened text are weighted using the first weighting parameter and the second weighting parameter to obtain the fusion similarity of each screened text;

[0015] The multiple filter texts are sorted by fusion similarity to obtain the sorted results.

[0016] In one possible implementation, the text processing device further includes a training unit, which is also used for:

[0017] Obtain multiple second training text pairs and the labeled similarity of each second training text pair;

[0018] The second initial model is used to perform similarity prediction on each second training text pair, including the second training text and the associated text, to obtain the similarity prediction results of multiple second training text pairs; the similarity prediction results of multiple second training text pairs include the third similarity between the second training text and each associated text of the second training text.

[0019] Based on the sample type and similarity prediction results of multiple second training text pairs, determine the ranking information of multiple second training text pairs;

[0020] The first difference data is determined based on the annotation similarity, similarity prediction results and ranking information of multiple second training text pairs, and the second difference data is determined based on the annotation similarity and similarity prediction results of multiple second training text pairs.

[0021] The model parameters of the second initial model are adjusted based on the first and second difference data to obtain the second prediction model.

[0022] In one possible implementation, when the training unit determines the ranking information of multiple second training text pairs based on the sample type and similarity prediction results, it specifically performs the following:

[0023] Determine the sample type for each second training text pair; the sample type includes positive samples and negative samples;

[0024] From multiple second training text pairs, identify multiple positive sample text pairs with positive sample type and multiple negative sample text pairs with negative sample type;

[0025] The third similarity of multiple positive sample text pairs is sorted in descending order to obtain the ranking information of the positive sample text pairs; the third similarity of multiple negative sample text pairs is sorted in descending order to obtain the ranking information of the negative sample text pairs.

[0026] Based on the ranking information of positive sample text pairs and negative sample text pairs, the ranking information of multiple second training text pairs is determined.

[0027] In one possible implementation, when the training unit is used to determine the first difference data based on the labeled similarity, similarity prediction results, and ranking information of multiple second training text pairs, it specifically uses:

[0028] Based on the sorting information of multiple second training text pairs, determine the first similarity sequence composed of the third similarity of multiple second training text pairs;

[0029] Based on the sorting information of multiple second training text pairs, determine the second similarity sequence composed of the labeled similarity of multiple second training text pairs;

[0030] The difference between the first similarity sequence and the second similarity sequence is calculated to obtain the first difference data.

[0031] In one possible implementation, multiple second training text pairs are selected from the set of training text pairs corresponding to the second training text;

[0032] Specifically, when the training unit is used to adjust the model parameters of the second initial model based on the first difference data and the second difference data to obtain the second prediction model, it is used for:

[0033] The first and second difference data are summed to obtain the summation result;

[0034] Select multiple new second training text pairs from the training text pair set, and determine the new summation result based on the multiple new second training text pairs;

[0035] The model parameters of the second initial model are adjusted based on the summation results and the new summation results to obtain the second prediction model.

[0036] In one possible implementation, the training unit is also used for:

[0037] Obtain multiple first training text pairs;

[0038] The first initial model is used to perform similarity prediction on each first training text pair, including the first training text and the associated text, to obtain the similarity prediction results of multiple first training text pairs; the similarity prediction results of multiple first training text pairs include the fourth similarity between the first training text and each associated text of the first training text.

[0039] The second prediction model is used to perform similarity prediction on each first training text pair, including the first training text and the associated text, to obtain the prediction result of the second prediction model; the prediction result of the second prediction model includes the fifth similarity between the first training text and each associated text of the first training text.

[0040] Based on the similarity prediction results of multiple first training text pairs and the prediction results of the second prediction model, third difference data is determined. The model parameters of the first initial model are adjusted according to the third difference data to obtain the first prediction model.

[0041] In one possible implementation, when the processing unit determines multiple filter texts from multiple associated texts of the target text based on the first prediction result, it specifically performs the following:

[0042] From the multiple first similarities included in the first prediction results, select the target first similarity with a first similarity greater than the similarity threshold, and determine the associated text corresponding to the target first similarity as the filtered text;

[0043] Alternatively, the multiple first similarities included in the first prediction result can be sorted in descending order, and the associated texts corresponding to the first similarities ranked in the top K positions of the descending sort result can be determined as the filter texts, where K is a positive integer.

[0044] Accordingly, embodiments of this application provide a computer device, which includes:

[0045] A processor is a tool for implementing computer programs.

[0046] A computer-readable storage medium storing a computer program adapted to be loaded by a processor and executed by the above-described text processing method.

[0047] Accordingly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when read and executed by a processor of a computer device, causes the computer device to perform the aforementioned text processing method.

[0048] Accordingly, this application provides a computer program product comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the aforementioned text processing method.

[0049] This application embodiment utilizes a first prediction model to perform similarity prediction processing on the target text and multiple related texts of the target text, obtaining a first prediction result. Based on the first prediction result, multiple filter texts are determined from the multiple related texts of the target text, thereby removing related texts with low similarity to the target text. Then, a second prediction model is used to perform similarity prediction processing on the target text and multiple filter texts, obtaining a second prediction result. Finally, based on the first similarity of the multiple filter texts in the first prediction result and the second similarity in the second prediction result, the ranking result of the multiple filter texts is determined. The above method comprehensively considers the first and second similarities between each filter text and the target text, ensuring the accuracy of the ranking result of the multiple filter texts, improving the accuracy of text ranking in content search scenarios, and enhancing the content search experience. Furthermore, this application embodiment pre-trains the second prediction model, and then uses the prediction result of the second prediction model to train the first prediction model, ensuring the similarity prediction capabilities of the first and second prediction models. By using the first prediction result of the first prediction model to filter multiple related texts, and then using the first prediction result of the first prediction model and the second prediction result of the second prediction model to determine the ranking result of the multiple filter texts, the efficiency and accuracy of text ranking are balanced. Attached Figure Description

[0050] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.

[0051] Figure 1 This is a schematic diagram of the architecture of a text processing system provided in an embodiment of this application;

[0052] Figure 2 This is a flowchart illustrating a text processing method provided in an embodiment of this application;

[0053] Figure 3 This is a flowchart illustrating another text processing method provided in an embodiment of this application;

[0054] Figure 4 This is a schematic diagram of an interface for a content search scenario provided in an embodiment of this application;

[0055] Figure 5 This is a schematic diagram of the structure of a text processing device provided in an embodiment of this application;

[0056] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0057] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0058] This application involves target text, training text (including first training text and second training text), associated text, etc. When the above embodiments of this application are applied to specific products or technologies, the relevant data collection, use and processing processes should comply with the requirements of relevant laws and regulations. Before data collection, the information processing rules should be informed and the individual consent of the subject should be obtained. Data should be processed in strict accordance with the requirements of laws and regulations and personal information processing rules, and technical measures should be taken to ensure the security of relevant data.

[0059] The embodiments of this application can be applied to various fields or scenarios such as cloud computing, cloud IoT, cloud gaming, artificial intelligence, large models, vehicle in-vehicle systems, intelligent transportation, assisted driving, and content search. Several typical fields or scenarios will be introduced below.

[0060] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0061] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, pre-trained model technology, operating / interactive systems, and mechatronics. Pre-trained models, also known as large models or foundational models, can be widely applied to downstream tasks across various AI fields after fine-tuning. AI software technologies mainly include computer vision, speech processing, natural language processing, and machine learning / deep learning. The solutions provided in this application relate to technologies under the umbrella of artificial intelligence, such as natural language processing, machine learning, and pre-trained models, which will be described below:

[0062] Natural Language Processing (NLP) is an important field within computer science and artificial intelligence. It studies the theories and methods that enable effective communication between humans and computers using natural language. NLP deals with natural language, the language people use in daily life, and is closely related to linguistics. NLP techniques typically include text processing, semantic understanding, machine translation, question answering, and knowledge graphs.

[0063] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and pre-trained learning. Pre-trained models are the latest development in deep learning, integrating all of these techniques.

[0064] Pre-trained models, also known as foundational models or large models, refer to deep neural networks (DNNs) with a large number of parameters. These DNNs are trained on massive amounts of unlabeled data. Leveraging the function approximation capabilities of large-parameter DNNs, Prompt-Transformer (PTM) extracts common features from the data. Through fine-tuning, efficient parameter fine-tuning (PEFT), and prompt-tuning techniques, they are suitable for downstream tasks. Therefore, pre-trained models can achieve ideal results in small-shot or zero-shot scenarios. PTMs can be categorized according to the data modality they process, such as language models (ELMO, BERT, GPT), visual models (swin-transformer, ViT, V-MOE), speech models (VALL-E), and multimodal models (ViBERT, CLIP, Flamingo, Gato). Multimodal models refer to models that establish feature representations for two or more data modalities. Pre-trained models are important tools for outputting AI-generated content (AIGC) and can also serve as a general interface connecting multiple task-specific models. In this application embodiment, a first prediction model and a second prediction model are constructed for text ranking in content search scenarios, thereby improving the accuracy of text ranking.

[0065] With the research and advancement of artificial intelligence (AI) technology, AI is being studied and applied in various fields, such as smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, autonomous driving, drones, digital twins, virtual humans, robots, AI-generated content (AIGC), conversational interaction, smart healthcare, smart customer service, and game AI. It is believed that with the development of technology, AI will be applied in more fields and play an increasingly important role.

[0066] The text processing system provided in the embodiments of this application is described below with reference to the accompanying drawings. The text processing system is suitable for implementing the text processing method provided in the embodiments of this application.

[0067] Please see Figure 1 This figure is a schematic diagram of the architecture of a text processing system provided in an embodiment of this application. The text processing system may specifically include a terminal device 101 and a server 102. The terminal device 101 and the server 102 are connected via a network, such as a local area network (LAN), a wide area network (WAN), or the mobile internet.

[0068] Terminal equipment 101 may also be referred to as terminal, user equipment (UE), access terminal, user unit, mobile device, user terminal, wireless communication equipment, user agent, or user device. Terminal equipment may be a smart home appliance, a handheld device with wireless communication capabilities (such as a smartphone or tablet), a computing device (such as a personal computer (PC)), an in-vehicle terminal, a smart voice interaction device, a wearable device, or other smart devices, but is not limited to these.

[0069] Server 102 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0070] In one possible implementation, server 102 may pre-train a first prediction model and a second prediction model, and configure the trained first prediction model and the second prediction model on the local end (e.g., on server 102). The model training process of the first prediction model and the second prediction model will be described in detail in subsequent embodiments, and will not be repeated here.

[0071] In one possible implementation, terminal device 101 can send a content search request to server 102, wherein the content search request may carry the target text to be searched; then, server 102 performs text recall processing on the target text, such as selecting recall candidate texts from the various candidate texts included in the text content database based on information such as the content relevance between the target text and each candidate text, the access rate of each candidate text, and the publication time, that is, selecting multiple related texts of the target text from the text content database.

[0072] Then, server 102 uses a trained first prediction model to perform similarity prediction processing on the target text and multiple related texts of the target text, respectively, to obtain a first prediction result. The first prediction result includes the first similarity between the target text and each related text of the target text. Server 102 then determines multiple filter texts from the multiple related texts of the target text based on the first prediction result (e.g., selecting multiple related texts with high first similarity as filter texts), and uses a trained second prediction model to perform similarity prediction processing on the target text and the multiple filter texts, respectively, to obtain a second prediction result. The second prediction result includes the second similarity between the target text and each filter text. Server 102 then determines the sorting result of the multiple filter texts based on the first and second similarities of the multiple filter texts. Finally, server 102 returns the sorting result of the multiple filter texts to terminal device 101, so that terminal device 101 can sort and display the multiple filter texts according to the sorting result.

[0073] It is understood that the system architecture diagrams described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. For example, the text processing method provided in the embodiments of this application can be executed not only by server 102, but also by other servers or server clusters that are different from server 102 and can communicate with terminal device 101 and / or server 102. Those skilled in the art will understand that... Figure 1 The number of terminal devices and servers shown is merely illustrative. Any number of terminal devices and servers can be configured according to business needs. Furthermore, as system architecture evolves and new business scenarios emerge, the technical solutions provided in this application are also applicable to similar technical problems. In subsequent embodiments, "terminal device" will refer to the aforementioned terminal device 101, and "server" will refer to the aforementioned server 102; further details will not be repeated in subsequent embodiments.

[0074] The text processing method provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0075] This application provides a text processing method that can be executed by a computer device, such as a computer device that can be... Figure 1 Server 102 in the text processing system shown. For example... Figure 2 As shown, the text processing method may include, but is not limited to, the following steps S201-S204:

[0076] S201. Using the first prediction model, perform similarity prediction processing on the target text and multiple associated texts of the target text respectively to obtain the first prediction result; the first prediction result includes the first similarity between the target text and each associated text of the target text.

[0077] In this embodiment, target text refers to the query text used for content search in a content search scenario, and associated text refers to text related to the target text in the content search scenario. Here, "associated" can mean semantically similar. For example, target text can refer to a word, phrase, or sentence entered by the user in a search engine, and multiple associated texts of the target text can refer to multiple matching results retrieved through the target text. Matching results can be words, phrases, sentences, text fragments, etc.

[0078] In one possible implementation, the multiple associated texts of the target text can be determined by a computer device based on the target text, or they can be directly obtained by the computer device. The recall method for determining the multiple associated texts of the target text can be implemented using an algorithm (such as a keyword matching algorithm). To ensure recall efficiency, the algorithms used are usually relatively simple, which leads to inaccurate results for the multiple associated texts of the target text (that is, the relevance between each associated text and the target text is unclear, making it difficult to accurately sort and display these multiple associated texts). Therefore, this embodiment of the application needs to further filter and sort the multiple associated texts of the target text to generate more accurate sorting results and ensure the accuracy of the search results displayed in the content search scenario.

[0079] In this embodiment, the first prediction model refers to a pre-trained model with similarity prediction capabilities. A computer device can use the first prediction model to perform similarity prediction processing on the target text and multiple associated texts of the target text, obtaining a first prediction result (the first prediction result includes the first similarity between the target text and each associated text). The first prediction model has a relatively simple structure, ensuring the efficiency of obtaining the first similarity between the target text and each associated text. The first prediction result generated by the first prediction model provides a basis for the subsequent text filtering process.

[0080] S202. Based on the first prediction result, determine multiple filter texts from multiple related texts of the target text.

[0081] In this embodiment of the application, since the multiple associated texts of the target text are not accurate, the computer device can filter the multiple associated texts of the target text according to the first prediction result to obtain multiple filtered texts, thereby removing associated texts with low similarity to the target text, which can effectively reduce the amount of subsequent calculations.

[0082] In one possible implementation, a computer device can filter out multiple related texts with high first similarity from multiple related texts of the target text based on a first prediction result, and determine the filtered related texts as the filter texts, thus obtaining multiple filter texts. The above process can be viewed as a text filtering process, which can eliminate related texts with low similarity to the target text, retaining only the related texts with high similarity as filter texts, ensuring the quality of the filter texts. The filter texts are used to generate ranking results, thereby ensuring the quality of each search result displayed in the content search scenario (each search result includes one filter text), and improving the content search experience.

[0083] S203. Use the second prediction model to perform similarity prediction processing on the target text and multiple selected texts respectively to obtain the second prediction result; the second prediction result includes the second similarity between the target text and each selected text.

[0084] In this embodiment, the second prediction model refers to a pre-trained model with similarity prediction capabilities. A computer device can use the second prediction model to perform similarity prediction processing on the target text and multiple selected texts respectively, obtaining a second prediction result (the second prediction result includes the second similarity between the target text and each selected text of the target text). The second prediction model has a relatively complex structure. Using the second prediction model to predict the second similarity ensures the accuracy of the second similarity between the target text and each selected text. Since the selected texts are determined from multiple related texts of the target text, for each selected text, the first similarity can be obtained through the prediction of the first prediction model, and the second similarity can be obtained through the prediction of the second prediction model. This provides a basis for the subsequent similarity fusion process.

[0085] S204. Determine the ranking result of multiple screened texts based on the first similarity and second similarity of the multiple screened texts.

[0086] In this embodiment, the computer device can determine the ranking result of multiple filtered texts based on the first and second similarities of the filtered texts. That is, it fuses the first and second similarities of each filtered text and determines the ranking result based on the fused similarity of the multiple filtered texts. This method comprehensively considers the similarity information of each filtered text in the first and second prediction results, ensuring that the ranking result does not solely rely on the similarity prediction result of a single prediction model. This guarantees the accuracy of the ranking result of multiple filtered texts, thereby improving the accuracy of text ranking in content search scenarios and enhancing the content search experience.

[0087] In this embodiment, the first prediction model has a relatively simple structure, while the second prediction model has a relatively complex structure, thus balancing the efficiency and accuracy of text ranking. Therefore, the computer device can first train the second prediction model and then transfer the similarity prediction capability learned by the second prediction model to the first prediction model, which reduces the model size while ensuring the model reasoning capability of the first prediction model.

[0088] Based on this, the computer device can pre-prepare multiple first training text pairs, each first training text pair including a first training text and a related text of the first training text. The first training text may refer to the query text used for content search in the content search scenario, and the related text may refer to the text associated with the target text in the content search scenario. Here, association may mean semantic similarity.

[0089] So, the first prediction model is obtained by training the first initial model using the similarity prediction results of multiple first training text pairs output by the second prediction model. Here, the similarity prediction results of multiple first training text pairs output by the second prediction model can be used as labels. The first prediction model is trained using the above labels, which enables the first prediction model to learn the knowledge of the second prediction model (that is, the similarity prediction ability).

[0090] The second prediction model is obtained by training the second initial model using the first difference data and the second difference data. The first difference data is determined based on the labeled similarity of multiple second training text pairs, the similarity prediction results of multiple second training text pairs output by the second initial model, and the ranking information of multiple second training text pairs. The second difference data is determined based on the labeled similarity and similarity prediction results of multiple second training text pairs. Each second training text pair includes the second training text and a related text of the second training text.

[0091] In other words, the computer device can pre-prepare multiple second training text pairs, each pair including the second training text and a related text. Based on this, the second prediction model can output similarity prediction results for multiple second training text pairs. Then, the computer device can determine first difference data (such as loss values) based on the labeled similarity, similarity prediction results, and ranking information of the multiple second training text pairs, and determine second difference data (such as loss values) based on the labeled similarity and similarity prediction results of the multiple second training text pairs. Finally, the computer device uses the first and second difference data to train the second initial model (such as adjusting model parameters) to obtain the second prediction model.

[0092] The ranking information of multiple second training text pairs (that is, the ranking information of multiple related texts of the second training text) can provide the second prediction model with a ranking reference for multiple second training text pairs, such as what ranking result should multiple second training text pairs correspond to, which helps the model better understand the similarity relationship between multiple related texts of the second training text and the second training text, thereby improving the accuracy of the model's prediction results.

[0093] Based on the above embodiments, the beneficial effects of this application are as follows: This application utilizes a first prediction model to perform similarity prediction processing on the target text and multiple associated texts of the target text, respectively, to obtain a first prediction result; based on the first prediction result, multiple filter texts are determined from the multiple associated texts of the target text, thereby removing associated texts with low similarity to the target text; then, a second prediction model is used to perform similarity prediction processing on the target text and the multiple filter texts, respectively, to obtain a second prediction result; finally, based on the first similarity of the multiple filter texts in the first prediction result and the second similarity in the second prediction result, the ranking result of the multiple filter texts is determined. The above method comprehensively considers the first and second similarities between each filter text and the target text, ensuring the accuracy of the ranking result of the multiple filter texts, improving the accuracy of text ranking in content search scenarios, and enhancing the content search experience. Furthermore, in this embodiment, a second prediction model is pre-trained, and the prediction results of the second prediction model are then used to train the first prediction model, ensuring the similarity prediction capabilities of the first and second prediction models. The first prediction results of the first prediction model are used to filter multiple related texts, and the first prediction results of the first prediction model and the second prediction results of the second prediction model are used to determine the ranking results of the multiple filtered texts, thereby balancing the efficiency and accuracy of text ranking.

[0094] This application provides another text processing method, which can be executed by a computer device, such as a computer device that can be... Figure 1Server 102 in the text processing system shown. For example... Figure 3 As shown, the text processing method may include, but is not limited to, the following steps S301-S306:

[0095] S301. Using the first prediction model, perform similarity prediction processing on the target text and multiple associated texts of the target text respectively to obtain the first prediction result; the first prediction result includes the first similarity between the target text and each associated text of the target text.

[0096] In this embodiment, the first prediction model refers to a pre-trained model with similarity prediction capabilities. A computer device can use the first prediction model to perform similarity prediction processing on the target text and multiple associated texts of the target text, obtaining a first prediction result (the first prediction result includes the first similarity between the target text and each associated text). The first prediction model has a relatively simple structure, ensuring the efficiency of obtaining the first similarity between the target text and each associated text. The first prediction result generated by the first prediction model provides a basis for the subsequent text filtering process.

[0097] In one possible implementation, the first prediction model can use a pre-trained language model, such as a Transformer-based Bidirectional Encoder Representations from Transformers (BERT) model, for example, the BERT model here may include 3 encoder layers.

[0098] S302. Based on the first prediction result, determine multiple filter texts from multiple related texts of the target text.

[0099] In this embodiment of the application, since the multiple associated texts of the target text are not accurate, the computer device can filter the multiple associated texts of the target text according to the first prediction result to obtain multiple filtered texts, thereby removing associated texts with low similarity to the target text, which can effectively reduce the amount of subsequent calculations.

[0100] In one possible implementation, step S302 can be implemented as follows: from the multiple first similarities included in the first prediction result, select the target first similarity whose first similarity is greater than the similarity threshold, and determine the associated text corresponding to the target first similarity as the filtered text.

[0101] For example, if the target text has 1000 associated texts, then there is a first similarity score between the target text and each associated text, resulting in 1000 first similarity scores for the target text. Based on this, the computer device can select target first similarities from these 1000 first similarities that have a first similarity score greater than a similarity threshold. For example, if the similarity threshold is 0.85, then the first similarities greater than 0.85 among the 1000 first similarities are the target first similarities. In other words, the associated texts corresponding to all first similarities greater than 0.85 are determined as the filtered texts.

[0102] It should be noted that the similarity threshold can be flexibly set according to the actual business situation, such as 0.6, 0.8, 0.9, 0.95, etc., and this application embodiment does not limit it in this way.

[0103] In one possible implementation, another implementation of step S302 can be as follows: sort the multiple first similarities included in the first prediction result in descending order, and determine the associated texts corresponding to the first similarities ranked in the top K positions in the descending order as the filtered texts, where K is a positive integer.

[0104] For example, if the target text has 1000 associated texts, the computer device can sort the 1000 first similarity values ​​in descending order to obtain the descending sort result, and select the first similarity values ​​ranked in the top K from the descending sort result. The associated texts corresponding to the selected first similarity values ​​ranked in the top K are determined as the filter texts. For example, the computer device can select the associated texts corresponding to the first 50 first similarity values ​​as the filter texts.

[0105] It should be noted that the size of K can be flexibly set according to the actual business situation, such as 10, 100, 200, etc., and this application embodiment does not limit it in this way.

[0106] The first method for determining multiple filter texts uses a similarity threshold. This quickly identifies texts with high similarity to the target text from a large volume of related texts, making it suitable for situations with large datasets and a need to rapidly narrow down the scope, such as initially filtering documents related to a specific topic from a massive amount of data. The second method uses similarity ranking to determine the filter texts. This more accurately identifies the multiple texts with the highest similarity to the target text and allows for flexible determination of the number of filter texts to be selected, making it suitable for situations requiring precise control over the number of filter texts. Choosing the appropriate method from these two approaches based on the actual business needs improves the flexibility of determining multiple filter texts.

[0107] S303. Use the second prediction model to perform similarity prediction processing on the target text and multiple selected texts respectively to obtain the second prediction result; the second prediction result includes the second similarity between the target text and each selected text.

[0108] In this embodiment, the second prediction model refers to a pre-trained model with similarity prediction capabilities. A computer device can use the second prediction model to perform similarity prediction processing on the target text and multiple selected texts respectively, obtaining a second prediction result (the second prediction result includes the second similarity between the target text and each selected text of the target text). The second prediction model has a relatively complex structure. Using the second prediction model to predict the second similarity ensures the accuracy of the second similarity between the target text and each selected text. Since the selected texts are determined from multiple related texts of the target text, for each selected text, the first similarity can be obtained through the prediction of the first prediction model, and the second similarity can be obtained through the prediction of the second prediction model. This provides a basis for the subsequent similarity fusion process.

[0109] In one possible implementation, the second prediction model can use a pre-trained language model, such as a Transformer-based Bidirectional Encoder Representations from Transformers (BERT) model, for example, the BERT model here may include 12 encoder layers. The model complexity of the second prediction model (e.g., the number of encoder layers) is greater than the model complexity of the first prediction model.

[0110] The specific implementation of step S303 is described in the relevant description of step S203 in the foregoing embodiments, and will not be repeated here.

[0111] The following steps, S304-S306, will detail the method for determining the ranking of multiple screened texts based on their first and second similarities (as in step S204).

[0112] S304. Obtain the first weighted parameter and the second weighted parameter.

[0113] In this embodiment of the application, in order to fuse the first similarity and second similarity of each screened text, the computer device can obtain a first weighting parameter and a second weighting parameter.

[0114] In one possible implementation, the first weighting parameter is a weighting parameter for the first similarity, the second weighting parameter is a weighting parameter for the second similarity, and the sum of the first weighting parameter and the second weighting parameter can be 1.

[0115] S305. The first similarity and second similarity of each screened text are weighted using the first weighting parameter and the second weighting parameter to obtain the fusion similarity of each screened text.

[0116] In this embodiment, the computer device can use a first weighting parameter and a second weighting parameter to weight the first similarity and the second similarity of each screened text to obtain a fused similarity for each screened text, thereby combining the two similarity indicators to obtain a fused similarity indicator. The purpose of the weighting process is to assign different weights according to the importance of different similarity indicators, thereby more accurately assessing the degree of similarity between the screened text and the target text.

[0117] In one possible implementation, for each selected text, the computer device can perform weighted processing on the first weighted parameter and the first similarity of the selected text to obtain a first weighted result, perform weighted processing on the second weighted parameter and the second similarity of the selected text to obtain a second weighted result, and then sum the first weighted result and the second weighted result to obtain the fusion similarity of each selected text.

[0118] For example, the first weighted parameter is denoted as w1, the second weighted parameter as w2, the first similarity as α, the second similarity as β, and the fusion similarity of each selected text as v. The calculation formula can be as follows:

[0119] v = w1 × α + w2 × β Equation (1)

[0120] It should be noted that the first and second weighting parameters can be flexibly set according to the actual business situation. In one implementation, since the second weighting parameter is obtained based on the prediction results of the second prediction model, which focuses more on ranking priority prediction compared to the first prediction model, the second weighting parameter can be greater than the first weighting parameter. In another implementation, the first and second weighting parameters can use an adaptive weight adjustment strategy, such as dynamic adjustment based on the online feedback of the model (that is, automatically adjusting the first and second weighting parameters according to the model's performance). This can make the model converge more stably and efficiently during training, while also reducing the workload of manual parameter tuning. This application does not limit this approach.

[0121] S306. Rank the multiple selected texts by using the fusion similarity of the multiple selected texts to obtain the ranking result of the multiple selected texts.

[0122] In this embodiment, the computer device can sort multiple filter texts by their fusion similarity. For example, the multiple filter texts can be sorted sequentially according to their fusion similarity from high to low to obtain a sorting result. This accurately determines the display order of the multiple filter texts that need to be sorted and displayed, making it easier for users to quickly find the text most relevant to the target text from the sorting results. This improves the accuracy of text sorting in content search scenarios and enhances the user's content search experience.

[0123] In one possible implementation, the content search scenario could specifically refer to an opinion search scenario. Taking book reading as an example, users can find relevant opinion knowledge (such as opinion descriptions) in books by searching for keywords (such as entity concept terms). Figure 4 As shown, Figure 4 The interface marked in (1) is the startup interface of the book reading product. In the book reading scenario, the target text can refer to entity concept words. Entity concept words can be terms entered in the search box of the book reading product. Multiple related texts of the target text can refer to multiple viewpoint descriptions recalled by the search engine of the book reading product through entity concept words.

[0124] like Figure 4 As shown in (2), the entity concept word (i.e., the search term) can be "influence". Therefore, by recalling the entity concept word, multiple opinion descriptions can be obtained, such as 1000 opinion descriptions. One opinion description can be a text description related to the entity concept word in a book. The computer device can use the first prediction model to perform similarity prediction processing on the entity concept word and the 1000 opinion descriptions respectively, and obtain the first similarity between the entity concept word and the 1000 opinion descriptions respectively. Then, the computer device can select multiple opinion descriptions with high first similarity from the 1000 opinion descriptions, such as selecting 50 opinion descriptions.

[0125] The computer device then uses a second prediction model to perform similarity prediction on the entity concept words and the 50 selected viewpoint descriptions, obtaining a second similarity between the entity concept words and the 50 selected viewpoint descriptions. Based on the first and second similarities corresponding to each of the 50 selected viewpoint descriptions, the computer device determines the fusion similarity corresponding to each of the 50 selected viewpoint descriptions, and sorts the 50 viewpoint descriptions in descending order of fusion similarity, obtaining a ranking result of the 50 selected viewpoint descriptions. For example, as shown... Figure 4(2) illustrates three viewpoint descriptions of the entity concept term "influence." Each viewpoint description may include at least the following: the author of the viewpoint (e.g., author a), the book to which the viewpoint belongs (e.g., book A), and the content of the viewpoint (e.g., "Influence refers to the ability of an individual or group to change the behavior, attitude, or belief of others through some means"). Applying the text processing method provided in this application to a book reading scenario can filter out high-quality viewpoint descriptions for users, improving their content search experience.

[0126] The first and second prediction models in the embodiments of this application will be described in detail below:

[0127] In this embodiment, the first prediction model and the second prediction model can be trained using a teacher-student model training strategy. That is, the second prediction model is a teacher model with a relatively complex structure and good performance, while the first prediction model is a student model with a relatively simple structure. In this embodiment, the second prediction model is trained first, and then the prediction results of the second prediction model are used to train the first prediction model (this process can be regarded as a knowledge distillation process of the model), thereby ensuring the similarity prediction ability of the first prediction model and the second prediction model, and ensuring the accuracy of the first prediction result and the second prediction result.

[0128] Based on this, the training method of the second prediction model will be explained in detail below:

[0129] In one possible implementation, training the second prediction model can be done through the following steps (1)-(5):

[0130] (1) Obtain multiple second training text pairs and the labeled similarity of each second training text pair.

[0131] In this embodiment, the second initial model learns the ranking priority features of multiple texts. First, it constructs training data for training the second prediction model, namely, second training text pairs. Specifically, multiple associated texts of the second training text can be recalled through the second training text. Therefore, each associated text of the second training text can form a second training text pair. That is, each second training text pair includes the second training text and one associated text of the second training text; here, the second training text included in multiple second training text pairs is the same text.

[0132] For example, the second training text is denoted as Q, and the multiple associated texts of the second training text are denoted as X, where X = {x1, x2, x3, ..., x...} n The similarity of the annotations of multiple second training text pairs is denoted as L, where L = {l1, l2, l3, ..., l...} n}

[0133] Where n is the number of associated texts of the second training text, l i ∈{0,1},l i This represents the annotation similarity of the i-th second training text pair among multiple second training text pairs. i =0 indicates that the associated text in the i-th pair of second training texts is not similar to the second training text. i =1 indicates that the associated text in the i-th second training text pair is similar to the second training text.

[0134] (2) Using the second initial model, perform similarity prediction processing on the second training text and associated text included in each second training text pair to obtain the similarity prediction results of multiple second training text pairs; the similarity prediction results of multiple second training text pairs include the third similarity between the second training text and each associated text of the second training text.

[0135] In this embodiment of the application, the second initial model learns the ranking priority features of the text. That is, the computer device provides ranking information of multiple second training text pairs and allows the second initial model to try to learn this ranking information.

[0136] For example, the similarity prediction results of multiple second training text pairs are denoted as S, S = {S1, S2, S3, ..., S...} n}. Among them, S i This represents the similarity prediction result (i.e., the third similarity) of the i-th second training text pair among multiple second training text pairs.

[0137] (3) Determine the ranking information of multiple second training text pairs based on the sample type and similarity prediction results of multiple second training text pairs.

[0138] In this embodiment, the computer device can determine the ranking information of multiple second training text pairs by combining the sample types and similarity prediction results of each second training text pair. The ranking information of the multiple second training text pairs is used by the second initial model to learn the ranking priority features of the texts.

[0139] In one possible implementation, step (3) can be implemented as follows:

[0140] a) Determine the sample type for each second training text pair; the sample type includes positive samples and negative samples.

[0141] For example, the computer device can determine the sample type of each second training text pair based on the annotation similarity of each second training text pair. For instance, if the annotation similarity of the second training text pair is greater than 0.5 (e.g., equal to 1), then the sample type of the second training text is determined to be a positive sample; if the annotation similarity of the second training text pair is less than or equal to 0.5 (e.g., equal to 0), then the sample type of the second training text is determined to be a negative sample.

[0142] b) From multiple second training text pairs, identify multiple positive sample text pairs with positive sample type and multiple negative sample text pairs with negative sample type.

[0143] For example, a computer device can divide multiple second training text pairs into two parts according to sample type: multiple positive sample text pairs with sample type being positive samples, and multiple negative sample text pairs with sample type being negative samples.

[0144] c) Sort the third similarity of multiple positive sample text pairs in descending order to obtain the ranking information of the positive sample text pairs, and sort the third similarity of multiple negative sample text pairs in descending order to obtain the ranking information of the negative sample text pairs.

[0145] For example, in the similarity prediction results of multiple second training text pairs, both positive and negative sample text pairs correspond to a third similarity. The computer device sorts the third similarities of multiple positive sample text pairs in descending order to determine the ranking information of the positive sample text pairs, and sorts the third similarities of multiple negative sample text pairs in descending order to determine the ranking information of the negative sample text pairs.

[0146] d) Determine the ranking information of multiple second training text pairs based on the ranking information of positive sample text pairs and negative sample text pairs.

[0147] In steps c)-d) above, the computer device can determine the sorting information of multiple second training text pairs based on the sorting information of positive sample text pairs and negative sample text pairs. For example, the sorting information of negative sample text pairs can be concatenated with the sorting information of positive sample text pairs to obtain the sorting information of multiple second training text pairs.

[0148] Based on the ranking information of multiple second training text pairs, the similarity prediction result of multiple second training text pairs S={S1,S2,S3,...,S n The similarity predictions are then reordered, and the reordered similarity predictions can be denoted as {S}. pos S neg}. Among them, S pos S represents the similarity prediction result for positive sample text pairs (which can be multiple). negThis represents the similarity prediction result for negative sample text pairs (there can be multiple pairs).

[0149] In this embodiment, determining the ranking information of multiple second training text pairs can refer to a label tensor, representing the index of each second training text pair, to facilitate the model's recognition of the ranking information. The label tensor is denoted as y, and its calculation formula is as follows:

[0150]

[0151] Here, R represents a rotation matrix, which is an orthogonal matrix whose row and column vectors are all of length 1 and are perpendicular to each other.

[0152] (4) Determine the first difference data based on the annotation similarity, similarity prediction results and ranking information of multiple second training text pairs, and determine the second difference data based on the annotation similarity and similarity prediction results of multiple second training text pairs.

[0153] In this embodiment of the application, the computer device can calculate first difference data based on the labeled similarity, similarity prediction results and ranking information of multiple second training text pairs, and calculate second difference data based on the labeled similarity and similarity prediction results of multiple second training text pairs. The first difference data is calculated based on the ranking information. The second initial model is trained based on the first difference data, so that the second initial model can learn the ranking priority features of the text.

[0154] In one possible implementation, the determination of the first difference data in step (4) can be achieved as follows:

[0155] a) Determine the first similarity sequence composed of the third similarity of multiple second training text pairs according to the sorting information of multiple second training text pairs.

[0156] For example, the computer device determines a first similarity sequence composed of the third similarity of the multiple second training text pairs according to the sorting information of the multiple second training text pairs. Here, the first similarity sequence may refer to the reordered similarity prediction result {S} in the aforementioned embodiment. pos S neg}. Among them, S pos The number of positive sample text pairs represented can be multiple, S neg The number of negative sample text pairs can be multiple.

[0157] b) Determine the second similarity sequence composed of the labeled similarity of multiple second training text pairs according to the sorting information of multiple second training text pairs.

[0158] Similarly, the computer device determines a second similarity sequence based on the ranking information of multiple second training text pairs, which consists of the labeled similarities of the multiple second training text pairs. In other words, the ranking information of the second training text pairs corresponding to the multiple third similarities in the first similarity sequence is the same as the ranking information of the second training text pairs corresponding to the multiple labeled similarities in the second similarity sequence.

[0159] For ease of understanding, taking an example where the number of the second training text pairs is equal to 6, the reordered similarity prediction results {S pos S neg} can be {S2, S1, S3, S4, S6, S5}, where S is the similarity prediction result of the positive sample text pairs. pos Including {S2, S1, S3}, the similarity prediction results S for negative sample text pairs. neg Including {S4, S6, S5}, the sorting information of multiple second training text pairs indicates that the order of the six second training text pairs is 2, 1, 3, 4, 6, and 5. Similarly, the order of the second training text pairs corresponding to multiple labeled similarities in the second similarity sequence should also be 2, 1, 3, 4, 6, and 5.

[0160] c) Calculate the difference between the first similarity sequence and the second similarity sequence to obtain the first difference data.

[0161] In this embodiment, the computer device can perform difference calculation on the first similarity sequence and the second similarity sequence to obtain the first difference data. For example, it can perform relative entropy calculation on the first similarity sequence and the second similarity sequence. Relative entropy can also be called KL divergence. The specific implementation process of relative entropy calculation will be described in detail in subsequent embodiments and will not be repeated here.

[0162] For example, the first difference data can be denoted as H1, and the calculation formula can be as follows:

[0163]

[0164] Among them, S res (x i ) refers to the first similarity sequence, L res (x i ) refers to the second similarity sequence, KL(S) res (x i )||L res (x i This refers to calculating the KL divergence between the first and second similarity sequences.

[0165] In one possible implementation, determining the second difference data in step (4) can be achieved by calculating the difference between the labeled similarity and similarity prediction results of multiple second training text pairs to obtain the second difference data. The difference calculation can be performed using the cross entropy calculation method.

[0166] For example, the second difference data can be denoted as H2, and the calculation formula can be as follows:

[0167]

[0168] Among them, Y i S represents the labeled similarity of the i-th second training text pair. i Let represent the third similarity of the i-th second training text pair. softmax(S) i ) indicates that the i-th second training text pair is normalized (softmax).

[0169] (5) Adjust the model parameters of the second initial model based on the first difference data and the second difference data to obtain the second prediction model.

[0170] In this embodiment of the application, the computer device can adjust the model parameters of the second initial model based on the first difference data and the second difference data. For example, the total loss (total loss is H1+H2) can be determined based on the first difference data and the second difference data, and the model parameters of the second initial model can be adjusted through the total loss to obtain the second prediction model.

[0171] In one possible implementation, multiple second training text pairs can be selected from the set of training text pairs corresponding to the second training text. That is, a second training text can recall a large number of related texts, and each recalled related text can form a second training text pair with the second training text, which is then stored in the training text pair set. This method allows for the batch generation of second training text pairs, improving the efficiency of training data generation.

[0172] For example, if the training text pair set includes 3000 second training text pairs (that is, composed of 3000 related texts of the target text and the target text), then the computer device can extract a portion of the second training text pairs (such as 1000 second training text pairs, which can be regarded as a subspace of the 3000 second training text pairs) as the training data set for this round of training. Furthermore, the process of extracting a portion of the second training text pairs from the training text pair set can be performed multiple times.

[0173] Based on this, step (5) above, that is, adjusting the model parameters of the second initial model according to the first difference data and the second difference data to obtain the second prediction model, can be implemented in the following way:

[0174] (1) Summing the first difference data and the second difference data to obtain the summation result.

[0175] For example, the computer device sums the first difference data and the second difference data to obtain a summation result, which is denoted as H1+H2. The summation result can be regarded as the model loss corresponding to the first subspace.

[0176] (2) Select multiple new second training text pairs from the training text pair set, and determine the new summation result based on the multiple new second training text pairs.

[0177] In this embodiment of the application, the computer device can select multiple new second training text pairs from the training text pair set. Referring to the implementation of steps S301-S304 in the aforementioned embodiment, a new summation result determined based on the multiple new second training text pairs can be obtained (the new summation result can be the sum of the new first difference data and the new second difference data).

[0178] For example, the computer device can refer to the implementation of steps S301-S306 in the foregoing embodiments to calculate the third difference data (denoted as H3) and the fourth difference data (denoted as H4), and sum the third difference data and the fourth difference data to obtain a new summation result, denoted as H3+H4. The new summation result can be regarded as the model loss corresponding to the second subspace.

[0179] (3) Adjust the model parameters of the second initial model based on the summation result and the new summation result to obtain the second prediction model.

[0180] In this embodiment of the application, the computer device can adjust the model parameters of the second initial model according to the summation result and the new summation result. For example, the total loss (the total loss is H1+H2+H3+H4) can be determined according to the summation result and the new summation result, and the model parameters of the second initial model can be adjusted through the total loss, such as learning the weights of the self-attention mechanism, so as to obtain the second prediction model.

[0181] For ease of explanation, this application only illustrates a method for adjusting the model parameters of the second initial model using the losses corresponding to two subspaces. This application can also calculate the losses corresponding to multiple subspaces and use these calculated losses (e.g., using three subspaces, with a total loss of H1+H2+H3+H4+H5+H6) to adjust the model parameters of the second initial model, thereby obtaining the second prediction model. The above method can improve the efficiency of training data utilization, reduce the risk of overfitting, and improve model performance and prediction accuracy.

[0182] The training method for the first prediction model will be explained in detail below:

[0183] In one possible implementation, training the first prediction model can be done through the following steps (1)-(4):

[0184] (1) Obtain multiple first training text pairs.

[0185] In this embodiment of the application, after the second prediction model is trained, the computer device can use the similarity prediction results of multiple first training text pairs output by the second prediction model to train the first initial model, thereby obtaining the first prediction model.

[0186] First, training data for training the first prediction model, i.e., the first training text pair, is constructed. The training data for training the first prediction model can be the same as the training data for training the second prediction model (e.g., the first training text pair and the second training text pair are the same), or they can be different. Specifically, multiple associated texts of the first training text can be retrieved. Therefore, each first training text and each associated text of the first training text can form a first training text pair. That is, each first training text pair includes the first training text and one associated text of the first training text, and the first training text included in multiple first training text pairs is the same text.

[0187] For ease of explanation, let's take the example where the training data for training the first prediction model is the same as the training data for training the second prediction model. Then, let's denot the multiple associated texts of the first training text as X, where X = {x1, x2, x3, ..., x...} n}

[0188] (2) Using the first initial model, perform similarity prediction processing on the first training text and associated text included in each first training text pair to obtain the similarity prediction results of multiple first training text pairs; the similarity prediction results of multiple first training text pairs include the fourth similarity between the first training text and each associated text of the first training text.

[0189] In this embodiment, the first initial model learns the similarity and relevance features of the texts. Specifically, the computer device can use the first initial model to perform similarity prediction processing on each first training text pair, obtaining the similarity prediction results of multiple first training text pairs, which can be denoted as f. S (x i ).

[0190] (3) Use the second prediction model to perform similarity prediction processing on each first training text pair including the first training text and the associated text, and obtain the prediction result of the second prediction model; the prediction result of the second prediction model includes the fifth similarity between the first training text and each associated text of the first training text.

[0191] In this embodiment, the computer device can use the trained second prediction model to perform similarity prediction processing on each first training text pair to obtain the prediction result of the second prediction model, which can be denoted as f. T (x i ).

[0192] (4) Based on the similarity prediction results of multiple first training text pairs and the prediction results of the second prediction model, determine the third difference data, and adjust the model parameters of the first initial model according to the third difference data to obtain the first prediction model.

[0193] In one possible implementation, the computer device can normalize the similarity prediction results of multiple first training text pairs and the prediction results of the second prediction model to obtain two normalized result sequences (such as the first normalized result sequence and the second normalized result sequence), and then perform difference calculation on the two normalized result sequences to obtain third difference data, such as performing relative entropy (KL divergence) calculation on the two normalized result sequences.

[0194] For example, the first normalized sequence of similarity prediction results for multiple first training text pairs can be denoted as P. S (x i The second normalized sequence of prediction results from the second prediction model can be denoted as P. T (x i The calculation formula can be as follows:

[0195]

[0196]

[0197] Softmax() performs normalization, and τ is a temperature coefficient used to control the smoothness of the normalization process.

[0198] The third difference data can be denoted as H. TS The calculation formula can be as follows:

[0199]

[0200] Among them, KL(P T (x i )||P S (x i This refers to calculating the KL divergence between the first and second normalized result sequences. The formula for calculating the KL divergence is as follows:

[0201]

[0202] Among them, P T (x i P represents the i-th first normalization result in the sequence of first normalization results. S (x i ) represents the i-th second normalization result in the second normalization result sequence.

[0203] The method provided in the above embodiments can train a first prediction model and a second prediction model. Based on these trained models, content search tasks in content search scenarios can be performed, and search results can be filtered and sorted, improving the accuracy of text sorting and the overall content search experience. Furthermore, by using the first prediction result of the first prediction model to filter multiple related texts, and then using the first prediction result of the first prediction model and the second prediction result of the second prediction model to determine the sorting result of the filtered texts, both efficiency and accuracy in text sorting are balanced.

[0204] The methods of the embodiments of this application have been described in detail above. In order to facilitate better implementation of the methods of the embodiments of this application, the apparatus of the embodiments of this application is provided below.

[0205] Please see Figure 5 This figure is a schematic diagram of the structure of a text processing device provided in an embodiment of this application. This text processing device can be installed in the computer equipment provided in this embodiment of the application, and the computer equipment can be as described above. Figure 1 Server 102 in the text processing system shown. Figure 5 The text processing device shown can be a computer program running on a computer device, which can be used to execute... Figure 2 or Figure 3 Some or all of the steps in the method embodiments shown. Please refer to [link / reference]. Figure 5 The text processing device may include the following units:

[0206] Processing unit 501 is used to perform similarity prediction processing on target text and multiple associated texts of target text using a first prediction model to obtain a first prediction result; the first prediction result includes a first similarity between target text and each associated text of target text; wherein, the first prediction model is obtained by training a first initial model using the similarity prediction results of multiple first training text pairs output by a second prediction model, and each first training text pair includes a first training text and an associated text of the first training text;

[0207] The processing unit 501 is further configured to determine multiple filter texts from multiple associated texts of the target text based on the first prediction result, and to perform similarity prediction processing on the target text and the multiple filter texts respectively using the second prediction model to obtain the second prediction result; the second prediction result includes the second similarity between the target text and each filter text.

[0208] The sorting unit 502 is used to determine the sorting result of multiple screened texts based on the first similarity and the second similarity of multiple screened texts; wherein, the second prediction model is obtained by training the second initial model using the first difference data and the second difference data, the first difference data is determined based on the labeled similarity of multiple second training text pairs, the similarity prediction result of multiple second training text pairs output by the second initial model, and the sorting information of multiple second training text pairs, and the second difference data is determined based on the labeled similarity and the similarity prediction result of multiple second training text pairs, and each second training text pair includes the second training text and a related text of the second training text.

[0209] In one possible implementation, when the sorting unit 502 determines the sorting result of multiple filtered texts based on a first similarity and a second similarity, it is specifically used for:

[0210] Obtain the first weighted parameter and the second weighted parameter;

[0211] The first similarity and second similarity of each screened text are weighted using the first weighting parameter and the second weighting parameter to obtain the fusion similarity of each screened text;

[0212] The multiple filter texts are sorted by fusion similarity to obtain the sorted results.

[0213] In one possible implementation, the text processing apparatus further includes a training unit 503, which is also used for:

[0214] Obtain multiple second training text pairs and the labeled similarity of each second training text pair;

[0215] The second initial model is used to perform similarity prediction on each second training text pair, including the second training text and the associated text, to obtain the similarity prediction results of multiple second training text pairs; the similarity prediction results of multiple second training text pairs include the third similarity between the second training text and each associated text of the second training text.

[0216] Based on the sample type and similarity prediction results of multiple second training text pairs, determine the ranking information of multiple second training text pairs;

[0217] The first difference data is determined based on the annotation similarity, similarity prediction results and ranking information of multiple second training text pairs, and the second difference data is determined based on the annotation similarity and similarity prediction results of multiple second training text pairs.

[0218] The model parameters of the second initial model are adjusted based on the first and second difference data to obtain the second prediction model.

[0219] In one possible implementation, when the training unit 503 determines the ranking information of multiple second training text pairs based on the sample type and similarity prediction results of multiple second training text pairs, it is specifically used for:

[0220] Determine the sample type for each second training text pair; the sample type includes positive samples and negative samples;

[0221] From multiple second training text pairs, identify multiple positive sample text pairs with positive sample type and multiple negative sample text pairs with negative sample type;

[0222] The third similarity of multiple positive sample text pairs is sorted in descending order to obtain the ranking information of the positive sample text pairs; the third similarity of multiple negative sample text pairs is sorted in descending order to obtain the ranking information of the negative sample text pairs.

[0223] Based on the ranking information of positive sample text pairs and negative sample text pairs, the ranking information of multiple second training text pairs is determined.

[0224] In one possible implementation, when training unit 503 is used to determine the first difference data based on the labeled similarity, similarity prediction results, and ranking information of multiple second training text pairs, it is specifically used for:

[0225] Based on the sorting information of multiple second training text pairs, determine the first similarity sequence composed of the third similarity of multiple second training text pairs;

[0226] Based on the sorting information of multiple second training text pairs, determine the second similarity sequence composed of the labeled similarity of multiple second training text pairs;

[0227] The difference between the first similarity sequence and the second similarity sequence is calculated to obtain the first difference data.

[0228] In one possible implementation, multiple second training text pairs are selected from the set of training text pairs corresponding to the second training text;

[0229] Specifically, when training unit 503 is used to adjust the model parameters of the second initial model based on the first difference data and the second difference data to obtain the second prediction model, it is used for:

[0230] The first and second difference data are summed to obtain the summation result;

[0231] Select multiple new second training text pairs from the training text pair set, and determine the new summation result based on the multiple new second training text pairs;

[0232] The model parameters of the second initial model are adjusted based on the summation results and the new summation results to obtain the second prediction model.

[0233] In one possible implementation, training unit 503 is also used for:

[0234] Obtain multiple first training text pairs;

[0235] The first initial model is used to perform similarity prediction on each first training text pair, including the first training text and the associated text, to obtain the similarity prediction results of multiple first training text pairs; the similarity prediction results of multiple first training text pairs include the fourth similarity between the first training text and each associated text of the first training text.

[0236] The second prediction model is used to perform similarity prediction on each first training text pair, including the first training text and the associated text, to obtain the prediction result of the second prediction model; the prediction result of the second prediction model includes the fifth similarity between the first training text and each associated text of the first training text.

[0237] Based on the similarity prediction results of multiple first training text pairs and the prediction results of the second prediction model, third difference data is determined. The model parameters of the first initial model are adjusted according to the third difference data to obtain the first prediction model.

[0238] In one possible implementation, when processing unit 501 determines multiple filtered texts from multiple associated texts of the target text based on the first prediction result, it specifically performs the following:

[0239] From the multiple first similarities included in the first prediction results, select the target first similarity with a first similarity greater than the similarity threshold, and determine the associated text corresponding to the target first similarity as the filtered text;

[0240] Alternatively, the multiple first similarities included in the first prediction result can be sorted in descending order, and the associated texts corresponding to the first similarities ranked in the top K positions of the descending sort result can be determined as the filter texts, where K is a positive integer.

[0241] Based on the above-mentioned text processing device, the embodiments of this application use a first prediction model to perform similarity prediction processing on the target text and multiple related texts of the target text respectively, and obtain a first prediction result;

[0242] Based on the first prediction result, multiple filter texts are determined from multiple related texts of the target text, thereby removing related texts with low similarity to the target text. Then, the second prediction model is used to perform similarity prediction processing on the target text and multiple filter texts respectively to obtain the second prediction result.

[0243] Finally, the ranking of the multiple selected texts is determined based on the first similarity in the first prediction result and the second similarity in the second prediction result.

[0244] The above method comprehensively considers the first and second similarities between each filtered text and the target text, ensuring the accuracy of the ranking results of multiple filtered texts, improving the accuracy of text ranking in content search scenarios, and enhancing the content search experience.

[0245] Furthermore, in this embodiment, the second prediction model is pre-trained, and the prediction results of the second prediction model are then used to train the first prediction model, thus ensuring the similarity prediction ability of the first prediction model and the second prediction model.

[0246] The first prediction result of the first prediction model is used to filter multiple related texts, and then the first prediction result of the first prediction model and the second prediction result of the second prediction model are used to determine the ranking result of the multiple filtered texts, thus balancing the efficiency and accuracy of text ranking.

[0247] It should be noted that the functions of each unit of the text processing device in the embodiments of this application can be specifically implemented according to the methods in the above method embodiments. The specific implementation process can be referred to the relevant descriptions in the various method embodiments of this application, which will not be repeated here.

[0248] According to another embodiment of this application, Figure 5The text processing apparatus shown can be constructed by combining the various units into one or more other units, or one or more of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The above-mentioned units are based on logical function division. In practical applications, the function of one unit can be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the text processing apparatus may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0249] According to another embodiment of this application, the following can be achieved by running on a general-purpose computing device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM), a device capable of performing operations such as... Figure 2 or Figure 3 Computer programs for the steps involved in some or all of the methods shown, to construct, for example... Figure 5 The text processing apparatus shown herein, and the text processing method for implementing the embodiments of this application, are described. A computer program may be recorded on, for example, a computer-readable storage medium, loaded onto the aforementioned computing device via the computer-readable storage medium, and executed therein.

[0250] Based on the above methods and apparatus embodiments, this application provides a computer device. Please refer to... Figure 6 This figure is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 6 The computer device shown includes at least a processor 601, a communication interface 602, and a computer-readable storage medium 603. The processor 601, communication interface 602, and computer-readable storage medium 603 can be connected via a bus or other means.

[0251] Computer-readable storage medium 603 can be stored in the memory of a computer device. The computer-readable storage medium 603 is used to store computer programs, including program instructions. Processor 601 is used to execute the computer program stored in the computer-readable storage medium 603. Processor 601 (or CPU (Central Processing Unit)) is the computing and control core of the computer device; it is suitable for implementing computer programs, specifically for loading and executing computer programs to achieve the above-mentioned functions. Figure 2 or Figure 3 The method flow is shown.

[0252] This application also provides a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both built-in storage media in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space for storing the operating system of the computer device. Furthermore, the storage space also stores computer programs suitable for loading and execution by a processor. It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device; optionally, it can also be at least one computer-readable storage medium located remotely from the aforementioned processor.

[0253] The computer equipment can be the above. Figure 1 The text processing system shown includes a server 102. In a specific implementation, a processor 601 can load and execute a computer program stored in a computer-readable storage medium 603 to implement the corresponding steps of the text processing methods in the various method embodiments of this application. Specifically, the computer program in the computer-readable storage medium 603 is loaded by the processor 601 and executed with the following steps:

[0254] The first prediction model is used to perform similarity prediction on the target text and multiple associated texts of the target text to obtain the first prediction result; the first prediction result includes the first similarity between the target text and each associated text of the target text; wherein, the first prediction model is obtained by training the first initial model using the similarity prediction results of multiple first training text pairs output by the second prediction model, and each first training text pair includes the first training text and one associated text of the first training text;

[0255] Based on the first prediction result, multiple filter texts are determined from multiple related texts of the target text. The second prediction model is then used to perform similarity prediction processing on the target text and the multiple filter texts respectively to obtain the second prediction result. The second prediction result includes the second similarity between the target text and each filter text.

[0256] The ranking of multiple selected texts is determined based on the first and second similarity scores of the selected texts. The second prediction model is trained on the second initial model using the first and second difference data. The first difference data is determined based on the labeled similarity of multiple second training text pairs, the similarity prediction results of multiple second training text pairs output by the second initial model, and the ranking information of multiple second training text pairs. The second difference data is determined based on the labeled similarity and similarity prediction results of multiple second training text pairs. Each second training text pair includes the second training text and a related text of the second training text.

[0257] In one possible implementation, when processor 601 determines the ranking result of multiple filtered texts based on a first similarity and a second similarity, it specifically performs the following:

[0258] Obtain the first weighted parameter and the second weighted parameter;

[0259] The first similarity and second similarity of each screened text are weighted using the first weighting parameter and the second weighting parameter to obtain the fusion similarity of each screened text;

[0260] The multiple filter texts are sorted by fusion similarity to obtain the sorted results.

[0261] In one possible implementation, processor 601 is also used for:

[0262] Obtain multiple second training text pairs and the labeled similarity of each second training text pair;

[0263] The second initial model is used to perform similarity prediction on each second training text pair, including the second training text and the associated text, to obtain the similarity prediction results of multiple second training text pairs; the similarity prediction results of multiple second training text pairs include the third similarity between the second training text and each associated text of the second training text.

[0264] Based on the sample type and similarity prediction results of multiple second training text pairs, determine the ranking information of multiple second training text pairs;

[0265] The first difference data is determined based on the annotation similarity, similarity prediction results and ranking information of multiple second training text pairs, and the second difference data is determined based on the annotation similarity and similarity prediction results of multiple second training text pairs.

[0266] The model parameters of the second initial model are adjusted based on the first and second difference data to obtain the second prediction model.

[0267] In one possible implementation, when determining the ranking information of multiple second training text pairs based on the sample type and similarity prediction results of multiple second training text pairs, the processor 601 specifically performs the following:

[0268] Determine the sample type for each second training text pair; the sample type includes positive samples and negative samples;

[0269] From multiple second training text pairs, identify multiple positive sample text pairs with positive sample type and multiple negative sample text pairs with negative sample type;

[0270] The third similarity of multiple positive sample text pairs is sorted in descending order to obtain the ranking information of the positive sample text pairs; the third similarity of multiple negative sample text pairs is sorted in descending order to obtain the ranking information of the negative sample text pairs.

[0271] Based on the ranking information of positive sample text pairs and negative sample text pairs, the ranking information of multiple second training text pairs is determined.

[0272] In one possible implementation, when determining the first difference data based on the labeled similarity, similarity prediction results, and ranking information of multiple second training text pairs, the processor 601 specifically performs the following:

[0273] Based on the sorting information of multiple second training text pairs, determine the first similarity sequence composed of the third similarity of multiple second training text pairs;

[0274] Based on the sorting information of multiple second training text pairs, determine the second similarity sequence composed of the labeled similarity of multiple second training text pairs;

[0275] The difference between the first similarity sequence and the second similarity sequence is calculated to obtain the first difference data.

[0276] In one possible implementation, multiple second training text pairs are selected from the set of training text pairs corresponding to the second training text;

[0277] Specifically, when processor 601 adjusts the model parameters of the second initial model based on the first difference data and the second difference data to obtain the second prediction model, it is used for:

[0278] The first and second difference data are summed to obtain the summation result;

[0279] Select multiple new second training text pairs from the training text pair set, and determine the new summation result based on the multiple new second training text pairs;

[0280] The model parameters of the second initial model are adjusted based on the summation results and the new summation results to obtain the second prediction model.

[0281] In one possible implementation, processor 601 is also used for:

[0282] Obtain multiple first training text pairs;

[0283] The first initial model is used to perform similarity prediction on each first training text pair, including the first training text and the associated text, to obtain the similarity prediction results of multiple first training text pairs; the similarity prediction results of multiple first training text pairs include the fourth similarity between the first training text and each associated text of the first training text.

[0284] The second prediction model is used to perform similarity prediction on each first training text pair, including the first training text and the associated text, to obtain the prediction result of the second prediction model; the prediction result of the second prediction model includes the fifth similarity between the first training text and each associated text of the first training text.

[0285] Based on the similarity prediction results of multiple first training text pairs and the prediction results of the second prediction model, third difference data is determined. The model parameters of the first initial model are adjusted according to the third difference data to obtain the first prediction model.

[0286] In one possible implementation, when processor 601 determines multiple filter texts from multiple associated texts of the target text based on a first prediction result, it specifically performs the following:

[0287] From the multiple first similarities included in the first prediction results, select the target first similarity with a first similarity greater than the similarity threshold, and determine the associated text corresponding to the target first similarity as the filtered text;

[0288] Alternatively, the multiple first similarities included in the first prediction result can be sorted in descending order, and the associated texts corresponding to the first similarities ranked in the top K positions of the descending sort result can be determined as the filter texts, where K is a positive integer.

[0289] Based on the aforementioned computer equipment, this application embodiment utilizes a first prediction model to perform similarity prediction processing on the target text and multiple associated texts of the target text, thereby obtaining a first prediction result;

[0290] Based on the first prediction result, multiple filter texts are determined from multiple related texts of the target text, thereby removing related texts with low similarity to the target text. Then, the second prediction model is used to perform similarity prediction processing on the target text and multiple filter texts respectively to obtain the second prediction result.

[0291] Finally, the ranking of the multiple selected texts is determined based on the first similarity in the first prediction result and the second similarity in the second prediction result.

[0292] The above method comprehensively considers the first and second similarities between each filtered text and the target text, ensuring the accuracy of the ranking results of multiple filtered texts, improving the accuracy of text ranking in content search scenarios, and enhancing the content search experience.

[0293] Furthermore, in this embodiment, the second prediction model is pre-trained, and the prediction results of the second prediction model are then used to train the first prediction model, thus ensuring the similarity prediction ability of the first prediction model and the second prediction model.

[0294] The first prediction result of the first prediction model is used to filter multiple related texts, and then the first prediction result of the first prediction model and the second prediction result of the second prediction model are used to determine the ranking result of the multiple filtered texts, thus balancing the efficiency and accuracy of text ranking.

[0295] In the several embodiments provided in this application, it should be understood that the disclosed methods, apparatus, systems, and computer devices can be implemented in other ways. The embodiments described above are merely illustrative, and the division of units is only a logical functional division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0296] This application also provides a computer program product, which includes program instructions stored in a computer-readable storage medium. A processor of a computer device reads the program instructions from the computer-readable storage medium and executes the program instructions, causing the computer device to perform the aforementioned text processing method, which will not be described in detail here.

[0297] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0298] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more program instructions. When the program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The program instructions can be stored in or transmitted through a computer-readable storage medium. The program instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0299] It should be noted that, in the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program with a predetermined function, which works together with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0300] It should be noted that the terms "first," "second," etc., used in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a technical feature specified with "first" or "second" may explicitly or implicitly include at least one of those features.

[0301] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A text processing method, characterized in that, The method includes: The first prediction model is used to perform similarity prediction processing on the target text and multiple associated texts of the target text to obtain a first prediction result; the first prediction result includes a first similarity between the target text and each associated text of the target text; wherein, the first prediction model is obtained by training a first initial model using the similarity prediction results of multiple first training text pairs output by the second prediction model, and each first training text pair includes a first training text and an associated text of the first training text; Based on the first prediction result, multiple filter texts are determined from multiple associated texts of the target text. The second prediction model is then used to perform similarity prediction processing on the target text and the multiple filter texts respectively to obtain a second prediction result. The second prediction result includes a second similarity between the target text and each of the filter texts. The ranking result of the multiple selected texts is determined based on the first similarity and the second similarity of the multiple selected texts; wherein, the second prediction model is obtained by training the second initial model using the first difference data and the second difference data, the first difference data is determined based on the labeled similarity of multiple second training text pairs, the similarity prediction result of the multiple second training text pairs output by the second initial model, and the ranking information of the multiple second training text pairs, and the second difference data is determined based on the labeled similarity and the similarity prediction result of the multiple second training text pairs, and each second training text pair includes a second training text and an associated text of the second training text.

2. The method as described in claim 1, characterized in that, The step of determining the ranking result of the multiple filtered texts based on the first similarity and the second similarity of the multiple filtered texts includes: Obtain the first weighted parameter and the second weighted parameter; The first similarity and second similarity of each of the selected texts are weighted using the first weighting parameter and the second weighting parameter to obtain the fusion similarity of each of the selected texts; The multiple filtered texts are sorted using the fusion similarity of the multiple filtered texts to obtain the sorting result of the multiple filtered texts.

3. The method as described in claim 1 or 2, characterized in that, The method further includes: Obtain multiple second training text pairs and the labeled similarity of each second training text pair; The second initial model is used to perform similarity prediction processing on the second training text and associated text included in each second training text pair to obtain the similarity prediction results of the multiple second training text pairs; the similarity prediction results of the multiple second training text pairs include a third similarity between the second training text and each associated text of the second training text. Based on the sample type and similarity prediction results of the plurality of second training text pairs, the ranking information of the plurality of second training text pairs is determined; The first difference data is determined based on the annotation similarity, similarity prediction results and ranking information of the plurality of second training text pairs, and the second difference data is determined based on the annotation similarity and similarity prediction results of the plurality of second training text pairs; The model parameters of the second initial model are adjusted based on the first difference data and the second difference data to obtain the second prediction model.

4. The method as described in claim 3, characterized in that, The step of determining the ranking information of the plurality of second training text pairs based on the sample type and similarity prediction results includes: Determine the sample type for each of the second training text pairs; the sample type includes positive samples and negative samples; From the plurality of second training text pairs, determine a plurality of positive sample text pairs with positive sample type and a plurality of negative sample text pairs with negative sample type; The third similarity of the plurality of positive sample text pairs is sorted in descending order to obtain the sorting information of the positive sample text pairs; and the third similarity of the plurality of negative sample text pairs is sorted in descending order to obtain the sorting information of the negative sample text pairs. The ranking information of the plurality of second training text pairs is determined based on the ranking information of the positive sample text pairs and the ranking information of the negative sample text pairs.

5. The method as described in claim 3, characterized in that, The step of determining the first difference data based on the labeled similarity, similarity prediction results, and ranking information of the plurality of second training text pairs includes: Based on the sorting information of the plurality of second training text pairs, a first similarity sequence composed of the third similarity of the plurality of second training text pairs is determined; Based on the sorting information of the plurality of second training text pairs, a second similarity sequence composed of the labeled similarity of the plurality of second training text pairs is determined; The difference between the first similarity sequence and the second similarity sequence is calculated to obtain the first difference data.

6. The method as described in claim 3, characterized in that, The plurality of second training text pairs are selected from the set of training text pairs corresponding to the second training text; The step of adjusting the model parameters of the second initial model based on the first difference data and the second difference data to obtain the second prediction model includes: The first difference data and the second difference data are summed to obtain the summation result; Select multiple new second training text pairs from the training text pair set, and determine a new summation result based on the multiple new second training text pairs; The model parameters of the second initial model are adjusted based on the summation result and the new summation result to obtain the second prediction model.

7. The method as described in claim 3, characterized in that, The method further includes: Obtain multiple first training text pairs; The first initial model is used to perform similarity prediction processing on the first training text and associated text of each first training text pair to obtain the similarity prediction results of the plurality of first training text pairs; the similarity prediction results of the plurality of first training text pairs include a fourth similarity between the first training text and each associated text of the first training text. The second prediction model is used to perform similarity prediction processing on each first training text pair, including the first training text and associated text, to obtain the prediction result of the second prediction model; the prediction result of the second prediction model includes the fifth similarity between the first training text and each associated text of the first training text. Based on the similarity prediction results of the multiple first training text pairs and the prediction results of the second prediction model, third difference data is determined, and the model parameters of the first initial model are adjusted according to the third difference data to obtain the first prediction model.

8. The method as described in claim 1 or 2, characterized in that, The step of determining multiple filter texts from multiple associated texts of the target text based on the first prediction result includes: From the multiple first similarities included in the first prediction result, select the target first similarity whose first similarity is greater than the similarity threshold, and determine the associated text corresponding to the target first similarity as the filtered text; Alternatively, the multiple first similarities included in the first prediction result can be sorted in descending order, and the associated texts corresponding to the first similarities ranked in the top K positions of the descending sort result can be determined as the filter texts, where K is a positive integer.

9. A text processing device, characterized in that, The device includes: The processing unit is configured to perform similarity prediction processing on the target text and multiple associated texts of the target text using a first prediction model to obtain a first prediction result; the first prediction result includes a first similarity between the target text and each associated text of the target text; wherein, the first prediction model is obtained by training a first initial model using the similarity prediction results of multiple first training text pairs output by a second prediction model, and each first training text pair includes a first training text and an associated text of the first training text; The processing unit is further configured to determine multiple filter texts from multiple associated texts of the target text based on the first prediction result, and to perform similarity prediction processing on the target text and the multiple filter texts respectively using the second prediction model to obtain a second prediction result; the second prediction result includes a second similarity between the target text and each of the filter texts; A sorting unit is used to determine the sorting result of the plurality of screened texts based on a first similarity and a second similarity; wherein, the second prediction model is obtained by training a second initial model using first difference data and second difference data, the first difference data is determined based on the labeled similarity of a plurality of second training text pairs, the similarity prediction result of the plurality of second training text pairs output by the second initial model, and the sorting information of the plurality of second training text pairs, and the second difference data is determined based on the labeled similarity and similarity prediction result of the plurality of second training text pairs, and each second training text pair includes a second training text and an associated text of the second training text.

10. A computer device, characterized in that, The computer device includes: A processor is a tool for implementing computer programs. A computer-readable storage medium storing a computer program adapted to be loaded by the processor and executed as described in any one of claims 1-8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and executed by the text processing method as described in any one of claims 1-8.

12. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the text processing method as described in any one of claims 1-8.