Search text classification method and device, computer device and storage medium

By acquiring multiple search results and their category information for the search text, and combining them with text and reference category features, the problem of poor classification performance in existing technologies is solved, and more accurate search text classification is achieved.

CN117688171BActive Publication Date: 2026-05-01TENCENT TECH (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECH (BEIJING) CO LTD
Filing Date
2022-08-11
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In existing technologies, search text classification only considers the textual features of the search text, resulting in poor classification performance.

Method used

By obtaining multiple search results corresponding to the search text, reference category information is determined based on the preset categories to which these results belong. The search text and reference category information are combined to obtain fusion features, and a classification network is used for classification to determine the predicted category information of the search text.

Benefits of technology

The accuracy of search text classification has been improved, and the reliability of classification has been enhanced by taking into account the preset categories of search text and historical search results of the performed interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117688171B_ABST
    Figure CN117688171B_ABST
Patent Text Reader

Abstract

The application discloses a search text classification method and device, computer equipment and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: acquiring a search text to be classified and a plurality of search results corresponding to the search text, wherein the plurality of search results comprise historical search results of executed interactive operations; determining reference category information of the search text based on preset categories to which the plurality of search results belong; acquiring fusion features of the search text based on the search text and the reference category information; and classifying the search text based on the fusion features to obtain predicted category information of the search text. The application considers that the possibility that the preset category to which the search text belongs is the same as the preset category to which the historical search results of the executed interactive operations belong is relatively large, so the preset category to which the historical search results of the executed interactive operations belong is additionally considered in addition to the search text itself, and the accuracy of classifying the search text is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Search text classification methods, devices, computer equipment, and storage media Technical Field

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

[0002] In the field of search, to improve search accuracy, one can combine the search text with the category to which the search is conducted. It is easier to find search results that users are interested in under that category. For example, the search text may belong to categories such as movies, TV series, anime, documentaries, sports, games, or music.

[0003] In related technologies, after obtaining the search text, its textual features are extracted, and then these features are used for classification to determine the category to which the search text belongs. However, because this method only considers the textual features of the search text, the classification effect is not good enough. Summary of the Invention

[0004] This application provides a method, apparatus, computer device, and storage medium for classifying search text, which can improve the accuracy of classifying search text. The technical solution is as follows:

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

[0006] Obtain the search text to be categorized and multiple search results corresponding to the search text, wherein the multiple search results include historical search results corresponding to the search text for which interactive operations were performed;

[0007] Based on the preset categories to which the multiple search results belong, reference category information of the search text is determined, and the reference category information includes the reference probability that the search text belongs to multiple preset categories;

[0008] Based on the search text and the reference category information, obtain the fusion features of the search text;

[0009] The search text is classified based on the fusion features to obtain the predicted category information of the search text. The predicted category information includes the predicted probability that the search text belongs to the multiple preset categories. The predicted category information is used to determine the preset category to which the search text belongs.

[0010] Optionally, obtaining the fusion features of the search text based on the search text and the reference category information includes:

[0011] Extract the text features of the search text;

[0012] Extract the category features of the reference category information;

[0013] The text features and the category features are fused to obtain the fused features.

[0014] Optionally, the method further includes:

[0015] If the search results corresponding to the search text are not stored, the preset category information is determined as the reference category information for the search text.

[0016] Optionally, the feature extraction network includes a first extraction layer, a second extraction layer, and a feature fusion layer. The step of calling the feature extraction network to obtain the fused features based on the search text and the reference category information includes:

[0017] The first extraction layer is invoked to extract the text features of the search text;

[0018] The second extraction layer is invoked to extract the category features of the reference category information;

[0019] The feature fusion layer is invoked to fuse the text features and the category features to obtain the fused features.

[0020] Optionally, the classification network includes feature mapping layers corresponding to multiple dimensions, weighting layers for each preset category, and classification layers; the step of calling the classification network to classify the search text based on the fused features to obtain the predicted category information includes:

[0021] The multiple feature mapping layers are invoked respectively to extract the mapping features of the multiple dimensions based on the text features;

[0022] The weighted layer for each preset category is called separately, and a weighted reorganization for each preset category is determined based on the text features. The weighted reorganization includes the weights of the multiple dimensions, and the weights represent the degree of influence of the features of any text in the dimension on whether the text belongs to the preset category.

[0023] The weighted layer for each preset category is called separately, and the mapping features of the multiple dimensions are weighted and fused according to the multiple weights in the weighted reorganization of each preset category to obtain the classification features of each preset category.

[0024] The classification layer for each preset category is called separately, and classification is performed based on the classification features of each preset category to obtain the predicted probability corresponding to each preset category.

[0025] On the other hand, a search text classification device is provided, the device comprising:

[0026] The first acquisition module is used to acquire the search text to be classified and multiple search results corresponding to the search text, wherein the multiple search results include historical search results corresponding to the search text for which an interactive operation was performed;

[0027] The information determination module is used to determine the reference category information of the search text based on the preset categories to which the multiple search results belong, wherein the reference category information includes the reference probability that the search text belongs to multiple preset categories;

[0028] The second acquisition module is used to acquire the fusion features of the search text based on the search text and the reference category information;

[0029] The classification module is used to classify the search text based on the fusion features to obtain the predicted category information of the search text. The predicted category information includes the predicted probability that the search text belongs to the multiple preset categories. The predicted category information is used to determine the preset category to which the search text belongs.

[0030] Optionally, the information determination module is used to:

[0031] Determine a first quantity for each preset category, where the first quantity refers to the number of historical search results that belong to the preset category and have been interactively performed among the plurality of search results;

[0032] The first ratio between the first quantity of each preset category and the total number of the multiple search results is determined as the reference probability corresponding to each preset category.

[0033] Optionally, the plurality of search results also includes historical search results corresponding to the search text that have not undergone interactive operations; the information determination module is configured to:

[0034] Determine a second quantity for each preset category, the second quantity referring to the number of historical search results belonging to the preset category among the plurality of search results; determine a second ratio between the second quantity for each preset category and the total number of the plurality of search results;

[0035] A third quantity is determined for each preset category, where the third quantity refers to the number of historical search results belonging to the preset category and for which an interactive operation has been performed among the plurality of search results; a third ratio is determined between the third quantity for each preset category and the total number of historical search results for which an interactive operation has been performed.

[0036] The second ratio and the third ratio for each preset category are weighted and fused to obtain the reference probability corresponding to each preset category.

[0037] Optionally, the classification module is used for:

[0038] Based on the fusion features, multi-dimensional mapping features are extracted;

[0039] Based on the fusion features, a weighted reorganization for each preset category is determined. The weighted reorganization includes the weights of the multiple dimensions, and the weights represent the degree of influence of the features of any text on the dimension on whether the text belongs to the preset category.

[0040] According to the multiple weights in the weighting of each preset category, the mapping features of the multiple dimensions are weighted and fused to obtain the classification features of each preset category;

[0041] The search text is classified based on the classification features of each preset category to obtain the predicted probability corresponding to each preset category.

[0042] Optionally, the second acquisition module is used for:

[0043] Extract the text features of the search text;

[0044] Extract the category features of the reference category information;

[0045] The text features and the category features are fused to obtain the fused features.

[0046] Optionally, the device further includes a search module for:

[0047] The preset category with the highest predicted probability is determined as the preset category to which the search text belongs;

[0048] Based on the preset category to which the search text belongs and the preset categories to which multiple candidate search results corresponding to the search text belong, the relevance between the search text and each candidate search result is determined;

[0049] Candidate search results that meet the relevance criteria are determined as the search results found based on the search text.

[0050] Optionally, the device further includes a category determination module for:

[0051] Retrieve multiple categories to which candidate search results belong in the database;

[0052] Determine a fourth quantity for each category, where the fourth quantity refers to the number of candidate search results belonging to that category in the database;

[0053] The multiple categories that satisfy the quantity condition of the fourth quantity are determined as the multiple preset categories.

[0054] Optionally, the information determination module is further configured to determine preset category information as reference category information for the search text when the search results corresponding to the search text are not stored.

[0055] Optionally, the text classification model includes a feature extraction network and a classification network. The second acquisition module is used to call the feature extraction network to acquire the fused features based on the search text and the reference category information.

[0056] The classification module is used to call the classification network to classify the search text based on the fusion features and obtain the predicted category information.

[0057] Optionally, the feature extraction network includes a first extraction layer, a second extraction layer, and a feature fusion layer, and the second acquisition module is used for:

[0058] The first extraction layer is invoked to extract the text features of the search text;

[0059] The second extraction layer is invoked to extract the category features of the reference category information;

[0060] The feature fusion layer is invoked to fuse the text features and the category features to obtain the fused features.

[0061] Optionally, the classification network includes feature mapping layers corresponding to multiple dimensions, weighting layers for each preset category, and classification layers; the classification module is used for:

[0062] The multiple feature mapping layers are invoked respectively to extract the mapping features of the multiple dimensions based on the text features;

[0063] The weighted layer for each preset category is called separately, and a weighted reorganization for each preset category is determined based on the text features. The weighted reorganization includes the weights of the multiple dimensions, and the weights represent the degree of influence of the features of any text in the dimension on whether the text belongs to the preset category.

[0064] The weighted layer for each preset category is called separately, and the mapping features of the multiple dimensions are weighted and fused according to the multiple weights in the weighted reorganization of each preset category to obtain the classification features of each preset category.

[0065] The classification layer for each preset category is called separately, and classification is performed based on the classification features of each preset category to obtain the predicted probability corresponding to each preset category.

[0066] Optionally, the device further includes:

[0067] The first acquisition module is further configured to acquire a first sample search text and multiple sample search results corresponding to the first sample search text, wherein the sample search results include historical search results of the interactive operation performed corresponding to the first sample search text;

[0068] The information determination module is further configured to determine a first reference category information of the first sample search text based on the preset categories to which the multiple sample search results belong, wherein the first reference category information includes the sample reference probability of the first sample search text belonging to the multiple preset categories;

[0069] The second acquisition module is further configured to call the feature extraction network to acquire the sample fusion features of the first sample search text based on the first sample search text and the first reference category information;

[0070] The classification module is also used to call the classification network to classify the first sample search text based on the sample fusion features to obtain first predicted category information, wherein the first predicted category information includes the sample prediction probability that the first sample search text belongs to the multiple preset categories;

[0071] The training module is used to train the text classification model based on the first true category information and the first predicted category information of the first sample search text, so as to increase the similarity between the first predicted category information and the first true category information obtained by the trained text classification model. The first true category information includes the true probability that the first sample search text belongs to the multiple preset categories.

[0072] Optionally, the feature extraction network includes a first extraction layer, a second extraction layer, and a feature fusion layer, and the second acquisition module is further configured to:

[0073] The first extraction layer is invoked to extract the sample text features of the first sample search text;

[0074] The second extraction layer is invoked to extract the sample category features of the first reference category information;

[0075] The feature fusion layer is invoked to fuse the sample text features and the sample category features to obtain the sample fusion features.

[0076] Optionally, the classification network includes feature mapping layers corresponding to multiple dimensions, weighting layers for each preset category, and classification layers; the classification module is further used for:

[0077] The multiple feature mapping layers are invoked respectively, and sample mapping features of multiple dimensions are extracted based on the sample fusion features;

[0078] The weighted layer for each preset category is called separately, and the weighted recombination for each preset category is determined based on the sample fusion features. The weighted recombination includes the weights of the multiple dimensions, and the weights represent the degree of influence of the features of any text in the dimension on whether the text belongs to the preset category.

[0079] The weighted layer for each preset category is called separately, and the sample mapping features of the multiple dimensions are weighted and fused according to the multiple weights in the weighted reorganization of each preset category to obtain the sample classification features of each preset category.

[0080] The classification layer of each preset category is called respectively, and the first sample search text is classified based on the sample classification features of each preset category to obtain the sample prediction probability corresponding to each preset category.

[0081] Optionally, the first acquisition module is further configured to acquire the second sample search text, and determine the preset category information as the second reference category information of the second sample search text, wherein the second reference category information includes the sample reference probability that the second sample search text belongs to the multiple preset categories;

[0082] The second acquisition module is further configured to invoke the feature extraction network to acquire the sample fusion features of the second sample search text based on the second sample search text and the second reference category information;

[0083] The classification module is also used to call the classification network to classify the second sample search text based on the sample fusion features to obtain second predicted category information. The second predicted category information includes the sample prediction probability that the second sample search text belongs to the multiple preset categories.

[0084] The training module is further configured to train the text classification model based on the second true category information and the second predicted category information of the second sample search text, so as to increase the similarity between the second predicted category information and the second true category information obtained by the trained text classification model. The second true category information includes the true probability that the second sample search text belongs to the multiple preset categories.

[0085] Optionally, the training module is used for:

[0086] According to the loss weight corresponding to each preset category, the difference parameter between the predicted probability and the true probability of the sample in each preset category is weighted and fused to obtain the loss parameter. The similarity between the predicted probability and the true probability of the sample is negatively correlated with the difference parameter.

[0087] Based on the loss parameters, the text classification model is trained and the loss weights are updated so that the loss parameters obtained based on the trained text classification model and the updated loss weights are reduced.

[0088] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor to perform the operations performed by the search text classification method as described above.

[0089] On the other hand, a computer-readable storage medium is provided that stores at least one computer program, which is loaded and executed by a processor to perform the operations performed by the search text classification method as described above.

[0090] On the other hand, a computer program product is provided, including a computer program loaded and executed by a processor to perform the operations performed by the search text classification method as described above.

[0091] The methods, apparatus, computer devices, and storage media provided in this application, considering the close relationship between search text and historical search results of the performed interactive operation, can initially determine the reference probability of the search text belonging to multiple preset categories based on the preset categories to which the historical search results of the performed interactive operation belong. Then, the search text and the corresponding reference probabilities are used for classification to determine the predicted probability of the search text belonging to multiple preset categories. This application considers the high probability that the preset category to which the search text belongs is the same as the preset category to which the historical search results of the performed interactive operation belong. Therefore, in addition to the search text itself, the preset category to which the historical search results of the performed interactive operation belong is also considered. Using the preset category to which the historical search results of the performed interactive operation belong as a reference, combined with the search text itself, to separate the search text is beneficial to improving the accuracy of search text classification. Attached Figure Description

[0092] 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 the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0093] Figure 1 is a schematic diagram of an implementation environment provided in an embodiment of this application;

