Text mapping model processing method, device, computer equipment and storage medium

By obtaining sample text information and first label information, determining the second label information using the text mapping model, and training the model in combination with the similarity of the predicted text information, the problem of poor mapping effect of the existing text mapping model is solved, and more efficient text information matching is achieved.

CN114328815BActive Publication Date: 2025-08-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111376101.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-19
Publication Date
2025-08-15
Estimated Expiration
2041-11-19

AI Technical Summary

Technical Problem

The existing text mapping model has shortcomings in mapping effects, making it difficult to accurately map similar text information.

Method used

By obtaining sample text information and first tag information, mapping based on the text mapping model, determining the second tag information, and training the model using the predicted text information and similarity, considering the difference and similarity between the predicted text information and the sample text information, improving the mapping effect of the model.

Benefits of technology

It improves the mapping accuracy of the text mapping model, can better match similar text information, and enhances the training effect of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114328815B_ABST
    Figure CN114328815B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a processing method, device, computer equipment and storage medium for a text mapping model, which belongs to the field of computer technology. The method includes: obtaining sample text information and first label information, mapping the sample text information based on the text mapping model to obtain predicted text information; determining the second label information based on the first similarity between the predicted text information and the sample text information and the second similarity between the first label information and the sample text information, and training the text mapping model based on the second label information, the predicted text information and the first similarity corresponding to the predicted text information. In the embodiment of the present application, the text information that is most similar to the sample text information is used as the second label information, and the text mapping model is trained based on the predicted text information, the second label text information and the first similarity between the predicted text information and the sample text information, thereby improving the mapping effect of the text mapping model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, apparatus, computer device, and storage medium for processing a text mapping model. Background Art

[0002] With the development of computer technology, artificial intelligence models are widely used in various scenarios. In natural language processing, text information is often mapped based on text mapping models to obtain text information similar to the original text information, thereby expanding the text information. However, the mapping effect of current text mapping models is still poor. Summary of the Invention

[0003] The present invention provides a method, apparatus, computer device, and storage medium for processing a text mapping model, which can improve the mapping effect of the text mapping model. The technical solution is as follows:

[0004] In one aspect, a method for processing a text mapping model is provided, the method comprising:

[0005] Acquire sample text information and first label information, where the first label information is text information whose similarity to the sample text information is not less than a similarity threshold;

[0006] Mapping the sample text information based on the text mapping model to obtain predicted text information;

[0007] determining second label information based on a first similarity between the predicted text information and the sample text information and a second similarity between the first label information and the sample text information, wherein the second label information is the text information having a greater similarity with the sample text information between the predicted text information and the first label information;

[0008] The text mapping model is trained based on the second tag information, the predicted text information, and the first similarity corresponding to the predicted text information. The text mapping model is used to map out similar text information of any text information.

[0009] On the other hand, a device for processing a text mapping model is provided, the device comprising:

[0010] an acquisition module, configured to acquire sample text information and first tag information, wherein the first tag information is text information having a similarity with the sample text information that is not less than a similarity threshold;

[0011] A mapping module, configured to map the sample text information based on the text mapping model to obtain predicted text information;

[0012] a determination module, configured to determine second label information based on a first similarity between the predicted text information and the sample text information and a second similarity between the first label information and the sample text information, wherein the second label information is the text information having a greater similarity with the sample text information between the predicted text information and the first label information;

[0013] A training module is used to train the text mapping model based on the second label information, the predicted text information and the first similarity corresponding to the predicted text information. The text mapping model is used to map out similar text information of any text information.

[0014] In one possible implementation, the apparatus further includes:

[0015] The acquisition module is further configured to acquire a third similarity and a fourth similarity between the predicted text information and the sample text information, wherein the third similarity indicates a difference in terms between the predicted text information and the sample text information, and the fourth similarity indicates a semantic similarity between the predicted text information and the sample text information;

[0016] The fusion module is configured to perform weighted fusion on the third similarity and the fourth similarity to obtain the first similarity.

[0017] In another possible implementation, the acquisition module is used to divide the predicted text information based on at least one number of characters to obtain at least one first word set, and the words belonging to the same first word set contain the same number of characters; divide the sample text information based on at least one number of characters to obtain at least one second word set, and the words belonging to the same second word set contain the same number of characters; determine a first number and a second number, the first number indicating the sum of the number of different words in the first word set and the second word set corresponding to each number of characters, and the second number indicating the total number of words in at least one first word set and at least one second word set; and determine the ratio of the first number to the second number as the third similarity between the predicted text information and the sample text information.

[0018] In another possible implementation, the acquisition module is used to perform semantic extraction on the predicted text information and the sample text information respectively to obtain a first semantic feature of the predicted text information and a second semantic feature of the sample text information; and determine the similarity between the first semantic feature and the second semantic feature as the fourth similarity.

[0019] In another possible implementation, the acquisition module is used to splice the predicted text information with the sample text information to obtain spliced text information; perform semantic extraction on the spliced text information to obtain a third semantic feature corresponding to the spliced text information; perform classification processing on the third semantic feature to obtain a classification result; and determine the classification result as the fourth similarity.

[0020] In another possible implementation, the training module is used to obtain a first loss value corresponding to the predicted text information based on the second label information and the predicted text information; and train the text mapping model based on the first similarity and the first loss value corresponding to the predicted text information.

[0021] In another possible implementation, the training module is used to obtain a weight parameter corresponding to each predicted text information based on the difference between the target similarity and the first similarity corresponding to each predicted text information; based on the weight parameter corresponding to each predicted text information, perform a weighted average of the first loss values corresponding to multiple predicted text information to obtain a second loss value; determine the average of the first loss values corresponding to multiple predicted text information as a third loss value; and train the text mapping model based on the second loss value and the third loss value.

[0022] In another possible implementation, the acquisition module includes:

[0023] an acquiring unit, configured to acquire a first text information set, wherein the first text information set includes a plurality of first text information and tag information corresponding to each first text information;

[0024] a determining unit, configured to determine a similarity between each of the first text information and the corresponding tag information;

[0025] The screening unit is configured to screen out the sample text information and the first label information having a similarity greater than a similarity threshold from the first text information set based on the similarity corresponding to each of the first text information.

[0026] In another possible implementation, the screening unit is used to screen out at least one second text information having a similarity greater than the similarity threshold from the first text information set based on the similarity corresponding to each first text information, and to form a second text information set with the screened out second text information and the corresponding label information; and to obtain the sample text information and the first label information from the second text information set, where the sample text information is any second text information.

[0027] In another possible implementation, the acquisition module is further configured to train the text mapping model based on the first text information and corresponding label information in the first text information set.

[0028] In another possible implementation, the determination module is configured to, in response to the largest first similarity among multiple first similarities being greater than the second similarity, determine the predicted text information corresponding to the largest first similarity as the second label information, where the multiple first similarities are similarities between multiple predicted text information and the sample text information; or, in response to the multiple first similarities not being greater than the second similarity, determine the first label information as the second label information.

[0029] In another possible implementation, the mapping module is further configured to map the target text information based on the text mapping model to obtain similar text information of the target text information.

[0030] On the other hand, a computer device is provided, which includes a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the text mapping model processing method as described in the above aspects.

[0031] On the other hand, a computer-readable storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the operations performed by the text mapping model processing method as described in the above aspects.

[0032] On the other hand, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the operations performed by the method for processing the text mapping model as described in the above aspects.

[0033] The beneficial effects of the technical solutions provided in the embodiments of the present application include at least:

[0034] The method, apparatus, computer device, and storage medium provided in the embodiments of the present application use the text information that is most similar to the sample text information in the predicted text information and the first label information as the second label information according to the similarity between the predicted text information and the first label information and the sample text information respectively. Not only the difference between the predicted text information and the second label text information is taken into account, but also the first similarity between the predicted text information and the sample text information is taken into account. Based on the second label information, the predicted text information, and the first similarity corresponding to the predicted text information, the text mapping model is trained to ensure that the trained text mapping model can subsequently map similar text information of any text information, thereby improving the mapping effect of the text mapping model. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0036] Figure 1 This is a schematic diagram of the structure of an implementation environment provided by an embodiment of the present application;

[0037] Figure 2 This is a flowchart of a method for processing a text mapping model provided by an embodiment of the present application;

[0038] Figure 3 This is a flowchart of another text mapping model processing method provided in an embodiment of the present application;

[0039] Figure 4 This is a structural diagram of a text mapping model provided in an embodiment of the present application;

[0040] Figure 5 This is a flowchart of another method for processing a text mapping model provided in an embodiment of the present application;

[0041] Figure 6 Schematic diagram of a training text mapping model provided in an embodiment of the present application;

[0042] Figure 7 This is a schematic diagram of data comparison provided in the examples of the present application;

[0043] Figure 8 This is a schematic diagram of an editing interface for a question-and-answer knowledge base provided in an embodiment of the present application;

