Method, device and equipment for searching text

CN116720521BActive Publication Date: 2026-10-16TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210187332.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-28
Publication Date
2026-10-16
Estimated Expiration
2042-02-28

AI Technical Summary

Technical Problem

[0004]但是,在用户在输入搜索文本时,由于输入错误或者认知偏差等问题,可能存在输入的搜索文本偏离真实搜索需求的情况

Benefits of technology

[0042] The technical solution provided in this application involves obtaining initial text input via a search function, then performing error identification on the initial text to determine the probability of errors present. If this probability meets the target probability condition, it indicates that errors may exist in the initial text. Error correction is then performed on the initial text to eliminate these errors, resulting in the target text. Since the process of obtaining candidate text is based on the corrected target text, the impact of errors in the initial text on the acquisition of candidate text is reduced, thus improving the accuracy of the obtained candidate text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116720521B_ABST
    Figure CN116720521B_ABST
Patent Text Reader

Abstract

The application discloses a search text acquisition method, device and equipment, which can be applied to content search, artificial intelligence and vehicle-mounted scenarios in computer technology. Through the technical scheme provided by the embodiment of the application, after the initial text based on the search function input is acquired, error identification is performed on the initial text first to obtain the probability of errors existing in the initial text. In the case that the probability meets the target probability condition, it is indicated that errors may exist in the initial text. In the process of acquiring the candidate text, the target text after error correction is used, so that the influence of the errors existing in the initial text on the acquisition of the candidate text is reduced, and the accuracy of the acquired candidate text is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, and device for obtaining search text. Background Technology

[0002] With the development of computer technology, the number of videos available online is increasing, and users use videos for learning and relaxation. To find the videos they want to watch, users search for them on video platforms by entering search terms.

[0003] In related technologies, video delivery platforms search based on user-input search text, generating multiple candidate texts. These candidate texts are related to the user's search query. When a candidate text more accurately reflects the user's search needs, the user can perform a video search based on that search text.

[0004] However, when users enter search text, due to input errors or cognitive biases, the entered search text may deviate from the actual search query. Adopting related technical solutions can further amplify this deviation from the actual search query, reducing the accuracy of the obtained candidate text. Summary of the Invention

[0005] This application provides a method, apparatus, and device for obtaining search text, which can improve the accuracy of the obtained candidate text. The technical solution is as follows:

[0006] On the one hand, a method for obtaining search text is provided, the method comprising:

[0007] Retrieve initial text from the terminal based on the search function input;

[0008] Error identification is performed on the initial text to obtain the probability that an error exists in the initial text;

[0009] If the probability of an error in the initial text meets the target probability condition, the initial text is corrected to obtain the target text.

[0010] Based on the target text, at least one candidate text is obtained, and the content of the at least one candidate text is associated with the content of the target text;

[0011] The at least one candidate text is returned to the terminal, and the at least one candidate text is used by the terminal to display it based on the search function.

[0012] On the one hand, a device for acquiring search text is provided, the device comprising:

[0013] The initial text acquisition module is used to acquire the initial text based on the search function input from the terminal;

[0014] An error identification module is used to identify errors in the initial text and obtain the probability that there are errors in the initial text.

[0015] The error correction module is used to correct the initial text to obtain the target text when the probability of an error in the initial text meets the target probability condition.

[0016] A candidate text acquisition module is used to acquire at least one candidate text based on the target text, wherein the content of the at least one candidate text is associated with the content of the target text;

[0017] A return module is used to return the at least one candidate text to the terminal, and the at least one candidate text is used by the terminal to display it based on the search function.

[0018] In one possible implementation, the error detection module is used to perform embedding encoding on the initial text to obtain the embedding features of the initial text; input the embedding features of the initial text into the error detection model, and the error detection model performs error detection based on the embedding features of the initial text, and outputs the probability that the initial text contains an error.

[0019] In one possible implementation, the error detection module is used to embed the position of each character in the initial text to obtain the position embedding feature of the initial text; to embed the position of each character in the initial text to obtain the character embedding feature of the initial text; to embed the words composed of each character in the initial text to obtain the word embedding feature of the initial text; and to fuse the position embedding feature, character embedding feature and word embedding feature of the initial text to obtain the embedding feature of the initial text.

[0020] In one possible implementation, the error detection module is used to encode the embedding features of the initial text based on an attention mechanism by the error detection model to obtain the attention features of the initial text; and to map the attention features of the initial text by the error detection model to output the probability that the initial text contains an error.

[0021] In one possible implementation, the initial text includes placeholders, and the error detection module is used to perform fully connected and normalized attention features of the placeholders by the error detection model, and output the probability that the initial text contains errors.

[0022] In one possible implementation, the error correction module is used to input the attention features of the initial text into the error correction model when the probability of the initial text containing an error is greater than or equal to a probability threshold, and the error correction model decodes the attention features of the initial text to output the target text.

[0023] In one possible implementation, the device further includes:

[0024] The training module is used to train the error recognition model and the error correction model using a sample dataset. The sample dataset includes positive samples and negative samples. The positive samples include positive sample text and labels for the positive sample text. The negative samples include negative sample text, labels for the negative sample text, and reference text for the negative sample text. The reference text is the correct form of the negative sample text.

[0025] In one possible implementation, the candidate text acquisition module is used to search in a candidate text library using the target text to obtain a plurality of first candidate texts, the candidate text library including a plurality of candidate texts; and to acquire the at least one candidate text from the plurality of first candidate texts.

[0026] In one possible implementation, the candidate text acquisition module is used to perform at least one of prefix search and fuzzy search on the candidate text in the candidate text library using the target text to obtain the plurality of first candidate texts.

[0027] In one possible implementation, the candidate text acquisition module is configured to determine the click-through rate of the plurality of first candidate texts; determine the sorting parameters of the plurality of first candidate texts based on the click-through rate of the plurality of first candidate texts and the probability that the target text has an error; and determine the first candidate text among the plurality of first candidate texts whose sorting parameters meet the target conditions as at least one candidate text.

[0028] In one possible implementation, the candidate text acquisition module is used to determine the click-through rate of any first candidate text among the plurality of first candidate texts based on at least one of the following: the target object's interest parameter for the first candidate text, the similarity between the first candidate text and the target text, and the historical interaction parameter of the first candidate text, wherein the target object is the object that input the initial text.

[0029] In one possible implementation, the candidate text acquisition module is used to input a second target parameter into a click-through rate prediction model, perform a fully connected and normalized operation on the second target parameter through the click-through rate prediction model, and output the click-through rate of the first candidate text. The second target parameter includes at least one of the target object's interest parameter in the first candidate text, the similarity between the first candidate text and the target text, and the historical interaction parameter of the first candidate text.

[0030] In one possible implementation, the similarity between the first candidate text and the target text includes at least one of the text similarity and the pinyin similarity between the first candidate text and the target text;

[0031] The historical interaction parameters of the first candidate text include at least one of the following: the historical number of searches for the first candidate text, the historical number of inputs for the first candidate text, the historical click-through rate of the first candidate text, and the click-through rate of the media resources corresponding to the first candidate text.

[0032] In one possible implementation, the device further includes:

[0033] An interest parameter determination module is used to determine the similarity between the first candidate text and multiple interest tags of the target object;

[0034] The similarity between the first candidate text and the plurality of interest tags is weighted and summed with the interest weights of the plurality of interest tags to obtain the interest parameter of the target object to the first candidate text. The interest weights of the plurality of interest tags are used to represent the degree of matching between the target object and the plurality of interest tags.

[0035] In one possible implementation, the candidate text acquisition module is configured to acquire at least one candidate text based on the target text and the initial text, wherein the content of the at least one candidate text is associated with the content of the target text or the content of the initial text.

[0036] In one possible implementation, the candidate text acquisition module is configured to search a candidate text library using the target text to obtain multiple first candidate texts, the candidate text library including multiple candidate texts; search the candidate text library using the initial text to obtain multiple second candidate texts; and acquire the at least one candidate text from the multiple first candidate texts and the multiple second candidate texts.

[0037] In one possible implementation, the candidate text acquisition module is configured to: determine the click-through rate of the plurality of first candidate texts and the click-through rate of the plurality of second candidate texts; determine the sorting parameters of the plurality of first candidate texts based on the click-through rates of the plurality of first candidate texts and the probability that the target text contains errors; determine the sorting parameters of the plurality of second candidate texts based on the click-through rates of the plurality of second candidate texts and the probability that the initial text contains errors; and determine the first candidate text or the second candidate text whose sorting parameters meet the target conditions as the at least one candidate text.

[0038] In one possible implementation, the candidate text acquisition module is further configured to acquire at least one candidate text based on the initial text if the probability of an error in the initial text does not meet the target probability condition.

[0039] On one hand, a computer device is provided, the computer device including one or more processors and one or more memories, the one or more memories storing at least one computer program, the computer program being loaded and executed by the one or more processors to implement the method for obtaining search text.

[0040] On one hand, a computer-readable storage medium is provided, wherein at least one computer program is stored in the computer-readable storage medium, the computer program being loaded and executed by a processor to implement the method for obtaining the search text.

[0041] On the one hand, a computer program product is provided, including a computer program that, when executed by a processor, implements the above-mentioned method for obtaining search text.

[0042] The technical solution provided in this application involves obtaining initial text input via a search function, then performing error identification on the initial text to determine the probability of errors present. If this probability meets the target probability condition, it indicates that errors may exist in the initial text. Error correction is then performed on the initial text to eliminate these errors, resulting in the target text. Since the process of obtaining candidate text is based on the corrected target text, the impact of errors in the initial text on the acquisition of candidate text is reduced, thus improving the accuracy of the obtained candidate text. Attached Figure Description

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

[0044] Figure 1 This is a schematic diagram of the implementation environment of a method for obtaining search text provided in an embodiment of this application;

[0045] Figure 2 This is a flowchart illustrating a method for obtaining search text provided in an embodiment of this application;

[0046] Figure 3 This is a flowchart illustrating a method for obtaining search text provided in an embodiment of this application;

[0047] Figure 4 This is a schematic diagram of a content search page provided in an embodiment of this application;