[0094] Figure 2 is a schematic diagram of an application scenario provided by an embodiment of this application;

[0095] Figure 3 is a flowchart of a text classification method provided in an embodiment of this application;

[0096] Figure 4 is a flowchart of another search text classification method provided in an embodiment of this application;

[0097] Figure 5 is a structural schematic diagram of a text classification model provided in an embodiment of this application;

[0098] Figure 6 is a flowchart of another search text classification method provided in an embodiment of this application;

[0099] Figure 7 is a schematic diagram of a convolutional layer provided in an embodiment of this application;

[0100] Figure 8 is a flowchart of the training method for the text classification model provided in the embodiments of this application;

[0101] Figure 9 is a flowchart of a training method for a search text classification model provided in an embodiment of this application;

[0102] Figure 10 is a schematic diagram of the structure of a text classification device provided in an embodiment of this application;

[0103] Figure 11 is a schematic diagram of another text classification device provided in an embodiment of this application;

[0104] Figure 12 is a schematic diagram of the structure of a terminal provided in an embodiment of this application;

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

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

[0107] It is understood that the terms "first," "second," etc., used in this application may be used to describe various concepts herein, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of this application, the first sample search text may be referred to as the second sample search text, and similarly, the second sample search text may be referred to as the first sample search text.

[0108] "At least one" refers to one or more preset categories. For example, at least one preset category can be any integer number of preset categories greater than or equal to one, such as one preset category, two preset categories, three preset categories, etc. "Multiple" refers to two or more preset categories. For example, multiple preset categories can be any integer number of preset categories greater than or equal to two, such as two preset categories, three preset categories, etc. "Each" refers to each of the at least one preset category. For example, each preset category refers to each of the multiple preset categories. If the multiple preset categories are three preset categories, then each preset category refers to each of the three preset categories.

[0109] It is understood that the embodiments of this application involve data such as user information, search text and search results. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0110] 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.

[0111] 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, as well as machine learning / deep learning, autonomous driving, and intelligent transportation.

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

[0113] Natural Language Processing (NLP) is an important field within computer science and artificial intelligence. It studies the theories and methods for enabling effective communication between humans and computers using natural language. NLP is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language people use in daily life—and thus it has a close relationship with linguistic research. NLP techniques typically include text processing, semantic understanding, machine translation, question answering, and knowledge graphs.

[0114] The following will describe the search text classification method provided in the embodiments of this application based on artificial intelligence technology and natural language processing technology.

[0115] The search text classification method provided in this application can be used in computer devices. Optionally, the computer device is a terminal or a server. Optionally, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, etc., but is not limited to these.

[0116] In one possible implementation, the computer program involved in the embodiments of this application 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 can form a blockchain system.

[0117] Figure 1 is a schematic diagram of an implementation environment provided in an embodiment of this application. Referring to Figure 1, the implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 are connected via a wireless or wired network. Optionally, the server 102 is used to train a text classification model, which is used to classify any search text. The server 102 sends the trained text classification model to the terminal 101, which can then call the text classification model to classify any search text based on the corresponding reference category information, obtaining predicted category information. This predicted category information is used to determine the preset category to which the search text belongs.

[0118] In one possible implementation, terminal 101 runs an application client provided by the server. Server 102 stores the trained text classification model in the application client, which has the function of classifying search text. Terminal 101, based on the application client, calls the text classification model to classify any search text based on the corresponding reference category information, thereby obtaining predicted category information.

[0119] It should be noted that Figure 1 only illustrates the example of server 102 training a text classification model and sending it to terminal 101. In another embodiment, the server can also call the text classification model to classify the search text, obtain the preset category to which the search text belongs, and then send the preset category to which the search text belongs to terminal 101.

[0120] The search text classification method provided in this application can be applied to any scenario where it is necessary to determine the category to which the search text belongs. Figure 2 is a schematic diagram of an application scenario provided in this application embodiment. As shown in Figure 2, determining the category to which the search text belongs includes application scenario 1 and application scenario 2.

[0121] Application Scenario 1: Each time a search request is received, the method provided in the embodiments of this application is used to determine the category to which the search text in the search request belongs, and then search recommendations are made based on the category to which the search text belongs.

[0122] (1) Determine the relevance between the search text and the search result based on their respective categories. Then, decide whether to recommend the search result based on the relevance between the search text and the search result.

[0123] A relevance model is used to determine the relevance between search text and search results. In this embodiment, when using the relevance model, the category to which the search text belongs and the category to which the search results belong can also be considered. For example, the text features of the search text, the data features of the search results, the category to which the search text belongs, and the category to which the search results belong are input into the relevance model, and the relevance model outputs the relevance between the search text and the search results. Thus, the category to which the search text belongs and the category to which the search results belong are used as features to determine the relevance between the search text and the search results.

[0124] (2) Sort multiple search results according to the category of the search text and the category of the search results, and then display the sorted search results.

[0125] A coarse-ranking model is used to determine the ranking score corresponding to the search results, and then ranks the multiple search results based on the ranking scores. In this embodiment, when using the coarse-ranking model, the category to which the search text belongs and the category to which the search results belong can also be additionally considered. For example, the text features of the search text, the data features of the search results, the category to which the search text belongs, and the category to which the search results belong are input into the coarse-ranking model, and the coarse-ranking model outputs the ranking score of the search results, thereby using the category to which the search text belongs and the category to which the search results belong as features for determining the ranking score of the search results.

[0126] Application Scenario 2: Whenever a search request is received, the method provided in this application embodiment is used to determine the category to which the search text in the search request belongs. The categories to which the search text received within a preset time period are statistically analyzed, and the statistical results are displayed.

[0127] (1) Calculate the traffic share of each category. The traffic share refers to the ratio between the number of search texts belonging to that category and the total number of search texts within a preset time period. The traffic share of each category can reflect the frequency of searching for each category of search texts.