[0044] Figure 9 It is a structural diagram of a processing device for a text mapping model provided in an embodiment of the present application;

[0045] Figure 10 1 is a structural diagram of another text mapping model processing device provided in an embodiment of the present application;

[0046] Figure 11 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present application;

[0047] Figure 12 This is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0049] As used herein, the terms "first," "second," "third," "fourth," and the like may be used to describe various concepts herein, but unless otherwise specified, these concepts are not limited by these terms. These terms are merely used to distinguish one concept from another. For example, a first similarity can be referred to as a second similarity, and similarly, a second similarity can be referred to as a first similarity without departing from the scope of this application.

[0050] As used herein, the terms "at least one," "a plurality," "each," and "any" include one, two, or more, "a plurality" includes two or more, "each" refers to each of the corresponding plurality, and "any" refers to any one of the plurality. For example, the plurality of predicted text information includes three predicted text information, and "each" refers to each of the three predicted text information. Any refers to any one of the three predicted text information, which can be the first predicted text information, the second predicted text information, or the third predicted text information.

[0051] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to 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 seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.

[0052] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0053] Natural language processing (NLP) is a key area of research in computer science and artificial intelligence. It studies the theories and methods that enable effective communication between humans and computers using natural language. Natural language processing (NLP) integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language we use in everyday life—and is closely linked to the study of linguistics. Natural language processing technologies typically include text processing, semantic understanding, machine translation, robotic question answering, and knowledge graphs.

[0054] Machine learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of AI. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning through demonstration.

[0055] The solution provided in the embodiment of the present application is based on artificial intelligence machine learning technology, which can train a text mapping model. Using the trained text mapping model, similar text information of any text information can be mapped out, thereby realizing a processing method of the text mapping model.

[0056] The processing method of the text mapping model provided in the embodiment of the present application is executed by a computer device. Optionally, the computer device is a terminal or a server. Optionally, the server is an independent physical server, or 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 communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, intelligent voice interaction device, smart home appliance and car terminal, etc., but is not limited to this.

[0057] In some embodiments, the computer program involved in the embodiments of the present application can be deployed and executed on a computer device, or on multiple computer devices located at one location, or on multiple computer devices distributed at multiple locations and interconnected through a communication network. Multiple computer devices distributed at multiple locations and interconnected through a communication network can constitute a blockchain system.

[0058] In some embodiments, the computer device is provided as a server. Figure 1 This is a schematic diagram of an implementation environment provided by an embodiment of the present application. Figure 1 , the implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 are connected via a wireless or wired network.

[0059] The server 102 is used to train the text mapping model. After the text mapping model training is completed, the text mapping model is stored. The terminal 101 sends the target text information to the server 102 through the network connection between the terminal 101 and the server 102. The server 102 is used to receive the target text information sent by the terminal 101, map out similar text information of the target text information based on the text mapping model, and send the similar text information to the terminal 101, which receives the similar text information.

[0060] In one possible implementation, a target application provided by server 102 is installed on terminal 101, and terminal 101 can implement, for example, a text mapping function through the target application. Optionally, the target application is a target application in the operating system of terminal 101, or a target application provided by a third party. For example, the target application is a text mapping application, which has a text mapping function. Of course, the text mapping application can also have other functions, such as a review function, a question-and-answer function, a navigation function, a game function, etc.

[0061] Terminal 101 is used to log in to the target application based on the user identification, and send a text expansion request to server 102 through the target application. The text expansion request carries the target text information. Server 102 is used to receive the text expansion request sent by terminal 101, map out similar text information of the target text information based on the text mapping model, and send the similar text information to terminal 101, which receives the similar text information.

[0062] Figure 2 This is a flowchart of a method for processing a text mapping model provided by an embodiment of the present application, which is executed by a computer device, such as a terminal or a server. Figure 2 As shown, the method includes:

[0063] 201. A computer device obtains sample text information and first label information, where the first label information is text information whose similarity to the sample text information is not less than a similarity threshold.

[0064] The sample text information is any type of text information, such as a question, an answer, or a disease description. The similarity threshold is any value, such as 0.8 or 3. If the similarity between the first label information and the sample text information is not less than the similarity threshold, it indicates that the first label information and the sample text information have the same or similar meaning. For example, if the sample text information is "Simple little question", the first label information is "Super simple question".

[0065] 202. The computer device maps the sample text information based on the text mapping model to obtain predicted text information.

[0066] The text mapping model is used to map out similar text information of any text information. Since the text mapping model is a model to be trained, the current text mapping model may be inaccurate, and the predicted text information mapped based on the text mapping model may be similar to the sample text information.

[0067] 203. The computer device determines second label information based on the first similarity between the predicted text information and the sample text information and the second similarity between the first label information and the sample text information. The second label information is the text information with the greater similarity to the sample text information between the predicted text information and the first label information.

[0068] Among them, the first similarity is used to represent the degree of similarity between the predicted text information and the sample text information, and the second similarity is used to represent the degree of similarity between the first label information and the sample text information. In an embodiment of the present application, after the predicted text information is obtained based on the text mapping model, according to the similarity between the predicted text information and the first label information and the sample text information respectively, the text information most similar to the sample text information is selected from the predicted text information and the first label information as the second label information, that is, the second label information is the text information most similar to the sample text information in the predicted text information and the first label information, so as to ensure the training effect of the subsequent text mapping model. For example, if the first similarity is greater than the second similarity, the second label information is the predicted text information; if the first similarity is not greater than the second similarity, the second label information is the first label information.

[0069] 204. The computer device trains a text mapping model based on the second label information, the predicted text information, and the first similarity corresponding to the predicted text information. The text mapping model is used to map out similar text information of any text information.

[0070] The method provided in the embodiment of the present application takes the text information that is most similar to the sample text information in the predicted text information and the first label information as the second label information according to the similarity between the predicted text information and the first label information and the sample text information respectively. Not only the difference between the predicted text information and the second label text information is taken into account, but also the first similarity between the predicted text information and the sample text information is taken into account. Based on the second label information, the predicted text information and the first similarity corresponding to the predicted text information, the text mapping model is trained to ensure that the trained text mapping model can subsequently map out similar text information of any text information, thereby improving the mapping effect of the text mapping model.

[0071] In the above Figure 2 On the basis of the illustrated embodiment, it is also possible to obtain the first similarity and the first loss value corresponding to the predicted text information, and to train the text mapping model based on the first similarity and the first loss value corresponding to the predicted text information. The training process is detailed in the following embodiment.

[0072] 301. A computer device obtains sample text information and first label information, where the first label information is text information whose similarity to the sample text information is not less than a similarity threshold.

[0073] 302. The computer device maps the sample text information based on the text mapping model to obtain predicted text information.

[0074] The predicted text information is text information mapped by the text mapping model and may be similar to the sample text information.

[0075] In one possible implementation, step 302 includes: a computer device maps the sample text information based on a text mapping model to obtain at least one piece of predicted text information.

[0076] In the embodiment of the present application, the text mapping model is used to map out at least one similar text information of any text information.

[0077] In one possible implementation, step 302 includes: the computer device encodes the sample text information based on the text mapping model to obtain the encoding feature, decodes the encoding feature to obtain the first word, fuses the word feature of the first word with the encoding feature to obtain the first fused feature, decodes the first fused feature to obtain the second word, fuses the first fused feature with the word feature of the second word to obtain the second fused feature, decodes the second fused feature to obtain the third word, and so on, until the nth word is obtained, and the obtained multiple words constitute the predicted text information.

[0078] In the embodiment of the present application, in the process of generating the predicted text information corresponding to the sample text information based on the text mapping model, each word of the predicted text information is output in sequence, and when outputting each word, it depends on the multiple words before the word to ensure that the output predicted text information is as similar as possible to the sample text information, thereby ensuring the mapping effect of the text mapping model. Figure 4 As shown, the text mapping model includes an encoding layer and a decoding layer. Based on the encoding layer, the sample text information is encoded to obtain an encoding feature. Based on the decoding layer, the encoding feature is decoded to obtain a first word. Based on the decoding layer, the word feature of the first word is fused with the encoding feature to obtain a first fused feature. The first fused feature is decoded to obtain a second word. Based on the decoding layer, the first fused feature is fused with the word feature of the second word to obtain a second fused feature. The second fused feature is decoded to obtain a third word, and so on, until the nth word is obtained. The obtained multiple words constitute the predicted text information.

[0079] 303. The computer device obtains a third similarity and a fourth similarity between the predicted text information and the sample text information.

[0080] The third similarity indicates the difference in terms between the predicted text information and the sample text information, and can indicate the degree of grammatical similarity between the predicted text information and the sample text information. The fourth similarity indicates the semantic similarity between the predicted text information and the sample text information, and can indicate the degree of semantic similarity between the predicted text information and the sample text information.