[0048] Figure 5 This is a schematic diagram of the structure of an error recognition model provided in an embodiment of this application;

[0049] Figure 6 This is a schematic diagram of the structure of a joint model provided in an embodiment of this application;

[0050] Figure 7 This is a schematic diagram of the structure of a click-through rate prediction model provided in an embodiment of this application;

[0051] Figure 8 This is a flowchart illustrating a method for obtaining search text provided in an embodiment of this application;

[0052] Figure 9 This is a schematic diagram of the structure of a text acquisition device provided in an embodiment of this application;

[0053] Figure 10 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application;

[0054] Figure 11 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0056] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items with essentially the same function. It should be understood that there is no logical or temporal dependency between "first," "second," and "nth," nor are there any restrictions on quantity or execution order.

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

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

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

[0060] Semantic features: Features used to represent the semantics expressed by text. Different texts can correspond to the same semantic features; for example, the text "How's the weather today?" and the text "How's the weather today?" can correspond to the same semantic feature. Computer devices can map characters in text into character vectors, and combine and operate on these character vectors according to the relationships between characters to obtain the semantic features of the text. For example, computer devices can use a bidirectional encoder representation from transformers (BERT).

[0061] Normalization: Mapping sequences of values ​​with different ranges to the interval (0, 1) to facilitate data processing. In some cases, normalized values ​​can be directly expressed as probabilities.

[0062] Embedded coding, mathematically speaking, represents a correspondence, that is, mapping data in space X to space Y using a function F. This function F is injective, and the mapping result preserves the structure. An injective function means that the mapped data uniquely corresponds to the original data, and preserving the structure means that the order of the original data remains the same. For example, if there are data X1 and X2 before mapping, after mapping we get Y1 corresponding to X1 and Y2 corresponding to X2. If the original data X1 > X2, then correspondingly, the mapped data Y1 > Y2. For words, this means mapping words to another space to facilitate subsequent machine learning and processing.

[0063] Attention weights represent the importance of a piece of data during training or prediction. Importance indicates the magnitude of the influence of input data on output data. Data with high importance corresponds to higher attention weights, while data with low importance corresponds to lower attention weights. The importance of data varies in different scenarios, and training the model to assign attention weights is essentially the process of determining data importance.

[0064] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the initial text and interest tags involved in this application were obtained with full authorization.

[0065] Figure 1 This is a schematic diagram illustrating the implementation environment of a method for obtaining search text provided in this application embodiment. See also... Figure 1 The implementation environment may include terminal 110 and server 140.

[0066] Terminal 110 is connected to server 140 via a wireless or wired network. Optionally, terminal 110 may be a vehicle terminal, smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or smart TV, but is not limited to these. Terminal 110 has applications installed and running that support content search and display.

[0067] Server 140 is a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. Server 140 provides background services for applications running on terminal 110.

[0068] Optionally, the number of terminals 110 and servers 140 is unlimited.

[0069] After introducing the implementation environment of the embodiments of this application, the application scenarios of the embodiments of this application will be introduced in conjunction with the above implementation environment. In the following description, the terminal is the terminal 110 in the above implementation environment, and the server is the server 140 in the above implementation environment.

[0070] The technical solutions provided in this application can be applied to various scenarios of searching for content, such as searching for videos, searching for music, or searching for text.

[0071] In a video search scenario, the terminal launches the video provider's application, which offers video search and playback functions. The terminal displays the application's main interface, including a search text input area. The application uses this input area to provide video search functionality. The user can enter initial text, which is the text used to search for videos. The terminal sends this initial text to the server, which performs error detection to determine the probability of errors in the initial text. If the probability of errors in the initial text meets a target probability condition, the server corrects the initial text to obtain the target text, which is the corrected initial text. Based on the target text, the server retrieves at least one candidate text, the content of which is associated with the target text. The server sends this candidate text to the terminal, which displays it, allowing the user to search for videos based on it.

[0072] It should be noted that the above description uses a server-side video search scenario as an example. Scenarios involving server-side music and text searches fall under the same inventive concept and will not be repeated here. Of course, the technical solutions provided in this application can be applied not only to the scenarios mentioned above but also to searching for other types of content; this application does not limit these applications.

[0073] After introducing the implementation environment and application scenarios of the embodiments of this application, the technical solutions provided by the embodiments of this application will be described below. See also Figure 2 The technical solutions provided in this application can be executed by a terminal or a server, or by both a terminal and a server. In this application embodiment, the execution subject is a server, and the method includes:

[0074] 201. The server retrieves the initial text based on the search function input from the terminal.

[0075] The terminal in this context refers to a terminal that provides search functionality. This search function has different meanings in different application scenarios. In a video search scenario, it's used for video searching; in a music search scenario, it's used for music searching; and in a text search scenario, it's used for text searching. The initial text is the text used for content searching. Correspondingly, similar to the search function described above, the initial text has different uses in different scenarios. In some embodiments, the initial text can be Chinese, English, or other languages; this application does not limit this.

[0076] 202. The server performs error identification on the initial text and obtains the probability that there are errors in the initial text.

[0077] In some embodiments, errors in the initial text are caused by operational mistakes during input or cognitive biases of the user. When the initial text is in Chinese, these errors include missing characters, mixed vocabulary, misspellings, and homophones. When the initial text is in English, these errors include missing letters and spelling errors. The process of error identification in the initial text is essentially the process of determining the probability of errors existing in the initial text.

[0078] 203. If the probability of an error in the initial text meets the target probability condition, the server corrects the initial text to obtain the target text.

[0079] The condition that the probability of errors in the initial text meets the target probability condition means that the probability of errors in the initial text is relatively high, and error correction is required. Error correction of the initial text is the process of eliminating the errors present in the initial text, and the resulting target text is the initial text after error correction.

[0080] 204. Based on the target text, the server obtains at least one candidate text, the content of which is associated with the content of the target text.

[0081] The at least one candidate text is a search suggestion, and content search can be achieved by using the at least one candidate text based on the search function.

[0082] 205. The server returns at least one candidate text to the terminal, which is used by the terminal to display the candidate text based on the search function.

[0083] The technical solution provided in this application involves obtaining initial text input via a search function, then performing error identification on the initial text to determine the probability of errors present. If this probability meets the target probability condition, it indicates that errors may exist in the initial text. Error correction is then performed on the initial text to eliminate these errors, resulting in the target text. Since the process of obtaining candidate text is based on the corrected target text, the impact of errors in the initial text on the acquisition of candidate text is reduced, thus improving the accuracy of the obtained candidate text.

[0084] It should be noted that steps 201-204 above are a simplified description of the technical solutions provided in the embodiments of this application. The technical solutions provided in the embodiments of this application will be described in more detail below with reference to some examples. See [link to relevant documentation]. Figure 3 The technical solutions provided in this application can be executed by a terminal or a server, or by both a terminal and a server. In this application, the technical solution is described as being executed by both a terminal and a server. The method includes:

[0085] 301. The terminal displays a content search page, which provides a search function.

[0086] This content search page is used for searching content; it is used to search for different content in different scenarios. In some embodiments, the content search page is the interface of a webpage or application, which is not limited in this application. In some embodiments, the search functions provided by the content search page include a search text input function and a search result display function.

[0087] In some embodiments, the content search page includes a search text input area for acquiring text. During a content search on this page, the user enters initial text in the search text input area, and subsequent content searches can be performed based on the text in the search text input area. In some embodiments, the search text input area includes a search control; triggering the search control can trigger a search instruction, which instructs the user to perform a content search based on the initial text in the search text input area.

[0088] For example, taking the technical solution provided in this application embodiment as an example in a video search scenario, the content search page is also a page used for searching videos, and the initial text entered in the search text input area is also the text used for searching videos, such as the name of the video, the author of the video, or the actors in the video. In some embodiments, the search text input area includes a search control, and in response to a click operation on the search control, the terminal searches for videos based on the text in the search text input area.

[0089] For example, see Figure 4 The terminal displays a content search page 400, which includes a search text input area 401. Users can enter initial text in this search text input area for content searching. In some embodiments, the search text input area 401 includes a search control 402; in response to a click on the search control 402, the terminal performs a content search based on the initial text in the search text input area 401.

[0090] 302. In response to an input operation on the content search page, the terminal sends the initial text corresponding to the input operation to the server.

[0091] The initial text refers to the text entered by the user through the input operation on the content search page, and this initial text is used for content searching. In some embodiments, this initial text is also referred to as the original text, original content, or search text, etc. The initial text corresponding to the output operation refers to the initial text entered through the input operation.

[0092] In one possible implementation, the content search page includes a search text input area. In response to an input operation in the search text input area, the terminal sends the initial text entered in the search text input area to the server. For example, the terminal establishes a persistent connection with the server, and in response to an input operation on the content search page, the terminal sends the initial text to the server through the persistent connection.

[0093] In some embodiments, the initial text sent by the terminal to the server can be either a complete initial text or a portion of an initial text. A portion of the initial text refers to the part of the text already entered during the initial text input process. The terminal can send the initial text to the server in real-time or at intervals. Real-time sending means that the terminal sends characters from the initial text to the server in real-time during the acquisition of the initial text; that is, during the input of the initial text on the terminal through the input operation on the content search page, the terminal sends each character to the server based on the input operation. At intervals means that the terminal sends the initial text to the server at target durations or at target character counts. Sending the initial text to the server at target character counts means that the terminal sends the initial text to the server once every target number of characters entered based on the input operation. The target duration and target character count can be set by those skilled in the art according to actual conditions, and this application embodiment does not limit them.

[0094] 303. The server retrieves the initial text from the terminal.

[0095] 304. The server performs error identification on the initial text and obtains the probability that there are errors in the initial text.

[0096] The purpose of error identification in the initial text is to determine whether errors exist in it. A higher probability of errors in the initial text indicates a greater likelihood of errors; conversely, a lower probability of errors indicates a lower likelihood of errors. Errors in the initial text are related to its language; for details, please refer to the description in step 202 above, which will not be repeated here.