[0128] (2) Statistical analysis of the performance indicators for each category. The performance indicators refer to the interactive actions performed on the search results after they are displayed. For example, the interactive actions are clicks, likes, dislikes, or following the publisher of the search results.

[0129] (3) Analyze the most frequently searched texts under each category.

[0130] In addition, the search text classification method provided in this application embodiment can also be applied to other scenarios, which will not be listed here.

[0131] Figure 3 is a flowchart of a text classification method provided in an embodiment of this application. This embodiment of the application is executed by a computer device. Referring to Figure 3, the method includes:

[0132] 301. Computer equipment acquires the search text to be categorized and multiple search results corresponding to the search text.

[0133] The computer device acquires the search text to be categorized and the corresponding multiple search results. The search text may be the search text carried in the search request currently received by the computer device, or it may be the search text generated by other devices and set for the computer. The multiple search results include the historical search results corresponding to the search text and the interactive operations performed.

[0134] The computer device stores historical search text and multiple historical search results corresponding to the historical search text. These multiple historical search results refer to the search results obtained based on the historical search text. The historical search text is the search text from the search process prior to the current point in time. The computer device checks among the stored multiple historical search texts to see if there is any historical search text identical to the current search text. If there is, it retrieves the multiple historical search results corresponding to that historical search text, and from these multiple historical search results, it retrieves the historical search result for which the interaction was performed, and determines the historical search result for which the interaction was performed as the search result corresponding to the current search text. Here, "historical search text identical to the current search text" means that the content of the historical search text is the same as the content of the current search text; for example, both the historical search text and the current search text are "paintbrushes suitable for beginners".

[0135] 302. The computer device determines the reference category information of the search text based on the preset categories to which multiple search results belong.

[0136] The computer equipment is configured with multiple preset categories. Any search result can be categorized into one of these preset categories, and any search text can be categorized into one of these preset categories. For example, the preset categories include TV series, variety shows, education, sports, documentaries, automobiles, music, movies, children's content, games, animation, culture and history, news, fashion, maternal and infant products, lifestyle, technology, finance, travel, people, and traditional performing arts, etc.

[0137] After obtaining the multiple search results, the computer device determines the preset category to which each search result belongs. Considering that the search text is closely related to the historical search results of the interactive operation, the preset category to which the historical search results of the interactive operation belong can reflect the preset category to which the search text belongs to a certain extent. Therefore, based on the preset categories to which the multiple search results belong, the computer device determines the reference category information of the search text, which includes the reference probability that the search text belongs to multiple preset categories.

[0138] 303. Computer devices obtain the fusion features of the search text based on the search text and reference category information.

[0139] Since the reference category information is determined based on the preset category to which the historical search results of the interactive operation corresponding to the search text belong, the reference category information can reflect to some extent which preset category the search text may belong to. Therefore, the fusion feature of the search text is obtained based on the search text and the reference category information, so that the fusion feature integrates the features of the search text itself and the features of the reference category information of the search text. This is equivalent to integrating the features of the text semantic dimension and the features of the text category dimension, thus enriching the information content of the fusion feature.

[0140] 304. Computer devices classify search texts based on fused features to obtain predicted category information for the search texts.

[0141] The predicted category information includes the predicted probability that the search text belongs to multiple preset categories. This predicted category information is used to determine the preset category to which the search text belongs. For example, the preset category with the highest predicted probability is determined as the preset category to which the search text belongs. Since this fusion feature combines the features of the search text itself and the features of the reference category information of the search text, classification based on this fusion feature takes into account both the features of the search text itself and the features of the reference category information of the search text.

[0142] The method provided in this application takes into account that the search text is closely related to the historical search results of the performed interaction. Therefore, based on the preset category to which the historical search results of the performed interaction belong, a reference probability of the search text belonging to multiple preset categories can be initially determined. Then, the search text and the corresponding reference probability are used for classification to determine the predicted probability of the search text belonging to multiple preset categories. This application considers that the preset category to which the search text belongs is likely to be the same as the preset category to which the historical search results of the performed interaction belong. Therefore, in addition to the search text itself, the preset category to which the historical search results of the performed interaction belong is also considered. Using the preset category to which the historical search results of the performed interaction belong as a reference, combined with the search text itself, to separate the search text is beneficial to improving the accuracy of the search text classification.

[0143] Based on the embodiment shown in Figure 3 above, the embodiment shown in Figure 4 below details the process of determining reference category information and the process of classification based on fusion features.

[0144] Figure 4 is a flowchart of another text classification method provided in an embodiment of this application. This embodiment of the application is executed by a computer device. Referring to Figure 4, the method includes:

[0145] 401. Computer equipment acquires search text to be categorized and multiple search results corresponding to the search text.

[0146] The search results include historical search results for the search text corresponding to the executed interactive actions. When a computer device stores historical search text identical to the search text, it retrieves multiple historical search results corresponding to the historical search text and identifies the historical search result for which the interactive action was executed from among these multiple historical search results as the search result corresponding to the current search text.

[0147] The interactive operation can be any one or more types of interactive operation, such as clicking, liking, commenting, or following the publisher of historical search results.

[0148] In one possible implementation, the computer device, having stored historical search texts identical to the search text, acquires multiple historical search texts within a target time period prior to the current time point. It then acquires multiple historical search results corresponding to each of these historical search texts, and identifies the historical search result for which an interactive operation was performed as the search result corresponding to the current search text. The time point at which the historical search text was received refers to the time point at which the search request carrying that historical search text was received. The target time period can be a pre-set duration by the computer device, such as 24 hours or 7 days.

[0149] 402. The computer device determines a first number of each preset category among the preset categories to which multiple search results belong.

[0150] Computer devices are configured with multiple preset categories. Any search result can be categorized into one of these preset categories, and any search text can be categorized into one of these preset categories. The first number of preset categories refers to the number of historical search results that belong to that preset category and have been interactively accessed among the multiple search results.

[0151] The computer device determines the preset category to which each search result belongs among multiple search results, and then determines a first quantity for each preset category. This first quantity for a preset category refers to the number of search results belonging to that preset category among the multiple search results. For example, if the interaction is a click operation, then the first quantity for each preset category is the number of times the search results belonging to that preset category among the multiple historical search results corresponding to the search text have been clicked.

[0152] For example, the number of search results is 10, and the preset categories include TV series, movies, anime, and variety shows. If there are 5 search results for TV series, then the first number of TV series search results is 5; if there are 2 search results for movies, then the first number of movies search results is 2; if there are 3 search results for anime search results, then the first number of anime search results is 3; and if there are 0 search results for variety shows search results, then the first number of variety shows search results is 0.

[0153] In one possible implementation, the computer device determines multiple preset categories, including: the computer device acquiring multiple categories to which candidate search results in the database belong, determining a fourth quantity corresponding to each category, the fourth quantity referring to the number of candidate search results in the database belonging to the category, and determining multiple categories that satisfy the quantity condition of the fourth quantity as multiple preset categories.

[0154] The database stores multiple candidate search results, which may fall into various categories such as TV dramas, variety shows, education, sports, documentaries, automobiles, music, movies, children's content, games, animation, culture and history, news, fashion, maternal and infant products, lifestyle, technology, finance, travel, people, traditional Chinese performing arts, selfies, entertainment, and comedy. For example, the computer device may identify multiple categories with a fourth quantity greater than a first target threshold as multiple preset categories, or it may identify the top 19 categories with the largest fourth quantity as multiple preset categories, such as the top 19 categories with the largest fourth quantity.

[0155] In this embodiment, if there are many candidate search results belonging to a certain category, it is considered that there are also many search texts belonging to that category. Therefore, the category is determined as a preset category. If there are few candidate search results belonging to a certain category, it is considered that there are also few search texts belonging to that category. Therefore, the category is not determined as a preset category, thereby controlling the number of preset categories and helping to reduce the processing load.

[0156] 403. The computer device determines the first ratio between the first quantity of each preset category and the total number of multiple search results as the reference probability corresponding to each preset category, thus constituting reference category information.

[0157] The reference probability corresponding to the preset category refers to the reference probability that the search text belongs to the preset category. The reference category information includes the reference probability that the search text belongs to multiple preset categories.

[0158] For example, if the total number of search results is 10, and the preset categories include TV series, movies, anime, and variety shows, and the first number of TV series is 5, then the reference probability for TV series is 0.5; the first number of movies is 2, then the reference probability for movies is 0.2; the first number of anime is 3, then the reference probability for anime is 0.3; and the first number of variety shows is 0, then the reference probability for variety shows is 0.

[0159] In one possible implementation, the multiple search results also include historical search results for the search text that have not undergone interactive operations. Steps 402-403 above can be replaced by the following steps: The computer device determines a second quantity for each preset category, which refers to the number of historical search results belonging to the preset category among the multiple search results, and determines a second ratio between the second quantity for each preset category and the total number of multiple search results. The computer device determines a third quantity for each preset category, which refers to the number of historical search results belonging to the preset category and for which interactive operations have been performed among the multiple search results. Here, historical search results are the search results displayed in the search interface, i.e., the exposed search results; therefore, the third quantity for a preset category is also the number of times the search results belonging to that preset category have been exposed. The computer device determines a third ratio between the third quantity for each preset category and the total number of historical search results for which interactive operations have been performed, and weights and fuses the second and third ratios for each preset category to obtain a reference probability corresponding to each preset category.

[0160] For example, the total number of search results is m, and the preset categories include TV series, movies, anime, and variety shows. The first number of search results belonging to TV series is x1, and the second number of interactive search results within the TV series category is y1. The first number of search results belonging to movies is x2, and the second number of interactive search results within the movie category is y2. There are no search results belonging to anime or variety shows among these multiple search results; that is, the sum of x1 and x2 equals m.

[0161] Therefore, the reference probability for a TV series is: 0.5*x1 / (x1+x2)+0.5*y1 / (y1+y2). The reference probability for a movie is: 0.5*x2 / (x1+x2)+0.5*y2 / (y1+y2). The reference probabilities for anime and variety shows are both 0.

[0162] By performing steps 402-403 above, the reference category information of the search text is determined based on the preset categories to which multiple search results belong.

[0163] 404. Computer devices obtain the fusion features of the search text based on the search text and reference category information.