[0081] In a possible implementation, multiple predicted text information corresponding to the sample text information is obtained based on the text mapping model, and step 303 includes: the computer device obtains the third similarity and the fourth similarity between each predicted text information and the sample text information.

[0082] In one possible implementation, the process of obtaining the third similarity between the predicted text information and the sample text information includes the following steps 3031-3034:

[0083] 3031. Based on at least one number of characters, the predicted text information is divided to obtain at least one first word set, where words belonging to the same first word set have the same number of characters.

[0084] The number of characters is any number, for example, 1, 2, or 3. The predicted text information is divided according to at least one number of characters to obtain at least one first word set, each first word set corresponding to a number of characters, and the words belonging to the same first word set have the same number of characters, and the words belonging to the same first word set have the same number of characters as the number of characters corresponding to the first word set. For example, if at least one number of characters includes 1, 2, and 3, and the predicted text information is "I am hungry", then the predicted text information is divided based on the three numbers of characters to obtain three first word sets. The first first word set includes "I", "belly", "son", and "hungry", that is, each word in the first first word set contains one character; the second first word set includes "my belly", "belly", and "son hungry", that is, each word in the second first word set contains two characters; the third first word set includes "my belly" and "hungry", that is, each word in the third first word set contains three characters.

[0085] In one possible implementation, step 3031 includes: for each number of characters, dividing the predicted text information based on the number of characters and the target step size to obtain a first word set corresponding to the number of characters.

[0086] The target step size is the number of characters moved each time a word is divided. The target step size is an arbitrary value, for example, the target step size is 1. For example, based on N-Gram (a statistical language model), the predicted text information is divided to obtain at least one first word set. For example, starting from the first character of the predicted text information, a selection box with a length equal to the number of characters is gradually moved according to the target step size to select characters in the predicted text information. Each time the selection box is moved, the number of characters in the selection box is regarded as a word, and the multiple words obtained constitute the first word set.

[0087] 3032. Based on at least one number of characters, the sample text information is divided to obtain at least one second word set, where words belonging to the same second word set have the same number of characters.

[0088] Each second word set corresponds to a number of characters, and the number of characters contained in each word in the second word set is equal to the corresponding number of characters. This step 3032 is similar to the above step 3031 and will not be repeated here.

[0089] 3033. Determine a first number and a second number, where the first number indicates the sum of the number of different words in the first word set and the second word set corresponding to each number of characters, and the second number indicates the total number of words in at least one first word set and at least one second word set.

[0090] For the first word set and the second word set corresponding to any number of characters, determine the number of different words contained in the first word set and the second word set corresponding to the number of characters, and determine the sum of the numbers corresponding to at least one number of characters as the first number.

[0091] 3034. Determine the ratio of the first number to the second number as the third similarity between the predicted text information and the sample text information.

[0092] By dividing the predicted text information into at least one first word set and the sample text information into at least one second word set according to at least one number of characters, the words in the first word sets corresponding to different numbers of characters contain different numbers of characters, and determining the third similarity between the predicted text information and the sample text information according to word sets at different granularity levels, the grammatical similarity between the predicted text information and the sample text information can be obtained, thereby ensuring the accuracy of the obtained third similarity.

[0093] In one possible implementation, the process of obtaining the fourth similarity between the predicted text information and the sample text information includes the following two methods:

[0094] The first method is to perform semantic extraction on the predicted text information and the sample text information respectively to obtain a first semantic feature of the predicted text information and a second semantic feature of the sample text information; and determine the similarity between the first semantic feature and the second semantic feature as a fourth similarity.

[0095] Among them, the first semantic feature is used to represent the predicted text information, and the second semantic feature is used to represent the sample text information. The first semantic feature and the second semantic feature can be represented in any form. For example, the first semantic feature and the second semantic feature are both represented in the form of feature vectors.

[0096] Optionally, the first semantic feature and the second semantic feature are both represented in the form of feature vectors, and the process of determining the fourth similarity includes: determining the product of the first semantic feature vector and the second semantic feature vector as the fourth similarity.

[0097] The second method is: splicing the predicted text information with the sample text information to obtain spliced text information; performing semantic extraction on the spliced text information to obtain a third semantic feature corresponding to the spliced text information; performing classification processing on the third semantic feature to obtain a classification result; and determining the classification result as the fourth similarity.

[0098] The third semantic feature is used to represent the concatenated text information. The third semantic feature incorporates the features of the predicted text information and the features of the sample text information. That is, the third semantic feature can represent the predicted text information and the sample text information.

[0099] By processing the predicted text information and the sample text information by first splicing and then classifying, the changes between the core words in the predicted text information and the sample text information can be captured, thereby semantically determining whether the predicted text information and the sample text information are identical, thereby ensuring the accuracy of the fourth similarity obtained.

[0100] For example, the predicted text information is "Why is the label displayed in gray?", and the sample text information is "Why is the label displayed in brown?", that is, the core words "gray" and "brown" of the two text information are different. According to the above-mentioned method of first splicing and then classifying, the fourth similarity obtained is small, so it can be determined that the meaning of the predicted text information is different from that of the sample text information.

[0101] Optionally, a self-attention method is used to perform semantic extraction on the spliced text information to obtain a third semantic feature, the third semantic feature is normalized to obtain a classification result, and the classification result is determined as the fourth similarity.

[0102] In the process of semantic extraction of the spliced text information by means of self-attention, the predicted text information and the sample text information can be cross-encoded to ensure that the third semantic feature is a feature obtained by fusing the features of the predicted text information and the features of the sample text information. The third semantic feature is subsequently normalized to determine whether the core words in the predicted text information and the sample text information are the same. The classification result indicates the degree of similarity between the predicted text information and the core words in the sample text information, thereby determining the fourth similarity.

[0103] It should be noted that the embodiment of the present application uses the above two methods to obtain the fourth similarity separately. In another embodiment, the above two methods can be combined, and the similarities obtained by the above two methods are weighted and fused to obtain the fourth similarity. In one possible implementation, the similarity obtained by the first method is the fifth similarity, and the similarity obtained by the second method is the sixth similarity. The fifth similarity and the sixth similarity are weighted and fused to obtain the fourth similarity.

[0104] 304. The computer device performs weighted fusion on the third similarity and the fourth similarity to obtain a first similarity between the predicted text information and the sample text information.

[0105] The first similarity is used to represent the degree of similarity between the predicted text information and the sample text information. The similarity between the first text information and the label information is considered in various ways to obtain a third similarity and a fourth similarity. The third similarity and the fourth similarity are weighted and fused to ensure the accuracy of the similarity between the predicted text information and the sample text information. This application provides a scoring mechanism that combines semantics and grammar. Based on this scoring mechanism, the similarity between the predicted text information and the sample text information is determined, thereby ensuring the accuracy of the determined first similarity.

[0106] In a possible implementation, the fourth similarity is obtained by weighting the fifth similarity and the sixth similarity, and step 303 includes: performing weighted fusion on the third similarity, the fifth similarity, and the sixth similarity to obtain the first similarity.

[0107] Optionally, the third similarity, the fifth similarity, the sixth similarity, and the first similarity satisfy the following relationship:

[0108] Score(all)=2*Score(sbert)+2*Score(common b ert)+1*Score(diversity)

[0109] Among them, Score(all) is used to represent the first similarity, Score(sbert) is used to represent the fifth similarity, Score(common b ert) is used to represent the sixth similarity, and Score(diversity) is used to represent the third similarity.

[0110] It should be noted that, in the embodiment of the present application, the third similarity and the fourth similarity between the predicted text information and the sample text information are first obtained, and then the third similarity and the fourth similarity are weightedly fused to obtain the fourth similarity between the predicted text information and the sample text information. In another embodiment, there is no need to perform steps 303-304, and other methods can be adopted to obtain the first similarity between the predicted text information and the sample text information.

[0111] 305. The computer device determines second label information based on the first similarity between the predicted text information and the sample text information and the second similarity between the first label information and the sample text information. The second label information is the text information with the greater similarity to the sample text information between the predicted text information and the first label information.

[0112] The first similarity represents the degree of similarity between the predicted text and the sample text, while the second similarity represents the degree of similarity between the first label and the sample text. By comparing the first and second similarities, the text most similar to the sample text can be determined from the predicted text and the first label, and the most similar text is used as the second label. The method for obtaining the second similarity between the first label and the sample text is similar to the method for obtaining the first similarity between the predicted text and the sample text, and will not be further described here.

[0113] In one possible implementation, step 305 includes the following two methods:

[0114] The first method: in response to the largest first similarity among multiple first similarities being greater than the second similarity, the predicted text information corresponding to the largest first similarity is determined as the second label information, and the multiple first similarities are similarities between multiple predicted text information and sample text information.