[0097] In one possible implementation, the server performs embedding encoding on the initial text to obtain the embedding features of the initial text. The server inputs the embedding features of the initial text into an error detection model, which performs error detection based on the embedding features of the initial text and outputs the probability that the initial text contains errors.

[0098] The process of embedding and encoding the initial text is essentially mapping the initial text to embedding features. These embedding features include the embedding features of each character within the initial text. When embedding features are represented as vectors, the embedding features of the initial text are essentially its embedding vectors.

[0099] To provide a clearer explanation of the above embodiments, the following description will be divided into two parts.

[0100] Part 1: The server performs embedding encoding on the initial text to obtain the embedding features of the initial text.

[0101] In one possible implementation, the server performs embedding encoding on the position of each character in the initial text to obtain the position embedding feature of the initial text. The server then performs embedding encoding on each character in the initial text to obtain the character embedding feature of the initial text. Next, the server performs embedding encoding on the words formed by the characters in the initial text to obtain the word embedding feature of the initial text. Finally, the server fuses the position embedding feature, character embedding feature, and word embedding feature of the initial text to obtain the embedding feature of the initial text.

[0102] In this context, the position of each character in the initial text refers to its location within the text, or its order of arrangement. The vocabulary formed by the characters in the initial text refers to the words composed of adjacent characters. For any given character in the initial text, the word embedding feature corresponding to that character is also the embedding feature of the vocabulary to which that character belongs. In some embodiments, the process of the server embedding and encoding the position of each character in the initial text is also referred to as the process of obtaining the position representation of the character; the process of the server embedding and encoding the vocabulary formed by the characters in the initial text is also referred to as the process of obtaining the word representation of the character.

[0103] By embedding and encoding the initial text, it can be transformed into embedded features, which facilitates subsequent processing.

[0104] For example, for any character in the initial text, the server performs embedding encoding on the character's position within the initial text, obtaining the character's positional embedding feature. The server then performs embedding encoding on the character itself, obtaining its character embedding feature. Next, the server performs embedding encoding on the word to which the character belongs within the initial text, obtaining its word embedding feature. Finally, the server performs a weighted sum of the word's positional embedding feature, character embedding feature, and word embedding feature to obtain the word's embedding feature. The embedding features of each character in the initial text constitute the embedding feature of the initial text. The weights of the summation are set by the technician based on the actual situation. When all weights in the summation are 1, that is, when the word's positional embedding feature, character embedding feature, and word embedding feature are added together, the word's embedding feature is obtained.

[0105] In some embodiments, the server can add a placeholder [CLS] at the beginning of the initial text, which can improve the efficiency of subsequent error detection. For example, if the initial text sent by the terminal is "ABCDEF", the server adds a placeholder to the initial text, and the initial text after adding the placeholder is "[CLS]ABCDEF". In the process of embedding and encoding the initial text to obtain the embedding features of the initial text, the server's processing object is also the embedding features of the initial text carrying the placeholder. It should be noted that the process of the server embedding and encoding the initial text carrying the placeholder to obtain the embedding features belongs to the same inventive concept as described above, and the implementation process will not be repeated.

[0106] The second part involves the server inputting the embedding features of the initial text into the error detection model, which then performs error detection based on the embedding features of the initial text and outputs the probability that the initial text contains errors.

[0107] The error recognition model is trained based on positive and negative samples and has the ability to output the probability of errors in the text based on the text embedding features. Positive samples include positive sample text and positive sample text labels, and negative samples include negative sample text and negative sample text labels. Positive sample text is correct text, and negative sample text is text with errors.

[0108] To provide a clearer explanation of the content in Part Two above, the structure of this error detection model will be introduced below.

[0109] In one possible implementation, the error detection model includes a first input layer, an encoding layer, and a first output layer. The first input layer is used to input the embedding features of the initial text. The encoding layer encodes the embedding features of the initial text to obtain a text encoding of the initial text, which includes the character encoding of each character in the initial text. Compared to the embedding features of the initial text, the text encoding of the initial text can more accurately represent the content of the initial text. The first output layer outputs the probability that the initial text contains errors based on the embedding encoding of the initial text. In some embodiments, the first output layer includes a fully connected layer and a normalization layer.

[0110] After introducing the structure of the error recognition model, the steps in the second part above will be described below.

[0111] In one possible implementation, the error detection model encodes the embedding features of the initial text based on an attention mechanism to obtain the attention features of the initial text. The error detection model then maps these attention features to output the probability that the initial text contains an error.

[0112] The attention features of the initial text are also its semantic features, and these attention features include the attention features of each character in the initial text. The embedding features of the initial text are input through the first input layer of the error detection model. The attention features of the initial text are obtained through the encoding layer of the error detection model. The probability of errors in the initial text is output through the first output layer of the error detection model.

[0113] In this implementation, the server can use the error recognition model to determine the probability that the initial text contains an error based on the attention mechanism. Since the attention mechanism does not require convolution, the probability determination is highly efficient.

[0114] The above implementation includes two steps: obtaining the attention features of the initial text through an error recognition model and outputting the probability that the initial text contains errors through the error recognition model. In order to explain these two steps in more detail, they will be described separately below.

[0115] A. The error detection model encodes the embedding features of the initial text based on the attention mechanism to obtain the attention features of the initial text.

[0116] In one possible implementation, the error detection model obtains the attention weights between each character in the initial text based on an attention mechanism. Based on these attention weights, the error detection model fuses the embedding features of each character to obtain the attention features of each character. The attention features of the initial text include the attention features of each character.

[0117] Taking an initial text containing two characters as an example, the error detection model uses three linear transformation matrices to linearly transform the embedding features of the first character, obtaining the first query matrix, first key matrix, and first value matrix of the first character. These three linear transformation matrices are obtained during model training. The error detection model then uses these three linear transformation matrices to linearly transform the embedding features of the second character, obtaining the second query matrix, second key matrix, and second value matrix of the second character. Based on the query matrix and key matrix of the first character, the error detection model obtains the first attention weight of the first character towards itself. Based on the query matrix and key matrix of the first character, the error detection model obtains the second attention weight of the first character towards the second character. Based on the query matrix and key matrix of the second character, the error detection model obtains the third attention weight of the second character towards itself. Based on the query matrix and key matrix of the second character, the error detection model obtains the fourth attention weight of the second character towards the first character. The error detection model uses a first attention weight and a second attention weight to perform a weighted sum of the first and second value matrices to obtain the attention feature of the first character. Similarly, the error detection model uses a third attention weight and a fourth attention weight to perform a weighted sum of the second and first value matrices to obtain the attention feature of the second character. When obtaining attention weights based on the query matrix and key matrix, the error detection model can multiply the query matrix and key matrix. The attention features of the first and second characters constitute the attention features of the initial text containing these two characters.

[0118] It should be noted that the above explanation is based on an initial text containing two characters. If the initial text contains more characters, the implementation process follows the same inventive concept and will not be repeated here. Through the above process, the attention features of each character in the initial text incorporate information from other characters in the initial text, and the character attention features can accurately represent the semantics of the character in the initial text.

[0119] Furthermore, the above explanation uses the example of the error detection model acquiring the attention features of the initial text based on a single-head attention mechanism. Here, "head" refers to an attention head, and each attention head corresponds to a set of attention parameters, which includes three linear transformation matrices. The attention parameters differ between different attention heads. Building upon this, the error detection model can also acquire the attention features of the initial text based on a multi-head attention mechanism. That is, it uses multiple attention heads to acquire the attention features of the initial text. The processing procedure for each attention head is the same as the process described above using a single attention head. Finally, fusing the attention features output by multiple attention heads yields the attention features of the initial text.

[0120] Additionally, if the initial text includes placeholders, the placeholders can be treated as characters within the initial text.

[0121] B. The error detection model maps the attention features of the initial text and outputs the probability that the initial text contains errors.

[0122] In one possible implementation, the error detection model performs a fully connected and normalized operation on the attention features of the initial text, and outputs the probability that the initial text contains an error.

[0123] For example, if the initial text includes placeholders, the error detection model performs a fully connected and normalized operation on the attention features of the placeholders, and outputs the probability that the initial text contains an error.

[0124] In this approach, the error detection model only needs to process the placeholders in the initial text to obtain the probability that the initial text contains errors, which is highly efficient.

[0125] For example, this error detection model uses at least one fully connected weight matrix to perform a full connection with the attention features of the placeholder, obtaining the fully connected features of the placeholder. The error detection model then uses a normalization function to normalize the fully connected features of the placeholder, obtaining the probability that the initial text contains an error. Normalization functions include SoftMax and Sigmoid, among others.

[0126] The following will combine Figure 5 The process of the server obtaining the embedding features of the initial text and determining the probability of errors in the initial text based on the embedding features of the initial text is explained.

[0127] See Figure 5The server adds a placeholder [CLS] before the initial text 501, which is the text input by the user. The server performs embedding encoding on the initial text 501 to obtain its embedding features. The process of embedding encoding on the initial text 501 includes three steps: obtaining the position representation, character representation, and vocabulary representation of each character in the initial text 501. The position representation, character representation, and vocabulary representation of each character are fused to obtain the embedding features of each character, which constitute the embedding features of the initial text. The server inputs the embedding features of the initial text into the error recognition model through the first input layer of the error recognition model. The server encodes the embedding features of the initial text through the encoding layer of the error recognition model to obtain the attention features 502 of the initial text, which includes the attention features of each character in the initial text. The server inputs the attention feature of the placeholder [CLS] in the initial text into the first output layer of the error detection model. The first output layer performs a fully connected and normalized operation on the attention feature of the placeholder [CLS] to obtain the probability that the initial text contains an error, 503.

[0128] After step 304, the server can determine whether to execute step 305 or step 308 based on the probability of an error in the initial text. If step 305 is executed, the server can execute steps 305, 306, 309, and 310 sequentially, or steps 305, 307, 309, and 310 sequentially. If step 308 is executed, the server can execute steps 308, 309, and 310 sequentially.

[0129] 305. If the probability of an error in the initial text meets the target probability condition, the server corrects the initial text to obtain the target text.