[0164] Since the fused feature is obtained based on the search text and reference category information, it combines the features of the search text itself and the features of the reference category information of the search text. This is equivalent to combining the features of the text semantic dimension and the features of the text category dimension, thus enriching the information content of the fused feature.

[0165] In one possible implementation, the computer device extracts textual features from the search text, extracts category features from the reference category information, and fuses the textual features and category features to obtain a fused feature. For example, the computer device concatenates the textual features and the category features to obtain the fused feature.

[0166] 405. Computer devices extract mapping features from multiple dimensions based on fusion features.

[0167] Computer devices extract features from multiple dimensions based on fused features, resulting in multi-dimensional mapping features. These multi-dimensional mapping features represent the features of the fused features in different dimensions, such as semantic dimension, part-of-speech dimension, sentence structure dimension, and reference probability dimension.

[0168] Optionally, these multiple dimensions are multiple dimensions preset by the computer device.

[0169] 406. The computer equipment determines the weighting of each preset category based on the fusion characteristics.

[0170] Each preset category corresponds to a weighted reassembly, and each weighted reassembly includes the weights of the multiple dimensions. The weights represent the degree to which the features of any text in a dimension affect whether the text belongs to a preset category.

[0171] For example, if there are m preset categories and n dimensions, the computer device will obtain m weighted reassemblies based on the fusion features. Each weighted reassembly includes n weights. The weight of a certain dimension in a weighted reassembly of a preset category represents the degree of influence of any text's feature in that dimension on whether the text belongs to that preset category. A larger weight indicates a higher degree of influence, and a smaller weight indicates a lower degree of influence.

[0172] 407. The computer equipment performs weighted fusion of the mapping features of multiple dimensions according to the multiple weights in the weighting of each preset category to obtain the classification features of each preset category.

[0173] For a given preset category among multiple preset categories, the computer device performs a weighted fusion of the mapping features of multiple dimensions according to the weights of the multiple dimensions in the weighted reorganization of that preset category, thereby obtaining the classification features of that preset category. The computer device performs the above operation for each preset category among multiple preset categories, thereby obtaining the classification features of each preset category.

[0174] 408. The computer equipment classifies each preset category based on its classification features to obtain the predicted probability for each preset category, thus forming the predicted category information.

[0175] For a given preset category among multiple preset categories, the computer device classifies the text based on the classification features of that preset category, obtaining the predicted probability corresponding to that preset category. This predicted probability refers to the probability that the search text belongs to that preset category. The computer device performs the above operation for each preset category, thereby obtaining the predicted probability corresponding to each preset category. The predicted probabilities corresponding to multiple preset categories constitute the predicted category information of the search text.

[0176] This predicted category information includes the predicted probability that the search text belongs to multiple preset categories. This predicted category information is used to determine the preset category to which the search text belongs. For example, the preset category with the highest predicted probability is determined as the preset category to which the search text belongs.

[0177] By performing steps 405-408 above, the search text is classified based on fused features, and the predicted category information of the search text is obtained.

[0178] In another embodiment, the computer device classifies the search text based on fused features. After obtaining the predicted category information of the search text, it determines the preset category to which the search text belongs based on the preset category to which the search text belongs. The computer device then determines the relevance between the search text and each candidate search result based on the preset category to which the search text belongs and the preset categories to which multiple candidate search results belong. The candidate search results whose relevance meets the relevance criteria are then determined as the search results found based on the search text.

[0179] For example, the computer device may identify candidate search results with a relevance greater than a second target threshold as search results based on the search text, or it may identify the top 10 most relevant candidate search results as search results based on the search text. The computer device can then display these search results in the search interface.

[0180] The method provided in this application takes into account that the search text is closely related to the historical search results of the performed interaction. Therefore, based on the preset category to which the historical search results of the performed interaction belong, a reference probability of the search text belonging to multiple preset categories can be initially determined. Then, the search text and the corresponding reference probability are used for classification to determine the predicted probability of the search text belonging to multiple preset categories. This application considers that the preset category to which the search text belongs is likely to be the same as the preset category to which the historical search results of the performed interaction belong. Therefore, in addition to the search text itself, the preset category to which the historical search results of the performed interaction belong is also considered. Using the preset category to which the historical search results of the performed interaction belong as a reference, combined with the search text itself, to separate the search text is beneficial to improving the accuracy of the search text classification.

[0181] It should be noted that the embodiment shown in Figure 4 is only illustrated using the example of storing search results corresponding to the search text. In another embodiment, when search results corresponding to the search text are not stored, the computer device determines preset category information as the reference category information for the search text. This preset category information includes the preset probability that any sample search text belongs to each preset category; for example, the preset probability for each preset category is equal.

[0182] Based on the above embodiments, the computer device also stores a text classification model. This text classification model is used to classify any search text. The text classification model includes a feature extraction network and a classification network. The computer device calls the feature extraction network to obtain fused features based on the search text and reference category information, and calls the classification network to classify the search text based on the fused features to obtain predicted category information. That is, steps 303-304 or 404-408 above are performed based on this text classification model. The training process of this text classification model is shown in the embodiment in Figure 8 below.

[0183] Figure 5 is a schematic diagram of the structure of a text classification model provided in an embodiment of this application. As shown in Figure 5, the text classification model includes a feature extraction network and a classification network. The feature extraction network includes a first extraction layer, a second extraction layer and a feature fusion layer. The classification network includes a feature mapping layer corresponding to multiple dimensions, a weighting layer for each preset category and a classification layer.

[0184] The system consists of a first extraction layer for extracting features from the search text, a second extraction layer for extracting features from the reference category information, a feature fusion layer for fusing the features extracted by the first and second extraction layers, a feature mapping layer for extracting features of a certain dimension of the text, a weighting layer for determining weights and weighted fusion, and a classification layer for performing classification.

[0185] In this system, the first extraction layer is connected to the feature fusion layer, and the second extraction layer is also connected to the feature fusion layer. The outputs of the first and second extraction layers serve as the inputs to the feature fusion layer. The feature fusion layer is connected to each feature mapping layer and also to each weighted layer (not shown in Figure 5). The output of the feature fusion layer serves as the input to each feature mapping layer and each weighted layer. Each feature mapping layer is connected to each weighted layer, and the output of each feature mapping layer serves as the input to each weighted layer. Each weighted layer for a predefined category is connected to its corresponding classification layer, and the output of each weighted layer serves as the input to the classification layer.

[0186] The embodiment shown in Figure 6 below details the process of calling the text classification model to obtain the predicted category information of the search text.

[0187] Figure 6 is a flowchart of another search text classification method provided in an embodiment of this application. This embodiment of the application is executed by a computer device. Referring to Figure 6, the method includes:

[0188] 601. The computer device calls the first extraction layer to extract the text features of the search text.

[0189] The computer device inputs the search text into the first extraction layer to obtain text features.

[0190] In one possible implementation, the first extraction layer includes a preprocessing layer, an embedding layer, and a convolutional layer. For example, the preprocessing layer is a TextVectorization layer. The computer device inputs the search text into the preprocessing layer to obtain the first character feature of each character in the search text. The first character features of multiple characters are then input into the embedding layer to obtain the second character feature of each character. Finally, the second character features of multiple characters are input into the convolutional layer to obtain the text feature.

[0191] Figure 7 is a schematic diagram of a convolutional layer provided in an embodiment of this application. As shown in Figure 7, the convolutional layer includes multiple convolutional kernels (only two kernels are shown in Figure 7). The stride of the convolutional kernels represented by the thick solid line is different from the stride of the convolutional kernels represented by the thick dashed line. Multiple convolutional kernels are used to convolve the second character features 701 of different dimensions of multiple characters (only two dimensions of the second character features 701 are shown in Figure 7), resulting in convolutional results 702 corresponding to multiple kernels (only the convolutional results 702 corresponding to four kernels are shown in Figure 7). Then, the multiple convolutional results 702 are pooled separately to obtain multiple pooling results 703. Finally, the multiple pooling results 703 are fused to obtain the text features.

[0192] 602. The computer device calls the second extraction layer to extract the category features of the reference category information.

[0193] The computer device inputs the reference category information into the second extraction layer to obtain the category features of the reference category information.

[0194] In one possible implementation, the second extraction layer is a dense layer, which can be represented by the following formula (1):

[0195] y(x) = activation(W*x + b); Formula (1)

[0196] Where y(x) represents the class feature output by the Dense layer, x represents the reference class information, W represents the matrix parameter, b represents the deviation parameter, and activation(·) represents the activation function, which can be any type of activation function.

[0197] 603. The computer device calls the feature fusion layer to fuse text features and category features to obtain fused features.

[0198] The computer device inputs the text features and category features into a feature fusion layer to obtain fused features. In one possible implementation, the feature fusion layer includes a concatenation function that concatenates the text features and category features to obtain the fused features.

[0199] 604. The computer device calls multiple feature mapping layers respectively, and extracts multi-dimensional mapping features based on the fused features.

[0200] The computer device inputs the fused feature into multiple feature mapping layers to obtain multiple mapped features output by the feature mapping layers, each with a different dimension.

[0201] In one possible implementation, the feature mapping layer is an Expert network in an MMoE (Multi-gate Mixture-of-Experts) model. This Expert network can be of any type, such as a Dense layer or a convolutional layer. Compared to convolutional layers, Dense layers have fewer parameters, which improves layer processing and training efficiency. Furthermore, because Dense layers have fewer parameters than convolutional layers, they also reduce the repetitive learning of redundant features, improving feature utilization. The number of these multiple feature mapping layers is a hyperparameter that can be flexibly set by the computer equipment; for example, the number of multiple feature mapping layers can be set to 24. The number of multiple feature mapping layers can be set by the developers based on experience, and this embodiment does not limit this setting.

[0202] 605. The computer device calls the weighted layer of each preset category respectively, and determines the weighted regrouping of each preset category based on the fusion features.

[0203] The computer device will input the fusion features into the weighted layer of each preset category respectively, and obtain the weighted recombination of the preset category output by the weighted layer of each preset category.

[0204] The weighting process includes weights across multiple dimensions, representing the degree to which a feature of any text in a given dimension influences whether the text belongs to a predefined category. The number of weighting layers equals the number of predefined categories. For example, if there are 22 predefined categories, then there are also 22 weighting layers. Each predefined category corresponds to one weighting layer, and these layers are used to determine the weighting structure for that category.