[0115] The second manner: in response to the fact that the multiple first similarities are not greater than the second similarity, the first label information is determined as the second label information.

[0116] In an embodiment of the present application, based on a text mapping model, sample text information is mapped to obtain multiple predicted text information, and then a first similarity between each predicted text information and the sample text information and a second similarity between the first label information and the sample text information are determined. The multiple first similarities are compared with the second similarities to determine the maximum similarity, and the information corresponding to the maximum similarity is determined as the second label information. For example, if the maximum similarity is the second similarity, the first label information corresponding to the second similarity is determined as the second label information. If the maximum similarity is a first similarity, the predicted text information corresponding to the first similarity is determined as the second label information.

[0117] In a possible implementation, the method further includes: when the second label information is predicted text information, updating the first label information corresponding to the sample text information in the second text information to the second label information.

[0118] If the first similarity between the predicted text information and the sample text information is greater than the second similarity between the first label information and the sample text information, it means that the predicted text information is more similar to the sample text information, that is, the predicted text information is more suitable as the label information of the sample text information. Therefore, the first label information corresponding to the sample text information in the second text information set is updated to ensure that the second text information and the corresponding label information in the second text information set are more accurate, so as to ensure that the quality of the second text information set is higher. When the text mapping model is subsequently trained based on the second text information and the corresponding label information in the second text information set, the mapping effect of the text mapping model can be guaranteed.

[0119] 306. The computer device obtains a first loss value corresponding to the predicted text information based on the second label information and the predicted text information.

[0120] Among them, the difference between the predicted text information and the second label information can represent the accuracy of the text mapping model. Therefore, the first loss value is determined based on the predicted text information and the second label information, so that the text mapping model can be trained based on the first loss value subsequently.

[0121] In a possible implementation, step 306 includes: obtaining a first loss value corresponding to each piece of predicted text information based on the second label information and each piece of predicted text information.

[0122] In an embodiment of the present application, based on the text mapping model, multiple predicted text information corresponding to the sample text information can be mapped. Then, based on each predicted text information and the second label information, the first loss value corresponding to each predicted text information can be determined, so that the text mapping model can be subsequently trained based on the multiple first loss values.

[0123] 307. The computer device trains the text mapping model based on the first similarity and the first loss value corresponding to the predicted text information.

[0124] The first similarity and the first loss value corresponding to the predicted text information can both reflect the accuracy of the text mapping model. Based on the first similarity and the first loss value corresponding to the predicted text information, the text mapping model is trained to improve the mapping effect of the text mapping model.

[0125] In one possible implementation, step 307 includes the following steps 3071-3074:

[0126] 3071. The computer device obtains a weight parameter corresponding to each piece of predicted text information based on a difference between the target similarity and a first similarity corresponding to each piece of predicted text information.

[0127] The target similarity is an arbitrary value that represents the maximum similarity between the expected predicted text information and the sample text information. For example, if the target similarity is 5, the first similarity corresponding to each predicted text information is no greater than 5. The weight parameter indicates whether each predicted text information is accurate and also reflects the mapping effect of the text mapping model. The loss value can be adjusted based on the weight parameter. The larger the weight parameter, the less accurate the predicted text information and the larger the subsequent calculated loss value; the smaller the weight parameter, the more accurate the predicted text information and the smaller the subsequent calculated loss value.

[0128] In one possible implementation, the target similarity, the first similarity corresponding to any predicted text information, and the weight parameter satisfy the following relationship:

[0129]

[0130] Among them, rewards is used to represent the weight parameter corresponding to any predicted text information, μ is used to represent the hyperparameter, μ is a constant, score max Used to indicate target similarity, score real Used to indicate the first similarity corresponding to the predicted text information.

[0131] 3072. The computer device performs weighted averaging of the first loss values corresponding to the plurality of predicted text information based on the weight parameter corresponding to each piece of predicted text information to obtain a second loss value.

[0132] Taking into account the accuracy of each predicted text information, the first loss values corresponding to the plurality of predicted text information are weighted averaged using the weight parameter corresponding to each predicted text information to ensure that the obtained second loss value is accurate.

[0133] In one possible implementation, the weight parameter corresponding to each predicted text information, the first loss value, and the second loss value corresponding to the plurality of predicted text information satisfy the following relationship:

[0134] loss rl =mean(loss mle-batch rewards)

[0135] Among them, loss rl Used to represent the second loss value, loss mle-batch It is used to represent the first loss value corresponding to the predicted text information, rewards is used to represent the weight parameter corresponding to the predicted text information, and mean(·) is used to represent the function for finding the average value.

[0136] 3073. The computer device determines an average of the first loss values corresponding to the multiple predicted text information as a third loss value.

[0137] The first loss value corresponding to each predicted text information can reflect the accuracy of the text mapping model. Taking into account the first loss values corresponding to multiple predicted text information, the average of the first loss values corresponding to the predicted text information is taken as the third loss value. The third loss value is then used to train the text mapping model to ensure the accuracy of the trained text mapping model, thereby improving the mapping effect of the text mapping model.

[0138] In one possible implementation, the third loss value and the first loss values corresponding to the plurality of predicted text information satisfy the following relationship:

[0139] loss mle =mean(loss mle-batch )

[0140] Among them, loss mle Used to represent the third loss value, loss mle-batch It is used to represent the first loss value corresponding to multiple predicted text information, and mean(·) is used to represent the average value.

[0141] 3074. The computer device trains the text mapping model based on the second loss value and the third loss value.

[0142] Since the second loss value and the third loss value can both reflect the accuracy of the text mapping model, the text mapping model is trained based on the second loss value and the third loss value to improve the mapping effect of the text mapping model.

[0143] In one possible implementation, step 3074 includes: performing weighted fusion on the second loss value and the third loss value to obtain a fourth loss value, and training the text mapping model based on the fourth loss value.

[0144] Optionally, the second loss value, the third loss value, and the fourth loss value satisfy the following relationship:

[0145] loss = λloss rl +(1-λ)loss mle

[0146] Among them, loss is used to represent the fourth loss value, λ is used to represent the hyperparameter, λ is a constant, loss rl Used to represent the second loss value, loss mle Used to represent the third loss value.

[0147] The text mapping model is trained by the second loss value and the third loss value, taking into account the influence of the first similarity between the predicted text information and the sample text information, so that when the predicted text information is sufficiently similar to the sample text information, the loss value is reduced to reduce the adjustment amplitude of the text model. When the predicted text information is not similar to the sample text information, the loss value is increased to accelerate the convergence and optimization of the text mapping model to ensure the mapping effect of the text mapping model finally obtained by training.

[0148] It should be noted that the embodiment of the present application trains the text mapping model by predicting the first loss value and the first similarity corresponding to the text information. In another embodiment, there is no need to execute steps 306-307, and other methods can be adopted to train the text mapping model based on the second label information, the predicted text information and the first similarity corresponding to the predicted text information.

[0149] It should be noted that the embodiment of the present application is only described by performing a single iterative training of the text mapping model based on the sample text information and the corresponding first label information. In another embodiment, the text mapping model can be iteratively trained multiple times according to the above steps 301-307. In one possible implementation, during the iterative training of the text mapping model according to the above steps 301-307, in response to the number of iterations reaching a first value, the text mapping model training is stopped; or in response to the fourth loss value of the current number of iterations being less than a second value, the text mapping model training is stopped.

[0150] The first value is used to represent the maximum number of iterations. The first value and the second value are both arbitrary values. For example, the first value is 100 and the second value is 0.3.

[0151] It should be noted that the embodiment of the present application is only based on one iterative training of the text mapping model based on one sample text information and the corresponding first label information. In another embodiment, when the text mapping model is iteratively trained, the text mapping model can be trained based on multiple sample text information and the first label information corresponding to each sample text information. For example, multiple sample text information and the first label information corresponding to each sample text information are obtained from the second text information set, and then the predicted text information corresponding to each sample text information is obtained according to the above steps 301-306, and the first similarity and first loss value corresponding to each predicted text information are obtained. Based on the first similarity and first loss value corresponding to the multiple predicted text information, the text mapping model is trained according to the above step 307.

[0152] In a possible implementation, after step 307 , the method further includes: mapping the target text information based on a text mapping model to obtain similar text information of the target text information.

[0153] The target text information is any text information. After the text mapping model is trained, similar text information of the target text information can be mapped based on the text mapping model.

[0154] Optionally, based on the text mapping model, the target text information is mapped to obtain a plurality of similar text information of the target text information.

[0155] The method provided in the embodiment of the present application takes the text information that is most similar to the sample text information in the predicted text information and the first label information as the second label information according to the similarity between the predicted text information and the first label information and the sample text information respectively. Not only the difference between the predicted text information and the second label text information is taken into account, but also the first similarity between the predicted text information and the sample text information is taken into account. Based on the second label information, the predicted text information and the first similarity corresponding to the predicted text information, the text mapping model is trained to ensure that the trained text mapping model can subsequently map out similar text information of any text information, thereby improving the mapping effect of the text mapping model.