[0130] In one possible implementation, if the probability of an error in the initial text is greater than or equal to a probability threshold, the server inputs the attention features of the initial text into the error correction model, which then decodes the attention features of the initial text and outputs the target text.

[0131] The error correction model is trained based on positive and negative samples and has the ability to correct text errors. The positive samples include the positive sample text and its labels, while the negative samples include the negative sample text, its labels, and a reference text, which is the correct form of the negative sample text. The probability threshold is set by a technician according to the actual situation, and this application embodiment does not limit it.

[0132] To provide a clearer explanation of the above implementation methods, the structure of the error correction model is described below.

[0133] In one possible implementation, the error correction model includes a first input layer, a decoding layer, and a second output layer. The first input layer is used to input the characters output by the second output layer. The decoding layer is used to decode the attention features of the initial text to obtain the characters in the target text; the number of decoding layers is at least two. The second output layer is used to output the characters in the target text. In some embodiments, the second output layer includes a fully connected layer and a normalization layer.

[0134] After introducing the structure of the error correction model, the implementation method described above will be introduced below.

[0135] In one possible implementation, if the probability of an error in the initial text is greater than or equal to a probability threshold, the server inputs the attention features of the initial text into an error correction model. The error correction model then decodes the initial text based on the attention features of each character through multiple iterative processes, outputting the target text. In each iteration, the error correction model outputs one character from the target text.

[0136] For example, in the first iteration, the server inputs the start character into the error correction model, which then performs embedding encoding on the start character to obtain its embedding features. The server uses the error correction model to determine the attention weight between the start character and the first character in the initial text. Based on this attention weight, the server fuses the embedding features of the start character with the attention features of the first character to obtain the decoded attention features of the first output character. The server uses the error correction model to map the decoded attention features of the first output character into a probability sequence corresponding to the first output character. This probability sequence includes multiple probabilities, each corresponding to a candidate character. Candidate characters are pre-configured characters and can be considered as a "dictionary" for decoding. The number of probabilities in the probability sequence is the same as the number of candidate characters. Based on this probability sequence, the server determines the first decoded output character from the multiple candidate characters; this first output character is also the first character in the target text. In some embodiments, the server determines the candidate character with the highest probability in the probability sequence as the first decoded output character. Where the initial text includes placeholders, the server does not need to input the attention features corresponding to those placeholders into the error correction model.

[0137] In the second iteration, the server inputs the first output character into the error correction model, which then performs embedding encoding on the first output character to obtain its embedding features. The server uses the error correction model to determine the attention weight between the first output character and the second character in the initial text. Based on this attention weight, the server fuses the embedding features of the first output character with the attention features of the second character to obtain the decoded attention features of the second output character. The server then uses the error correction model to map the decoded attention features of the second output character into a probability sequence corresponding to the second output character. Based on this probability sequence, the server determines the decoded second output character, which is also the second character in the target text.

[0138] In subsequent iterations, the server processes the text using the attention features of other characters in the initial text, employing a similar approach to the second iteration, until the error correction model outputs a terminator, stopping the decoding process. The multiple output characters from this error correction model constitute the target text.

[0139] To illustrate the above examples more clearly, the second iteration process will be further explained below.

[0140] In the second iteration, the server inputs the first output character into the error correction model, which then performs embedding encoding on the first output character to obtain its embedding features. This embedding encoding includes both positional and character embedding features. The server then fuses these features to obtain the final embedding feature of the first output character. Finally, the server performs a linear transformation on the embedding feature to obtain the third query matrix of the first output character. This third key matrix is ​​the key matrix of the second character in the initial text, and the third value matrix is ​​the value matrix of the second character in the initial text. Based on this third query matrix and the key matrix, the server determines the attention weight between the first output character and the second character in the initial text. The server uses the error correction model to determine the attention features of the first output character based on its attention weights and the third value matrix. The server then uses this attention feature to fuse it with the attention features of the second character in the initial text, obtaining the decoded attention features of the second output character. Finally, the server uses the error correction model to perform a fully connected and normalized process on these decoded attention features, resulting in a probability sequence for the second output character. The server then identifies the candidate character with the highest value in this probability sequence as the second output character.

[0141] In some embodiments, the attention features of the initial text used in the processing of the above error correction model are determined by the error identification model in step 304. In this case, the error identification model and the error correction model form a joint model. The error identification model acts as the encoder of the joint model, and the error correction model acts as the decoder of the joint model. Whether the decoder starts decoding is determined by the probability that there is an error in the initial text output by the encoder. Figure 6 A schematic diagram of the joint model is provided; see [link / reference]. Figure 6 This includes the error identification model 601 and the error correction model 602. In the error correction model 602, <s>represents a start symbol, C0represents the first decoded character, C k represents the kth decoded character,< / s> This indicates the terminator, where k is a positive integer.

[0142] The training method for this joint model will be explained below.

[0143] In one possible implementation, the server trains the error detection model and the error correction model using a sample dataset, which includes positive samples and negative samples. The positive samples include positive sample text and labels for the positive sample text, and the negative samples include negative sample text, labels for the negative sample text, and reference text for the negative sample text, which is the correct form of the negative sample text.

[0144] In this context, positive sample text refers to correct text, meaning text without errors. The label for positive sample text indicates that the corresponding text is a positive sample text. Negative sample text refers to text containing errors. The label for negative sample text indicates that the corresponding text is a negative sample text. Reference text can be considered as text after correcting the errors in the negative sample text.

[0145] In this implementation, the error detection model and the error correction model are trained using a multi-task joint training method. The multi-task refers to the tasks of the error detection model and the error correction model: the error detection model's task is to correctly output the probability that the initial text contains errors, and the error correction model's task is to correctly output the target text. Using a multi-task joint training method can improve the performance of both the error detection model and the error correction model.

[0146] During training, the error detection model is trained using positive samples (including positive sample text, positive sample text labels), negative sample text, and negative sample text labels. In other words, the model inputs both positive and negative sample texts and performs error detection on them, yielding the error detection result. The model parameters are then adjusted based on this error detection result, the labels of the positive and negative sample texts. Similarly, the error correction model is trained using negative sample text, its labels, and a reference text. This involves inputting the negative sample text into the error detection model to determine its attention features. These attention features are then input into the error correction model, which outputs a predicted corrected text. The model parameters are then adjusted based on the differences between the predicted corrected text and the reference text.

[0147] Optionally, after step 305, the server can obtain at least one candidate text through steps 306 or 307 below.

[0148] 306. Based on the target text, the server obtains at least one candidate text, the content of which is associated with the content of the target text.

[0149] In some embodiments, candidate text is also referred to as search suggestions, and the at least one candidate text is used for content search.

[0150] In one possible implementation, the server searches a candidate text library using the target text to obtain multiple first candidate texts, the candidate text library including multiple candidate texts. The server then retrieves at least one candidate text from these multiple first candidate texts.

[0151] To provide a clearer explanation of the above implementation methods, the method for constructing the candidate text library will be described first.

[0152] In video search scenarios, the server adds multiple candidate texts corresponding to the video to a candidate text library. In some embodiments, these candidate texts include the video's name, actor names, character names, director / writer names, theme song names, guest names, texts used by users on the video platform, and names of trending events. After adding these candidate texts, the server can create prefix search and fuzzy search indexes, thereby improving the efficiency of subsequent searches within the candidate text library. For example, the server can create prefix search indexes using a prefix tree and fuzzy search indexes using Elasticsearch.

[0153] It should be noted that the above explanation uses the scenario of searching for videos on a server as an example. In scenarios such as searching for music or text on a server, the same inventive concept applies, and the details will not be repeated here.

[0154] After explaining the method for constructing the candidate text library, the following will describe the above implementation method in two parts.

[0155] Part 1: The server uses the target text to search the candidate text library and obtains multiple first candidate texts.

[0156] In one possible implementation, the server uses the target text to perform at least one of prefix search and fuzzy search in the candidate text library to obtain the plurality of first candidate texts.

[0157] The second part involves the server retrieving at least one candidate text from the plurality of first candidate texts.

[0158] In one possible implementation, the server determines the click-through rate (CTR) of the plurality of first candidate texts. Based on the CTR of the plurality of first candidate texts, the server determines the ranking parameters of the plurality of first candidate texts. The server identifies the first candidate text among the plurality of first candidate texts whose ranking parameters meet the target conditions as at least one candidate text.

[0159] The ranking parameters of the multiple first candidate texts indicate the probability that each first candidate text is selected, where "selected" refers to being chosen as the search text during a search based on the search function. In some embodiments, the ranking parameters are positively correlated with the click-through rate (CTR); a larger ranking parameter indicates a higher probability that the corresponding first candidate text is selected, and vice versa. In other embodiments, the ranking parameters are negatively correlated with the CTR; a larger ranking parameter indicates a lower probability that the corresponding first candidate text is selected, and vice versa.

[0160] To illustrate the above embodiments, the embodiments will be described below through sub-steps A-C.

[0161] A. The server determines the click-through rate of the multiple first candidate texts.

[0162] In one possible implementation, for any one of the plurality of first candidate texts, the server determines the click-through rate of the first candidate text based on at least one of the target object's interest parameters in the first candidate text, the similarity between the first candidate text and the target text, and the historical interaction parameters of the first candidate text, wherein the target object is the object that input the initial text.

[0163] For example, the server inputs the first target parameter into the click-through rate prediction model, performs a fully connected and normalized operation on the first target parameter through the click-through rate prediction model, and outputs the click-through rate of the first candidate text. The first target parameter includes at least one of the following: the target object's interest parameter in the first candidate text, the similarity between the first candidate text and the target text, and the historical interaction parameter of the first candidate text.

[0164] In some embodiments, the similarity between the first candidate text and the target text includes at least one of textual similarity and pinyin similarity. The historical interaction parameters of the first candidate text include at least one of the historical search count, historical input count, historical click-through rate, and click-through rate of the media resource corresponding to the first candidate text. In some embodiments, the click-through rate prediction model is a deep neural network (DNN). Figure 7 The structure of the click-through rate (CTR) prediction model is shown. The CTR prediction model 700 includes an input layer 701, a fully connected layer 702, and a normalization layer 703. The input layer 701 inputs a first target parameter into the CTR prediction model. The fully connected layer 702 performs a full connection on the first target parameter to obtain a first parameter feature. There can be one or more fully connected layers. The normalization layer normalizes the first parameter feature to obtain the CTR of the first candidate text.