[0205] 606. The computer device calls the weighted layer of each preset category respectively, and performs weighted fusion of the mapping features of multiple dimensions according to the multiple weights in the weighted reorganization of each preset category to obtain the classification features of each preset category.

[0206] After the weighted layer of each preset category is restructured, the mapping features of multiple dimensions are weighted and fused according to the multiple weights in the restructured layer to obtain the classification features of the preset category.

[0207] In one possible implementation, the weighting layer is a gating network in the MMoE model, which can be represented by the following formulas (2) and (3).

[0208] g(x) = softmax(W) g *x); Formula (2)

[0209]

[0210] Where x represents the fusion feature, W g Let represent the matrix parameters, softmax(·) represent the activation function, g(x) represent the weighted reassembly, n represent the number of dimensions (n ​​is a positive integer), and i is a positive integer not greater than n. i Let m(x) represent the weight of the i-th dimension in the weighted reorganization. i Let f(x) represent the mapping feature of the i-th dimension, and f(x) represent the classification feature.

[0211] 607. The computer device calls the classification layer of each preset category, classifies based on the classification features of each preset category, and obtains the predicted probability corresponding to each preset category, thus forming the predicted category information.

[0212] The computer device inputs the classification features of each preset category into the classification layer of each preset category, obtains the prediction probability output by the classification layer of each preset category, and thus obtains the prediction probabilities corresponding to multiple preset categories. The prediction probabilities corresponding to multiple preset categories constitute the prediction category information.

[0213] In one possible implementation, the classification layer is a Task Tower network in the MMoE model. This Task Tower network can be of any type, such as a Dense layer or a convolutional layer. The number of classification layers equals the number of preset categories; for example, if the number of preset categories is 22, then the number of classification layers is also 22. Each preset category corresponds to one classification layer, and each classification layer is connected to a weighted layer corresponding to that preset category. The classification layer for each preset category is used to determine the predicted probability for that preset category.

[0214] The method provided in this application embodiment includes a text classification model comprising a classification network corresponding to each preset category. Each classification network classifies based on the weighted fusion features obtained by weighting the mapping features output by multiple feature mapping layers, thereby obtaining the probability corresponding to each preset category. Therefore, in the task of multi-classifying search text, only one text classification model is needed to determine the predicted probabilities corresponding to multiple preset categories, without having to use different text classification models for each preset category. This saves the processing resources of computer equipment and improves the efficiency and convenience of classifying search text to a certain extent.

[0215] Figure 8 is a flowchart of a text classification model training method provided in an embodiment of this application. This embodiment is executed by a computer device. Referring to Figure 8, the method includes:

[0216] 801. The computer device acquires the first sample search text and multiple sample search results corresponding to the first sample search text.

[0217] The multiple sample search results include the historical search results of the interactive operation performed corresponding to the first sample search text. The process of step 801 is the same as that of steps 301 and 401 above, and will not be repeated here.

[0218] 802. The computer device determines the first reference category information of the first sample search text based on the preset categories to which multiple sample search results belong.

[0219] The first reference category information includes the sample reference probability that the first sample search text belongs to multiple preset categories. The process of step 802 is the same as that of steps 302 and 402-403 above, and will not be described again here.

[0220] 803. The computer device calls the feature extraction network in the text classification model, obtains the sample fusion features of the first sample search text based on the first sample search text and the first reference category information, calls the classification network in the text classification model, classifies the first sample search text based on the sample fusion features, and obtains the first predicted category information.

[0221] The first prediction category information includes the predicted probability of the first sample search text belonging to multiple preset categories.

[0222] In one possible implementation, the feature extraction network includes a first extraction layer, a second extraction layer, and a feature fusion layer. The computer device invokes the feature extraction network to obtain sample fusion features of the first sample search text based on the first sample search text and the first reference category information. This includes: invoking the first extraction layer to extract sample text features of the first sample search text; invoking the second extraction layer to extract sample category features from the first reference category information; and invoking the feature fusion layer to fuse the sample text features and sample category features to obtain the sample fusion features. This process is similar to steps 601-603 described above and will not be repeated here.

[0223] In one possible implementation, the classification network includes feature mapping layers corresponding to multiple dimensions, weighted layers for each preset category, and a classification layer. The computer device invokes the classification network to classify the first sample search text based on sample fusion features, obtaining first predicted category information. This includes: invoking multiple feature mapping layers respectively; extracting sample mapping features of multiple dimensions based on sample fusion features; invoking the weighted layers for each preset category respectively; determining the weighted reorganization for each preset category based on the sample fusion features; the weighted reorganization includes weights for multiple dimensions, where each weight represents the degree of influence of any text's feature in a dimension on whether the text belongs to a preset category. The computer device invokes the weighted layers for each preset category respectively; weightedly fused the sample mapping features of multiple dimensions according to the multiple weights in the weighted reorganization for each preset category, obtaining sample classification features for each preset category. The computer device invokes the classification layer for each preset category respectively; classifying the first sample search text based on the sample classification features for each preset category, obtaining the sample prediction probability corresponding to each preset category. This process is similar to steps 604-607 above and will not be repeated here.

[0224] 804. The computer device trains a text classification model based on the first true category information and the first predicted category information of the first sample search text, so as to increase the similarity between the first predicted category information and the first true category information obtained by the trained text classification model.

[0225] The computer device obtains the first true category information of the first sample search text, which includes the true probability that the first sample search text belongs to multiple preset categories.

[0226] Since the first true category information includes the true probability and the first predicted category information includes the predicted probability, the greater the similarity between the first predicted category information and the first true category information, the higher the accuracy of the text classification model. Therefore, the computer device trains the text classification model based on the first true category information and the first predicted category information to increase the similarity between the first predicted category information and the first true category information obtained by the trained text classification model, thereby improving the accuracy of the text classification model.

[0227] In one possible implementation, the computer device weights and fuses the difference parameter between the predicted and true probabilities of samples for each preset category according to the loss weight corresponding to each preset category, thus obtaining a loss parameter. The similarity between the predicted and true probabilities of samples is negatively correlated with this difference parameter. Based on the loss parameter, the computer device trains a text classification model and updates the loss weights to reduce the loss parameter obtained based on the trained text classification model and the updated loss weights.

[0228] The loss weight corresponding to each preset category represents the degree to which the loss of the predicted probability of samples in that preset category affects the accuracy of the text classification model. For a given preset category, the computer device determines a difference parameter between the predicted and true probabilities based on the similarity between them. This difference parameter is negatively correlated with the similarity; that is, the higher the similarity, the smaller the difference parameter, and vice versa. For example, this difference parameter is the cross-entropy between the predicted and true probabilities. The computer device performs the above operation for each preset category to obtain the difference parameter corresponding to each preset category. Then, the computer device weights and fuses the difference parameters corresponding to multiple preset categories according to the loss weights for each preset category to obtain the loss parameter.

[0229] While training the text classification model based on the loss parameter, the computer device also updates the loss weights corresponding to each preset category based on the loss parameter, so as to improve the accuracy of the text classification model and make the loss weights more accurate, thereby realizing the automatic learning of the loss weights corresponding to each preset category.

[0230] In one possible implementation, the first true category information is obtained based on the first reference category information. Optionally, for a preset category with the highest sample reference probability, the true probability corresponding to the preset category is set to 1; for a preset category with a lower sample reference probability, the true probability corresponding to the preset category is set to 0; and the true probabilities corresponding to multiple preset categories constitute the first true category information.

[0231] 805. The computer device acquires the second sample search text and determines the preset category information as the second reference category information of the second sample search text.

[0232] The second reference category information includes the sample reference probability that the second sample search text belongs to multiple preset categories. This preset category information is the same as the preset category information in the above embodiments. In this embodiment, considering that some second sample search texts may not have corresponding sample search results, and it is impossible to determine the second reference category information of the second sample search text based on the preset category to which the sample search results belong, the preset category information is directly used as the second reference category information of the second sample search text. This allows the sample search text to be used to train the text classification model even when there are no corresponding sample search results, thus expanding the amount of sample search text data.

[0233] 806. The computer device calls the feature extraction network in the text classification model, obtains the sample fusion features of the second sample search text based on the second sample search text and the second reference category information, calls the classification network in the text classification model, classifies the second sample search text based on the sample fusion features, and obtains the second predicted category information.

[0234] The second prediction category information includes the predicted probability of the second sample search text belonging to multiple preset categories. The process of step 806 is the same as that of step 803 above, and will not be repeated here.

[0235] 807. The computer device trains a text classification model based on the second true category information and the second predicted category information of the second sample search text, so as to increase the similarity between the second predicted category information and the second true category information obtained by the trained text classification model.

[0236] The computer device acquires the second true category information of the second sample search text, which includes the true probability that the second sample search text belongs to multiple preset categories. The process of step 807 is the same as that of step 804 described above, and will not be repeated here.

[0237] In one possible implementation, the second true category information is obtained through manual annotation. For example, the true probability corresponding to the preset category to which the second sample search text belongs is determined to be 1, the true probability corresponding to other preset categories is determined to be 0, and the true probabilities corresponding to multiple preset categories constitute the second true category information.

[0238] This embodiment employs a two-stage training method to train the text classification model. The two-stage training method refers to training the text classification model using two training phases. Steps 801-804 constitute the first training phase, and steps 805-807 constitute the second training phase. Different training samples are used in the two training phases.

[0239] The methods for determining the sample reference category information differ between the two training phases. As described in step 802 above, in the first training phase, the first reference category information for the first sample search text is determined based on the preset categories to which multiple sample search results belong. As described in step 805 above, in the second training phase, the preset category information is determined as the second reference category information for the second sample search text. For example, the sample reference probabilities for multiple preset categories in this preset category information are all 0.5, 0, or 1, etc.