[0156] Furthermore, the present application provides a scoring mechanism that combines semantics and grammar to determine the similarity between the first text information and the corresponding tag information, thereby ensuring the accuracy of the determined similarity.

[0157] Moreover, during the training process of the text mapping model, the label information will be updated so that the updated label information is the text information that is most similar to the sample text information between the predicted text information and the label text information, so as to ensure the accuracy of the label information. The text mapping model is trained based on the updated label information, the predicted text information and the first similarity corresponding to the predicted text information. This can improve the mapping effect of the text mapping model, avoid training the model in a fixed label manner, and enable the text mapping model to have better generalization capabilities.

[0158] exist Figure 2 On the basis of the shown embodiment, the text mapping model can also be trained in multiple stages, that is, the text mapping model is first trained in the first stage based on the first text information and the corresponding label information in the first text information set, and then the first text information set is screened, and the text mapping model is trained in the second stage based on the second text information set obtained by screening. The training process is detailed in the following embodiment.

[0159] Figure 5 This is a flowchart of a method for processing a text mapping model provided by an embodiment of the present application, which is executed by a computer device, such as Figure 5 As shown, the method includes:

[0160] 501. A computer device obtains a first text information set.

[0161] The first text information set includes multiple first text information and label information corresponding to each first text information. The first text information is any type of text information, for example, the first text information includes a question statement, an answer statement, or a disease description statement. The label information corresponding to each first text information is text information that may be similar to the first text information.

[0162] 502. The computer device trains a text mapping model based on the first text information and corresponding label information in the first text information set.

[0163] The text mapping model is any network model, for example, the text mapping model is Seq2Seq (Sequence to Sequence, a neural network model) or Transformer (an attention network model).

[0164] The text mapping model is trained using the first text information and the corresponding label information in the first text information set, so that the trained text mapping model has preliminary text mapping capabilities and can map out similar text information of any text information.

[0165] In one possible implementation, step 502 includes: mapping the first text information based on the text mapping model to obtain predicted text information corresponding to the first text information, and training the text mapping model based on the predicted text information and label information corresponding to the first text information.

[0166] Based on the text mapping model, the predicted text information corresponding to the first text information is mapped out. The difference between the predicted text information and the label information corresponding to the first text information can reflect the quality of the mapping effect of the text mapping model. The text mapping model is trained based on the predicted text information and the label information corresponding to the first text information to improve the mapping effect of the text mapping model.

[0167] Optionally, the process of training the text mapping model includes: determining a fifth loss value based on the predicted text information and label information corresponding to the first text information, and training the text mapping model based on the fifth loss value.

[0168] The fifth loss value indicates the degree of difference between the predicted text information and the label information corresponding to the first text information, and can reflect the mapping performance of the text mapping model. For example, the fifth loss value can be determined using a cross-entropy loss function based on the predicted text information and the label information corresponding to the first text information. The text mapping model is trained using the fifth loss value to improve its mapping performance.

[0169] In one possible implementation, step 502 includes iteratively training the text mapping model based on the plurality of first text information and label information corresponding to each first text information.

[0170] The text mapping model is trained iteratively multiple times to improve the mapping effect of the text mapping model as much as possible.

[0171] Optionally, during the iterative training of the text mapping model, in response to the number of iterations reaching a third value, the training of the text mapping model is stopped; or, in response to the fifth loss value of the current number of iterations being less than a fourth value, the training of the text mapping model is stopped.

[0172] The third value is used to represent the maximum number of iterations. The third value and the fourth value are both arbitrary values. For example, the third value is 100 and the fourth value is 0.3.

[0173] 503. The computer device determines the similarity between each first text information and the corresponding tag information.

[0174] The similarity between each first text information and the corresponding tag information can reflect the degree of similarity between the first text information and the corresponding tag information.

[0175] In one possible implementation, step 503 includes: for any first text information and corresponding tag information, obtaining the seventh similarity and the eighth similarity between the first text information and the tag information, performing weighted fusion on the seventh similarity and the eighth similarity to obtain the similarity between the first text information and the tag information.

[0176] Among them, the seventh similarity indicates the difference between the words contained in the first text information and the label information, and can express the grammatical similarity between the first text information and the label information. The eighth similarity indicates the semantic similarity between the first text information and the label information, and can express the semantic similarity between the first text information and the label information. By considering the similarity between the first text information and the label information in a variety of ways, the seventh similarity and the eighth similarity are obtained, and the seventh similarity and the eighth similarity are weightedly fused to ensure the accuracy of the similarity between the obtained first text information and the label information. The present application provides a scoring mechanism that combines semantics and grammar, and determines the similarity between the first text information and the corresponding label information based on the scoring mechanism, thereby ensuring the accuracy of the determined similarity.

[0177] Optionally, the process of obtaining the seventh similarity between the first text information and the tag information includes:

[0178] 5031. Based on at least one number of characters, divide the first text information into at least one third word set to obtain at least one third word set, where words belonging to the same third word set have the same number of characters.

[0179] 5032. Based on at least one number of characters, the tag information is divided to obtain at least one fourth word set, where words belonging to the same fourth word set have the same number of characters.

[0180] 5033. Determine a third number and a fourth number, where the third number indicates the sum of the number of different words in the third word set and the fourth word set corresponding to each number of characters, and the fourth number indicates the total number of words in at least one third word set and at least one fourth word set.

[0181] 5034. Determine the ratio of the third number to the fourth number as the seventh similarity between the first text information and the tag information.

[0182] Steps 5031-5034 are similar to the above steps 3031-3034 and will not be repeated here.

[0183] Optionally, the process of obtaining the eighth similarity between the first text information and the tag information includes the following two methods:

[0184] The first method is to perform semantic extraction on the first text information and the tag information respectively to obtain a fourth semantic feature of the first text information and a fifth semantic feature of the tag information; and determine the similarity between the fourth semantic feature and the fifth semantic feature as an eighth similarity.

[0185] The first method for obtaining the eighth similarity is similar to the first method for obtaining the fourth similarity, and will not be described in detail here.

[0186] The second method is: splicing the first text information with the label information to obtain first spliced text information; performing semantic extraction on the first spliced text information to obtain a sixth semantic feature corresponding to the first spliced text information; classifying the sixth semantic feature to obtain a classification result; and determining the classification result as the eighth similarity.

[0187] The second method for obtaining the eighth similarity is similar to the second method for obtaining the fourth similarity, and will not be described in detail here.

[0188] It should be noted that the embodiment of the present application uses the above two methods to obtain the eighth similarity separately. In another embodiment, the above two methods can be combined, and the similarities obtained by the above two methods are weighted and fused to obtain the eighth similarity. In one possible implementation, the similarity obtained by the first method is the ninth similarity, and the similarity obtained by the second method is the tenth similarity. The ninth similarity and the tenth similarity are weighted and fused to obtain the eighth similarity.

[0189] 504. The computer device selects at least one second text message having a similarity greater than a similarity threshold from the first text message set based on the similarity corresponding to each first text message, and forms a second text message set with the selected second text message and the corresponding tag information.

[0190] The similarity threshold is an arbitrary threshold, for example, the similarity threshold is 0.8, or 3.

[0191] In an embodiment of the present application, the first text information set includes multiple first text information and label information corresponding to each first text information, each first text information and the corresponding label information constitute an information combination, the quality of the information combination in the first text information set is different, and there may be poor information combinations, that is, the first text information and the label information in the information combination are not similar. If the text mapping model is trained according to the poor information combination, it will lead to poor mapping effect of the text mapping model. Therefore, by screening the text information and the corresponding label information in the first text information set, a second text information set is generated to ensure that the similarity between each second text information in the second text information set and the corresponding label information is greater than the similarity threshold, that is, the second text information set includes high-quality information combinations, and subsequently based on the second text information and the corresponding label information in the second text information set, the text mapping model is trained to ensure the mapping effect of the text mapping model.

[0192] It should be noted that, in the embodiment of the present application, the text mapping model is first trained based on the first text information and the corresponding label information in the first text information set, and then the second text information set is filtered out based on the first text information set. In another embodiment, the above steps 503-504 can be executed first to filter out the second text information set, and then the above step 502 can be executed. This application does not limit the order of executing the steps.

[0193] 505. The computer device obtains sample text information and first tag information from the second text information set, where the sample text information is any second text information.

[0194] In an embodiment of the present application, the second text information set includes at least one second text information and label information corresponding to each second text information. Any second text information is obtained from the second text information set as sample text information, and the first label information corresponding to the sample text information is obtained.