[0165] The specific parameters in the first target parameter are explained below.

[0166] First, we will explain the interest parameters of the target object in the first candidate text.

[0167] In one possible implementation, the server determines the similarity between the first candidate text and multiple interest tags of the target object. The server then performs a weighted summation of the similarity between the first candidate text and the multiple interest tags, along with the interest weights of the multiple interest tags, to obtain the target object's interest parameter for the first candidate text. The interest weights of the multiple interest tags are used to represent the degree of matching between the target object and the multiple interest tags.

[0168] For example, the input first candidate text and target object interest parameters are: each interest tag of the target object (similarity between the first candidate text and the target object's interest tag * interest weight of the target object's interest tag), where the similarity between the first candidate text and the target object's interest tag = 1 – edit distance (first candidate text, target object's interest tag) / max (length of the first candidate text, length of the target object's interest tag), and max is a function that takes the maximum value.

[0169] Next, the text similarity between the first candidate text and the target text will be explained.

[0170] In one possible implementation, the server determines the text similarity between the first candidate text and the target text based on the edit distance between the first candidate text and the target text, as well as the text lengths of the first candidate text and the target text. For example, the text similarity between the first candidate text and the target text is: 1 – edit distance(first candidate text, target text) / max(text length of the first candidate text, text length of the target text).

[0171] The following section explains the pinyin similarity between the first candidate text and the target text.

[0172] In one possible implementation, the server performs pinyin transcription on the first candidate text and the target text, obtaining the first pinyin of the first candidate text and the second pinyin of the target text. The server determines the pinyin similarity between the first candidate text and the target text based on the edit distance between the first and second pinyin and the pinyin lengths of the first and second pinyin. For example, the pinyin similarity between the first candidate text and the target text = 1 – edit distance(first pinyin, second pinyin) / max(pinyin length of the first pinyin, pinyin length of the second pinyin).

[0173] The following explains the historical search count for the first candidate text.

[0174] In some embodiments, the server standardizes the historical search count of the first candidate text to reduce data volume and improve processing efficiency. For example, the server divides the historical search count of the first candidate text by the highest search count, and uses the result of the division as the historical search count of the first candidate text. This result can also be referred to as the search popularity of the first candidate text. For example, the search popularity of the first candidate text is: min(1.0, historical search count of the first candidate text / S1), where S1 is the highest search count on the platform, and min is a function that takes the minimum value.

[0175] The following explains the historical number of times the first candidate text was entered.

[0176] In some embodiments, the server standardizes the historical input count of the first candidate text to reduce data volume and improve processing efficiency. For example, the server divides the historical input count of the first candidate text by the highest input count, and uses the result of the division as the historical input count of the first candidate text. This result can also be referred to as the input popularity of the first candidate text. For example, the input popularity of the first candidate text is: min(1.0, historical input count of the first candidate text / S2), where S2 is the highest input count on the platform.

[0177] The following section explains the historical click-through rate of the first candidate text.

[0178] In one possible implementation, the server obtains the historical click-through rate of the first candidate text based on the historical click count and the historical display count of the first candidate text. For example, the historical click-through rate of the first candidate text is: historical click count of the first candidate text / historical display count of the first candidate text.

[0179] The following explains the method for determining the click-through rate of the media resource corresponding to the first candidate text.

[0180] In one possible implementation, the server obtains the historical click-through rate (CTR) of the media resource corresponding to the first candidate text based on the historical click count and the historical display count of the media resource corresponding to the first candidate text. For example, the historical CTR of the media resource corresponding to the first candidate text is calculated as: historical click count / historical display count of the media resource corresponding to the first candidate text.

[0181] When training a click-through rate prediction model, it can be trained using a dataset labeled with both clicked and non-clicked data.

[0182] B. The server determines the sorting parameters for the multiple first candidate texts based on their click-through rates.

[0183] In one possible implementation, the server determines the click-through rate of the plurality of first candidate texts as the sorting parameter for the plurality of first candidate texts.

[0184] In one possible implementation, the server performs a linear transformation on the click-through rates of the multiple first candidate texts to obtain the ranking parameters of the multiple first candidate texts.

[0185] Linear transformations include adding a first value to the click-through rate (CTR), multiplying or dividing the CTR by a second value, or adding a first value to the CTR and then multiplying or dividing it by a second value. The first and second values ​​are set by a technician according to the actual situation, and this application does not limit this.

[0186] C. The server determines the first candidate text whose sorting parameters meet the target conditions among the multiple first candidate texts as at least one candidate text.

[0187] In one possible implementation, if the ranking parameter is positively correlated with the click-through rate, the server identifies the N first candidate texts with the largest ranking parameters from among the multiple first candidate texts as the at least one candidate text, where N is a positive integer. In this implementation, a larger ranking parameter indicates a higher probability that the first candidate text is selected, and meeting the target condition means that the ranking parameter is the largest among the multiple first candidate texts (N).

[0188] For example, the server sorts the multiple first candidate texts in descending order of sorting parameters, and determines the top N candidate texts as the at least one candidate text. Here, N is set by the technician according to the actual situation, and this application embodiment does not limit it.

[0189] In one possible implementation, the server identifies the first candidate text among the plurality of first candidate texts whose sorting parameter is greater than or equal to a sorting parameter threshold as at least one candidate text. In this implementation, a larger sorting parameter indicates a higher probability that the first candidate text is selected, and meeting the target condition means that the sorting parameter is greater than or equal to the parameter threshold.

[0190] The sorting parameter threshold is set by technicians according to the actual situation, and this application embodiment does not limit it.

[0191] In one possible implementation, when the ranking parameter is negatively correlated with the click-through rate, the server determines the N first candidate texts with the smallest ranking parameter among the plurality of first candidate texts as the at least one candidate text, where N is a positive integer. In this implementation, the smaller the ranking parameter, the higher the probability that the first candidate text is selected. Meeting the target condition means that the ranking parameter is the smallest among the plurality of first candidate texts.

[0192] In addition to the two implementation methods described above, this application also provides another method for determining at least one candidate text from the plurality of first candidate texts.

[0193] In one possible implementation, the server determines the click-through rate of the plurality of first candidate texts. Based on the click-through rate of the plurality of first candidate texts and the probability that the target text is incorrect, the server determines the sorting parameters of the plurality of first candidate texts. The server identifies the first candidate text whose sorting parameters meet the target conditions as at least one candidate text.

[0194] In this implementation, ranking parameters are determined based on click-through rate and the probability of errors. By using the probability of errors as a weight for the click-through rate during parameter determination, the accuracy of the determined ranking parameters is improved. Subsequently, at least one candidate text is obtained based on these ranking parameters, thus improving the accuracy of the obtained candidate text.

[0195] For example, the server determines the click-through rate (CTR) of a plurality of first candidate texts. For any one of the multiple first candidate texts, the server multiplies the CTR of the first candidate text by the probability that the target text contains an error, to obtain the ranking parameter of the first candidate text. The probability that the target text contains an error is output by the server through an error detection model. In some embodiments, the ranking parameter of the first candidate text is also referred to as the fusion ranking score of the first candidate text. The server determines the N first candidate texts with the largest ranking parameters from the plurality of first candidate texts as the at least one candidate text. The method for the server to determine the CTR of the plurality of first candidate texts is described in the relevant description of sub-step A in the previous embodiment, and will not be repeated here.

[0196] 307. The server obtains at least one candidate text based on the target text and the initial text, the content of the at least one candidate text being associated with the content of the initial text or the target text.

[0197] In one possible implementation, the server uses the target text to search the candidate text library and obtains multiple first candidate texts. The server uses the initial text to search the candidate text library and obtains multiple second candidate texts, the candidate text library including multiple candidate texts. The server obtains the at least one candidate text from the multiple first candidate texts and the multiple second candidate texts.

[0198] To provide a clearer explanation of the above embodiments, the following description will be divided into three parts.

[0199] The first part involves searching the candidate text library using the target text to obtain multiple first candidate texts.

[0200] In one possible implementation, the server uses the target text to perform at least one of prefix search and fuzzy search in the candidate text library to obtain the plurality of first candidate texts.

[0201] In some embodiments, a plurality of first candidate texts constitute a candidate text list Sug_list_chk corresponding to the target text.

[0202] The second part involves the server using the initial text to search the candidate text library and obtaining multiple second candidate texts.

[0203] In one possible implementation, the server uses the initial text to perform at least one of prefix search and fuzzy search in the candidate text library to obtain the plurality of second candidate texts.

[0204] In some embodiments, a plurality of second candidate texts constitute a candidate text list Sug_list_src corresponding to the initial text.

[0205] Part Three: The server obtains at least one candidate text from the plurality of first candidate texts and the plurality of second candidate texts.

[0206] In one possible implementation, the server determines the click-through rate (CTR) of the plurality of first candidate texts and the CTR of the plurality of second candidate texts. Based on the CTR of the plurality of first candidate texts, the server determines a ranking parameter for the plurality of first candidate texts. Based on the CTR of the plurality of second candidate texts, the server determines a ranking parameter for the plurality of second candidate texts. The server identifies the first candidate text or the second candidate text whose ranking parameter meets the target condition as at least one candidate text.

[0207] The sorting parameters for the multiple first candidate texts are used to indicate the probability of the multiple first candidate texts being selected, and the sorting parameters for the multiple second candidate texts are used to indicate the probability of the multiple second candidate texts being selected.

[0208] In this implementation, the sorting parameters are determined based on the click-through rate and the probability of errors, and at least one candidate text is obtained based on the sorting parameters, which improves the accuracy of the obtained candidate text.

[0209] To illustrate the above implementation method, the following will describe the implementation method through sub-steps A-D.

[0210] A. The server determines the click-through rate of the multiple first candidate texts and the click-through rate of the multiple second candidate texts.

[0211] In one possible implementation, for any one of the plurality of first candidate texts, the server determines the click-through rate of the first candidate text based on at least one of the target object's interest parameters in the first candidate text, the similarity between the first candidate text and the target text, and the historical interaction parameters of the first candidate text. For any one of the plurality of second candidate texts, the server determines the click-through rate of the second candidate text based on at least one of the target object's interest parameters in the second candidate text, the similarity between the second candidate text and the initial text, and the historical interaction parameters of the second candidate text, wherein the target object is the object that input the initial text.

[0212] For example, the server inputs a first target parameter into a click-through rate (CTR) prediction model. The model performs a fully connected operation and normalization on the first target parameter, outputting the CTR of the first candidate text. The first target parameter includes at least one of the following: the target audience's interest in the first candidate text, the similarity between the first candidate text and the target text, and the historical interaction parameters of the first candidate text. The server then inputs a second target parameter into the CTR prediction model. The model performs a fully connected operation and normalization on the second target parameter, outputting the CTR of the second candidate text. The second target parameter includes at least one of the following: the target audience's interest in the second candidate text, the similarity between the second candidate text and the initial text, and the historical interaction parameters of the second candidate text. The specific parameters in the second target parameter are analogous to those in the first target parameter and will not be elaborated further here.

[0213] In some embodiments, the similarity between the second candidate text and the initial text includes at least one of textual similarity and pinyin similarity between the second candidate text and the initial text. The historical interaction parameters of the second candidate text include at least one of the historical search count of the second candidate text, the historical input count of the second candidate text, the historical click-through rate of the second candidate text, and the click-through rate of the media resource corresponding to the second candidate text. For a description of the first candidate text and the structure and usage of the click-through rate prediction model, please refer to the description of step 306 above, which will not be repeated here.

[0214] B. The server determines the sorting parameters for the multiple first candidate texts based on their click-through rates.

[0215] In one possible implementation, the server determines the click-through rate of the plurality of first candidate texts as the sorting parameter for the plurality of first candidate texts.

[0216] In one possible implementation, the server performs a linear transformation on the click-through rates of the multiple first candidate texts to obtain the ranking parameters of the multiple first candidate texts.

[0217] Linear transformations include adding a first value to the click-through rate (CTR), multiplying or dividing the CTR by a second value, or adding a first value to the CTR and then multiplying or dividing it by a second value. The first and second values ​​are set by a technician according to the actual situation, and this application does not limit this.

[0218] C. The server determines the sorting parameters for the multiple second candidate texts based on their click-through rates.

[0219] In one possible implementation, the server determines the click-through rate of the plurality of second candidate texts as the sorting parameter for the plurality of second candidate texts.

[0220] In one possible implementation, the server performs a linear transformation on the click-through rates of the multiple second candidate texts to obtain the ranking parameters of the multiple second candidate texts.

[0221] Linear transformations include adding a first value to the click-through rate (CTR), multiplying or dividing the CTR by a second value, or adding a first value to the CTR and then multiplying or dividing it by a second value. The first and second values ​​are set by a technician according to the actual situation, and this application does not limit this.

[0222] D. The server determines the first or second candidate text among the multiple first candidate texts and the multiple second candidate texts whose sorting parameters meet the target conditions as at least one candidate text.

[0223] In one possible implementation, if the ranking parameter is positively correlated with the click-through rate, the server determines the N candidate texts with the largest ranking parameter among the plurality of first candidate texts and the plurality of second candidate texts as the at least one candidate text.

[0224] For example, the server sorts the multiple first candidate texts and the multiple second candidate texts in descending order of sorting parameters, and determines the top N candidate texts as the at least one candidate text. Here, N is set by the technician according to the actual situation, and this application embodiment does not limit it.

[0225] In one possible implementation, when the sorting parameter is negatively correlated with the click-through rate, the server determines the N first candidate texts with the smallest sorting parameter among the plurality of first candidate texts as the at least one candidate text, where N is a positive integer.

[0226] In addition to the two implementation methods described above, this application also provides another method for determining at least one candidate text from the plurality of first candidate texts and the plurality of second candidate texts.

[0227] In one possible implementation, the server determines the click-through rate (CTR) of the plurality of first candidate texts and the CTR of the plurality of second candidate texts. Based on the CTR of the plurality of first candidate texts and the probability that the target text contains an error, the server determines a ranking parameter for the plurality of first candidate texts. Based on the CTR of the plurality of second candidate texts and the probability that the initial text contains an error, the server determines a ranking parameter for the plurality of second candidate texts. The server then identifies the first or second candidate text whose ranking parameter matches the target condition as at least one candidate text.

[0228] For example, the server determines the click-through rate (CTR) of a plurality of first candidate texts and the CTR of a plurality of second candidate texts. For any first candidate text among the plurality of first candidate texts, the server multiplies the CTR of the first candidate text by the probability that the target text contains an error, to obtain a ranking parameter for the first candidate text, wherein the probability that the target text contains an error is output by the server through an error detection model. In some embodiments, the ranking parameter of the first candidate text is also referred to as the fused ranking score of the first candidate text. For any second candidate text among the plurality of second candidate texts, the server multiplies the CTR of the second candidate text by the probability that the initial text contains an error, to obtain a ranking parameter for the second candidate text, wherein the probability that the initial text contains an error is output by the server through an error detection model. In some embodiments, the ranking parameter of the second candidate text is also referred to as the fused ranking score of the second candidate text. The server determines the N candidate texts with the largest ranking parameters among the plurality of first candidate texts and the plurality of second candidate texts as the at least one candidate text. The method for the server to determine the CTR of the plurality of first candidate texts and second candidate texts is described in the relevant description of sub-step A in the previous embodiment, and will not be repeated here.

[0229] In some embodiments, when the number of candidate texts obtained by the server based on the initial text and the target text is one, the first candidate text obtained by the server based on the initial text and the second candidate text obtained by the server based on the target text are the same candidate text.

[0230] 308. If the probability of an error in the initial text does not meet the target probability condition, the server obtains at least one candidate text based on the initial text.

[0231] In one possible implementation, if the probability of the initial text containing an error is less than a probability threshold, the server searches the candidate text library based on the initial text to obtain at least one candidate text.

[0232] The scheme in which the server searches the candidate text library based on the initial text is the same inventive concept as the method in step 306 above that searches the candidate text library based on the initial text to obtain multiple first candidate texts. The implementation process is described in the relevant description in step 306 and will not be repeated here.

[0233] 309. The server returns at least one candidate text to the terminal.

[0234] 310. The terminal receives the at least one candidate text and displays the at least one candidate text based on the search function.

[0235] In one possible implementation, the terminal receives the at least one candidate text and displays it on a content search page. Displaying the at least one candidate text based on the search function means displaying the at least one candidate text on the content search page. A user clicking on any of the at least one candidate text can trigger a search command based on that candidate text.

[0236] In some embodiments, the content search page includes a search text input area, which includes a search suggestion area, which is a drop-down window of the search text input area, allowing the terminal to display at least one candidate text. For example, see... Figure 4 The content search page 400 includes a search text input area 401. When input is made in the search text input area 401, the terminal displays a search suggestion area 403, showing at least one candidate text. In response to a click on any candidate text displayed in the search suggestion area 403, a search instruction based on that candidate text is triggered. In response to the search instruction, the terminal performs a search based on the candidate text and displays the search results on the content search page. In the scenario of searching for videos, the at least one candidate text is used to search for videos, and the search result is the video found.

[0237] The above steps 301-310 include three execution sequences: 301-305, 306, 310 and 310; 301-305, 307, 310 and 310; 301-304 and 308-310. The above three execution sequences will be explained through three examples below.

[0238] First, we will use a specific example to illustrate steps 301-305, 306, 310, and 310 above.

[0239] Taking video search as an example, the terminal displays a content search page. The user initially intends to search for the video "Fengyun 2," but due to an input error, the initial text entered is "Fengyun." The server retrieves this initial text "Fengyun" from the terminal, performs error detection on it, and calculates the probability that the initial text "Fengyun" contains an error. If the probability of the initial text "Fengyun" containing an error is greater than or equal to a probability threshold, the server corrects the initial text "Fengyun," obtaining the target text "Fengyun." Based on the target text "Fengyun," the server retrieves at least one candidate text. For example, if the server retrieves the candidate texts "Fengyun," "Fengyun 2," and "Fengyun 3" based on the target text "Fengyun," then the server can send all three candidate texts to the terminal, which then displays them on the content search page. Through this process, the user can quickly select "Fengyun 2" from the three candidate texts displayed on the content search page, thus finding the video "Fengyun 2." The technical solution provided by the embodiments of this application reduces the impact of input errors on search results. Even if the initial text contains errors, the user can still obtain the search results they want, thus improving the efficiency of human-computer interaction.

[0240] The following is a concrete example to illustrate steps 301-305, 307, 310, and 310 above.

[0241] Taking video search as an example, a terminal displays a content search page. A user originally intends to search for the video "Infernal Affairs 2" through the content search page, but due to an input error, the initial text entered in the search page is "Wu Jian Dao (Five Items Path)". A server obtains the initial text "Wu Jian Dao" from the terminal, performs error recognition on the initial text "Wu Jian Dao", and obtains the probability that an error exists in the initial text "Wu Jian Dao". When the probability that an error exists in the initial text "Wu Jian Dao" is greater than or equal to a probability threshold, the server performs error correction on the initial text "Wu Jian Dao" to obtain the target text "Infernal Affairs". The server performs recall based on the initial text "Wu Jian Dao" and the target text "Infernal Affairs" to obtain at least one candidate text. For example, the server obtains the candidate texts "Five Armors" and "Five Trivial Matters" based on the initial text "Wu Jian Dao", and obtains the candidate texts "Infernal Affairs", "Infernal Affairs 2" and "Infernal Affairs 3" based on the target text "Infernal Affairs". In this case, the server can send all five candidate texts "Five Armors", "Five Trivial Matters", "Infernal Affairs", "Infernal Affairs 2" and "Infernal Affairs 3" to the terminal, and the terminal displays the five candidate texts on the content search page. Through this processing manner, the user can quickly select "Infernal Affairs 2" for search through the five candidate texts displayed on the content search page, so as to search for the video "Infernal Affairs 2". Alternatively, in some special cases, the user just wants to perform a search based on the initial text "Wu Jian Dao", and the five candidate texts displayed by the terminal also include the candidate text obtained based on the initial text "Wu Jian Dao, so the user can also perform a search based on the candidate text. That is to say, according to the technical solution provided in the embodiments of the present application, the initial text input by the user and the target text generated by the server are fully utilized, and the human-computer interaction efficiency is improved.

[0242] Finally, the above steps 301 to 304 and 308 to 310 are described through a specific example.

[0243] Taking video search as an example, the terminal displays a content search page. A user wants to search for the video "Fengyun 2" on this page, and the initial text entered is "Fengyun". The server retrieves the initial text "Fengyun" from the terminal, performs error identification on it, and calculates the probability that an error exists in the initial text "Fengyun". If the probability of an error in the initial text "Fengyun" is less than a probability threshold, the server recalls at least one candidate text based on the initial text "Fengyun". For example, if the server retrieves the candidate texts "Fengyun", "Fengyun 2", and "Fengyun 3" based on the initial text "Fengyun", then the server can send all three candidate texts to the terminal, which then displays them on the content search page. Through this processing method, the user can quickly select "Fengyun 2" to search for using the three candidate texts displayed on the content search page, thus finding the video "Fengyun 2". The technical solution provided by this application embodiment can expand the initial text entered by the user to obtain at least one candidate text, thereby improving search efficiency.

[0244] The following will combine Figure 8 The method for obtaining search text provided in this application embodiment is described in conjunction with the various optional implementation methods in steps 301-310 above.

[0245] See Figure 8 The server creates a candidate text library containing multiple candidate texts. The server retrieves the initial text, which is the original text input by the user. The server performs error identification and correction on the initial text to obtain the target text. The server searches based on the initial text to obtain multiple first candidate texts. The server searches based on the target text to obtain multiple second candidate texts. The server sorts these first and second candidate texts according to a sorting parameter. The server returns the top N candidate texts from these first and second candidate texts to the terminal for user use.

[0246] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.

[0247] The technical solution provided in this application involves obtaining initial text input via a search function, then performing error identification on the initial text to determine the probability of errors present. If this probability meets the target probability condition, it indicates that errors may exist in the initial text. Error correction is then performed on the initial text to eliminate these errors, resulting in the target text. Since the process of obtaining candidate text is based on the corrected target text, the impact of errors in the initial text on the acquisition of candidate text is reduced, thus improving the accuracy of the obtained candidate text.

[0248] Figure 9 This is a schematic diagram of the structure of a text acquisition device provided in an embodiment of this application. See also... Figure 9 The device includes: an initial text acquisition module 901, an error recognition module 902, an error correction module 903, a candidate text acquisition module 904, and a return module 905.

[0249] The initial text acquisition module 901 is used to acquire the initial text based on the search function input from the terminal.

[0250] Error identification module 902 is used to identify errors in the initial text and obtain the probability that there are errors in the initial text.

[0251] The error correction module 903 is used to correct the initial text and obtain the target text when the probability of an error in the initial text meets the target probability condition.

[0252] The candidate text acquisition module 904 is used to acquire at least one candidate text based on the target text, wherein the content of the at least one candidate text is associated with the content of the target text.

[0253] The return module 905 is used to return the at least one candidate text to the terminal, which is used by the terminal to display the at least one candidate text based on the search function.

[0254] In one possible implementation, the error detection module 902 is used to perform embedding encoding on the initial text to obtain the embedding features of the initial text. The embedding features of the initial text are then input into an error detection model, which performs error detection based on the embedding features of the initial text and outputs the probability that the initial text contains an error.

[0255] In one possible implementation, the error detection module 902 is used to embed and encode the positions of each character in the initial text to obtain the positional embedding features of the initial text. It also embeds and encodes each character in the initial text to obtain the character embedding features. Furthermore, it embeds and encodes the words formed by the characters in the initial text to obtain the word embedding features. Finally, it fuses the positional embedding features, character embedding features, and word embedding features of the initial text to obtain the embedding features of the initial text.

[0256] In one possible implementation, the error detection module 902 is used to encode the embedding features of the initial text using the error detection model based on an attention mechanism to obtain the attention features of the initial text. The error detection model then maps the attention features of the initial text to output the probability that the initial text contains an error.

[0257] In one possible implementation, the initial text includes placeholders, and the error detection module 902 is used to perform fully connected and normalized attention features of the placeholders by the error detection model, and output the probability that the initial text contains errors.

[0258] In one possible implementation, the error correction module 903 is used to input the attention features of the initial text into the error correction model when the probability of the initial text containing an error is greater than or equal to a probability threshold, and the error correction model decodes the attention features of the initial text and outputs the target text.

[0259] In one possible implementation, the device further includes:

[0260] The training module is used to train the error recognition model and the error correction model using a sample dataset. The sample dataset includes positive samples and negative samples. The positive samples include positive sample text and labels for the positive sample text. The negative samples include negative sample text, labels for the negative sample text, and reference text for the negative sample text, which is the correct form of the negative sample text.

[0261] In one possible implementation, the candidate text acquisition module 904 is used to search a candidate text library using the target text to obtain multiple first candidate texts, the candidate text library including multiple candidate texts. At least one candidate text is then acquired from the multiple first candidate texts.

[0262] In one possible implementation, the candidate text acquisition module 904 is used to perform at least one of prefix search and fuzzy search on the candidate text in the candidate text library to obtain the plurality of first candidate texts.

[0263] In one possible implementation, the candidate text acquisition module 904 is used to determine the click-through rate of the plurality of first candidate texts. Based on the click-through rates of the plurality of first candidate texts and the probability that the target text contains errors, a sorting parameter for the plurality of first candidate texts is determined. The first candidate text among the plurality of first candidate texts whose sorting parameter meets the target condition is determined as at least one candidate text.

[0264] In one possible implementation, the candidate text acquisition module 904 is used to determine the click rate of any first candidate text among the plurality of first candidate texts based on at least one of the following: the target object's interest parameter in the first candidate text, the similarity between the first candidate text and the target text, and the historical interaction parameter of the first candidate text, wherein the target object is the object that input the initial text.

[0265] In one possible implementation, the candidate text acquisition module 904 is used to input a second target parameter into a click-through rate prediction model, perform a fully connected and normalized operation on the second target parameter through the click-through rate prediction model, and output the click-through rate of the first candidate text. The second target parameter includes at least one of the following: the target object's interest parameter in the first candidate text, the similarity between the first candidate text and the target text, and the historical interaction parameter of the first candidate text.

[0266] In one possible implementation, the similarity between the first candidate text and the target text includes at least one of the text similarity and the pinyin similarity between the first candidate text and the target text.

[0267] The historical interaction parameters of the first candidate text include at least one of the following: the historical number of searches for the first candidate text, the historical number of inputs for the first candidate text, the historical click-through rate of the first candidate text, and the click-through rate of the media resources corresponding to the first candidate text.

[0268] In one possible implementation, the device further includes:

[0269] The interest parameter determination module is used to determine the similarity between the first candidate text and multiple interest tags of the target object.

[0270] The similarity between the first candidate text and the multiple interest tags is weighted and summed with the interest weights of the multiple interest tags to obtain the interest parameter of the target object to the first candidate text. The interest weights of the multiple interest tags are used to represent the degree of matching between the target object and the multiple interest tags.

[0271] In one possible implementation, the candidate text acquisition module 904 is used to acquire at least one candidate text based on the target text and the initial text, wherein the content of the at least one candidate text is associated with the content of the target text or the content of the initial text.

[0272] In one possible implementation, the candidate text acquisition module 904 is used to search a candidate text library using the target text to obtain multiple first candidate texts, the candidate text library including multiple candidate texts. The initial text is then used to search the candidate text library to obtain multiple second candidate texts. Finally, at least one candidate text is obtained from the multiple first candidate texts and the multiple second candidate texts.

[0273] In one possible implementation, the candidate text acquisition module 904 is configured to determine the click-through rate of the plurality of first candidate texts and the click-through rate of the plurality of second candidate texts. Based on the click-through rates of the plurality of first candidate texts and the probability that the target text contains errors, a sorting parameter for the plurality of first candidate texts is determined. Based on the click-through rates of the plurality of second candidate texts and the probability that the initial text contains errors, a sorting parameter for the plurality of second candidate texts is determined. The first candidate text or the second candidate text whose sorting parameter meets the target condition is determined as at least one candidate text.

[0274] In one possible implementation, the candidate text acquisition module 904 is further configured to acquire at least one candidate text based on the initial text if the probability of an error in the initial text does not meet the target probability condition.

[0275] It should be noted that the search text acquisition device provided in the above embodiments is only illustrated by the division of the above functional modules. In practical 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 search text acquisition device and the search text acquisition method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0276] The technical solution provided in this application involves obtaining initial text input via a search function, then performing error identification on the initial text to determine the probability of errors present. If this probability meets the target probability condition, it indicates that errors may exist in the initial text. Error correction is then performed on the initial text to eliminate these errors, resulting in the target text. Since the process of obtaining candidate text is based on the corrected target text, the impact of errors in the initial text on the acquisition of candidate text is reduced, thus improving the accuracy of the obtained candidate text.