[0240] Furthermore, the methods for determining the true category information differ between the two training phases. As described in step 804 above, in the first training phase, the first true category information of the first sample search text is determined based on the first reference category information of the first sample search text. For example, the true probability corresponding to the preset category with the highest sample reference probability is determined to be 1, and the true probability corresponding to the preset category with a lower sample reference probability is determined to be 0. As described in step 807 above, in the second training phase, the category information manually labeled for the second sample search text is determined as the second true category information of the second sample search text. For example, the true probability corresponding to the preset category to which the second sample search text belongs is determined to be 1, and the true probability corresponding to other preset categories is determined to be 0.

[0241] In the first training phase, considering the close correlation between the first sample search text and the historical search results of the executed interaction, the reference probabilities of the first sample search text belonging to multiple preset categories can be preliminarily determined based on the preset categories to which the historical search results of the executed interaction belong. Then, the text classification model is trained using the first sample search text and its corresponding reference probabilities. This allows the text classification model to learn how to determine the predicted probability of the search text based on the search text and its corresponding reference probabilities, thereby improving the classification ability of the text classification model. Furthermore, in the first training phase, the first true category information of the first sample search text is determined based on the first reference category information, eliminating the need for manual annotation, which saves manpower and time, and improves the processing efficiency of the first training phase.

[0242] In the second training phase, considering that some second sample search texts may not have corresponding sample search results, making it impossible to determine the second reference category information of the second sample search text based on the preset category to which the sample search results belong, the preset category information is directly used as the second reference category information of the second sample search text. This allows the sample search text to be used to train the text classification model even when no corresponding sample search results exist, thus expanding the amount of sample search text data. Furthermore, in the second training phase, the second true category information of the second sample search text is manually labeled, ensuring the accuracy of the second true category information. Therefore, retraining the text classification model based on this second true category information allows for fine-tuning of the text classification model, further improving its accuracy.

[0243] The method provided in this application provides training a text classification model for classifying search text. The text classification model includes a classification network corresponding to each preset category. Each classification network classifies based on the weighted fusion features obtained by weighting the mapping features output by multiple feature mapping layers, thereby obtaining the probability corresponding to each preset category. Therefore, in the task of multi-classifying search text, only one text classification model is needed to determine the predicted probabilities corresponding to multiple preset categories, without having to use different text classification models for each preset category. This saves the processing resources of computer equipment and improves the efficiency and convenience of classifying search text to a certain extent.

[0244] Furthermore, a two-stage training method is adopted to train the text classification model. First, the text classification model is trained using the first sample search text and the corresponding sample reference category information. Then, the text classification model is trained a second time using the second sample search text and the corresponding sample reference category information. This allows for fine-tuning of the text classification model and helps improve its accuracy.

[0245] It should be noted that the embodiment shown in Figure 8 above is only used as an example to illustrate training the text classification model using the first sample search text and the second sample search text respectively. In another embodiment, the text classification model can be trained using only the first sample search text, without using the second sample search text, that is, only steps 801-804 are performed, and steps 805-807 are not performed.

[0246] Figure 9 is a flowchart of a training method for a search text classification model provided in an embodiment of this application. This embodiment is executed by a computer device. Referring to Figure 9, the method includes:

[0247] 901. Obtain the sample set used to train the text classification model. The sample set includes two types: a first sample set mined by machine and a second sample set manually labeled.

[0248] (1) The first sample set includes multiple first sample search texts, first true category information corresponding to each first sample search text, and first reference category information. The first true category information includes the true probability that the first sample search text belongs to multiple preset categories, and the first reference category information includes the sample reference probability that the first sample search text belongs to multiple preset categories. These multiple preset categories include 19 categories such as TV series, variety shows, education, sports, documentaries, automobiles, music, movies, children's, games, animation, culture and history, news, fashion, maternal and infant, lifestyle, technology, finance, and tourism.

[0249] The first reference category information is determined based on the exposure and click counts of the historical search results corresponding to the first sample search text, and belongs to the posterior information of the first sample search text. Each historical search result corresponds to its own preset category. The preset categories to which the historical search results exposed and clicked in the search interface belong to reflect, to some extent, the preset category to which the first sample search text belongs. Therefore, by determining the exposure and click counts of the historical search results for the first sample search text within 7 days, processing the exposure and click counts of the historical search results for each preset category, and finally determining the sample reference probability of the first sample search text belonging to multiple preset categories. For example, for a given first sample search text, based on the exposure and click logs from the past 7 days, we can determine that the exposure count for the search results in the "Anime" category is x1, the exposure count for the search results in the "TV Series" category is x2, the number of clicks by users on the search results in the "Anime" category is y1, the number of clicks by users on the search results in the "TV Series" category is y2, and no other categories of search results have been exposed or clicked. Therefore, the reference probability for this first sample search text belonging to the "Anime" category is 0.5*x1 / (x1+x2)+0.5*y1 / (y1+y2), the reference probability for belonging to the "TV Series" category is 0.5*x2 / (x1+x2)+0.5*y2 / (y1+y2), and the reference probability for belonging to other preset categories is 0.

[0250] The first true category information is obtained based on the first reference category information. For example, for the preset category with the highest sample reference probability, the true probability corresponding to the preset category is determined to be 1, and for the preset category with a lower sample reference probability, the true probability corresponding to the preset category is determined to be 0.

[0251] (2) The second sample set includes multiple second sample search texts, second true category information corresponding to each second sample search text, and second reference category information. The second reference category information includes the sample reference probability that the second sample search text belongs to multiple preset categories, and the second true category information includes the true probability that the second sample search text belongs to multiple preset categories. These multiple preset categories include 22 categories such as TV series, variety shows, education, sports, documentaries, automobiles, music, movies, children's, games, animation, culture and history, news, fashion, maternal and infant, lifestyle, technology, finance, tourism, people, folk arts, and others.

[0252] The second reference category information is preset category information, which includes the preset probability that any sample search text belongs to each preset category. For example, the preset probability of each preset category is equal, such as 0.5, 0, or 1.

[0253] The second true category information is manually labeled category information. For example, the true probability corresponding to the preset category to which the second sample search text belongs is set to 1, and the true probability corresponding to other preset categories is set to 0.

[0254] (3) In addition, the first and second sample sets can be preprocessed to form a three-column format. The first column is the sample search text split word by word, with each pair of words separated by the first delimiter. The second column is the label, which indicates the preset category to which the sample search text belongs. The third column is the reference category information split by category, with the sample reference probabilities corresponding to each preset category separated by the second delimiter. The sample reference probabilities corresponding to multiple preset categories are arranged in a preset order.

[0255] 902. In the first training phase, a text classification model is trained using a first sample set. This text classification model includes a feature extraction network and a classification network.

[0256] (1) The feature extraction network includes a first extraction layer, a second extraction layer and a feature fusion layer.

[0257] The input to the first extraction layer is the sample search text, which has a size of batch_size*1. batch_size represents the number of samples used in one forward computation and is a hyperparameter; for example, it can be set to 32. The input to the second extraction layer is reference category information, which has a size of batch_size*m, where m represents the number of preset categories.

[0258] The first extraction layer comprises a preprocessing layer, an embedding layer, and a convolutional layer. The preprocessing layer can be a TextVectorization layer, used to extract character vectors to obtain the character features of each character. The output size of the preprocessing layer is batch_size * max_len, where max_len represents the number of characters in the longest search text. The features output from the preprocessing layer are then fed into the embedding layer, whose output size is batch_size * max_len * emb_size, where emb_size represents the vector dimension. Finally, the features output from the embedding layer are fed into the convolutional layer to extract the text features of the search text.

[0259] The second extraction layer includes a Dense layer, and the feature fusion layer includes a concatenation function. Reference category information is input into the second extraction layer to obtain category features. Text features and category features are then input into the feature fusion layer to obtain the fused features of the sample search text.

[0260] (2) The classification network is a network built based on the MMoE model structure. The classification network includes multiple feature mapping layers, multiple weighting layers and multiple classification layers.

[0261] The feature mapping layer is an expert network, the weighting layer is a gating network, and the classification layer is a dense layer. The number of expert networks is a hyperparameter, which can be equal to 24. The number of gating networks and the number of dense layers are equal to the number of preset categories, for example, 22. The fused features of the sample search text are input into the gating network corresponding to each preset category to obtain multiple mapping features. These multiple mapping features are then input into the expert network corresponding to each preset category to obtain multiple weighted sets. Finally, these multiple mapping features and the weighted sets corresponding to each preset category are input into the corresponding dense layer to obtain the predicted probability for each preset category, thus forming the predicted category information. Here, the dense layer is used for binary classification, and the corresponding activation function is softmax (an activation function).

[0262] After obtaining the predicted category information, the loss parameter of the text classification model is determined based on the difference between the predicted and true category information. This loss parameter can be obtained based on cross-entropy, and gradient descent is used to adjust the model parameters of the text classification model based on this loss parameter. Since each preset category corresponds to a cross-entropy, the cross-entropies of multiple preset categories can be weighted and fused to obtain the loss parameter of the text classification model. Furthermore, the weights corresponding to different preset categories can be obtained through training.

[0263] This method transforms the multi-classification problem of search text into a multi-task problem by training a text classification model based on the MMoE model structure. Each task refers to a binary classification task of the search text. In other words, by training a single model, the multi-classification problem of search text can be solved. Compared to training multiple binary classification models, this solution reduces the number of models to be trained and managed to one, lowering the difficulty of model training and online maintenance, and saving computer processing resources. Furthermore, compared to training multiple binary classification models, the text classification model trained in this embodiment improves offline evaluation metrics by 4.47%, thus enhancing the efficiency and convenience of classifying search text to a certain extent.

[0264] (3) It should be noted that the first sample set includes multiple first sample search texts. The text classification model is iteratively trained using these multiple first sample search texts to obtain the text classification model trained in the first training stage.

[0265] 903. In the second training phase, the text classification model is trained again using the second sample set.

[0266] After obtaining the text classification model trained in the first training phase, multiple second sample search texts from the second sample set are used to continue iteratively training the text classification model to obtain the text classification model trained in the second training phase. This allows for secondary fine-tuning of the text classification model, resulting in the final trained text classification model.

[0267] The two-stage training method provided in this application embodiment improves the offline evaluation metrics by 3.4% compared to the scheme that only performs the first training stage, significantly improving the performance of the text classification model.

[0268] 904. Use the trained text classification model to classify any search text and obtain the preset category to which the search text belongs.

