Brand name-based data processing method, model training method and device
Through the combination of multiple preset databases and neural network models, the brand name in the text input by the user is identified, which solves the problem of low brand name recognition accuracy and improves the search accuracy.
Patent Information
- Application Number
- CN202410882666.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-10-08
AI Technical Summary
The existing technology has the problem of low recognition accuracy in brand name recognition. Especially when the brand name in the text input by the user is not standardized, it is difficult to accurately identify it and affects the search accuracy.
By obtaining the text to be recognized input by the user, using multiple preset databases for data retrieval, combined with semantic analysis and preset weights, the brand name in the text to be recognized is determined, and word segmentation and probability calculation are performed based on the neural network model to improve the brand name recognition accuracy.
It improves the recognition accuracy of brand names, thereby improving the search accuracy of brand-related information, and solves the problem of low recognition accuracy of information based on text itself.
Smart Images

Figure CN118747233A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of text recognition in the field of artificial intelligence, and in particular to a data processing method based on brand names, a model training method and a device. Background Art
[0002] When a user wants to know about a brand, he needs to search for the brand. For example, when a user wants to attract investment and franchise, he usually needs to query the franchisee and get information about the franchisee.
[0003] Users can input text information through human-computer interaction, and the text information represents the brand that the user wants to query. Brand names are usually not standardized words. How to accurately identify brand names from text information and then accurately search for brand information is a critical and challenging task. Summary of the invention
[0004] The present disclosure provides a data processing method based on brand names, a model training method and a device.
[0005] According to a first aspect of the present disclosure, a method for processing data based on brand names is provided, comprising:
[0006] Acquire a text to be recognized input by a user; wherein the text to be recognized includes a brand name, and the text to be recognized represents the user's search demand for the brand corresponding to the brand name;
[0007] Determine the brand name in the text to be identified based on brand information in a plurality of preset databases; wherein the plurality of preset databases represent a plurality of channels for data retrieval processing, and the brand information represents information related to the brand;
[0008] According to the brand name in the text to be recognized, a search result corresponding to the text to be recognized is determined.
[0009] According to a second aspect of the present disclosure, a training method based on a brand name recognition model is provided, comprising:
[0010] Acquire a pre-collected data set to be trained; wherein the data set to be trained includes a text to be trained and a preset label of each segmentation in the text to be trained, and the preset label indicates whether the segmentation belongs to a brand name;
[0011] According to the brand information in a plurality of preset databases, based on a preset initial model, a prediction probability of each word segment in the text to be trained is obtained; wherein the plurality of preset databases represent multiple channels for data retrieval processing, the brand information represents information related to the brand, and the prediction probability represents the probability that the predicted word segment in the text to be trained belongs to the brand name;
[0012] Performing model training according to the predicted probability of each word segment in the text to be trained and the preset label of each word segment in the text to be trained to obtain a trained brand name recognition model;
[0013] The brand name recognition model is used to determine the brand name in the text to be recognized based on the text to be recognized in the first aspect.
[0014] According to a third aspect of the present disclosure, there is provided a data processing device based on a brand name, comprising:
[0015] A text acquisition unit, used to acquire the text to be recognized input by the user; wherein the text to be recognized includes a brand name, and the text to be recognized represents the user's search demand for the brand corresponding to the brand name;
[0016] A name determination unit, configured to determine the brand name in the to-be-recognized text according to brand information in a plurality of preset databases; wherein the plurality of preset databases represent a plurality of channels for data retrieval processing, and the brand information represents information related to the brand;
[0017] The result determination unit is used to determine the search result corresponding to the text to be recognized according to the brand name in the text to be recognized.
[0018] According to a fourth aspect of the present disclosure, a training device based on a brand name recognition model is provided, comprising:
[0019] A data set acquisition unit, used to acquire a pre-collected data set to be trained; wherein the data set to be trained includes a text to be trained and a preset label of each segmentation in the text to be trained, and the preset label indicates whether the segmentation belongs to a brand name;
[0020] A probability prediction unit is used to obtain the prediction probability of each word segment in the text to be trained based on the brand information in multiple preset databases and based on a preset initial model; wherein the multiple preset databases represent multiple channels for data retrieval processing, the brand information represents information related to the brand, and the prediction probability represents the predicted probability that the word segment in the text to be trained belongs to the brand name;
[0021] A model training unit, used to perform model training according to the predicted probability of each segmentation in the text to be trained and the preset label of each segmentation in the text to be trained, so as to obtain a trained brand name recognition model;
[0022] The brand name recognition model is used to determine the brand name in the text to be recognized based on the text to be recognized in the third aspect.
[0023] According to a fifth aspect of the present disclosure, there is provided an electronic device, including:
[0024] at least one processor; and
[0025] a memory communicatively connected to the at least one processor; wherein,
[0026] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the first aspect and the second aspect of the present disclosure.
[0027] According to a sixth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the methods described in the first and second aspects of the present disclosure.
[0028] According to a seventh aspect of the present disclosure, a computer program product is provided, comprising a computer program, which implements the steps of the method described in the first aspect and the second aspect of the present disclosure when executed by a processor.
[0029] According to the technology disclosed in the present invention, the recognition accuracy of brand names is improved, thereby improving the search accuracy for brands.
[0030] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0032] Figure 1 is a flowchart of a data processing method based on brand names provided according to an embodiment of the present disclosure;
[0033] Figure 2 is a flowchart of a data processing method based on brand names provided according to an embodiment of the present disclosure;
[0034] Figure 3is a flowchart of a data processing method based on brand names provided according to an embodiment of the present disclosure;
[0035] Figure 4 is a flowchart of a training method based on a brand name recognition model provided according to an embodiment of the present disclosure;
[0036] Figure 5 is a flowchart of a training method based on a brand name recognition model provided according to an embodiment of the present disclosure;
[0037] Figure 6 is a schematic diagram of the structure of a brand name recognition model provided according to an embodiment of the present disclosure;
[0038] Figure 7 is a structural block diagram of a data processing device based on a brand name provided according to an embodiment of the present disclosure;
[0039] Figure 8 is a structural block diagram of a data processing device based on a brand name provided according to an embodiment of the present disclosure;
[0040] Fig. 9 is a structural block diagram of a training device based on a brand name recognition model provided according to an embodiment of the present disclosure;
[0041] Fig.10 is a block diagram of an electronic device for implementing the brand name-based data processing method and model training method of the embodiment of the present disclosure;
[0042] Fig.11 It is a block diagram of an electronic device used to implement the brand name-based data processing method and model training method of the embodiments of the present disclosure. DETAILED DESCRIPTION
[0043] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0044] In the field of franchise recruitment, accurately identifying and confirming brand names is a critical and challenging task. Accurate brand recognition technology can effectively improve brand tracing, new brand recognition, and content quality. Currently, brand recognition mainly relies on manual review or simple keyword matching to extract brand names from user input information. These methods are inefficient and easily constrained by subjective judgment and incomplete data.
[0045] A neural network-based text extraction method can also be used to extract brand names from user input information. However, brand names are usually not standardized and look varied, which makes it difficult for neural networks to identify them. For example, a word used in daily life is "AB", and a brand name changes "AB" to "AD". Using traditional text extraction methods, "AD" may be misjudged as a typo. In other words, traditional text extraction methods cannot fully meet the needs of brand recognition and cannot accurately identify complete brand names, which in turn affects the accuracy of users' searches for brand-related information.
[0046] The present disclosure provides a data processing method based on brand names, a model training method and a device, which are applied to the field of text recognition in the field of artificial intelligence to improve the recognition accuracy of brand names, thereby improving the search accuracy of texts to be recognized.
[0047] It should be noted that the model in this embodiment is not a model for a specific user and cannot reflect the personal information of a specific user. It should be noted that the data in this embodiment comes from a public data set.
[0048] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0049] In order to enable readers to more deeply understand the implementation principle of the present disclosure, the following Figure 1-Figure 11 The embodiment is further refined.
[0050] Figure 1 FIG. 1 is a flow chart of a data processing method based on brand names provided according to an embodiment of the present disclosure. The method can be executed by a data processing device based on brand names. Figure 1 As shown, the method comprises the following steps:
[0051] S101. Obtain text to be recognized input by a user; wherein the text to be recognized includes a brand name, and the text to be recognized represents the user's search demand for the brand corresponding to the brand name.
[0052] For example, a user can search for information related to a brand. When a user wants to learn about a brand, the user can input text to be recognized through human-computer interaction. For example, the user can directly input text information as the text to be recognized, or can first input voice information, and then convert the user's voice information into text information to obtain the text to be recognized. The text to be recognized can be obtained in real time. A human-computer interaction interface can be preset, and the obtained text to be recognized can be displayed on the human-computer interaction interface for the user to view.
[0053] The text to be recognized may include the brand name of the brand that the user wants to know about, and the text to be recognized may represent the user's search demand for the brand corresponding to the brand name. For example, if the user's search demand is to know whether the things sold by brand A are fresh, the text to be recognized may be "Are the things sold by brand A fresh?"
[0054] S102, determining the brand name in the text to be recognized based on brand information in multiple preset databases; wherein the multiple preset databases represent multiple channels for data retrieval processing, and the brand information represents information related to the brand.
[0055] Exemplarily, multiple databases are pre-set, each of which can store a large amount of brand information, and the brand information in each database can be the same or different. Each database can represent a channel for data retrieval processing, that is, data retrieval can be performed through different channels, and each channel corresponds to its own database. For example, it can include encyclopedia channels, e-commerce channels, community channels, and map channels. Brand information refers to various information related to the brand, for example, it can be the brand's place of origin, launch time, brand public opinion news, etc.
[0056] After obtaining the text to be recognized, the brand name can be identified from the text to be recognized based on the brand information in each database. That is, the brand name is obtained by combining all the databases. For example, a preset automatic crawling technology can be used to put the text to be recognized into a database containing rich brand information for retrieval to obtain various information related to the text to be recognized. Each database may obtain various information related to the text to be recognized. If the various information related to the text to be recognized does not exist in the database, the database cannot retrieve the various information related to the text to be recognized. In this embodiment, the preset automatic crawling technology is not specifically limited. For example, information with semantic similarity to the text to be recognized can be searched, and information with a high degree of text overlap with the text to be recognized can also be searched.
[0057] The brand name in the text to be identified can be determined based on the information retrieved from each database. For example, one or more words that have the highest number of overlaps with the words in the text to be identified can be found from the information retrieved from different databases, and then the brand name can be determined from these words through semantic analysis. For example, these words include "Brand A" and "Location". After semantic analysis, "Location" can be excluded, and "Brand A" can be determined as the brand name.
[0058] S103: Determine search results corresponding to the text to be recognized based on the brand name in the text to be recognized.
[0059] Exemplarily, after obtaining the brand name of the text to be recognized, the search requirement represented by the text to be recognized can be searched according to the brand name. For example, the text to be recognized can be segmented according to the brand name, the brand name can be separated from the text to be recognized, and the remaining content in the text to be recognized can be semantically analyzed to determine the user's search requirement. According to the determined search requirement, the information corresponding to the brand name is searched from the preset target library as the search result corresponding to the text to be recognized. For example, if the brand name is brand A and the search requirement is to find a location, the location of brand A can be searched from the target library. The preset target library can be one or more of the preset databases, or other databases.
[0060] The search results may be displayed to the user through a preset human-computer interaction interface. For example, the search results may be displayed on the human-computer interaction interface as an answer to the user's search needs. The search results may be displayed to the user in the form of voice or text.
[0061] In the disclosed embodiment, multiple databases are preset to represent multiple data retrieval channels, and the text to be recognized input by the user is obtained, and the brand name in the text to be recognized is determined based on the brand information in multiple preset databases. According to the brand name in the text to be recognized, the search result corresponding to the text to be recognized is determined to meet the user's search needs for the brand. By combining different databases, the problem of low recognition accuracy caused by brand name recognition based on the information of the text itself is solved. Taking into account the information changes in different channels, the information stored in the actual website is introduced to improve the recognition accuracy of the brand name, thereby improving the search accuracy of the search needs represented by the text to be recognized.
[0062] Figure 2 A flowchart of a data processing method based on brand names is provided for an embodiment of the present disclosure. This embodiment is an optional embodiment based on the above embodiment.
[0063] In this embodiment, the brand name in the text to be recognized is determined based on the brand information in multiple preset databases, which can be further refined as follows: the text to be recognized is searched and processed based on the brand information in the preset databases to obtain the search results corresponding to each preset database; wherein the search results indicate whether information related to the text to be recognized is retrieved; and the brand name in the text to be recognized is determined based on the search results corresponding to each preset database.
[0064] like Figure 2 As shown, the method comprises the following steps:
[0065] S201. Obtain text to be recognized input by a user; wherein the text to be recognized includes a brand name, and the text to be recognized represents the user's search demand for the brand corresponding to the brand name.
[0066] Exemplarily, this step may refer to the above-mentioned step S101 and will not be described in detail.
[0067] S202, performing search processing on the text to be recognized according to the brand information in the preset database, and obtaining search results corresponding to each preset database; wherein the search results indicate whether information related to the text to be recognized is retrieved.
[0068] Exemplarily, for each preset database, the text to be recognized can be retrieved and processed according to the stored brand information. Each database can correspond to a search result, and the search result can indicate whether information related to the text to be recognized is retrieved. For example, the search result can be 0 or 1, 0 indicates that no information related to the text to be recognized is retrieved in the database, and 1 indicates that information related to the text to be recognized is retrieved in the database. The search result can also indicate the amount of information retrieved from the database, or the retrieved information itself, etc.
[0069] In this embodiment, the amount and content of information retrieved from the database are not specifically limited. For example, it is only necessary to determine whether relevant information can be found from the database, and it is not necessary to determine the specific content of the relevant information found.
[0070] S203: Determine the brand name in the text to be recognized according to the search results corresponding to each preset database.
[0071] Exemplarily, after obtaining the search results corresponding to each database, the brand name is identified from the text to be identified based on these search results. In this embodiment, the search result can be the amount of information retrieved by the database, and the amount of information retrieved by the database can be determined based on the search results. For example, the amount of information retrieved by the database of the encyclopedia channel is large, and the amount of information retrieved by the database of the community channel is small, and the community refers to the network community. According to the search results, each database can be assigned a weight, and the weight can represent the reliability of the database. For example, if the amount of information represented by the search results is large, a larger weight is assigned to the database; if the amount of information represented by the search results is small, a smaller weight is assigned to the database. According to the size of the weight, the reliability of each database is determined, so as to determine the brand name in the text to be identified based on the information retrieved from the database. For example, according to the information retrieved from the database, the brand name in the retrieved information can be first identified, and then the brand names identified by each database can be merged according to the weight of the database to obtain the brand name in the text to be identified.
[0072] In this embodiment, a search result can be obtained for each database. Based on multiple search results, actual data query channels are mixed to avoid one-sidedness of information and improve the recognition accuracy of brand names.
[0073] In this embodiment, the brand name in the text to be recognized is determined according to the search results corresponding to each preset database, including: performing word segmentation processing on the text to be recognized to obtain multiple word segments in the text to be recognized; determining the probability that the word segmentation in the text to be recognized belongs to the brand name according to the search results corresponding to each preset database; determining the brand name in the text to be recognized according to the probability that the word segmentation in the text to be recognized belongs to the brand name.
[0074] Specifically, if the text to be recognized is a natural sentence, the text to be recognized can be segmented and the text to be recognized can be split into multiple segmented words. In this embodiment, the method of segmentation is not specifically limited. For each segmented word in the text to be recognized, the probability that the segmented word in the text to be recognized belongs to the brand name is determined in combination with the search results corresponding to each preset database. In this embodiment, a neural network model can be pre-constructed, and the text to be recognized and the search results of each database are input into the preset model, and the model performs segmentation and probability calculations. For example, after the segmentation, the model can fuse the search results of each database, and determine the probability that each segmented word belongs to the brand name based on the fused search results. In this embodiment, the structure of the preset model is not specifically limited.
[0075] After obtaining the probability that each segmented word belongs to a brand name, the brand name in the text to be recognized is determined according to the probability that the segmented word in the text to be recognized belongs to a brand name. For example, the segmented word with the highest probability can be determined as the brand name in the text to be recognized.
[0076] The beneficial effect of this arrangement is that the search results are used as factors affecting recognition accuracy, and multiple search results are combined to determine the probability that each word belongs to a brand name, thereby introducing multi-channel realistic factors and improving brand name recognition accuracy.
[0077] In this embodiment, the probability that a segmented word in the text to be recognized belongs to a brand name is determined based on the search results corresponding to each preset database, including: obtaining the preset weight of each preset database; wherein the preset weight represents the reliability of the database search data; based on the search results corresponding to each preset database and the preset weight of each preset database, the probability that a segmented word in the text to be recognized belongs to a brand name is determined.
[0078] Specifically, a weight is set in advance for each database as a preset weight. The preset weight can represent the reliability of database retrieval data. For example, the reliability of Baidu is higher than that of e-commerce, and the preset weight of Baidu can be greater than the preset weight of e-commerce. The preset weight of the database can be changed at any time according to the actual changes of the brand information stored in the database.
[0079] The probability that the segmented words in the text to be recognized belong to the brand name is determined based on the search results corresponding to each preset database and the preset weights of each preset database. For example, a weighted sum calculation can be performed on the search results of the database and the corresponding preset weights, and the probability that the segmented words in the text to be recognized belong to the brand name can be obtained based on the calculation results and the feature vectors of the segmented words in the text to be recognized.
[0080] The beneficial effect of such a setting is that, according to the preset weights, the search results of the database can be processed in a targeted manner, thereby avoiding the impact of low-reliability databases on brand name recognition and improving the recognition accuracy of brand names.
[0081] In this embodiment, the probability that the segmented words in the text to be recognized belong to the brand name is determined according to the search results corresponding to each preset database and the preset weights of each preset database, including: obtaining the credibility value of the preset database according to the search results corresponding to the preset database and the preset weights of the preset database; wherein the credibility value of the database represents the product between the search results corresponding to the database and the preset weights; and determining the probability that the segmented words in the text to be recognized belong to the brand name according to the credibility values of each preset database.
[0082] Specifically, for each database, the credibility value of the database can be determined according to the search result corresponding to the database and the preset weight of the database. The credibility value of the database can represent the product between the search result corresponding to the database and the preset weight. That is, the credibility value of the database is obtained by multiplying the search result of the database by the preset weight. For example, the search result can be 1 or 0, and the preset weight can be a value between 0 and 1.
[0083] Combined with the credibility values of each database, the probability that each word in the text to be recognized belongs to the brand name is determined. For example, the credibility values of each database can be added together, and the feature vector of the word can be determined according to a preset model. The probability that the word belongs to the brand name is calculated based on the added value and the feature vector of the word.
[0084] The beneficial effect of such a setting is that the search results of the database are multiplied by preset weights, and then the values after each multiplication are combined to achieve the integration of multiple real channels and improve the calculation accuracy of the probability.
[0085] In this embodiment, the probability that a segmentation in the text to be recognized belongs to a brand name is determined based on the credibility values of each preset database, including: adding the credibility values of each preset database to obtain the sum of the credibility values; performing vector representation on the segmentation in the text to be recognized through a preset embedding layer to obtain vector data corresponding to the segmentation in the text to be recognized; inputting the sum of the credibility values and the vector data corresponding to the segmentation in the text to be recognized into a preset network layer for feature extraction processing to obtain the probability that the segmentation in the text to be recognized belongs to a brand name.
[0086] Specifically, after obtaining the credibility values of each database, these credibility values are added together to obtain the sum of the credibility values. A neural network model is pre-built, and the neural network model includes an embedding layer. The word segmentation in the text to be recognized is input into the embedding layer, and the word segmentation of the text to be recognized is represented by a vector to obtain the vector data corresponding to the word segmentation in the text to be recognized.
[0087] The preset neural network also includes one or more network layers, for example, the network layer can be a Trm (Transformer) layer. The sum of the credibility values and the vector data corresponding to the segmented words in the text to be recognized are input into the preset network layer for feature extraction processing, and the probability that the segmented words in the text to be recognized belong to the brand name is calculated based on the extracted results. Each segmented word can correspond to a probability value.
[0088] The beneficial effect of such a setting is that the credibility values of each database are summed up, and the probability of word segmentation is calculated based on the preset network structure, thereby improving the efficiency and accuracy of probability calculation.
[0089] In this embodiment, the brand name in the text to be recognized is determined according to the probability that the segmentation in the text to be recognized belongs to the brand name, including: if the probability that the segmentation in the text to be recognized belongs to the brand name is greater than a preset probability threshold, the segmentation in the text to be recognized is determined to be a target segmentation; and the brand name in the text to be recognized is determined according to the text arrangement order of the target segmentation in the text to be recognized.
[0090] Specifically, a probability threshold is preset, and the probability corresponding to each segmentation is compared with the preset probability threshold. If the probability that the segmentation in the text to be recognized belongs to the brand name is less than or equal to the preset probability threshold, it is determined that the segmentation does not belong to the brand name; if the probability that the segmentation in the text to be recognized belongs to the brand name is greater than the preset probability threshold, it is determined that the segmentation belongs to the brand name and the segmentation is determined as the target segmentation.
[0091] One or more target segmented words can be determined. If there is only one target segmented word, the target segmented word is the brand name. If there are multiple target segmented words, the brand name in the text to be recognized can be determined based on the text arrangement order of the target segmented words in the text to be recognized. For example, the text to be recognized is "AB's establishment time", the segmented words include "A", "B" and "establishment time", and the target segmented words are "A" and "B". According to the arrangement order of "A" and "B" in the text to be recognized, the brand name can be determined to be "AB".
[0092] The beneficial effect of such a setting is that the brand name can be quickly determined according to the preset probability threshold, thereby improving the efficiency of determining the brand name.
[0093] S204: Determine search results corresponding to the text to be recognized based on the brand name in the text to be recognized.
[0094] Exemplarily, this step may refer to the above-mentioned step S103 and will not be described in detail.
[0095] In the disclosed embodiment, multiple databases are preset to represent multiple data retrieval channels, and the text to be recognized input by the user is obtained, and the brand name in the text to be recognized is determined based on the brand information in multiple preset databases. According to the brand name in the text to be recognized, the search result corresponding to the text to be recognized is determined to meet the user's search needs for the brand. By combining different databases, the problem of low recognition accuracy caused by brand name recognition based on the information of the text itself is solved. Taking into account the information changes in different channels, the information stored in the actual website is introduced to improve the recognition accuracy of the brand name, thereby improving the search accuracy of the search needs represented by the text to be recognized.
[0096] Figure 3 A flowchart of a data processing method based on brand names is provided for an embodiment of the present disclosure. This embodiment is an optional embodiment based on the above embodiment.
[0097] In this embodiment, the search results corresponding to the text to be recognized are determined based on the brand name in the text to be recognized, which can be further refined as follows: semantic analysis is performed on the text to be recognized to obtain semantic analysis results; based on the semantic analysis results, search results corresponding to the brand name in the text to be recognized are searched from a preset target library; wherein the target library is one of the preset multiple databases.
[0098] like Figure 3 As shown, the method comprises the following steps:
[0099] S301. Obtain text to be recognized input by a user; wherein the text to be recognized includes a brand name, and the text to be recognized represents the user's search demand for the brand corresponding to the brand name.
[0100] Exemplarily, this step may refer to the above-mentioned step S101 and will not be described in detail.
[0101] S302, determining the brand name in the text to be recognized based on brand information in multiple preset databases; wherein the multiple preset databases represent multiple channels for data retrieval processing, and the brand information represents information related to the brand.
[0102] Exemplarily, this step may refer to the above-mentioned step S102 and will not be described in detail.
[0103] S303: Perform semantic analysis on the text to be recognized to obtain a semantic analysis result.
[0104] Exemplarily, the user wants to obtain an answer corresponding to the search requirement represented by the text to be recognized, and therefore, it is necessary to perform semantic recognition on the text to be recognized to determine the user's search requirement, that is, to determine what information the user wants to query.
[0105] A semantic analysis algorithm may be preset, and based on the preset semantic analysis algorithm, semantic analysis may be performed on the text to be recognized to obtain a semantic analysis result of the text to be recognized. The semantic analysis result may represent the search demand represented by the text to be recognized. In this embodiment, no specific limitation is made to the preset semantic analysis algorithm. For example, the brand name may be removed from the text to be recognized first, and a semantic analysis may be performed on the text to be recognized after the brand name is removed. For example, if the text to be recognized is "the establishment time of a certain brand", a semantic analysis may be performed on the "establishment time" to determine the user's actual search demand and avoid the influence of the brand name on the semantic analysis result.
[0106] S304. According to the semantic analysis result, searching for search results corresponding to the brand name in the text to be recognized from a preset target library; wherein the target library is one of the preset multiple databases.
[0107] Exemplarily, a target library is pre-set, and the target library can be one of multiple preset databases. For example, relevant information of each brand is collected in advance and stored in a database, and the database is determined as the target library. The database with the largest preset weight can also be determined as the target library. The preset weights of each database can be regularly updated, and the target library can be regularly replaced according to the preset weights of each database.
[0108] According to the semantic analysis results and brand names, search from the target library to determine the information that meets the semantic analysis results and belongs to the brand name in the text to be identified as the search result. For example, if the brand name is "Brand A" and the semantic analysis result is to find the founding time, you can first search for information related to Brand A in the target library, and then search for information related to the founding time from the information related to Brand A as the search result.
[0109] In this embodiment, by performing semantic analysis, the search requirements can be accurately queried, and the search is performed from a preset target database to avoid data confusion among multiple databases, thereby improving the efficiency and accuracy of the query.
[0110] In this embodiment, the method also includes: if it is determined that there is no search result corresponding to the brand name in the text to be identified in the target library, pushing a preset default speech text to the user.
[0111] Specifically, a default speech text is pre-set as a fallback speech. According to the semantic analysis results, the search results corresponding to the brand name in the text to be identified are searched from the target library. If the corresponding search results can be found, the search results are displayed to the user; if the search results cannot be found, it means that there is no search result corresponding to the brand name in the text to be identified in the target library, then the fallback speech can be displayed to the user, that is, the preset default speech text can be pushed to the user. For example, the user can be prompted to change the way of asking the question to facilitate re-searching.
[0112] The beneficial effect of such a setting is that by pushing the default script text to the user, it can ensure that the user's search needs are responded to, avoid the user waiting for search results, and improve the user's interactive experience.
[0113] In the disclosed embodiment, multiple databases are preset to represent multiple data retrieval channels, and the text to be recognized input by the user is obtained, and the brand name in the text to be recognized is determined based on the brand information in multiple preset databases. According to the brand name in the text to be recognized, the search result corresponding to the text to be recognized is determined to meet the user's search needs for the brand. By combining different databases, the problem of low recognition accuracy caused by brand name recognition based on the information of the text itself is solved. Taking into account the information changes in different channels, the information stored in the actual website is introduced to improve the recognition accuracy of the brand name, thereby improving the search accuracy of the search needs represented by the text to be recognized.
[0114] Figure 4 FIG. 1 is a flow chart of a training method based on a brand name recognition model provided according to an embodiment of the present disclosure. The method can be performed by a training device based on a brand name recognition model. Figure 4 As shown, the method comprises the following steps:
[0115] S401, obtaining a pre-collected data set to be trained; wherein the data set to be trained includes a text to be trained and a preset label of each segmentation in the text to be trained, and the preset label indicates whether the segmentation belongs to a brand name.
[0116] Exemplarily, a neural network model to be trained is pre-built as an initial model of the brand name recognition model, and the initial model is trained to obtain a trained brand name recognition model. The brand name recognition model can determine the brand name in the text to be recognized. For example, the text to be recognized can be input into the brand name recognition model, and the brand name in the text to be recognized can be output. In this embodiment, the model structure is not specifically limited.
[0117] When training a model, a data set for training can be collected in advance as a data set to be trained. The data set to be trained can include the text to be trained and the preset labels of each segmentation in the text to be trained. The preset labels can indicate whether the segmentation belongs to a brand name. That is, a large amount of text can be collected in advance as the text to be trained. The text to be trained contains a brand name, and the words that belong to the brand name in the text to be trained are manually determined and labeled. For example, if a word in the text to be trained belongs to a brand name, a preset label is added to the word; if a word in the text to be trained does not belong to a brand name, a preset label is not added to the word.
[0118] S402. According to the brand information in a plurality of preset databases, based on a preset initial model, a prediction probability of each word segment in the text to be trained is obtained; wherein the plurality of preset databases represent multiple channels for data retrieval processing, the brand information represents information related to the brand, and the prediction probability represents the probability that the predicted word segment in the text to be trained belongs to the brand name.
[0119] Exemplarily, multiple databases are pre-set, and the databases can represent different data retrieval channels. The same or different brand information can be stored in each database, and the brand information refers to information related to each brand.
[0120] The training text in the training data set is input into the preset initial model, and the initial model performs word segmentation on the training text. And according to the brand information in each database, the prediction probability of each word in the training text is calculated. The prediction probability represents the probability that the word in the training text predicted by the model belongs to the brand name, and each word can correspond to a prediction probability.
[0121] S403: Perform model training according to the predicted probability of each word segment in the text to be trained and the preset label of each word segment in the text to be trained to obtain a trained brand name recognition model.
[0122] Exemplarily, after the predicted probability of each word segment is obtained, the initial model can be iteratively trained according to the preset label of each word segment in the text to be trained to obtain a trained brand name recognition model.
[0123] For a word segmentation with a preset label, the word segmentation belongs to a brand name, that is, the prediction probability of the word segmentation should be relatively large. If the calculated probability of the word segmentation is relatively small, it means that the model has not been trained successfully, and the model training needs to be continued; if the calculated probability of the word segmentation is relatively large, it means that the model training is successful, and a brand name recognition model is obtained. In this embodiment, a back propagation algorithm and a loss function can be preset for training the model. In this embodiment, the preset back propagation algorithm and loss function are not specifically limited.
[0124] In the disclosed embodiment, the brand name recognition model is pre-trained. When brand name recognition is required, the brand name can be automatically obtained according to the brand name recognition model, thereby improving the efficiency and accuracy of data processing. When training the model, multiple databases are preset to represent multiple data retrieval channels, and the text to be trained is obtained. Based on the brand information in multiple preset databases and preset labels, it is determined whether the brand name recognition model can accurately obtain the brand name. Taking into account the changes in information from different channels, the information stored in real websites is introduced to improve the training accuracy of the brand name recognition model, thereby improving the recognition accuracy of the model for brand names.
[0125] Figure 5 A flowchart of a training method based on a brand name recognition model provided in an embodiment of the present disclosure is provided. This embodiment is an optional embodiment based on the above embodiment.
[0126] In this embodiment, according to the brand information in multiple preset databases, based on the preset initial model, the predicted probability of each word in the text to be trained is obtained, which can be refined as follows: according to the brand information in multiple preset databases, the text to be trained is searched and processed to obtain the search results of each preset database for the text to be trained; wherein the search results represent whether information related to the text to be trained is retrieved; the text to be trained and the search results of each preset database for the text to be trained are input into the preset initial model to obtain the predicted probability of each word in the text to be trained.
[0127] like Figure 5 As shown, the method comprises the following steps:
[0128] S501, obtaining a pre-collected data set to be trained; wherein the data set to be trained includes a text to be trained and a preset label of each segmentation in the text to be trained, and the preset label indicates whether the segmentation belongs to a brand name.
[0129] Exemplarily, this step may refer to the above-mentioned step S401 and will not be described in detail.
[0130] S502. Perform search processing on the text to be trained according to the brand information in multiple preset databases to obtain search results for the text to be trained in each preset database; wherein the search results indicate whether information related to the text to be trained is retrieved.
[0131] For example, for each database, the training text is searched based on the brand information in the database to obtain the search result of the training text in the database. The search result can indicate whether information related to the training text is retrieved, and each database can correspond to a search result.
[0132] For example, the search result may be preset to 0 or 1, and based on the preset search method, the database is queried whether there is information related to the text to be trained, and if so, the search result is determined to be 1; if not, the search result is determined to be 0. In this embodiment, the preset search method is not specifically limited.
[0133] In this embodiment, the training text is searched and processed according to the brand information in multiple preset databases to obtain the search results of the training text in each preset database, including: searching and processing the training text according to the brand information in multiple preset databases to obtain a search data set corresponding to each preset database; wherein the search data set represents a collection of retrieved information related to the training text; and determining the search results of the preset database for the training text according to the search data set corresponding to the preset database.
[0134] Specifically, for each database, it is queried whether there is information related to the text to be trained in the database. If not, the search result corresponding to the database is determined to be a search result that indicates that no information related to the text to be trained is retrieved, for example, the search result is determined to be 0; if it exists, the search data set corresponding to the database is determined, and the search data set represents the collection of information related to the text to be trained retrieved from the database. For example, automatic crawling technology can be used to put the text to be trained into a channel containing rich brand information for retrieval to obtain various information related to the text to be trained. In this embodiment, text information in the database can be crawled, and image information can also be crawled. If image information is crawled, the text in the image can be extracted and added to the search data set.
[0135] For a database that has determined a search data set, a search result of the database for the training text is determined according to the search data set corresponding to the database. For example, as long as the database has a corresponding search data set, the search result of the database is 1. For another example, a quantity threshold is set in advance, and if the amount of information in the search data set is greater than the preset quantity threshold, the corresponding search result is 1; otherwise, it is 0.
[0136] The beneficial effect of such a setting is that, based on the retrieved retrieval data set, the retrieval results of the database are determined in a targeted manner, the determination accuracy of the retrieval results is improved, and then the training accuracy of the brand name recognition model is improved.
[0137] In this embodiment, based on the retrieval data set corresponding to the preset database, the retrieval result of the preset database for the training text is determined, including: performing data cleaning processing on the data in the retrieval data set corresponding to each preset database to obtain a cleaned retrieval data set corresponding to the preset database; based on the cleaned retrieval data set corresponding to the preset database, the retrieval result of the preset database for the training text is determined.
[0138] Specifically, after obtaining the search data sets corresponding to each database, each search data set is cleaned. For example, redundant information may be screened out to obtain a cleaned search data set. In this embodiment, the data cleaning process is not specifically limited.
[0139] According to the cleaned retrieval data set, the retrieval result of the database for the training text is determined. For example, if the retrieval data set is empty after cleaning, it can be determined that the retrieval result of the database is 0.
[0140] The beneficial effect of such a setting is that by performing data cleaning, the validity of the retrieved data is improved, thereby improving the accuracy of the retrieval results.
[0141] S503: Input the text to be trained and the search results of each preset database for the text to be trained into a preset initial model to obtain the prediction probability of each word in the text to be trained.
[0142] Exemplarily, after obtaining the search results of each database, all the search results and the text to be trained can be input into a preset initial model. The initial model performs word segmentation on the text to be trained, and calculates the prediction probability of each word segmentation based on all the search results.
[0143] In this embodiment, for the text to be trained, the search results of each database are determined, and the prediction probability of each word segmentation is calculated based on the preset initial model in combination with each search result. This realizes the combination of real data and algorithm models in the industry, thereby obtaining a mixed reality prediction model and improving the training accuracy of the model.
[0144] In this embodiment, the text to be trained and the search results of the preset database for the text to be trained are input into a preset initial model to obtain the predicted probability of each word segment in the text to be trained, including: performing word segmentation processing on the text to be trained through the preset initial model to obtain multiple word segments in the text to be trained; obtaining the preset weights of each preset database; wherein the preset weights represent the reliability of the database search data; and determining the predicted probability of each word segment in the text to be trained based on the preset initial model according to the search results of the text to be trained by each preset database and the preset weights of each preset database.
[0145] Specifically, the text to be trained is input into a preset initial model, and the initial model performs word segmentation on the text to be trained to obtain a plurality of word segments in the text to be trained.
[0146] Each database corresponds to a preset weight, and the preset weight represents the reliability of the database retrieval data. The preset weight can be set for each database in advance, and the preset weight of the database can be adjusted during the model training process. The initial preset weight can be set for each database before model training. For example, the initial preset weight can be set according to the amount of information in the retrieval data set corresponding to each database. A higher preset weight can be set for a database with a large amount of information, and a lower preset weight can be set for a database with a low amount of information.
[0147] The preset weights are stored in the model as parameters for model calculation. According to the search results of the training text in each database and the current preset weights of each database, the preset initial model calculates the prediction probability of each word in the training text.
[0148] For each database, the product between the search result corresponding to the database and the preset weight is calculated as the credibility value of the database. The credibility values of each database are added together to obtain the sum of the credibility values, and the sum is determined as the weight information. Through the embedding layer in the initial model, the word segmentation in the training text is vectorized to obtain the vector data corresponding to the word segmentation in the training text. The weight information and the vector data corresponding to the word segmentation in the training text are input into the network layer in the initial model for feature extraction processing to obtain the predicted probability of the word segmentation in the training text.
[0149] The training texts can be input into the initial model in batches each time, that is, multiple training texts can be input at one time. The number of segmented words in different training texts may be inconsistent. The training texts can be supplemented with segmented words to make the number of segmented words in each training text consistent. For example, the training texts lacking segmented words can be supplemented with preset meaningless words, for example, the form of "PAD(1)" can be supplemented. For the supplemented words, the weight information can be set to 0, and the calculated prediction probability is 0.
[0150] The beneficial effect of such a setting is that, through the preset initial model, the prediction probability is calculated according to the retrieval results of all databases and the corresponding preset weights, and the influence of the preset weights on the prediction probability is determined, which facilitates the subsequent adjustment of the model parameters, improves the training accuracy of the model, and avoids the erroneous influence of the database on the probability calculation results.
[0151] S504: Perform model training according to the predicted probability of each word segment in the text to be trained and the preset label of each word segment in the text to be trained to obtain a trained brand name recognition model.
[0152] Exemplarily, after the predicted probability of each word segment is obtained, the initial model can be iteratively trained based on the preset label of each word segment in the text to be trained and based on a preset loss function to obtain a trained brand name recognition model.
[0153] In this embodiment, model training is performed according to the predicted probability of each segmentation in the text to be trained and the preset label of each segmentation in the text to be trained to obtain a trained brand name recognition model, including: determining a loss value based on a preset loss function according to preset weights of each preset database, the predicted probability of each segmentation in the text to be trained, and the preset label of each segmentation in the text to be trained; if it is determined that the loss value meets the preset training completion condition, a trained brand name recognition model is obtained.
[0154] Specifically, a loss function is pre-set, and the preset weights of each database, the predicted probability of each word in the text to be trained, and the preset labels of each word in the text to be trained can be substituted into the preset loss function to calculate the loss value. Whether the model training is completed is determined based on the loss value. For example, the conditions for the completion of model training can be preset. If the preset training completion conditions are met according to the loss value, a trained brand name recognition model is obtained; otherwise, based on the preset back propagation algorithm, the model training continues until the preset training completion conditions are met.
[0155] The loss function can be expressed as:
[0156]
[0157] Among them, L is the loss value, N is the number of texts to be trained, and M is the number of word segments in a text to be trained. The M corresponding to each text to be trained is the same. ij Represents the weight information of the jth word in the i-th text to be trained. ij Indicates the preset label of the jth word segment in the i-th text to be trained. The preset label can be 0 or 1. 0 indicates that the word segment does not belong to the brand name, and 1 indicates that the word segment belongs to the brand name. is the predicted probability of the word segmentation.
[0158] If the segmented words are words separated from the training text, then the w corresponding to the segmented words is ij The same is the sum of the search results corresponding to each database multiplied by the corresponding preset weights, and then the sum of the products is added. If the participle is a participle added to make the number of participles consistent, then the w corresponding to the participle is ij It can be a preset value, for example, it can be 0.
[0159] The beneficial effect of this setting is that through the preset loss function, combined with the actual data channel for training, the uncertain preset weights are integrated into the model as realistic factors, which improves the accuracy of model training and thus improves the recognition accuracy of brand names.
[0160] Figure 6 Schematic diagram of the brand name recognition model. Figure 6 In the figure, the segmented words in the text to be trained include A and B, where A is the brand name. PAD(1) is a supplementary segmented word, and Prompt is a prompt word used in the large model, that is, the brand name recognition model can be a large model. The embedding layer is used to determine the data in vector form, that is, E0, E1, E2, and E3 are all data in vector form, E0 represents Prompt, E1 represents PAD(1), E2 represents A, and E3 represents B. In the weight information, W0 and W1 are the same and can be preset to 0, and W2 and W3 are the same. The search results of each database can be multiplied by the corresponding preset weight to obtain the credibility value of each database, and then the credibility values of each database are added to obtain the weight information, that is, W2 and W3. The segmented word position indicates the position of each segmented word in the text to be trained, that is, the text arrangement order of the segmented words. P0 and P1 are preset position information, and P2 and P3 represent the front-to-back order between A and B. The vector data, weight information, and position information of the word segmentation are input into the preset network layer for feature extraction and other processing. In this embodiment, the connection relationship between the various network layers is not specifically limited. Each word segmentation can output a probability value. For the word segmentation belonging to the brand name, the output probability value should be 1, or close to 1. For the word segmentation that does not belong to the brand name, the output probability value should be 0, or close to 0.
[0161] In the disclosed embodiment, the brand name recognition model is pre-trained. When brand name recognition is required, the brand name can be automatically obtained according to the brand name recognition model, thereby improving the efficiency and accuracy of data processing. When training the model, multiple databases are preset to represent multiple data retrieval channels, and the text to be trained is obtained. Based on the brand information in multiple preset databases and preset labels, it is determined whether the brand name recognition model can accurately obtain the brand name. Taking into account the changes in information from different channels, the information stored in real websites is introduced to improve the training accuracy of the brand name recognition model, thereby improving the recognition accuracy of the model for brand names.
[0162] Figure 7 The following is a structural block diagram of a data processing device based on a brand name provided in an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 7 The data processing device 700 based on brand name includes: a text acquisition unit 701, a name determination unit 702 and a result determination unit 703.
[0163] The text acquisition unit 701 is used to acquire the text to be recognized input by the user; wherein the text to be recognized includes a brand name, and the text to be recognized represents the user's search demand for the brand corresponding to the brand name;
[0164] The name determination unit 702 is used to determine the brand name in the to-be-recognized text according to brand information in a plurality of preset databases; wherein the plurality of preset databases represent a plurality of channels for data retrieval processing, and the brand information represents information related to the brand;
[0165] The result determination unit 703 is used to determine the search result corresponding to the text to be recognized according to the brand name in the text to be recognized.
[0166] Figure 8 A structural block diagram of a data processing device based on a brand name provided in an embodiment of the present disclosure, such as Figure 8 As shown, the data processing device 800 based on brand name includes a text acquisition unit 801 , a name determination unit 802 and a result determination unit 803 , wherein the name determination unit 802 includes an information retrieval module 8021 and a name determination module 8022 .
[0167] The information retrieval module 8021 is used to perform retrieval processing on the text to be recognized according to the brand information in the preset database, and obtain the retrieval result corresponding to each preset database; wherein the retrieval result indicates whether the information related to the text to be recognized is retrieved;
[0168] The name determination module 8022 is used to determine the brand name in the text to be recognized according to the search results corresponding to each preset database.
[0169] In one example, the name determination module 8022 includes:
[0170] A word segmentation submodule, used for performing word segmentation processing on the text to be recognized to obtain a plurality of word segments in the text to be recognized;
[0171] A probability determination submodule, for determining the probability that the segmented word in the to-be-recognized text belongs to a brand name according to the search results corresponding to each preset database;
[0172] The name determination submodule is used to determine the brand name in the text to be recognized according to the probability that the segmented words in the text to be recognized belong to the brand name.
[0173] In one example, the probability determination submodule includes:
[0174] The weight acquisition submodule is used to acquire the preset weight of each preset database; wherein the preset weight represents the reliability of the database retrieval data;
[0175] The probability determination submodule is used to determine the probability that the segmented words in the text to be identified belong to the brand name according to the search results corresponding to each preset database and the preset weights of each preset database.
[0176] In one example, the probability determination submodule is specifically used to:
[0177] According to the search result corresponding to the preset database and the preset weight of the preset database, the credibility value of the preset database is obtained; wherein the credibility value of the database represents the product between the search result corresponding to the database and the preset weight;
[0178] According to the credibility values of the preset databases, the probability that the segmented words in the to-be-recognized text belong to the brand name is determined.
[0179] In one example, the probability determination submodule is specifically used to:
[0180] Adding the credibility values of each preset database to obtain a sum of the credibility values;
[0181] Through a preset embedding layer, vector representation is performed on the word segmentation in the to-be-recognized text to obtain vector data corresponding to the word segmentation in the to-be-recognized text;
[0182] The sum of the credibility values and the vector data corresponding to the word segment in the text to be recognized are input into a preset network layer for feature extraction processing to obtain the probability that the word segment in the text to be recognized belongs to the brand name.
[0183] In one example, the name identifies the submodule, specifically for:
[0184] If the probability that the segmented word in the to-be-recognized text belongs to a brand name is greater than a preset probability threshold, determining the segmented word in the to-be-recognized text as a target segmented word;
[0185] The brand name in the text to be recognized is determined according to the text arrangement order of the target segmented words in the text to be recognized.
[0186] In one example, the result determination unit 803 includes:
[0187] A semantic analysis module, used to perform semantic analysis on the text to be recognized to obtain a semantic analysis result;
[0188] A result search module is used to search for search results corresponding to the brand name in the text to be identified from a preset target library according to the semantic analysis result; wherein the target library is one of the preset multiple databases.
[0189] In one example, it also includes:
[0190] A speech text pushing unit is used to push a preset default speech text to the user if it is determined that there is no search result corresponding to the brand name in the text to be identified in the target library.
[0191] Fig. 9 The structural block diagram of a training device based on a brand name recognition model provided by an embodiment of the present disclosure. For the convenience of explanation, only the parts related to the embodiment of the present disclosure are shown. Fig. 9 The training device 900 based on the brand name recognition model includes: a data set acquisition unit 901, a probability prediction unit 902 and a model training unit 903.
[0192] The data set acquisition unit 901 is used to acquire a pre-collected data set to be trained; wherein the data set to be trained includes a text to be trained and a preset label of each segmentation in the text to be trained, and the preset label indicates whether the segmentation belongs to a brand name;
[0193] The probability prediction unit 902 is used to obtain the prediction probability of each word in the text to be trained based on the brand information in multiple preset databases and the preset initial model; wherein the multiple preset databases represent multiple channels for data retrieval processing, the brand information represents information related to the brand, and the prediction probability represents the predicted probability that the word in the text to be trained belongs to the brand name;
[0194] A model training unit 903 is used to perform model training according to the predicted probability of each segmentation in the text to be trained and the preset label of each segmentation in the text to be trained, so as to obtain a trained brand name recognition model;
[0195] The brand name recognition model is used to determine the brand name in the text to be recognized based on the text to be recognized.
[0196] In one example, the probability prediction unit 902 includes:
[0197] A text retrieval module, used to perform retrieval processing on the text to be trained according to brand information in a plurality of preset databases, and obtain a retrieval result of each preset database for the text to be trained; wherein the retrieval result indicates whether information related to the text to be trained is retrieved;
[0198] The probability prediction module is used to input the text to be trained and the search results of the text to be trained in each preset database into a preset initial model to obtain the prediction probability of each word in the text to be trained.
[0199] In one example, a text retrieval module includes:
[0200] A text retrieval submodule, used to perform retrieval processing on the text to be trained according to brand information in a plurality of preset databases, and obtain a retrieval data set corresponding to each preset database; wherein the retrieval data set represents a collection of retrieved information related to the text to be trained;
[0201] The result determination submodule is used to determine the search result of the preset database for the training text according to the search data set corresponding to the preset database.
[0202] In one example, the result determination submodule is specifically used to:
[0203] Performing data cleaning processing on the data in the search data set corresponding to each of the preset databases to obtain a cleaned search data set corresponding to the preset database;
[0204] According to the cleaned retrieval data set corresponding to the preset database, the retrieval result of the preset database for the training text is determined.
[0205] In one example, the probability prediction module includes:
[0206] A text segmentation submodule, used to perform segmentation processing on the text to be trained through a preset initial model to obtain multiple segmentations in the text to be trained;
[0207] The weight acquisition submodule is used to acquire the preset weight of each preset database; wherein the preset weight represents the reliability of the database retrieval data;
[0208] The probability prediction submodule is used to determine the prediction probability of each word in the text to be trained based on the preset initial model according to the search results of the text to be trained in each preset database and the preset weights of each preset database.
[0209] In one example, the model training unit 903 includes:
[0210] A loss value determination module, used to determine the loss value based on a preset loss function according to the preset weights of each preset database, the predicted probability of each segmentation in the text to be trained, and the preset label of each segmentation in the text to be trained;
[0211] The model training module is used to obtain a trained brand name recognition model if it is determined that the loss value meets a preset training completion condition.
[0212] Fig.10 A structural block diagram of an electronic device provided in an embodiment of the present disclosure, such as Fig.10 As shown, the electronic device 1000 includes: at least one processor 1002; and a memory 1001 communicatively connected to the at least one processor 1002; wherein the memory stores instructions executable by the at least one processor 1002, and the instructions are executed by the at least one processor 1002 so that the at least one processor 1002 can execute the brand name-based data processing method and model training method disclosed in the present invention.
[0213] The electronic device 1000 further includes a receiver 1003 and a transmitter 1004. The receiver 1003 is used to receive instructions and data sent by other devices, and the transmitter 1004 is used to send instructions and data to external devices.
[0214] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0215] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.
[0216] Fig.11 A schematic block diagram of an example electronic device 1100 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0217] like Fig.11 As shown, the device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1102 or a computer program loaded from a storage unit 1108 into a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the device 1100 can also be stored. The computing unit 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0218] A number of components in the device 1100 are connected to the I / O interface 1105, including: an input unit 1106, such as a keyboard, a mouse, etc.; an output unit 1107, such as various types of displays, speakers, etc.; a storage unit 1108, such as a disk, an optical disk, etc.; and a communication unit 1109, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1109 allows the device 1100 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0219] The computing unit 1101 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1101 performs the various methods and processes described above, such as data processing methods based on brand names and training methods for models. For example, in some embodiments, data processing methods based on brand names and training methods for models may be implemented as computer software programs, which are tangibly included in machine-readable media, such as storage units 1108. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1100 via ROM 1102 and / or communication unit 1109. When the computer program is loaded into RAM 1103 and executed by the computing unit 1101, one or more steps of the data processing method based on brand names and the training method for models described above may be performed. Alternatively, in other embodiments, the computing unit 1101 may be configured in any other appropriate manner (eg, by means of firmware) to execute the brand name-based data processing method and the model training method.
[0220] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0221] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0222] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0223] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0224] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0225] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0226] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0227] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A data processing method based on brand name, comprising: Acquire a text to be recognized input by a user; wherein the text to be recognized includes a brand name, and the text to be recognized represents the user's search demand for the brand corresponding to the brand name; Determine the brand name in the text to be identified based on brand information in a plurality of preset databases; wherein the plurality of preset databases represent a plurality of channels for data retrieval processing, and the brand information represents information related to the brand; According to the brand name in the text to be recognized, a search result corresponding to the text to be recognized is determined.
2. The method according to claim 1, wherein: The step of determining the brand name in the to-be-recognized text according to the brand information in a plurality of preset databases includes: According to the brand information in the preset database, the text to be recognized is searched and processed to obtain the search results corresponding to each preset database; wherein the search results indicate whether the information related to the text to be recognized is retrieved; The brand name in the text to be recognized is determined according to the search results corresponding to each preset database.
3. The method according to claim 2, wherein: The step of determining the brand name in the text to be identified according to the search results corresponding to each preset database includes: Performing word segmentation processing on the text to be recognized to obtain multiple word segments in the text to be recognized; Determining the probability that the segmented word in the to-be-recognized text belongs to a brand name according to the search results corresponding to each preset database; The brand name in the text to be recognized is determined according to the probability that the segmented word in the text to be recognized belongs to the brand name.
4. The method according to claim 3, wherein: The determining, based on the search results corresponding to each preset database, the probability that the segmented word in the to-be-recognized text belongs to the brand name includes: Obtaining a preset weight of each preset database; wherein the preset weight represents the reliability of the database retrieval data; The probability that the segmented word in the to-be-recognized text belongs to a brand name is determined according to the search results corresponding to each preset database and the preset weight of each preset database.
5. The method according to claim 4, wherein: The determining, based on the search results corresponding to each preset database and the preset weight of each preset database, the probability that the segmented word in the to-be-recognized text belongs to the brand name includes: According to the search result corresponding to the preset database and the preset weight of the preset database, the credibility value of the preset database is obtained; wherein the credibility value of the database represents the product between the search result corresponding to the database and the preset weight; According to the credibility values of the preset databases, the probability that the segmented words in the to-be-recognized text belong to the brand name is determined.
6. The method according to claim 5, wherein: Determining the probability that the segmented word in the to-be-recognized text belongs to the brand name according to the credibility values of each preset database includes: Adding the credibility values of each preset database to obtain a sum of the credibility values; Through a preset embedding layer, vector representation is performed on the word segmentation in the to-be-recognized text to obtain vector data corresponding to the word segmentation in the to-be-recognized text; The sum of the credibility values and the vector data corresponding to the word segment in the text to be recognized are input into a preset network layer for feature extraction processing to obtain the probability that the word segment in the text to be recognized belongs to the brand name.
7. The method according to any one of claims 3 to 6, wherein: The step of determining the brand name in the text to be recognized according to the probability that the segmented word in the text to be recognized belongs to the brand name includes: If the probability that the segmented word in the to-be-recognized text belongs to a brand name is greater than a preset probability threshold, determining the segmented word in the to-be-recognized text as a target segmented word; The brand name in the text to be recognized is determined according to the text arrangement order of the target segmented words in the text to be recognized.
8. The method according to any one of claims 1 to 7, wherein: The step of determining the search result corresponding to the text to be recognized according to the brand name in the text to be recognized includes: Performing semantic analysis on the text to be recognized to obtain a semantic analysis result; According to the semantic analysis result, a search result corresponding to the brand name in the text to be recognized is searched from a preset target library; wherein the target library is one of a plurality of preset databases.
9. The method according to claim 8, further comprising: If it is determined that there is no search result corresponding to the brand name in the text to be identified in the target library, a preset default speech text is pushed to the user.
10. A training method based on a brand name recognition model, comprising: Acquire a pre-collected data set to be trained; wherein the data set to be trained includes a text to be trained and a preset label of each segmentation in the text to be trained, and the preset label indicates whether the segmentation belongs to a brand name; According to the brand information in a plurality of preset databases, based on a preset initial model, a prediction probability of each word segment in the text to be trained is obtained; wherein the plurality of preset databases represent multiple channels for data retrieval processing, the brand information represents information related to the brand, and the prediction probability represents the probability that the predicted word segment in the text to be trained belongs to the brand name; Performing model training according to the predicted probability of each word segment in the text to be trained and the preset label of each word segment in the text to be trained to obtain a trained brand name recognition model; The brand name recognition model is used to determine the brand name in the text to be recognized based on the text to be recognized in any one of claims 1-9.
11. The method according to claim 10, wherein: The step of obtaining the prediction probability of each word in the text to be trained based on the brand information in the plurality of preset databases and the preset initial model includes: According to the brand information in a plurality of preset databases, the text to be trained is searched and processed to obtain the search result of each preset database for the text to be trained; wherein the search result indicates whether the information related to the text to be trained is retrieved; The text to be trained and the search results of the preset databases for the text to be trained are input into a preset initial model to obtain the prediction probability of each word in the text to be trained.
12. The method according to claim 11, wherein: The searching and processing of the text to be trained is performed according to the brand information in the plurality of preset databases to obtain the search result of the text to be trained in each preset database, including: According to the brand information in a plurality of preset databases, the text to be trained is searched and processed to obtain a search data set corresponding to each preset database; wherein the search data set represents a collection of retrieved information related to the text to be trained; According to the search data set corresponding to the preset database, the search result of the preset database for the training text is determined.
13. The method according to claim 12, wherein: The step of determining the search result of the preset database for the training text according to the search data set corresponding to the preset database includes: Performing data cleaning processing on the data in the search data set corresponding to each of the preset databases to obtain a cleaned search data set corresponding to the preset database; According to the cleaned retrieval data set corresponding to the preset database, the retrieval result of the preset database for the training text is determined.
14. The method according to any one of claims 11 to 13, wherein: The step of inputting the text to be trained and the search result of the preset database on the text to be trained into a preset initial model to obtain the prediction probability of each word in the text to be trained includes: Performing word segmentation processing on the text to be trained by using a preset initial model to obtain multiple word segments in the text to be trained; Obtaining a preset weight of each preset database; wherein the preset weight represents the reliability of the database retrieval data; According to the search results of the to-be-trained text in each preset database and the preset weights of each preset database, the prediction probability of each word segment in the to-be-trained text is determined based on the preset initial model.
15. The method according to claim 14, wherein: The method of performing model training according to the predicted probability of each word segment in the text to be trained and the preset label of each word segment in the text to be trained to obtain a trained brand name recognition model includes: Determine the loss value based on the preset loss function according to the preset weights of the preset databases, the predicted probability of each word in the text to be trained, and the preset label of each word in the text to be trained; If it is determined that the loss value meets the preset training completion condition, a trained brand name recognition model is obtained.
16. A data processing device based on a brand name, comprising: A text acquisition unit, used to acquire the text to be recognized input by the user; wherein the text to be recognized includes a brand name, and the text to be recognized represents the user's search demand for the brand corresponding to the brand name; A name determination unit, configured to determine the brand name in the to-be-recognized text according to brand information in a plurality of preset databases; wherein the plurality of preset databases represent a plurality of channels for data retrieval processing, and the brand information represents information related to the brand; The result determination unit is used to determine the search result corresponding to the text to be recognized according to the brand name in the text to be recognized.
17. The device according to claim 16, wherein: The name determination unit comprises: An information retrieval module, used to perform retrieval processing on the text to be recognized according to the brand information in the preset database, and obtain the retrieval result corresponding to each preset database; wherein the retrieval result indicates whether the information related to the text to be recognized is retrieved; The name determination module is used to determine the brand name in the text to be identified according to the search results corresponding to each preset database.
18. The device according to claim 17, wherein: The name determination module comprises: A word segmentation submodule, used for performing word segmentation processing on the text to be recognized to obtain a plurality of word segments in the text to be recognized; A probability determination submodule, for determining the probability that the segmented word in the to-be-recognized text belongs to a brand name according to the search results corresponding to each preset database; The name determination submodule is used to determine the brand name in the text to be recognized according to the probability that the segmented words in the text to be recognized belong to the brand name.
19. The device according to claim 18, wherein: The probability determination submodule includes: The weight acquisition submodule is used to acquire the preset weight of each preset database; wherein the preset weight represents the reliability of the database retrieval data; The probability determination submodule is used to determine the probability that the segmented words in the text to be identified belong to the brand name according to the search results corresponding to each preset database and the preset weights of each preset database.
20. The device according to claim 19, wherein The probability determination submodule is specifically used for: According to the search result corresponding to the preset database and the preset weight of the preset database, the credibility value of the preset database is obtained; wherein the credibility value of the database represents the product between the search result corresponding to the database and the preset weight; According to the credibility values of the preset databases, the probability that the segmented words in the to-be-recognized text belong to the brand name is determined.
21. The device according to claim 20, wherein: The probability determination submodule is specifically used for: Adding the credibility values of each preset database to obtain a sum of the credibility values; Through a preset embedding layer, vector representation is performed on the word segmentation in the to-be-recognized text to obtain vector data corresponding to the word segmentation in the to-be-recognized text; The sum of the credibility values and the vector data corresponding to the word segment in the text to be recognized are input into a preset network layer for feature extraction processing to obtain the probability that the word segment in the text to be recognized belongs to the brand name.
22. The device according to any one of claims 18 to 21, wherein: The name determination submodule is specifically used for: If the probability that the segmented word in the to-be-recognized text belongs to a brand name is greater than a preset probability threshold, determining the segmented word in the to-be-recognized text as a target segmented word; The brand name in the text to be recognized is determined according to the text arrangement order of the target segmented words in the text to be recognized.
23. The device according to any one of claims 16 to 22, wherein: The result determination unit comprises: A semantic analysis module, used to perform semantic analysis on the text to be recognized to obtain a semantic analysis result; A result search module is used to search for search results corresponding to the brand name in the text to be identified from a preset target library according to the semantic analysis result; wherein the target library is one of the preset multiple databases.
24. The apparatus according to claim 23, further comprising: A speech text pushing unit is used to push a preset default speech text to the user if it is determined that there is no search result corresponding to the brand name in the text to be identified in the target library.
25. A training device based on a brand name recognition model, comprising: A data set acquisition unit, used to acquire a pre-collected data set to be trained; wherein the data set to be trained includes a text to be trained and a preset label of each segmentation in the text to be trained, and the preset label indicates whether the segmentation belongs to a brand name; A probability prediction unit is used to obtain the prediction probability of each word segment in the text to be trained based on the brand information in multiple preset databases and based on a preset initial model; wherein the multiple preset databases represent multiple channels for data retrieval processing, the brand information represents information related to the brand, and the prediction probability represents the predicted probability that the word segment in the text to be trained belongs to the brand name; A model training unit, used to perform model training according to the predicted probability of each segmentation in the text to be trained and the preset label of each segmentation in the text to be trained, so as to obtain a trained brand name recognition model; The brand name recognition model is used to determine the brand name in the text to be recognized based on the text to be recognized in any one of claims 16-22.
26. The device according to claim 25, wherein The probability prediction unit comprises: A text retrieval module, used to perform retrieval processing on the text to be trained according to brand information in a plurality of preset databases, and obtain a retrieval result of each preset database for the text to be trained; wherein the retrieval result indicates whether information related to the text to be trained is retrieved; The probability prediction module is used to input the text to be trained and the search results of the text to be trained in each preset database into a preset initial model to obtain the prediction probability of each word in the text to be trained.
27. The device according to claim 26, wherein: The text retrieval module comprises: A text retrieval submodule, used to perform retrieval processing on the text to be trained according to brand information in a plurality of preset databases, and obtain a retrieval data set corresponding to each preset database; wherein the retrieval data set represents a collection of retrieved information related to the text to be trained; The result determination submodule is used to determine the search result of the preset database for the training text according to the search data set corresponding to the preset database.
28. The device according to claim 27, wherein The result determination submodule is specifically used for: Performing data cleaning processing on the data in the search data set corresponding to each of the preset databases to obtain a cleaned search data set corresponding to the preset database; According to the cleaned retrieval data set corresponding to the preset database, the retrieval result of the preset database for the training text is determined.
29. The device according to any one of claims 26 to 28, wherein: The probability prediction module comprises: A text segmentation submodule, used to perform segmentation processing on the text to be trained through a preset initial model to obtain multiple segmentations in the text to be trained; The weight acquisition submodule is used to acquire the preset weight of each preset database; wherein the preset weight represents the reliability of the database retrieval data; The probability prediction submodule is used to determine the prediction probability of each word in the text to be trained based on the preset initial model according to the search results of the text to be trained in each preset database and the preset weights of each preset database.
30. The device according to claim 29, wherein: The model training unit comprises: A loss value determination module, used to determine the loss value based on a preset loss function according to the preset weights of each preset database, the predicted probability of each segmentation in the text to be trained, and the preset label of each segmentation in the text to be trained; The model training module is used to obtain a trained brand name recognition model if it is determined that the loss value meets a preset training completion condition.
31. An electronic device, wherein: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9 or 10-15.
32. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-9 or 10-15.
33. A computer program product, wherein: The invention comprises a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 9 or 10 to 15.
Citation Information
Patent Citations
Data search device, data search method and program
CN102893280A
Search result display method and device, medium and electronic device
CN110597962A
Data identification method and device and computer readable storage medium
CN111061840A
Search method and device based on search terms, equipment, medium and program product
CN114417116A
Shop brand identification method and device
CN114817359A