[0277] This application provides a computer device for performing the above-described method. This computer device can be implemented as a terminal or a server. The structure of the terminal will be described below:

[0278] Figure 10 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application.

[0279] Typically, terminal 1000 includes one or more processors 1001 and one or more memories 1002.

[0280] Processor 1001 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1001 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1001 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1001 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1001 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0281] The memory 1002 may include one or more computer-readable storage media, which may be non-transitory. The memory 1002 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1002 are used to store at least one computer program, which is executed by the processor 1001 to implement the method for obtaining search text provided in the method embodiments of this application.

[0282] In some embodiments, the terminal 1000 may also optionally include a peripheral device interface 1003 and at least one peripheral device. The processor 1001, memory 1002, and peripheral device interface 1003 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1003 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 1004, a display screen 1005, a camera assembly 1006, an audio circuit 1007, and a power supply 1008.

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

[0284] The radio frequency (RF) circuit 1004 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1004 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1004 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 1004 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, etc.

[0285] Display screen 1005 is used to display a user interface (UI). This UI may include graphics, text, icons, video, and any combination thereof. When display screen 1005 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1001 for processing. In this case, display screen 1005 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard.

[0286] The camera assembly 1006 is used to capture images or videos. Optionally, the camera assembly 1006 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal.

[0287] The audio circuit 1007 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 to the processor 1001 for processing, or input to the radio frequency circuit 1004 to realize voice communication.