[0195] It should be noted that, in the embodiment of the present application, the first text information set is first screened to obtain the second text information set, and the sample text information and the first label information are obtained from the second text information set. In another embodiment, there is no need to perform steps 504-505, and other methods can be adopted to screen out the sample text information and the first label information whose similarity is greater than the similarity threshold from the first text information set based on the similarity corresponding to each first text information.

[0196] It should be noted that, in the embodiment of the present application, the text mapping model is preliminarily trained based on the first text information set, and then the first text information in the first text information set is screened to construct a second text information set, and sample text information and first label information are obtained from the second text information set. In another embodiment, there is no need to first train the text mapping model based on the first text information set, nor is there any need to execute steps 501-504. Other methods can be adopted to obtain sample text information and first label information, and the first label information is text information whose similarity with the sample text information is not less than a similarity threshold.

[0197] 506. The computer device maps the sample text information based on the text mapping model to obtain predicted text information.

[0198] 507. The computer device determines second label information based on the first similarity between the predicted text information and the sample text information and the second similarity between the first label information and the sample text information. The second label information is the text information with the greater similarity to the sample text information between the predicted text information and the first label information.

[0199] 508. The computer device trains a text mapping model based on the second label information, the predicted text information, and the first similarity corresponding to the predicted text information. The text mapping model is used to map out similar text information of any text information.

[0200] Steps 506-508 are similar to the above steps 302-307 and are not described again here.

[0201] The method provided in the embodiment of the present application takes the text information that is most similar to the sample text information in the predicted text information and the first label information as the second label information according to the similarity between the predicted text information and the first label information and the sample text information respectively. Not only the difference between the predicted text information and the second label text information is taken into account, but also the first similarity between the predicted text information and the sample text information is taken into account. Based on the second label information, the predicted text information and the first similarity corresponding to the predicted text information, the text mapping model is trained to ensure that the trained text mapping model can subsequently map out similar text information of any text information, thereby improving the mapping effect of the text mapping model.

[0202] Moreover, in the process of training the text mapping model, the label information corresponding to the sample text information in the second text information set will be updated, so that the updated label information is the text information that is most similar to the sample text information in the predicted text information and the label text information, so as to ensure the accuracy of the label information. In this way, the text mapping model can be trained to improve the mapping effect of the text mapping model, avoid training the model in a fixed label manner, and make the text mapping model have better generalization ability.

[0203] Moreover, by screening the initial first text information set and cleaning up the low-quality information combinations in the first text information set, it is ensured that the similarity between the second text information in the screened second text information and the corresponding label information is greater than the similarity threshold, thereby improving the quality of the information combination in the second text information set. The text mapping model is trained with the second text information and the corresponding label information in the second text information set to ensure the accuracy of the sample information of the training text mapping model, thereby ensuring the training effect of the subsequent training text mapping model.

[0204] In addition, the present application adopts a multi-stage training method to train the text mapping model. The text mapping model is first preliminarily trained based on the first text information set so that the text mapping model has preliminary text mapping capabilities. The text mapping model is then trained with the screened second text information set to further improve the mapping effect of the text mapping model.

[0205] Furthermore, the present application provides a scoring mechanism that combines semantics and grammar to determine the similarity between the first text information and the corresponding tag information, thereby ensuring the accuracy of the determined similarity.

[0206] like Figure 6 As shown, the text mapping model is trained in two stages. In the first training stage, the text mapping model is trained based on the first text information set. In the second training stage, a scoring mechanism is used to screen out a second text information set based on the first text information set, and the text mapping model is trained based on the second text information set. In addition, during the training process, a scoring mechanism is used to determine a first similarity between the sample text information and the predicted text information and a second similarity between the first label information and the sample text information. Based on the first similarity and the second similarity, the second label information is determined. Based on the second label information, the predicted text information, and the first similarity corresponding to the predicted text information, the text mapping model is subjected to intensive training.

[0207] like Figure 7As shown, the processing method of the text mapping model provided in the embodiment of the present application is compared with the text mapping model processing method in the related art. Related art 1 is to train the text mapping model directly based on the original training data set, and related art 2 is to filter the original training data set, adopt the cross entropy loss function, and train the text mapping model through the filtered training data set. Through comparison, it can be seen that the amount of training data obtained by the method provided in the embodiment of the present application is the smallest, but the number of similar text information mapped out by the text mapping model provided in the embodiment of the present application is large, and the quality of the mapped similar text information is high, that is, the performance of the text mapping model provided in the embodiment of the present application is better and the mapping effect is better.

[0208] The processing method of the text mapping model provided in the embodiment of the present application can be applied to a variety of scenarios, for example, in the intelligent question-answering scenario, the question-answering knowledge base can be expanded based on the text mapping model. Figure 8 As shown, the question and answer knowledge base of the intelligent dialogue robot is configured with multiple questions and answers to each question. In the editing interface of the question and answer knowledge base, in response to the triggering operation of the editing option corresponding to any question, the question and answer editing interface is displayed, and the user can edit the question and the corresponding answer in the question and answer editing interface. Based on the text mapping model, the question entered in the question and answer editing interface is mapped to obtain multiple similar questions of the question, and a prompt mark 801 is displayed to prompt the user to map out multiple similar questions of the currently entered question. The user clicks the similar question option to display multiple similar questions. The user clicks the save option to associate the entered question with the corresponding multiple similar questions, enriching the multiple questions corresponding to each answer in the question and answer knowledge base. When the user subsequently communicates with the intelligent dialogue robot, the user enters any question, and the intelligent dialogue robot can find the answer to any question from the question and answer knowledge base, thereby improving the user experience and avoiding the situation where the intelligent dialogue robot cannot answer the question due to the small number of questions configured in the question and answer knowledge base.

[0209] Figure 9 This is a structural diagram of a processing device for a text mapping model provided in an embodiment of the present application. Figure 9 As shown, the device includes:

[0210] An acquisition module 901 is configured to acquire sample text information and first tag information, where the first tag information is text information having a similarity with the sample text information that is not less than a similarity threshold;

[0211] A mapping module 902 is configured to map the sample text information based on a text mapping model to obtain predicted text information;

[0212] Determining module 903, configured to determine second label information based on a first similarity between the predicted text information and the sample text information and a second similarity between the first label information and the sample text information, where the second label information is the text information having a greater similarity with the sample text information between the predicted text information and the first label information;

[0213] The training module 904 is configured to train a text mapping model based on the second label information, the predicted text information, and the first similarity corresponding to the predicted text information. The text mapping model is configured to map out similar text information of any text information.

[0214] In one possible implementation, Figure 10 As shown, the device also includes:

[0215] The acquisition module 901 is further configured to acquire a third similarity and a fourth similarity between the predicted text information and the sample text information, wherein the third similarity indicates the difference in terms between the predicted text information and the sample text information, and the fourth similarity indicates the semantic similarity between the predicted text information and the sample text information;

[0216] The fusion module 905 is configured to perform weighted fusion on the third similarity and the fourth similarity to obtain the first similarity.

[0217] In another possible implementation, the acquisition module 901 is used to divide the predicted text information based on at least one number of characters to obtain at least one first word set, and the words belonging to the same first word set contain the same number of characters; divide the sample text information based on at least one number of characters to obtain at least one second word set, and the words belonging to the same second word set contain the same number of characters; determine a first number and a second number, the first number indicating the sum of the number of different words in the first word set and the second word set corresponding to each number of characters, and the second number indicating the total number of words in at least one first word set and at least one second word set; and determine the ratio of the first number to the second number as the third similarity between the predicted text information and the sample text information.

[0218] In another possible implementation, the acquisition module 901 is used to perform semantic extraction on the predicted text information and the sample text information respectively to obtain a first semantic feature of the predicted text information and a second semantic feature of the sample text information; and determine the similarity between the first semantic feature and the second semantic feature as a fourth similarity.

[0219] In another possible implementation, the acquisition module 901 is used to splice the predicted text information with the sample text information to obtain spliced text information; perform semantic extraction on the spliced text information to obtain a third semantic feature corresponding to the spliced text information; perform classification processing on the third semantic feature to obtain a classification result; and determine the classification result as a fourth similarity.

[0220] In another possible implementation, the training module 904 is used to obtain a first loss value corresponding to the predicted text information based on the second label information and the predicted text information; and train the text mapping model based on the first similarity and the first loss value corresponding to the predicted text information.

[0221] In another possible implementation, the training module 904 is used to obtain a weight parameter corresponding to each predicted text information based on the difference between the target similarity and the first similarity corresponding to each predicted text information; based on the weight parameter corresponding to each predicted text information, perform a weighted average of the first loss values corresponding to multiple predicted text information to obtain a second loss value; determine the average of the first loss values corresponding to the multiple predicted text information as a third loss value; and train the text mapping model based on the second loss value and the third loss value.

[0222] In another possible implementation, Figure 10 As shown, the acquisition module 901 includes:

[0223] An acquiring unit 9011 is configured to acquire a first text information set, where the first text information set includes a plurality of first text information and tag information corresponding to each first text information;