[0269] Figure 10 is a schematic diagram of a text classification device provided in an embodiment of this application. Referring to Figure 10, the device includes:

[0270] The first acquisition module 1001 is used to acquire the search text to be classified and multiple search results corresponding to the search text, including the historical search results of the interaction operation performed on the search text.

[0271] The information determination module 1002 is used to determine the reference category information of the search text based on the preset categories to which multiple search results belong. The reference category information includes the reference probability that the search text belongs to multiple preset categories.

[0272] The second acquisition module 1003 is used to acquire the fusion features of the search text based on the search text and reference category information;

[0273] The classification module 1004 is used to classify the search text based on the fusion features to obtain the predicted category information of the search text. The predicted category information includes the predicted probability that the search text belongs to multiple preset categories. The predicted category information is used to determine the preset category to which the search text belongs.

[0274] The search text classification device provided in this application takes into account the close relationship between the search text and the historical search results of the executed interaction. Therefore, based on the preset category to which the historical search results of the executed interaction belong, a reference probability of the search text belonging to multiple preset categories can be initially determined. Then, the search text and the corresponding reference probability are used for classification to determine the predicted probability of the search text belonging to multiple preset categories. This application considers that the preset category to which the search text belongs is likely to be the same as the preset category to which the historical search results of the executed interaction belong. Therefore, in addition to the search text itself, the preset category to which the historical search results of the executed interaction belong is also considered. Using the preset category to which the historical search results of the executed interaction belong as a reference, combined with the search text itself, the search text is separated, which helps to improve the accuracy of search text classification.

[0275] Optionally, referring to Figure 11, the information determination module 1002 is used for:

[0276] Determine the first quantity for each preset category. The first quantity refers to the number of historical search results that belong to the preset category and have been interactively performed among multiple search results.

[0277] The first ratio between the first quantity of each preset category and the total number of multiple search results is determined as the reference probability for each preset category.

[0278] Optionally, referring to Figure 11, multiple search results may also include historical search results for the search text that have not undergone interactive operations; the information determination module 1002 is used for:

[0279] Determine a second quantity for each preset category, where the second quantity refers to the number of historical search results belonging to the preset category among multiple search results; determine a second ratio between the second quantity for each preset category and the total number of multiple search results.

[0280] Determine the third quantity for each preset category, where the third quantity refers to the number of historical search results that belong to the preset category and have been interactively processed among multiple search results; determine the third ratio between the third quantity for each preset category and the total number of historical search results that have been interactively processed;

[0281] The second and third ratios of each preset category are weighted and fused to obtain the reference probability corresponding to each preset category.

[0282] Optionally, referring to Figure 11, the classification module 1004 is used for:

[0283] Based on the fusion features, multi-dimensional mapping features are extracted;

[0284] Based on the fusion features, the weight reorganization of each preset category is determined. The weight reorganization includes weights of multiple dimensions. The weights represent the degree of influence of the features of any text in a dimension on whether the text belongs to the preset category.

[0285] According to the multiple weights in the weighting of each preset category, the mapping features of multiple dimensions are weighted and fused to obtain the classification features of each preset category;

[0286] The search text is classified based on the classification features of each preset category, and the predicted probability corresponding to each preset category is obtained.

[0287] Optionally, referring to Figure 11, the second acquisition module 1003 is used for:

[0288] Extract text features from the search text;

[0289] Extract category features from reference category information;

[0290] Text features and category features are fused to obtain fused features.

[0291] Optionally, referring to Figure 11, the device further includes a search module 1005 for:

[0292] The preset category with the highest predicted probability is determined as the preset category to which the search text belongs;

[0293] Based on the preset category to which the search text belongs and the preset categories to which multiple candidate search results belong, the relevance between the search text and each candidate search result is determined;

[0294] Candidate search results that meet the relevance criteria are identified as search results based on the search text.

[0295] Optionally, referring to Figure 11, the device further includes a category determination module 1006, for:

[0296] Retrieve multiple categories to which candidate search results belong in the database;

[0297] Determine the fourth quantity for each category, which refers to the number of candidate search results belonging to the category in the database;

[0298] The fourth quantity satisfies the quantity condition in multiple categories and is defined as multiple preset categories.

[0299] Optionally, referring to Figure 11, the information determination module 1002 is also used to determine the preset category information as the reference category information of the search text when the search results corresponding to the search text are not stored.

[0300] Optionally, referring to Figure 11, the text classification model includes a feature extraction network and a classification network. The second acquisition module 1003 is used to call the feature extraction network to acquire fused features based on the search text and reference category information.

[0301] The classification module 1004 is used to call the classification network to classify the search text based on the fused features and obtain the predicted category information.

[0302] Optionally, referring to Figure 11, the feature extraction network includes a first extraction layer, a second extraction layer, and a feature fusion layer. The second acquisition module 1003 is used for:

[0303] The first extraction layer is invoked to extract the text features of the search text;

[0304] Call the second extraction layer to extract the category features of the reference category information;

[0305] The feature fusion layer is invoked to fuse text features and category features to obtain fused features.

[0306] Optionally, referring to Figure 11, the classification network includes feature mapping layers corresponding to multiple dimensions, weighting layers for each preset category, and a classification layer; the classification module 1004 is used for:

[0307] Multiple feature mapping layers are invoked respectively to extract multi-dimensional mapping features based on text features;

[0308] The weighted layer for each preset category is called separately. Based on the text features, the weighted reorganization of each preset category is determined. The weighted reorganization includes weights in multiple dimensions. The weights represent the degree of influence of any text feature in a dimension on whether the text belongs to a preset category.

[0309] The weighted layer for each preset category is called separately, and the mapping features of multiple dimensions are weighted and fused according to the multiple weights in the weighted reorganization of each preset category to obtain the classification features of each preset category.

[0310] The classification layer for each preset category is called separately, and classification is performed based on the classification features of each preset category to obtain the predicted probability corresponding to each preset category.

[0311] Optionally, referring to Figure 11, the device further includes:

[0312] The first acquisition module 1001 is also used to acquire the first sample search text and multiple sample search results corresponding to the first sample search text. The sample search results include the historical search results of the interactive operation performed corresponding to the first sample search text.

[0313] The information determination module 1002 is also used to determine the first reference category information of the first sample search text based on the preset categories to which multiple sample search results belong. The first reference category information includes the sample reference probability that the first sample search text belongs to multiple preset categories.

[0314] The second acquisition module 1003 is also used to call the feature extraction network to acquire the sample fusion features of the first sample search text based on the first sample search text and the first reference category information.

[0315] The classification module 1004 is also used to call the classification network to classify the first sample search text based on the sample fusion features and obtain the first predicted category information. The first predicted category information includes the sample prediction probability that the first sample search text belongs to multiple preset categories.

[0316] Training module 1007 is used to train a text classification model based on the first true category information and the first predicted category information of the first sample search text, so as to increase the similarity between the first predicted category information and the first true category information obtained by the trained text classification model. The first true category information includes the true probability that the first sample search text belongs to multiple preset categories.

[0317] Optionally, referring to Figure 11, the feature extraction network includes a first extraction layer, a second extraction layer, and a feature fusion layer. The second acquisition module 1003 is further used for:

[0318] The first extraction layer is invoked to extract the sample text features of the first sample search text;

[0319] Call the second extraction layer to extract sample category features from the first reference category information;

[0320] The feature fusion layer is invoked to fuse the sample text features and sample category features to obtain the sample fused features.

[0321] Optionally, referring to Figure 11, the classification network includes feature mapping layers corresponding to multiple dimensions, weighting layers for each preset category, and a classification layer; the classification module 1004 is also used for:

[0322] Multiple feature mapping layers are invoked respectively, and sample mapping features of multiple dimensions are extracted based on sample fusion features;

[0323] The weighted layer for each preset category is called separately. Based on the sample fusion features, the weighted reorganization of each preset category is determined. The weighted reorganization includes weights in multiple dimensions. The weights represent the degree of influence of the features of any text in a dimension on whether the text belongs to a preset category.

[0324] The weighted layer for each preset category is called separately, and the sample mapping features of multiple dimensions are weighted and fused according to the multiple weights in the weighted reorganization of each preset category to obtain the sample classification features of each preset category.

[0325] The classification layer of each preset category is called respectively, and the first sample search text is classified based on the sample classification features of each preset category to obtain the sample prediction probability corresponding to each preset category.

[0326] Optionally, referring to Figure 11, the first acquisition module 1001 is further configured to acquire the second sample search text and determine the preset category information as the second reference category information of the second sample search text. The second reference category information includes the sample reference probability that the second sample search text belongs to multiple preset categories.

[0327] The second acquisition module 1003 is also used to call the feature extraction network to acquire the sample fusion features of the second sample search text based on the second sample search text and the second reference category information.

[0328] The classification module 1004 is also used to call the classification network to classify the second sample search text based on the sample fusion features and obtain the second predicted category information. The second predicted category information includes the sample prediction probability that the second sample search text belongs to multiple preset categories.

[0329] The training module 1007 is also used to train a text classification model based on the second true category information and the second predicted category information of the second sample search text, so as to increase the similarity between the second predicted category information and the second true category information obtained by the trained text classification model. The second true category information includes the true probability that the second sample search text belongs to multiple preset categories.

[0330] Optionally, referring to Figure 11, training module 1007 is used for:

[0331] According to the loss weight corresponding to each preset category, the difference parameter between the predicted probability and the true probability of the sample in each preset category is weighted and fused to obtain the loss parameter. The similarity between the predicted probability and the true probability of the sample is negatively correlated with the difference parameter.

[0332] Based on the loss parameters, a text classification model is trained and the loss weights are updated so that the loss parameters obtained based on the trained text classification model and the updated loss weights are reduced.

[0333] It should be noted that the search text classification device provided in the above embodiments is only an example of 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 classification device and the search text classification method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0334] This application also provides a computer device, which includes a processor and a memory. The memory stores at least one computer program, which is loaded and executed by the processor to perform the operations performed in the search text classification method of the above embodiments.

[0335] Optionally, the computer device is provided as a terminal. Figure 12 shows a schematic diagram of the structure of a terminal 1200 provided in an exemplary embodiment of this application.