[0288] The power supply 1008 is used to supply power to the various components in the terminal 1000. The power supply 1008 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery.

[0289] In some embodiments, the terminal 1000 further includes one or more sensors 1009. The one or more sensors 1009 include, but are not limited to: an acceleration sensor 1010, a gyroscope sensor 1011, a pressure sensor 1012, an optical sensor 1013, and a proximity sensor 1014.

[0290] Accelerometer 1010 can detect the magnitude of acceleration on the three coordinate axes of a coordinate system established with terminal 1000.

[0291] The gyroscope sensor 1011 can detect the orientation and rotation angle of the terminal 1000. The gyroscope sensor 1011 can work in conjunction with the accelerometer sensor 1010 to collect the user's 3D movements on the terminal 1000.

[0292] The pressure sensor 1012 can be installed on the side bezel of the terminal 1000 and / or on the lower layer of the display screen 1005. When the pressure sensor 1012 is installed on the side bezel of the terminal 1000, it can detect the user's grip signal on the terminal 1000, and the processor 1001 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 1012. When the pressure sensor 1012 is installed on the lower layer of the display screen 1005, the processor 1001 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 1005.

[0293] An optical sensor 1013 is used to collect ambient light intensity. In one embodiment, a processor 1001 can control the display brightness of a display screen 1005 based on the ambient light intensity collected by the optical sensor 1013.