[0224] a determining unit 9012, configured to determine a similarity between each first text information and corresponding tag information;

[0225] The screening unit 9013 is configured to screen out sample text information and first label information having a similarity greater than a similarity threshold from the first text information set based on the similarity corresponding to each first text information.

[0226] In another possible implementation, the screening unit 9013 is used to screen out at least one second text information having a similarity greater than a similarity threshold from the first text information set based on the similarity corresponding to each first text information, and to form a second text information set with the screened out second text information and the corresponding label information; and to obtain sample text information and the first label information from the second text information set, where the sample text information is any second text information.

[0227] In another possible implementation, the acquisition module 901 is further configured to train the text mapping model based on the first text information and the corresponding label information in the first text information set.

[0228] In another possible implementation, the determination module 903 is used to determine the predicted text information corresponding to the largest first similarity as the second label information in response to the largest first similarity among multiple first similarities being greater than the second similarity, where the multiple first similarities are similarities between multiple predicted text information and the sample text information; or, in response to the multiple first similarities not being greater than the second similarity, determine the first label information as the second label information.

[0229] In another possible implementation, the mapping module 902 is further configured to map the target text information based on a text mapping model to obtain similar text information of the target text information.

[0230] It should be noted that the text mapping model processing device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. In addition, the text mapping model processing device provided in the above embodiment and the text mapping model processing method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0231] An embodiment of the present application also provides a computer device, which includes a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the text mapping model processing method of the above embodiment.

[0232] Optionally, the computer device is provided as a terminal. Figure 11 The following is a block diagram of a terminal 1100 according to an exemplary embodiment of the present application. Terminal 1100 may be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. Terminal 1100 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other similar names.

[0233] The terminal 1100 includes a processor 1101 and a memory 1102 .

[0234] The processor 1101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1101 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 1101 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1101 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1101 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0235] The memory 1102 may include one or more computer-readable storage media, which may be non-transitory. The memory 1102 may also include a high-speed random access memory and a non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1102 is used to store at least one computer program, which is used to be executed by the processor 1101 to implement the text mapping model processing method provided in the method embodiment of the present application.

[0236] In some embodiments, terminal 1100 may optionally include a peripheral device interface 1103 and at least one peripheral device. Processor 1101, memory 1102, and peripheral device interface 1103 may be connected via a bus or signal lines. Each peripheral device may be connected to peripheral device interface 1103 via a bus, signal lines, or circuit boards. Specifically, the peripheral device may include at least one of a radio frequency circuit 1104, a display screen 1105, a camera assembly 1106, an audio circuit 1107, and a power supply 1109.

[0237] The peripheral device interface 1103 can be used to connect at least one I / O (Input / Output)-related peripheral device to the processor 1101 and the memory 1102. In some embodiments, the processor 1101, the memory 1102, and the peripheral device interface 1103 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1101, the memory 1102, and the peripheral device interface 1103 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

[0238] The RF circuit 1104 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1104 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1104 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the RF circuit 1104 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The RF circuit 1104 can communicate with other terminals via at least one wireless communication protocol. Such wireless communication protocols include, but are not limited to, the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1104 may also include circuitry related to Near Field Communication (NFC), although this application does not limit this.

[0239] The display screen 1105 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1105 is a touch screen display, the display screen 1105 also has the ability to collect touch signals on the surface or above the surface of the display screen 1105. The touch signal can be input as a control signal to the processor 1101 for processing. At this time, the display screen 1105 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, there can be one display screen 1105, which is set on the front panel of the terminal 1100; in other embodiments, there can be at least two display screens 1105, which are respectively set on different surfaces of the terminal 1100 or in a folding design; in other embodiments, the display screen 1105 can be a flexible display screen, which is set on the curved surface or folding surface of the terminal 1100. Even more, the display screen 1105 can be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 1105 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0240] The camera assembly 1106 is used to capture images or videos. Optionally, the camera assembly 1106 includes a front camera and a rear camera. The front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 1106 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0241] The audio circuit 1107 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals that are input into the processor 1101 for processing, or input into the radio frequency circuit 1104 to achieve voice communication. For the purpose of stereo sound collection or noise reduction, there may be multiple microphones, each located in different parts of the terminal 1100. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert electrical signals from the processor 1101 or the radio frequency circuit 1104 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for purposes such as distance measurement. In some embodiments, the audio circuit 1107 may also include a headphone jack.

[0242] Power supply 1109 is used to power various components in terminal 1100. Power supply 1109 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1109 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is charged via a wired line, while a wireless rechargeable battery is charged via a wireless coil. The rechargeable battery can also support fast charging technology.

[0243] In some embodiments, the terminal 1100 further includes one or more sensors 1110 , including but not limited to: an acceleration sensor 1111 , a gyroscope sensor 1112 , a pressure sensor 1113 , an optical sensor 1115 , and a proximity sensor 1116 .

[0244] The accelerometer 1111 can detect the magnitude of acceleration along the three coordinate axes of the coordinate system established by the terminal 1100. For example, the accelerometer 1111 can be used to detect the components of gravity acceleration along the three coordinate axes. The processor 1101 can control the display screen 1105 to display the user interface in a landscape or portrait view based on the gravity acceleration signal collected by the accelerometer 1111. The accelerometer 1111 can also be used to collect game or user motion data.

[0245] The gyroscope sensor 1112 can detect the orientation and rotation angle of the terminal 1100. The gyroscope sensor 1112 can work with the acceleration sensor 1111 to collect the user's 3D movements on the terminal 1100. Based on the data collected by the gyroscope sensor 1112, the processor 1101 can implement the following functions: motion sensing (such as changing the UI based on the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0246] The pressure sensor 1113 can be set on the side frame of the terminal 1100 and / or the lower layer of the display screen 1105. When the pressure sensor 1113 is set on the side frame of the terminal 1100, it can detect the user's grip signal of the terminal 1100, and the processor 1101 performs left and right hand recognition or shortcut operations based on the grip signal collected by the pressure sensor 1113. When the pressure sensor 1113 is set on the lower layer of the display screen 1105, the processor 1101 controls the operable controls on the UI interface based on the user's pressure operation on the display screen 1105. The operable controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0247] Optical sensor 1115 is used to collect ambient light intensity. In one embodiment, processor 1101 can control the display brightness of display screen 1105 based on the ambient light intensity collected by optical sensor 1115. Specifically, when the ambient light intensity is high, the display brightness of display screen 1105 is increased; when the ambient light intensity is low, the display brightness of display screen 1105 is decreased. In another embodiment, processor 1101 can also dynamically adjust the shooting parameters of camera assembly 1106 based on the ambient light intensity collected by optical sensor 1115.

[0248] Proximity sensor 1116, also known as a distance sensor, is disposed on the front panel of terminal 1100. Proximity sensor 1116 is used to detect the distance between the user and the front of terminal 1100. In one embodiment, when proximity sensor 1116 detects that the distance between the user and the front of terminal 1100 is gradually decreasing, processor 1101 controls display screen 1105 to switch from the screen-on state to the screen-off state. When proximity sensor 1116 detects that the distance between the user and the front of terminal 1100 is gradually increasing, processor 1101 controls display screen 1105 to switch from the screen-off state to the screen-on state.

[0249] Those skilled in the art will understand that Figure 11 The structure shown in the figure does not constitute a limitation on the terminal 1100, and the terminal 1100 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0250] Optionally, the computer device is provided as a server. Figure 121 is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server 1200 may vary significantly due to different configurations or performances, and may include one or more processors (Central Processing Units, CPUs) 1201 and one or more memories 1202. The memories 1202 store at least one computer program, which is loaded and executed by the processor 1201 to implement the methods provided in the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be described in detail here.

[0251] An embodiment of the present application also provides a computer-readable storage medium, which stores at least one computer program. The at least one computer program is loaded and executed by a processor to implement the operations performed by the text mapping model processing method of the above embodiment.

[0252] An embodiment of the present application also provides a computer program product or computer program, and provides a computer program product, including a computer program, which, when executed by a processor, implements the operations performed by the processing method of the text mapping model in the above embodiment.

[0253] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0254] The above description is merely an optional embodiment of the embodiments of the present application and is not intended to limit the embodiments of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the embodiments of the present application shall be included in the scope of protection of the present application.

Claims