[0336] Terminal 1200 includes a processor 1201 and a memory 1202.

[0337] Processor 1201 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1201 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 1201 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 1201 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 1201 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0338] The memory 1202 may include one or more computer-readable storage media, which may be non-transitory. The memory 1202 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 1202 are used to store at least one computer program, which is used by the processor 1201 to implement the search text classification method provided in the method embodiments of this application.

[0339] In some embodiments, the terminal 1200 further includes a peripheral device interface 1203 and at least one peripheral device. The processor 1201, memory 1202, and peripheral device interface 1203 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1203 via a bus, signal line, or circuit board. Optionally, the peripheral device includes at least one of a radio frequency circuit 1204 or a display screen 1205.

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

[0341] The radio frequency (RF) circuit 1204 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1204 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1204 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 1204 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. The RF circuit 1204 can communicate with other devices using at least one wireless communication protocol.

[0342] Display screen 1205 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When display screen 1205 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 1201 for processing. In this case, display screen 1205 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 1205, disposed on the front panel of terminal 1200; in other embodiments, there may be at least two display screens 1205, disposed on different surfaces of terminal 1200 or in a foldable design.

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

[0344] Optionally, the computer device is provided as a server. Figure 13 is a schematic diagram of the structure of a server provided in an embodiment of this application. The server 1300 can vary considerably due to different configurations or performance, and may include one or more Central Processing Units (CPUs) 1301 and one or more memories 1302. The memory 1302 stores at least one computer program, which is loaded and executed by the processor 1301 to implement the methods provided in the above-described method embodiments. Of course, the server may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be elaborated here.

[0345] This application also provides a computer-readable storage medium storing at least one computer program, which is loaded and executed by a processor to implement the operations performed by the search text classification method of the above embodiments.

[0346] This application also provides a computer program product, including a computer program loaded and executed by a processor to perform the operations performed by the search text classification method of the above embodiments.

[0347] 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 instructing 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.

[0348] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present application should be included within the protection scope of the present application.

Claims

1. A method for classifying search text, characterized in that, The method includes: acquiring a search text to be classified and multiple search results corresponding to the search text, the multiple search results including historical search results of the search text corresponding to the executed interactive operation; determining reference category information of the search text based on the preset categories to which the multiple search results belong, the reference category information including the reference probability of the search text belonging to multiple preset categories; acquiring fusion features of the search text based on the search text and the reference category information; classifying the search text based on the fusion features to obtain predicted category information of the search text, the predicted category information including the predicted probability of the search text belonging to the multiple preset categories, the predicted category information being used to determine the preset category to which the search text belongs.

2. The method according to claim 1, characterized in that, The step of determining the reference category information of the search text based on the preset categories to which the multiple search results belong includes: determining a first quantity for each preset category, wherein the first quantity refers to the number of historical search results belonging to the preset category and having undergone interactive operations among the multiple search results; and determining a first ratio between the first quantity for each preset category and the total number of the multiple search results as the reference probability corresponding to each preset category.

3. The method according to claim 1, characterized in that, The multiple search results also include historical search results for the search text that have not undergone interactive operations; determining the reference category information of the search text based on the preset categories to which the multiple search results belong includes: determining a second quantity for each preset category, the second quantity being the number of historical search results belonging to the preset category among the multiple search results; determining a second ratio between the second quantity for each preset category and the total number of the multiple search results; determining a third quantity for each preset category, the third quantity being the number of historical search results belonging to the preset category and for which interactive operations have been performed among the multiple search results; determining a third ratio between the third quantity for each preset category and the total number of historical search results for which interactive operations have been performed; and weighting and fusing the second ratio and the third ratio for each preset category to obtain a reference probability corresponding to each preset category.

4. The method according to claim 1, characterized in that, The step of classifying the search text based on the fusion features to obtain the predicted category information of the search text includes: extracting mapping features of multiple dimensions based on the fusion features; determining a weighted reorganization for each preset category based on the fusion features, wherein the weighted reorganization includes weights of the multiple dimensions, and the weights represent the degree of influence of the features of any text in the dimension on whether the text belongs to the preset category; performing weighted fusion on the mapping features of the multiple dimensions according to the multiple weights in the weighted reorganization of each preset category to obtain the classification features of each preset category; and classifying the search text based on the classification features of each preset category to obtain the predicted probability corresponding to each preset category.

5. The method according to claim 1, characterized in that, After classifying the search text based on the fusion features to obtain the predicted category information of the search text, the method further includes: determining the preset category with the highest predicted probability as the preset category to which the search text belongs; determining the relevance between the search text and each candidate search result based on the preset category to which the search text belongs and the preset categories to which multiple candidate search results corresponding to the search text belong; and determining the candidate search results whose relevance meets the relevance conditions as the search results found based on the search text.

6. The method according to claim 1, characterized in that, Before determining the reference category information of the search text based on the preset categories to which the multiple search results belong, the method further includes: obtaining multiple categories to which candidate search results in the database belong; determining a fourth quantity corresponding to each category, wherein the fourth quantity refers to the number of candidate search results in the database belonging to the category; and determining multiple categories that satisfy the quantity condition of the fourth quantity as the multiple preset categories.

7. The method according to any one of claims 1-6, characterized in that, The text classification model includes a feature extraction network and a classification network. The step of obtaining fused features of the search text based on the search text and the reference category information includes: calling the feature extraction network to obtain the fused features based on the search text and the reference category information; the step of classifying the search text based on the fused features to obtain predicted category information of the search text includes: calling the classification network to classify the search text based on the fused features to obtain the predicted category information.

8. The method according to claim 7, characterized in that, The training process of the text classification model includes: acquiring a first sample search text and multiple sample search results corresponding to the first sample search text, wherein the sample search results include historical search results of the interaction performed corresponding to the first sample search text; determining a first reference category information of the first sample search text based on the preset categories to which the multiple sample search results belong, wherein the first reference category information includes the sample reference probability of the first sample search text belonging to the multiple preset categories; calling the feature extraction network to acquire sample fusion features of the first sample search text based on the first sample search text and the first reference category information; calling the classification network to classify the first sample search text based on the sample fusion features to obtain first predicted category information, wherein the first predicted category information includes the sample predicted probability of the first sample search text belonging to the multiple preset categories; and training the text classification model based on the first true category information and the first predicted category information of the first sample search text to increase the similarity between the first predicted category information and the first true category information obtained by the trained text classification model, wherein the first true category information includes the true probability of the first sample search text belonging to the multiple preset categories.

9. The method according to claim 8, characterized in that, The feature extraction network includes a first extraction layer, a second extraction layer, and a feature fusion layer. Calling the feature extraction network to obtain sample fusion features of the first sample search text based on the first sample search text and the first reference category information includes: calling the first extraction layer to extract sample text features of the first sample search text; calling the second extraction layer to extract sample category features from the first reference category information; and calling the feature fusion layer to fuse the sample text features and the sample category features to obtain the sample fusion features.

10. The method according to claim 8, characterized in that, The classification network includes feature mapping layers corresponding to multiple dimensions, weighted layers for each preset category, and a classification layer. Calling the classification network to classify the first sample search text based on the sample fusion features to obtain first predicted category information includes: calling the multiple feature mapping layers respectively to extract sample mapping features of the multiple dimensions based on the sample fusion features; calling the weighted layers for each preset category respectively to determine a weighted reorganization for each preset category based on the sample fusion features, wherein the weighted reorganization includes weights of the multiple dimensions, and the weights represent the degree of influence of any text's features in that dimension on whether the text belongs to the preset category; calling the weighted layers for each preset category respectively to perform weighted fusion of the sample mapping features of the multiple dimensions according to the multiple weights in the weighted reorganization of each preset category to obtain sample classification features for each preset category; and calling the classification layer for each preset category respectively to classify the first sample search text based on the sample classification features for each preset category to obtain the sample prediction probability corresponding to each preset category.

11. The method according to claim 8, characterized in that, After training the text classification model based on the first true category information and the first predicted category information of the first sample search text, the method further includes: obtaining a second sample search text; determining preset category information as the second reference category information of the second sample search text, the second reference category information including the sample reference probability of the second sample search text belonging to the multiple preset categories; calling the feature extraction network to obtain sample fusion features of the second sample search text based on the second sample search text and the second reference category information; calling the classification network to classify the second sample search text based on the sample fusion features to obtain second predicted category information, the second predicted category information including the sample predicted probability of the second sample search text belonging to the multiple preset categories; and training the text classification model based on the second true category information and the second predicted category information of the second sample search text, so that the similarity between the second predicted category information obtained by the trained text classification model and the second true category information is increased, the second true category information including the true probability of the second sample search text belonging to the multiple preset categories.

12. The method according to claim 8, characterized in that, The step of training the text classification model based on the first true category information and the first predicted category information of the first sample search text, so as to increase the similarity between the first predicted category information and the first true category information obtained by the trained text classification model, includes: weighting and fusing the difference parameter between the sample predicted probability and the true probability of each preset category according to the loss weight corresponding to each preset category to obtain a loss parameter, wherein the similarity between the sample predicted probability and the true probability is negatively correlated with the difference parameter; training the text classification model based on the loss parameter and updating the loss weight, so as to reduce the loss parameter obtained based on the trained text classification model and the updated loss weight.

13. A text classification device for search, characterized in that, The device includes: a first acquisition module, configured to acquire a search text to be classified and multiple search results corresponding to the search text, the multiple search results including historical search results of the search text corresponding to the executed interactive operation; a determination module, configured to determine reference category information of the search text based on the preset categories to which the multiple search results belong, the reference category information including the reference probability of the search text belonging to multiple preset categories; a second acquisition module, configured to acquire fusion features of the search text based on the search text and the reference category information; and a classification module, configured to classify the search text based on the fusion features to obtain predicted category information of the search text, the predicted category information including the predicted probability of the search text belonging to the multiple preset categories, the predicted category information being used to determine the preset category to which the search text belongs.

14. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one computer program, which is loaded and executed by the processor to perform the operations performed by the search text classification method as described in any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to perform the operations performed by the search text classification method as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Similar text retrieval method and device, electronic equipment and storage medium

    CN113407738A

  • Classifying text into hierarchical categories

    US8145636B1