[0294] The proximity sensor 1014 is used to detect the distance between the user and the front of the terminal 1000.

[0295] Those skilled in the art will understand that Figure 10 The structure shown does not constitute a limitation on terminal 1000 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0296] The aforementioned computer equipment can also be implemented as a server. The structure of a server is described below:

[0297] Figure 11 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1100 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 1101 and one or more memories 1102. The one or more memories 1102 store at least one computer program, which is loaded and executed by the one or more processors 1101 to implement the methods provided in the above-described method embodiments. Of course, the server 1100 may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server 1100 may also include other components for implementing device functions, which will not be elaborated upon here.

[0298] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores at least one computer program that is loaded and executed by a processor to implement the method for obtaining search text in the above embodiments. For example, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, or optical data storage device, etc.

[0299] In an exemplary embodiment, a computer program product is also provided, including a computer program that, when executed by a processor, implements the above-described method for obtaining search text.

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

[0301] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program controlling the related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0302] The above are merely optional embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for obtaining search text, characterized in that, The method includes: Obtain initial text from the terminal based on the search function input, the initial text including placeholders; The initial text is embedded and encoded to obtain its embedding features. These embedding features are then input into an error detection model, which encodes them based on an attention mechanism to obtain the initial text's attention features. Finally, the error detection model performs a fully connected and normalized process on the attention features of placeholders in the initial text to output the probability that the initial text contains errors. If the probability of an error in the initial text meets the target probability condition, the attention features of the initial text are input into the error correction model, and the error correction model decodes the attention features of the initial text and outputs the target text. The target text is searched in a candidate text library to obtain multiple first candidate texts, the candidate text library including multiple candidate texts; the click-through rate of the multiple first candidate texts is determined; for any first candidate text among the multiple first candidate texts, the click-through rate of the first candidate text is multiplied by the probability that the target text has an error to obtain the ranking parameter of the first candidate text, the probability that the target text has an error is output by the error recognition model; the first candidate text among the multiple first candidate texts whose ranking parameter meets the target condition is determined as at least one candidate text, the content of the at least one candidate text is associated with the content of the target text; The at least one candidate text is returned to the terminal, and the at least one candidate text is used by the terminal to display in the search suggestion area.

2. The method according to claim 1, characterized in that, The process of embedding and encoding the initial text to obtain its embedding features includes: The position of each character in the initial text is embedded and encoded to obtain the position embedding feature of the initial text; Each character in the initial text is embedded and encoded to obtain the character embedding features of the initial text; The words composed of each character in the initial text are embedded and encoded to obtain the word embedding features of the initial text; The positional embedding features, character embedding features, and word embedding features of the initial text are fused together to obtain the embedding features of the initial text.

3. The method according to claim 1, characterized in that, The method further includes: The error identification model and the error correction model are trained using a sample dataset, which includes positive samples and negative samples. The positive samples include positive sample text and labels for the positive sample text. The negative samples include negative sample text, labels for the negative sample text, and reference text for the negative sample text, wherein the reference text is the correct form of the negative sample text.

4. The method according to claim 1, characterized in that, The step of searching the candidate text in the candidate text library using the target text to obtain multiple first candidate texts includes: The target text is used to perform at least one of prefix search and fuzzy search in the candidate text library to obtain the plurality of first candidate texts.

5. The method according to claim 1, characterized in that, Determining the click-through rate of the plurality of first candidate texts includes: For any one of the plurality of first candidate texts, the click-through rate of the first candidate text is determined based on at least one of the target object's interest parameter for the first candidate text, the similarity between the first candidate text and the target text, and the historical interaction parameter of the first candidate text, wherein the target object is the object that input the initial text.

6. The method according to claim 5, characterized in that, The step of determining the click-through rate of the first candidate text based on at least one of the target object's interest parameters in the first candidate text, the similarity between the first candidate text and the target text, and the historical interaction parameters of the first candidate text includes: The second target parameter is input into the click-through rate prediction model. The click-through rate prediction model performs a fully connected and normalized operation on the second target parameter and outputs the click-through rate of the first candidate text. The second target parameter includes at least one of the target object's interest parameter in the first candidate text, the similarity between the first candidate text and the target text, and the historical interaction parameter of the first candidate text.

7. The method according to claim 5, characterized in that, The similarity between the first candidate text and the target text includes at least one of the text similarity and pinyin similarity between the first candidate text and the target text; The historical interaction parameters of the first candidate text include at least one of the following: the historical number of searches for the first candidate text, the historical number of inputs for the first candidate text, the historical click-through rate of the first candidate text, and the click-through rate of the media resources corresponding to the first candidate text.

8. The method according to claim 5, characterized in that, The method for determining the target object's interest parameters in the first candidate text includes: Determine the similarity between the first candidate text and multiple interest tags of the target object; The similarity between the first candidate text and the plurality of interest tags is weighted and summed with the interest weights of the plurality of interest tags to obtain the interest parameter of the target object to the first candidate text. The interest weights of the plurality of interest tags are used to represent the degree of matching between the target object and the plurality of interest tags.

9. The method according to claim 1, characterized in that, The method further includes: Based on the target text and the initial text, at least one candidate text is obtained, and the content of the at least one candidate text is associated with the content of the target text or the content of the initial text.

10. The method according to claim 9, characterized in that, The step of obtaining the at least one candidate text based on the target text and the initial text includes: The target text is used to search in the candidate text library to obtain multiple first candidate texts, and the candidate text library includes multiple candidate texts; The initial text is used to search the candidate text library to obtain multiple second candidate texts; At least one candidate text is obtained from the plurality of first candidate texts and the plurality of second candidate texts.

11. The method according to claim 10, characterized in that, The step of obtaining at least one candidate text from the plurality of first candidate texts and the plurality of second candidate texts includes: Determine the click-through rate of the plurality of first candidate texts and the click-through rate of the plurality of second candidate texts; Based on the click-through rate of the plurality of first candidate texts, the sorting parameters of the plurality of first candidate texts are determined; Based on the click-through rate of the multiple second candidate texts, the sorting parameters of the multiple second candidate texts are determined; The first candidate text or the second candidate text whose sorting parameter meets the target condition among the plurality of first candidate texts and the plurality of second candidate texts is determined as at least one candidate text.

12. The method according to claim 1, characterized in that, The method further includes: If the probability of an error in the initial text does not meet the target probability condition, at least one candidate text is obtained based on the initial text.

13. A device for acquiring search text, characterized in that, The device includes: An initial text acquisition module is used to acquire initial text from the terminal based on the search function input, wherein the initial text includes placeholders; An error detection module is used to perform embedding encoding on the initial text to obtain the embedding features of the initial text, input the embedding features of the initial text into an error detection model, and encode the embedding features of the initial text based on an attention mechanism to obtain the attention features of the initial text; the error detection model performs fully connected and normalized processing on the attention features of placeholders in the initial text, and outputs the probability that the initial text contains errors. The error correction module is used to input the attention features of the initial text into the error correction model when the probability of an error in the initial text meets the target probability condition. The error correction model then decodes the attention features of the initial text and outputs the target text. The candidate text acquisition module is used to search a candidate text library using the target text to obtain multiple first candidate texts, the candidate text library including multiple candidate texts; determine the click rate of the multiple first candidate texts; for any first candidate text among the multiple first candidate texts, multiply the click rate of the first candidate text by the probability that the target text has an error to obtain the ranking parameter of the first candidate text, the probability that the target text has an error is output by the error recognition model; and determine the first candidate text among the multiple first candidate texts whose ranking parameter meets the target condition as at least one candidate text, the content of the at least one candidate text being associated with the content of the target text; A return module is used to return the at least one candidate text to the terminal, and the at least one candidate text is used by the terminal to display in the search suggestion area.

14. A computer device, characterized in that, The computer device includes one or more processors and one or more memories, wherein at least one computer program is stored in the one or more memories, and the computer program is loaded and executed by the one or more processors to implement the method for obtaining search text as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Retrieved text error correction method and device, and storage medium

    CN111382260A

  • Text fixed-length error correction method and device, equipment and storage medium

    CN113887201A