1. A method for processing a text mapping model, characterized in that: The method comprises: Acquire sample text information and first label information, where the first label information is text information whose similarity to the sample text information is not less than a similarity threshold; Mapping the sample text information based on a text mapping model to obtain predicted text information; determining second label information based on a first similarity between the predicted text information and the sample text information and a second similarity between the first label information and the sample text information, wherein the second label information is the text information having a greater similarity with the sample text information between the predicted text information and the first label information; Based on the second label information and the predicted text information, obtaining a first loss value corresponding to the predicted text information; Obtaining a weight parameter corresponding to each piece of the predicted text information based on a difference between a target similarity and the first similarity corresponding to each piece of the predicted text information, wherein the target similarity is used to indicate a maximum expected similarity between the predicted text information and the sample text information; Based on the weight parameter corresponding to each piece of predicted text information, performing a weighted average of the first loss values corresponding to a plurality of pieces of predicted text information to obtain a second loss value; determining an average of the first loss values corresponding to the plurality of predicted text information as a third loss value; The text mapping model is trained based on the second loss value and the third loss value, and the text mapping model is used to map out similar text information of any text information.

2. The method according to claim 1, characterized in that Before determining the second label information based on the first similarity between the predicted text information and the sample text information and the second similarity between the first label information and the sample text information, the method further includes: Obtaining a third similarity and a fourth similarity between the predicted text information and the sample text information, wherein the third similarity indicates a difference in terms between the predicted text information and the sample text information, and the fourth similarity indicates a semantic similarity between the predicted text information and the sample text information; The third similarity and the fourth similarity are weightedly fused to obtain the first similarity.

3. The method according to claim 2, characterized in that The obtaining of a third similarity between the predicted text information and the sample text information includes: Based on at least one number of characters, the predicted text information is divided respectively to obtain at least one first word set, where words belonging to the same first word set have the same number of characters; Based on at least one of the numbers of characters, the sample text information is divided to obtain at least one second word set, where words belonging to the same second word set have the same number of characters; Determining a first number and a second number, wherein the first number indicates the sum of the number of different words in the first word set and the second word set corresponding to each number of the characters, and the second number indicates the total number of words in at least one of the first word set and at least one of the second word set; The ratio of the first number to the second number is determined as the third similarity between the predicted text information and the sample text information.

4. The method according to claim 2, characterized in that Obtaining a fourth similarity between the predicted text information and the sample text information includes: Performing semantic extraction on the predicted text information and the sample text information respectively to obtain a first semantic feature of the predicted text information and a second semantic feature of the sample text information; The similarity between the first semantic feature and the second semantic feature is determined as the fourth similarity.

5. The method according to claim 2, characterized in that Obtaining a fourth similarity between the predicted text information and the sample text information includes: Splicing the predicted text information with the sample text information to obtain spliced text information; Performing semantic extraction on the spliced text information to obtain a third semantic feature corresponding to the spliced text information; performing classification processing on the third semantic feature to obtain a classification result; The classification result is determined as the fourth similarity.

6. The method according to claim 1, characterized in that The obtaining of the sample text information and the first label information includes: Acquire a first text information set, where the first text information set includes a plurality of first text information and tag information corresponding to each first text information; Determining the similarity between each of the first text information and the corresponding tag information; Based on the similarity corresponding to each of the first text information, the sample text information and the first tag information having a similarity greater than the similarity threshold are filtered out from the first text information set.

7. The method according to claim 6, characterized in that The step of screening out the sample text information and the first tag information having a similarity greater than a similarity threshold from the first text information set based on the similarity corresponding to each of the first text information includes: Based on the similarity corresponding to each of the first text messages, at least one second text message having a similarity greater than the similarity threshold is screened out from the first text message set, and the screened out second text messages and corresponding tag information form a second text message set; The sample text information and the first tag information are obtained from the second text information set, where the sample text information is any one of the second text information.

8. The method according to claim 6, characterized in that Before mapping the sample text information based on the text mapping model to obtain predicted text information, the method further includes: The text mapping model is trained based on the first text information and corresponding label information in the first text information set.

9. The method according to any one of claims 1 to 8, characterized in that The determining of second label information based on a first similarity between the predicted text information and the sample text information and a second similarity between the first label information and the sample text information includes: In response to the largest first similarity among the plurality of first similarities being greater than the second similarity, the predicted text information corresponding to the largest first similarity is determined as the second label information, wherein the plurality of first similarities are similarities between the plurality of predicted text information and the sample text information; or In response to the fact that none of the plurality of first similarities is greater than the second similarity, the first label information is determined as the second label information.

10. The method according to any one of claims 1 to 8, characterized in that After training the text mapping model based on the second tag information, the predicted text information, and the first similarity corresponding to the predicted text information, the method further includes: Based on the text mapping model, the target text information is mapped to obtain similar text information of the target text information.

11. A text mapping model processing device, characterized in that: The device comprises: an acquisition module, configured to acquire sample text information and first tag information, wherein the first tag information is text information having a similarity with the sample text information that is not less than a similarity threshold; A mapping module, configured to map the sample text information based on the text mapping model to obtain predicted text information; a determination module, configured to determine second label information based on a first similarity between the predicted text information and the sample text information and a second similarity between the first label information and the sample text information, wherein the second label information is the text information having a greater similarity with the sample text information between the predicted text information and the first label information; A training module is used to obtain a first loss value corresponding to the predicted text information based on the second label information and the predicted text information; obtain a weight parameter corresponding to each predicted text information based on the difference between the target similarity and the first similarity corresponding to each predicted text information, the target similarity being used to represent the expected maximum value of the similarity between the predicted text information and the sample text information; based on the weight parameter corresponding to each predicted text information, perform a weighted average of the first loss values corresponding to multiple predicted text information to obtain a second loss value; determine the average of the first loss values corresponding to multiple predicted text information as a third loss value; and train the text mapping model based on the second loss value and the third loss value, the text mapping model being used to map out similar text information of any text information.

12. The device according to claim 11, characterized in that The device further comprises: The acquisition module is further configured to acquire a third similarity and a fourth similarity between the predicted text information and the sample text information, wherein the third similarity indicates a difference in terms between the predicted text information and the sample text information, and the fourth similarity indicates a semantic similarity between the predicted text information and the sample text information; The fusion module is configured to perform weighted fusion on the third similarity and the fourth similarity to obtain the first similarity.

13. The device according to claim 12, characterized in that The acquisition module is configured to divide the predicted text information based on at least one number of characters to obtain at least one first word set, wherein words belonging to the same first word set have the same number of characters; divide the sample text information based on at least one number of characters to obtain at least one second word set, wherein words belonging to the same second word set have the same number of characters; determine a first number and a second number, wherein the first number indicates the sum of the number of different words in the first word set and the second word set corresponding to each number of characters, and the second number indicates the total number of words in at least one first word set and at least one second word set; and determine the ratio of the first number to the second number as the third similarity between the predicted text information and the sample text information.

14. The device according to claim 12, characterized in that The acquisition module is configured to perform semantic extraction on the predicted text information and the sample text information respectively to obtain a first semantic feature of the predicted text information and a second semantic feature of the sample text information; The similarity between the first semantic feature and the second semantic feature is determined as the fourth similarity.

15. The device according to claim 12, characterized in that The acquisition module is configured to concatenate the predicted text information with the sample text information to obtain concatenated text information; and perform semantic extraction on the concatenated text information to obtain a third semantic feature corresponding to the concatenated text information. Classify the third semantic feature to obtain a classification result; and determine the classification result as the fourth similarity.

16. The device according to claim 11, characterized in that The acquisition module includes: an acquiring unit, configured to acquire a first text information set, wherein the first text information set includes a plurality of first text information and tag information corresponding to each first text information; a determining unit, configured to determine a similarity between each of the first text information and the corresponding tag information; The screening unit is configured to screen out the sample text information and the first label information having a similarity greater than a similarity threshold from the first text information set based on the similarity corresponding to each of the first text information.

17. The device according to claim 16, characterized in that The screening unit is configured to screen out at least one second text message having a similarity greater than a similarity threshold from the first text message set based on the similarity corresponding to each first text message, and form a second text message set with the screened second text message and the corresponding tag information; The sample text information and the first tag information are obtained from the second text information set, where the sample text information is any one of the second text information.

18. The device according to claim 16, characterized in that The acquisition module is further configured to train the text mapping model based on the first text information and corresponding label information in the first text information set.

19. The device according to any one of claims 11 to 18, characterized in that The determination module is configured to determine, in response to a largest first similarity among multiple first similarities being greater than the second similarity, the predicted text information corresponding to the largest first similarity as the second label information, where the multiple first similarities are similarities between the multiple predicted text information and the sample text information; or, in response to none of the multiple first similarities being greater than the second similarity, determine the first label information as the second label information.

20. The device according to any one of claims 11 to 18, characterized in that The mapping module is further configured to map the target text information based on the text mapping model to obtain similar text information to the target text information.

21. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the text mapping model processing method according to any one of claims 1 to 10.

22. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to implement the operations performed by the method for processing a text mapping model according to any one of claims 1 to 10.

23. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the operations performed by the method for processing a text mapping model according to any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • Text recommendation method and device based on artificial intelligence and electronic equipment

    CN111414538A

  • Semantic recognition method and device, computer equipment and storage medium

    CN112232086A