Keyword recognition method, device and equipment and computer storage medium
By inputting the text to be identified into the trained keyword recognition model and combining the preset keyword set for recognition for recognition, the problem of low keyword recognition accuracy in the prior art is solved, and the recognition accuracy is improved through feedback optimization. Effect.
Patent Information
- Application Number
- CN202411440968.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, the accuracy of keyword recognition is low, making it difficult to determine the different meanings of keywords in specific scenarios or group communication.
By obtaining the text to be recognized and inputting it into the trained keyword recognition model, and combining the preset keyword set, keyword recognition processing is performed on the text to be recognized. If the recognition result hits keywords that exceed the preset number threshold, the recognition result will be sent to the target user for review, and the keyword recognition model and keyword set will be optimized and adjusted based on the feedback information.
The accuracy of keyword recognition is improved, and the accuracy of recognition is gradually improved through feedback optimization of the model and keyword set.
Smart Images

Figure CN119476276A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device and equipment for keyword recognition and a computer storage medium. Background Art
[0002] With the continuous development and popularization of Internet technology, the technology of network text keyword detection has also emerged. This technology aims to maintain the clarity of cyberspace and ensure information security. It mainly uses artificial intelligence, big data analysis and other technical means to identify and filter keywords in text, pictures, videos and other content on the network platform. This technology is widely used in social media, forums, live broadcast platforms and other scenarios to purify the network environment and protect information security.
[0003] In related technologies, some certain, high-frequency keywords can be identified through various technologies, and the identified keywords are generally blocked using network technologies. However, due to the diversity of words, combined with the fact that they may have different meanings when they appear in specific scenarios or in specific group communications, it is often difficult to determine whether they are keywords during keyword recognition, resulting in low accuracy in keyword recognition.
[0004] Therefore, a new keyword recognition method is needed to improve the accuracy of keyword recognition. Summary of the invention
[0005] The embodiments of the present application provide a method, apparatus, device and computer storage medium for keyword recognition, so as to improve the accuracy of keyword recognition.
[0006] In a first aspect, an embodiment of the present application provides a method for keyword recognition, comprising:
[0007] Obtaining a text to be recognized, and inputting the text to be recognized into a trained keyword recognition model;
[0008] Through the keyword recognition model, combined with a preset keyword set, the text to be recognized is subjected to keyword recognition processing to obtain a corresponding recognition result; wherein the recognition result represents: the distribution of each keyword in the keyword set in the text to be recognized;
[0009] When the recognition result indicates that the text to be recognized hits more than a preset number of keywords, the recognition result is sent to a target user, so that the target user reviews the recognition result based on the recognition result and the text to be recognized, and returns corresponding feedback information;
[0010] Based on the feedback information and the recognition result, the keyword recognition model and the keyword set are optimized and adjusted.
[0011] Optionally, obtaining the text to be recognized includes:
[0012] Based on a preset time interval, continuously obtaining raw text from at least one data source;
[0013] For each piece of text to be processed in the obtained original text, perform the following operations:
[0014] Performing word segmentation processing on the text to be processed to obtain at least one corresponding word segmentation result;
[0015] Performing part-of-speech tagging for each of the at least one word segmentation result obtained, and obtaining a part-of-speech identifier corresponding to each word segmentation result;
[0016] Based on the at least one word segmentation result and the part-of-speech identifier corresponding to each word segmentation result, the at least one word segmentation result is converted into at least one corresponding word vector, and the at least one word vector obtained is used as the text to be recognized.
[0017] Optionally, the keyword recognition model is combined with a preset keyword set to perform keyword detection processing on the text to be recognized to obtain a corresponding recognition result, including:
[0018] Using the keyword recognition model, identifying the position information corresponding to each keyword in the keyword set in the text to be recognized, and obtaining a corresponding recognition result;
[0019] Among them, the keyword recognition model is obtained after multiple rounds of iterative training to meet preset evaluation indicators; the evaluation indicators include one or more of the following: a first evaluation threshold corresponding to the accuracy of the keyword recognition model, a second evaluation threshold corresponding to the precision, a third evaluation threshold corresponding to the recall rate, and a fourth evaluation threshold corresponding to the harmonic mean result of the precision and recall rate.
[0020] Optionally, optimizing and adjusting the keyword recognition model and the keyword set based on the feedback information and the recognition result includes:
[0021] When it is determined based on the feedback information that there are keywords with recognition errors in the recognition result, or when it is determined based on the feedback information that keywords hit by the text to be recognized are omitted in the recognition result, adjusting model parameters of the keyword recognition model based on the feedback information, and adjusting keywords in the keyword set;
[0022] After optimizing and adjusting the keyword recognition model and the keyword set, the method further includes:
[0023] Based on the adjusted keyword recognition model and in combination with the adjusted keyword set, keyword recognition processing is performed on the acquired new text to be recognized.
[0024] Optionally, after obtaining the corresponding recognition result, the method further includes:
[0025] When the recognition result indicates that the keywords hit by the to-be-recognized text meet at least one of the preset warning conditions, based on the recognition result, corresponding warning information is generated, and a level identifier is set for the warning information; wherein the level identifier corresponds to the level of the warning condition;
[0026] Based on the level identifier of the alarm information and the publishing channel corresponding to the level identifier, the alarm information is sent to a target publishing channel, and the sending time and receiving information of the alarm information are obtained.
[0027] In a second aspect, an embodiment of the present application provides a device for keyword recognition, including:
[0028] An acquisition module, used for acquiring text to be recognized and inputting the text to be recognized into a trained keyword recognition model;
[0029] A recognition module, used to perform keyword recognition processing on the text to be recognized by combining the keyword recognition model with a preset keyword set, and obtain a corresponding recognition result; wherein the recognition result represents: the distribution of each keyword in the keyword set in the text to be recognized;
[0030] A sending module, configured to send the recognition result to a target user when the recognition result indicates that the text to be recognized hits more than a preset number of keywords, so that the target user can review the recognition result based on the recognition result and the text to be recognized, and return corresponding feedback information;
[0031] A processing module is used to optimize and adjust the keyword recognition model and the keyword set based on the feedback information and the recognition result.
[0032] Optionally, when the acquisition module is used to acquire the text to be recognized, it is specifically used to:
[0033] Based on a preset time interval, continuously obtaining raw text from at least one data source;
[0034] For each piece of text to be processed in the obtained original text, perform the following operations:
[0035] Performing word segmentation processing on the text to be processed to obtain at least one corresponding word segmentation result;
[0036] Performing part-of-speech tagging for each of the at least one word segmentation result obtained, and obtaining a part-of-speech identifier corresponding to each word segmentation result;
[0037] Based on the at least one word segmentation result and the part-of-speech identifier corresponding to each word segmentation result, the at least one word segmentation result is converted into at least one corresponding word vector, and the at least one word vector obtained is used as the text to be recognized.
[0038] Optionally, the recognition module is used to perform keyword detection processing on the text to be recognized by using the keyword recognition model in combination with a preset keyword set, and when obtaining a corresponding recognition result, is specifically used to:
[0039] Using the keyword recognition model, identifying the position information corresponding to each keyword in the keyword set in the text to be recognized, and obtaining a corresponding recognition result;
[0040] Among them, the keyword recognition model is obtained after multiple rounds of iterative training to meet preset evaluation indicators; the evaluation indicators include one or more of the following: a first evaluation threshold corresponding to the accuracy of the keyword recognition model, a second evaluation threshold corresponding to the precision, a third evaluation threshold corresponding to the recall rate, and a fourth evaluation threshold corresponding to the harmonic mean result of the precision and recall rate.
[0041] Optionally, when the processing module is used to optimize and adjust the keyword recognition model and the keyword set based on the feedback information and the recognition result, it is specifically used to:
[0042] When it is determined based on the feedback information that there are keywords with recognition errors in the recognition result, or when it is determined based on the feedback information that keywords hit by the text to be recognized are omitted in the recognition result, adjusting model parameters of the keyword recognition model based on the feedback information, and adjusting keywords in the keyword set;
[0043] After optimizing and adjusting the keyword recognition model and the keyword set, the processing module is further used to:
[0044] Based on the adjusted keyword recognition model and in combination with the adjusted keyword set, keyword recognition processing is performed on the acquired new text to be recognized.
[0045] Optionally, the device further comprises: an early warning module, configured to generate corresponding warning information based on the recognition result and set a level identifier for the warning information when the recognition result indicates that the keyword hit by the to-be-recognized text satisfies at least one warning condition in a preset early warning condition set; wherein the level identifier corresponds to the level of the early warning condition;
[0046] Based on the level identifier of the alarm information and the publishing channel corresponding to the level identifier, the alarm information is sent to a target publishing channel, and the sending time and receiving information of the alarm information are obtained.
[0047] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor executes the instructions stored in the memory, so that the at least one processor executes the method described in the first aspect or any optional embodiment of the first aspect.
[0048] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which is used to store instructions. When the instructions are executed, the method in the first aspect or any optional implementation of the first aspect is implemented.
[0049] In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions, wherein the computer program product stores instructions that, when executed on a computer, enable the computer to execute the method described in the first aspect or any optional implementation of the first aspect.
[0050] The beneficial effects of this application are as follows:
[0051] In this scheme, after obtaining the text to be recognized, keyword recognition is performed on the text to be recognized through the keyword recognition model in combination with the keyword set. A large amount of text to be recognized can be quickly recognized and processed, and then the corresponding keyword recognition results are obtained. The recognition results characterize the distribution of each keyword in the keyword set in the text to be recognized.
[0052] When the recognition result indicates that the text to be recognized hits more than a preset number of keywords, the recognition result can be sent to the target user, so that the target user can review the recognition result and return corresponding feedback information, which can indicate the accuracy of the recognition result, the efficiency of the keyword recognition model, and other information. Therefore, using the feedback information and recognition results, the keyword recognition model and keyword set can be optimized and adjusted accordingly. In this way, by using the feedback information on the recognition results, the keyword recognition model and keyword set can be continuously optimized and adjusted, and feedback adjustment information can be continuously provided to the model, so that the keyword recognition model can further improve its accuracy in keyword recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0054] Figure 1 A schematic diagram of possible application scenarios provided for embodiments of the present application;
[0055] Figure 2 A schematic diagram of the training process of the keyword recognition model provided in the embodiment of the present application;
[0056] Figure 3 A flowchart of a keyword recognition method provided in an embodiment of the present application;
[0057] Figure 4 A flowchart of a method for obtaining text to be recognized provided in an embodiment of the present application;
[0058] Figure 5 A schematic diagram of a presentation format of text data provided in an embodiment of the present application;
[0059] Figure 6 A schematic diagram of keyword distribution provided in an embodiment of the present application;
[0060] Figure 7 A flowchart of a method for issuing alarm information provided in an embodiment of the present application;
[0061] Figure 8 A schematic diagram of the structure of a keyword recognition device provided in an embodiment of the present application;
[0062] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.
[0064] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.
[0065] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0066] In the technical solution of this application, the acquisition, transmission, storage, and use of data are in compliance with the requirements of relevant national laws and regulations.
[0067] With the continuous development and popularization of Internet technology, the information presented to the public in cyberspace has exploded. In order to maintain the clarity of cyberspace and ensure information security, it is necessary to perform corresponding keyword recognition operations on the information content displayed to the public in cyberspace. It mainly uses artificial intelligence, big data analysis and other technical means to identify and filter keywords in text, pictures, videos and other content on the network platform. This technology is widely used in social media, forums, live broadcast platforms and other scenarios to purify the network environment and protect information security.
[0068] In related technologies, some certain, high-frequency keywords can be identified through various technologies, and the identified keywords are generally blocked using network technologies. However, due to the diversity of words, combined with the fact that they may have different meanings when they appear in specific scenarios or in specific group communications, it is often difficult to determine whether they are keywords during keyword recognition, resulting in low accuracy in keyword recognition.
[0069] In view of this, the present application proposes a method for keyword recognition, which inputs the acquired text to be recognized into a trained keyword recognition model, uses the keyword recognition model in combination with a preset keyword set, performs keyword recognition processing on the text to be recognized, and obtains corresponding recognition results to characterize the distribution of each keyword in the keyword set in the text to be recognized. In this way, keyword recognition processing can be quickly performed on a large amount of text to obtain whether there are keywords in the keyword set in the text to be recognized, and determine their corresponding distribution.
[0070] When the recognition result indicates that the text to be recognized hits more than a preset number of keywords, the result to be recognized can be sent to the target user, so that the target user can review the recognition result based on the recognition result and the text to be recognized, and return corresponding feedback information. In this way, the keyword recognition model and the keyword set can be optimized and adjusted based on the feedback information and the recognition result. In this way, the accuracy of the recognition result is determined based on the feedback information of the target user on the recognition result, and then the keyword recognition model and the keyword set are optimized and adjusted based on the feedback information. The keyword recognition model and the keyword set can be adjusted synchronously during the application process, so that the keyword recognition model can gradually improve the accuracy of keyword recognition during the application process.
[0071] After completing the introduction of the main inventive ideas of the embodiments of the present application, the specific implementation of the method for keyword recognition proposed in the embodiments of the present application will be introduced below through some specific embodiments and drawings.
[0072] The following briefly introduces the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In the specific implementation process, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.
[0073] See also Figure 1 , which is a schematic diagram of a possible application scenario provided in an embodiment of the present application. In this scenario, a terminal device 101 and a server 102 may be included.
[0074] The terminal device 101 may be a mobile phone, a tablet computer (PAD), a personal computer (PC), a wearable device, a vehicle-mounted terminal, etc. The server 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0075] The terminal device 101 and the server 102 may be directly or indirectly connected to each other through one or more communication networks 103. The communication network 103 may be a wired network or a wireless network, for example, a mobile cellular network or a wireless fidelity (Wireless-Fidelity, WIFI) network, or other possible networks, which are not limited in the embodiment of the present invention.
[0076] It should be noted that the keyword recognition method in the embodiment of the present application can be executed by a computer device, which can be a terminal device 101 or a server 102. For example, when the keyword recognition method is performed by the server 102, the server can obtain the corresponding text to be recognized by using the terminal device connected to the server itself, and then input the text to be recognized into the keyword recognition model deployed in the server. In this way, through the keyword recognition model, combined with the preset keyword set, the text to be recognized can be recognized accordingly. When the recognition result represents that the text to be recognized hits more than the preset number threshold of keywords, the server can send the recognition result to the target user, so that the target user reviews the recognition result based on the recognition result and the text to be recognized, and returns the corresponding feedback information. In this way, the server optimizes and adjusts the keyword recognition model and the keyword set according to the review content of the recognition result in the feedback information, so that the keyword recognition model can improve the accuracy of keyword recognition through multiple application adjustments during the application process.
[0077] It should be noted that Figure 1 What is shown is just an example. In fact, the number and communication mode of terminal devices and servers are not limited and are not specifically limited in the embodiments of the present application.
[0078] The following describes the keyword recognition method provided by the exemplary embodiment of the present application in combination with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the implementation of the present application is not limited in this respect.
[0079] When introducing the keyword recognition method provided in the embodiment of the present application, it is first necessary to introduce the training process of the keyword recognition model used to execute the keyword recognition method.
[0080] See also Figure 2 , is a training flow chart of the keyword recognition model provided in the embodiment of the present application, which includes the following steps:
[0081] Step S201: Obtain samples to be processed, each of which includes different sample texts and a true label corresponding to each sample text.
[0082] Exemplarily, before training the keyword recognition model, a corresponding keyword set is pre-set, and the keyword set includes at least one restricted public word, character, etc. Then, in a sample to be processed, the sample text may contain at least one keyword in the keyword set or may not contain any keyword. Regardless of whether the sample to be processed contains keywords or does not contain keywords, there are corresponding true labels to characterize the situation in which the sample contains keywords. For example, the true label corresponding to the sample to be processed that contains a keyword can characterize that the sample to be processed contains the keyword, and the specific meaning and location information of the keyword, while the true label corresponding to the sample to be processed that does not contain the keyword can characterize that the processed sample does not contain the keyword.
[0083] On the other hand, with regard to the acquisition of the text to be processed, it is possible to directly obtain some text to be processed that has been annotated with real labels, or it is possible to directly obtain some original text and then manually annotate it to obtain the above-mentioned text to be processed. This application does not impose any restrictions on this.
[0084] Step S202: Using the model to be trained in this round of iteration, perform keyword recognition on the samples to be processed in this round of iteration to obtain sample recognition results for each sample to be processed.
[0085] In the embodiment of the present application, in each round of iterative training, all samples to be processed can be used as the input of this round, or part of the samples to be processed can be extracted as the input of this round. The process of keyword recognition will be described in detail later, so it will not be described in detail here.
[0086] Step S203: Based on the sample recognition result of each sample to be processed and the corresponding true label, determine the model loss value of the model to be trained in this iteration.
[0087] In a possible implementation, the model loss value may be calculated using any possible loss function, such as a cross entropy loss function, whose formula is: Among them, y represents the true label, y ^ Characterize the prediction probability, or the mean squared error (MSE) loss function, the squared absolute error loss function, the maximum likelihood loss (LHL) function, etc. Of course, it can also be other possible loss functions, and the embodiments of the present application are not limited to this.
[0088] Step S204: Determine whether the model to be trained in this iteration has reached the convergence condition.
[0089] In the embodiment of the present application, the convergence condition may include one or more of the following conditions:
[0090] (1) The number of iterations reaches the set threshold.
[0091] (2) The model loss value is less than the set loss threshold.
[0092] Step S205: If the determination process of step S204 is no, the model parameters are adjusted based on the model loss value.
[0093] In the embodiment of the present application, when the number of iterations does not exceed the preset number threshold, and the model loss value is not less than the set loss threshold, the determination process of step 204 can be determined to be no, that is, it is considered that the current model to be trained does not meet the convergence condition, and the model parameters need to be adjusted to continue training. After the parameter adjustment, the next iterative training process is entered, that is, jumping to step 202.
[0094] In a possible implementation, when the model still does not meet the convergence condition, the model weight parameters can be updated by the gradient descent method, and the training can be continued with the updated model weight parameters.
[0095] When the number of iterations exceeds the preset threshold, or the model loss value is less than the set loss threshold, the determination process of step 204 is yes, that is, it is considered that the current recognition model to be trained has met the convergence conditions, the model training is completed, and the keyword recognition model is obtained.
[0096] In order to verify the effect of the trained keyword recognition model, the embodiment of the present application tests the keyword recognition model using the verification data in the verification set. The verification set can be at least one of the samples to be processed that did not participate in the training process, or other sample data with real labels other than the samples to be processed, which is not limited by the present application.
[0097] If the evaluation index reaches the preset evaluation effect, the recognition model to be trained can be used in the actual keyword recognition process. If the model evaluation fails, training and testing need to be continued until the recognition model to be trained reaches the preset evaluation effect.
[0098] In a possible implementation, during the evaluation process for the model to be identified, corresponding first evaluation thresholds, second evaluation thresholds, third evaluation thresholds, and fourth evaluation thresholds may be set in advance for the accuracy, precision, recall, and F1 score of the model to be identified.
[0099] Among them, accuracy refers to the ratio of the number of correctly identified samples to the total number of samples, and its calculation formula is: Accuracy = (true positive examples + true negative examples) / (true positive examples + true negative examples + false positive examples + false negative examples). In this embodiment of the application, the accuracy corresponds to the first evaluation threshold.
[0100] It should be noted that the true positive examples, true negative examples, false positive examples, and false negative examples mentioned above have the following meanings:
[0101] True Positive (TP), that is, the number of samples correctly predicted as positive;
[0102] True Negative (TN), that is, the number of samples correctly predicted as negative;
[0103] False Positive (FP), that is, the number of samples that are incorrectly predicted to be positive;
[0104] False Negative (FN) refers to the number of samples that are incorrectly predicted as negative.
[0105] Precision refers to the ratio of the number of samples correctly predicted as positive to the total number of samples predicted as positive, and its calculation formula is as follows: Precision = (TP) / (TP+FP). In the embodiment of the present application, the accuracy corresponds to the second evaluation threshold.
[0106] Recall refers to the ratio of the number of samples correctly predicted as positive to the total number of samples that are actually positive. It reflects the ability of the model to capture all positive samples. The calculation formula is as follows: Recall = (TP) / (TP+FN). In this embodiment of the present application, the accuracy rate corresponds to the third evaluation threshold.
[0107] The F1 score refers to the harmonic mean of precision and recall, which comprehensively considers the balance between precision and recall. The higher the F1 score, the more balanced the precision and recall of the model. Specifically, the calculation formula is as follows: F1 score = 2×(precision×recall) / (precision+recall). In the embodiment of the present application, the accuracy corresponds to the fourth evaluation threshold.
[0108] After completing the setting of the evaluation thresholds corresponding to the above indicators, the server can test the training model based on these indicators to determine whether the evaluation thresholds corresponding to the above indicators can be met, or it can also determine whether the weighted sum of the accuracy, precision, recall rate, and F1 score of the model reaches the fifth threshold.
[0109] Furthermore, the models trained in different rounds can be tested based on evaluation indicators respectively, and then the model parameters or training strategies can be adjusted based on the test results. Finally, the model with the best performance can be selected for subsequent deployment.
[0110] Thus, in this method, the server uses the evaluation index to test the model to be trained, which can effectively ensure that the basic accuracy of the keyword recognition model in the keyword recognition process meets the standard, thereby obtaining the corresponding keyword recognition model that can be used.
[0111] After the model training is completed, the trained keyword recognition model can be used to participate in the actual keyword recognition process. The following is an explanation of the keyword recognition process based on the keyword recognition model in conjunction with the accompanying drawings:
[0112] See also Figure 3 , is a flowchart of a keyword recognition method provided in an embodiment of the present application, and the execution subject of the method can be Figure 1 The terminal device and / or server shown in the figure is not limited in this application. For the convenience of subsequent description, the data processing method proposed in this application will be introduced by taking the execution subject as a server as an example.
[0113] like Figure 3 As shown, the specific implementation steps of this method are as follows:
[0114] Step S301: Obtain a text to be recognized, and input the text to be recognized into a trained keyword recognition model.
[0115] When the server obtains the text to be recognized, it can directly obtain it from the input content of the terminal device connected to the server, or from the text, picture or video uploaded to the relevant server. On the other hand, for the text to be recognized, the content included can be all the data directly obtained from the data source, and then the server inputs it into the trained keyword recognition model for subsequent keyword recognition processing, or it can be the original text obtained from the data source, and then the text to be recognized is obtained after some processing, and then input into the trained keyword recognition model.
[0116] In a possible implementation manner, the server may acquire the text to be recognized in the following manner:
[0117] See also Figure 4 , which is a flow chart of a method for obtaining a text to be recognized provided in an embodiment of the present application, such as Figure 4 As shown, the specific implementation steps of this method are as follows:
[0118] Step S401: based on a preset time interval, continuously obtain original text from at least one data source.
[0119] It should be noted that regarding the keyword recognition method executed by the server, during the application process, the execution can be started or ended according to the user's instructions, or the execution can be selected based on the start or end of the system operation, or the execution method can be started or ended according to a preset time point. This application does not impose any restrictions on this.
[0120] While the server is executing the above keyword recognition method, the server may continuously obtain original text from at least one data source based on a preset time interval.
[0121] Exemplarily, after the server starts to execute the keyword recognition method, it can continuously obtain the original text. For example, the server can first determine the target platform and data type of data collection, such as social platforms, forums, public websites, etc. In these target platforms, Figure 5 As shown, the text data included therein, the text information in the picture data, and the text information or voice information in the video, etc., can all be the data that the server needs to collect.
[0122] Secondly, the server can use technical means such as application programming interfaces to continuously capture text data in text, pictures or videos from at least one of the above-mentioned data sources regularly or irregularly according to preset collection strategies and time interval requirements.
[0123] Then, the server performs a preliminary quality check on the collected text data, such as removing duplicate content, filtering out non-text data, etc. The cleaned text data can be stored as original text in a database or data warehouse for further processing by the subsequent server.
[0124] After the server obtains the original text, it can continue to perform the following operations for each piece of text to be processed in the original text:
[0125] Step S402: performing word segmentation processing on the text to be processed, and obtaining at least one corresponding word segmentation result.
[0126] For the text to be processed, the server can segment it in different ways. For example, the server can use the Forward Maximum Matching (FMM) method to scan the text from left to right and match the longest word possible each time. Or, the server can use the Backward Maximum Matching (BMM) method to scan the text from right to left and also match the longest word possible each time. Additionally, the server can use the Bidirectional Maximum Matching (BiMM) method, which combines the forward and backward maximum matching methods and takes the intersection or union of the two to segment the text to be processed, splitting the text into words or phrases and obtaining the corresponding segmentation results.
[0127] Furthermore, the server can also remove high-frequency but meaningless words in the text to be processed, such as "的" (de) and "了" (le), according to a preset stop word list.
[0128] In this way, after the server obtains at least one segmentation result, the server can continue to perform the following operations:
[0129] Step S403: Perform part-of-speech tagging on each of the at least one segmentation results obtained to obtain the corresponding part-of-speech tags for each segmentation result.
[0130] The server can perform part-of-speech tagging on each of the at least one segmentation results obtained, identify words of different parts of speech such as nouns, verbs, and adjectives, and then label these segmentation results with the corresponding part-of-speech tags, so that when converting word vectors later, the server can more accurately distinguish segmentation results with the same characters but different parts of speech.
[0131] Step S404: Based on the at least one segmentation result and the corresponding part-of-speech tag for each segmentation result, convert the at least one segmentation result into the corresponding at least one word vector, and use the obtained at least one word vector as the text to be recognized.
[0132] After the server obtains the segmentation result, it can use a word vector generator to convert the segmentation result into a word vector. The calculation formula for this process is word_vector = f(word), where f is the word vector mapping function and word is a single word. Then, use a sequence encoder to convert the word vector sequence into a format acceptable to the keyword recognition model, including padding or truncating to meet the fixed-length input. Finally, use the at least one word vector obtained after processing as the text to be recognized for use by the keyword recognition model.
[0133] In this way, in this method, after the original text is converted into a word vector, it is input into the keyword recognition model as the text to be recognized, which reduces the steps required to be executed by the keyword recognition model, improves the efficiency of keyword recognition, reduces the training cost of the keyword recognition model, and improves the reliability of the implementation of this solution.
[0134] The above describes various implementation methods for the server to obtain the text to be recognized. After the server obtains the text to be recognized and inputs it into the keyword recognition model, it can continue to perform the following operations:
[0135] Step S302: Using the keyword recognition model and the preset keyword set, the text to be recognized is subjected to keyword recognition processing to obtain corresponding recognition results, wherein the recognition results represent the distribution of each keyword in the keyword set in the text to be recognized.
[0136] First of all, it should be noted that a corresponding keyword set will be set in advance in the server, and the keyword set includes one or more keywords, which are all keywords that are restricted from being disclosed, such as words involving sensitive information, words involving confidential information, or words that need to be paid special attention to, etc. Therefore, for one or more keywords in the keyword set, you can mark their types when setting them, and save and record these keywords in different types.
[0137] On the other hand, in order to ensure that the keywords recorded in the keyword set meet the requirements, the server can regularly detect the keyword set and regularly update the keyword set according to the user's instructions or needs. During the update process, the server can add new keywords to the keyword set, delete keywords that are no longer applicable, or mark different matching paths for the same keywords in the keyword set, etc. Furthermore, the server can also provide query and retrieval functions for the keyword set, so that users can quickly locate corresponding keywords when using the keyword set.
[0138] After clarifying the contents included in the keyword set, step S302 will be further introduced below.
[0139] When the server performs keyword matching processing on the text to be recognized through the keyword recognition model and keyword set to obtain the corresponding recognition results, the server can use the Bidirectional Long Short-Term Memory (BiLSTM) neural network architecture in the keyword recognition model to realize keyword recognition. The BiLSTM neural network architecture is a variant of a time recursive neural network that is specifically used to process sequence data, such as text or time series. BiLSTM processes data by combining forward and backward long short-term memory units to capture past and future information in the sequence. In traditional long short-term memory unit models, information flows only in one direction, from the beginning to the end of the sequence. This limits the model's ability to understand and predict information in the sequence because it can only take into account past information. BiLSTM improves the performance of the model by simultaneously considering the information before and after each time point in the sequence.
[0140] In this way, the keyword recognition model can identify the word meaning information in the text to be recognized from both the forward and backward directions, and use the context information to further clarify the specific meanings of different word segmentation results in the text to be recognized, which can effectively improve the accuracy of the keyword recognition model's semantic understanding.
[0141] When the server recognizes that a keyword in the keyword set is hit in the text to be recognized through the keyword recognition model, the keyword and its corresponding position information in the text to be recognized can be recorded in the recognition result to characterize the distribution of each keyword in the keyword set in the text to be recognized. Figure 6 As shown, for the keywords that are not hit in the text to be recognized, their distribution is that they are not distributed in the text to be recognized, and for the keywords that are hit in the text to be recognized, their distribution will indicate the keywords that are hit in the text to be recognized, the number of times the keyword is hit, and the position information of the keyword in the text to be recognized.
[0142] The above describes how the server obtains the recognition result. After obtaining the recognition result, the server can continue to perform the following operations:
[0143] Step S303: When the recognition result indicates that the text to be recognized hits more than a preset number of keywords, the recognition result is sent to the target user, so that the target user reviews the recognition result based on the recognition result and the text to be recognized, and returns corresponding feedback information.
[0144] After obtaining the recognition result, the server needs to judge whether the text to be recognized represented by the recognition result hits the keyword. When the recognition result represents that the text to be recognized hits the keyword exceeding the preset number threshold, the server can send the recognition result to the target user.
[0145] For example, assuming that the preset quantity threshold is 0, the server needs to send the recognition results corresponding to the text to be recognized that the number of hit keywords is 1 or more to the target user, so that the target user can know that the text to be recognized hits at least one keyword and continue to perform other warnings, restrictions or modifications on the text to be recognized.
[0146] Alternatively, the preset quantity threshold may be other values greater than 0, so that the server will send the corresponding recognition result to the target user only when it determines that the number of hit keywords in the text to be recognized exceeds a certain level.
[0147] When the target user receives the recognition result, in addition to performing corresponding processing operations on the text to be recognized, he can also review the recognition result to determine whether there are misjudged keywords or missing keywords in the recognition result, and then return the corresponding feedback result to the server.
[0148] On the other hand, after the server obtains the recognition result for the text to be recognized, the server may also make a judgment on the recognition result to determine whether the meaning represented by the recognition result needs to be published to inform other users.
[0149] In a possible implementation, after obtaining the corresponding recognition result, the server may further perform the following operations:
[0150] See also Figure 7 , is a flow chart of a method for issuing alarm information provided by an embodiment of the present application, such as Figure 7 As shown, the specific implementation steps of this method are as follows:
[0151] Step S701: When the recognition result indicates that the keywords hit by the text to be recognized meet at least one warning condition in the preset warning condition set, corresponding warning information is generated based on the recognition result, and a level identifier is set for the warning information; wherein the level identifier corresponds to the level of the warning condition.
[0152] In the server, for different situations in the recognition results, a warning condition set can be pre-set, and the warning condition set can include one or more warning conditions, and the warning condition can be: the text to be recognized hits keyword A, or the text to be recognized hits keyword B N times or more, or the number of keywords hit by the text to be recognized exceeds M, etc. These different warning conditions can correspond to records with their own levels, and the specific division of the levels can be related to the severity of the warning conditions, or the number of keywords included in the warning conditions, and this application does not make specific restrictions on this.
[0153] When the keywords hit by the text to be identified meet at least one warning condition, the server can generate corresponding warning information based on the recognition result, and the warning information indicates the hit situation of the text to be identified for the keyword set, and set a level mark for these warning information to represent the importance of the warning information. For example, when the keywords hit by the text to be identified meet the warning conditions with a higher degree of severity, the corresponding warning information can be set with a corresponding level mark representing a higher degree of importance.
[0154] Step S702: Based on the level identifier of the alarm information and the publishing channel corresponding to the level identifier, the alarm information is sent to the target publishing channel, and the sending time and receiving information of the alarm information are obtained.
[0155] After the server generates the alarm information, it needs to send the alarm information through the target release channel according to the level identification of the alarm information, where the target release channel can be email, SMS, system notification, etc., and this application does not limit this. Furthermore, for the alarm information, it can be sent to the target user through different release channels. The target user can be the corresponding administrator, or other corresponding business systems, etc.
[0156] On the other hand, after sending the alarm information, the server can also obtain and record the sending time and receiving information of the alarm information to clearly record the release of the alarm information, and determine whether the situation has been notified to the preset administrator or business system through the relevant information of the recipient's processing operations on the alarm information that may be included in the received information.
[0157] In this method, when the server determines that the recognition result meets at least one warning condition, it will generate and send corresponding alarm information based on the recognition result to warn that the text to be recognized hits the keyword, so that the recipient can quickly obtain the key information he or she expects and provide timely feedback, thereby improving the reliability of the implementation of this solution.
[0158] Step S304: Optimize and adjust the keyword recognition model and keyword set based on the feedback information and recognition results.
[0159] After receiving the feedback information returned by the target user, the server can optimize and adjust the keyword recognition model and the keyword set according to the feedback information and the recognition result.
[0160] In a possible implementation, the server may adjust the keyword recognition model and the keyword set in the following manner.
[0161] First, the server needs to judge the feedback information.
[0162] Then, when it is determined based on the feedback information that there are misrecognized keywords in the recognition results, or when it is determined based on the feedback information that keywords that hit the text to be recognized are missing in the recognition results, the server can adjust the model parameters of the keyword recognition model based on the feedback information, as well as adjust the keywords in the keyword set.
[0163] Exemplarily, the feedback information may include feedback on the accuracy of the recognition results and the server operating performance, so the server can obtain the feedback information, then analyze the feedback information, identify the parts that need to be improved when the server is running, and then adjust and optimize the algorithms and keyword sets in the keyword recognition model.
[0164] In this way, after completing the optimization adjustment of the keyword recognition model and the keyword set, the server can redeploy the adjusted keyword recognition model to replace the original keyword recognition model, and then perform the same operation on the keyword set.
[0165] In this way, after the replacement operation, the server can perform keyword recognition processing on the acquired new text to be recognized based on the adjusted keyword recognition model and the adjusted keyword set.
[0166] In this way, while the server is continuously applying the keyword recognition model and keyword set, it utilizes the feedback information on the recognition results to continuously optimize and adjust the keyword recognition model and keyword set, and can continuously provide feedback adjustment information to the model, so that the keyword recognition model can further improve its accuracy in keyword recognition.
[0167] In this solution, after obtaining the text to be recognized, the server uses the keyword recognition model and the keyword set to perform keyword recognition on the text to be recognized. It can quickly recognize and process a large amount of text to be recognized, and then obtain the corresponding keyword recognition results. The recognition results characterize the distribution of each keyword in the keyword set in the text to be recognized.
[0168] When the recognition result indicates that the text to be recognized hits more than a preset number of keywords, the recognition result can be sent to the target user, so that the target user can review the recognition result and return corresponding feedback information, which can indicate the accuracy of the recognition result, the efficiency of the keyword recognition model, and other information. Therefore, using the feedback information and recognition results, the keyword recognition model and keyword set can be optimized and adjusted accordingly. In this way, by using the feedback information on the recognition results, the keyword recognition model and keyword set can be continuously optimized and adjusted, and feedback adjustment information can be continuously provided to the model, so that the keyword recognition model can further improve its accuracy in keyword recognition.
[0169] In one possible manner, the server may further perform the following operations in addition to the above manner:
[0170] A module responsible for exception monitoring and processing can be set up in the server. Through this module, the above-mentioned model training, data processing, text recognition, result feedback and other links can be monitored. When an exception is detected in any of these links, and the exception indicates that the system cannot operate normally, the server can use this module to record the exception information and try to restore the server to normal operation, or directly execute the backup plan set in the server, thereby ensuring the stability of the server operation and the integrity of the data it records.
[0171] Based on the same inventive concept, an embodiment of the present application also provides a device for keyword recognition.
[0172] See also Figure 8 , which is a structural schematic diagram of a device for keyword recognition provided in an embodiment of the present application. The device may be the above-mentioned server or a chip or integrated circuit in the device, etc. The device includes a module / unit / technical means for executing the method executed by the server in the above-mentioned method embodiment.
[0173] Exemplarily, the device 800 includes:
[0174] An acquisition module 801 is used to acquire a text to be recognized and input the text to be recognized into a trained keyword recognition model;
[0175] The recognition module 802 is used to perform keyword recognition processing on the text to be recognized by combining the keyword recognition model with a preset keyword set to obtain a corresponding recognition result; wherein the recognition result represents: the distribution of each keyword in the keyword set in the text to be recognized;
[0176] The sending module 803 is used to send the recognition result to the target user when the recognition result indicates that the text to be recognized hits more than a preset number of keywords, so that the target user can review the recognition result based on the recognition result and the text to be recognized, and return corresponding feedback information;
[0177] The processing module 804 is used to optimize and adjust the keyword recognition model and the keyword set based on the feedback information and the recognition result.
[0178] Optionally, when the acquisition module 801 is used to acquire the text to be recognized, it is specifically used to:
[0179] Based on a preset time interval, continuously obtaining raw text from at least one data source;
[0180] For each piece of text to be processed in the obtained original text, perform the following operations:
[0181] Performing word segmentation processing on the text to be processed to obtain at least one corresponding word segmentation result;
[0182] Performing part-of-speech tagging for each of the at least one word segmentation result obtained, and obtaining a part-of-speech identifier corresponding to each word segmentation result;
[0183] Based on the at least one word segmentation result and the part-of-speech identifier corresponding to each word segmentation result, the at least one word segmentation result is converted into at least one corresponding word vector, and the at least one word vector obtained is used as the text to be recognized.
[0184] Optionally, the recognition module 802 is used to perform keyword detection processing on the text to be recognized by using the keyword recognition model in combination with a preset keyword set, and when obtaining a corresponding recognition result, specifically to:
[0185] Using the keyword recognition model, identifying the position information corresponding to each keyword in the keyword set in the text to be recognized, and obtaining a corresponding recognition result;
[0186] Among them, the keyword recognition model is obtained after multiple rounds of iterative training to meet preset evaluation indicators; the evaluation indicators include one or more of the following: a first evaluation threshold corresponding to the accuracy of the keyword recognition model, a second evaluation threshold corresponding to the precision, a third evaluation threshold corresponding to the recall rate, and a fourth evaluation threshold corresponding to the harmonic mean result of the precision and recall rate.
[0187] Optionally, the processing module 804 is used to optimize and adjust the keyword recognition model and the keyword set based on the feedback information and the recognition result, specifically to:
[0188] When it is determined based on the feedback information that there are keywords with recognition errors in the recognition result, or when it is determined based on the feedback information that keywords hit by the text to be recognized are omitted in the recognition result, adjusting model parameters of the keyword recognition model based on the feedback information, and adjusting keywords in the keyword set;
[0189] After optimizing and adjusting the keyword recognition model and the keyword set, the processing module 804 is further used to:
[0190] Based on the adjusted keyword recognition model and in combination with the adjusted keyword set, keyword recognition processing is performed on the acquired new text to be recognized.
[0191] Optionally, the device further includes: an early warning module 805, which is used to generate corresponding warning information based on the recognition result when the recognition result indicates that the keywords hit by the to-be-recognized text meet at least one warning condition in a preset early warning condition set, and set a level identifier for the warning information; wherein the level identifier corresponds to the level of the early warning condition;
[0192] Based on the level identifier of the alarm information and the publishing channel corresponding to the level identifier, the alarm information is sent to a target publishing channel, and the sending time and receiving information of the alarm information are obtained.
[0193] As an example, Figure 8 The apparatus described can be used to perform Figure 3 Therefore, for the functions that can be realized by each functional module of the device, reference can be made to Figure 3 The description of the illustrated embodiment will not be repeated here.
[0194] It should be noted that, although several modules or submodules of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more units described above can be embodied in one module. Conversely, the features and functions of one module described above can be further divided into multiple modules to be embodied.
[0195] As a possible product form of the above device, see Fig. 9 The embodiment of the present application further provides an electronic device 900, including:
[0196] At least one processor 901; and a communication interface 903 that is communicatively connected to the at least one processor 901; the at least one processor 901 executes instructions stored in the memory 902, so that the electronic device 900 executes the method steps performed by any device in the above method embodiment through the communication interface 903.
[0197] Optionally, the memory 902 is located outside the electronic device 900 .
[0198] Optionally, the electronic device 900 includes the memory 902, the memory 902 is connected to the at least one processor 901, and the memory 902 stores instructions that can be executed by the at least one processor 901. Fig. 9 The dashed lines indicate that the memory 902 is optional for the electronic device 900 .
[0199] The processor 901 and the memory 902 may be coupled via an interface circuit or may be integrated together, which is not limited here.
[0200] The specific connection medium between the processor 901, the memory 902 and the communication interface 903 is not limited in the embodiment of the present application. Fig. 9 In the embodiment, the processor 901, the memory 902 and the communication interface 903 are connected via a bus 904. Fig. 9 The connections between the other components are shown in bold lines, which are only for illustration and are not intended to be limiting. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 In the example, only one thick line is used to represent the bus, but it does not mean that there is only one bus or one type of bus. It should be understood that the processor mentioned in the embodiment of the present application can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented by software, the processor can be a general-purpose processor, which is implemented by reading the software code stored in the memory.
[0201] Exemplarily, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0202] It should be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DirectRambus RAM, DR RAM).
[0203] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, the memory (storage module) can be integrated into the processor.
[0204] It should be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0205] As another possible product form, an embodiment of the present application also provides a computer-readable storage medium, which is used to store instructions. When the instructions are executed, the computer executes the method steps executed by any device in the above method example.
[0206] As another possible product form, an embodiment of the present application also provides a computer program product including instructions, wherein the computer program product stores instructions that, when executed on a computer, enable the computer to execute the method steps executed by any device in the above method embodiment.
[0207] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0208] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0209] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0210] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0211] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for keyword recognition, characterized in that: include: Obtaining a text to be recognized, and inputting the text to be recognized into a trained keyword recognition model; Through the keyword recognition model, combined with a preset keyword set, the text to be recognized is subjected to keyword recognition processing to obtain a corresponding recognition result; wherein the recognition result represents: the distribution of each keyword in the keyword set in the text to be recognized; When the recognition result indicates that the text to be recognized hits more than a preset number of keywords, the recognition result is sent to a target user, so that the target user reviews the recognition result based on the recognition result and the text to be recognized, and returns corresponding feedback information; Based on the feedback information and the recognition result, the keyword recognition model and the keyword set are optimized and adjusted.
2. The method according to claim 1, characterized in that The step of obtaining the text to be recognized includes: Based on a preset time interval, continuously obtaining raw text from at least one data source; For each piece of text to be processed in the obtained original text, perform the following operations: Performing word segmentation processing on the text to be processed to obtain at least one corresponding word segmentation result; Performing part-of-speech tagging for each of the at least one word segmentation result obtained, and obtaining a part-of-speech identifier corresponding to each word segmentation result; Based on the at least one word segmentation result and the part-of-speech identifier corresponding to each word segmentation result, the at least one word segmentation result is converted into at least one corresponding word vector, and the at least one word vector obtained is used as the text to be recognized.
3. The method according to claim 1, characterized in that The keyword recognition model is used in combination with a preset keyword set to perform keyword detection processing on the text to be recognized to obtain a corresponding recognition result, including: Using the keyword recognition model, identifying the position information corresponding to each keyword in the keyword set in the text to be recognized, and obtaining a corresponding recognition result; Among them, the keyword recognition model is obtained after multiple rounds of iterative training to meet preset evaluation indicators; the evaluation indicators include one or more of the following: a first evaluation threshold corresponding to the accuracy of the keyword recognition model, a second evaluation threshold corresponding to the precision, a third evaluation threshold corresponding to the recall rate, and a fourth evaluation threshold corresponding to the harmonic mean result of the precision and recall rate.
4. The method according to any one of claims 1 to 3, characterized in that: The optimizing and adjusting the keyword recognition model and the keyword set based on the feedback information and the recognition result includes: When it is determined based on the feedback information that there are keywords with recognition errors in the recognition result, or when it is determined based on the feedback information that keywords hit by the text to be recognized are omitted in the recognition result, adjusting model parameters of the keyword recognition model based on the feedback information, and adjusting keywords in the keyword set; After optimizing and adjusting the keyword recognition model and the keyword set, the method further includes: Based on the adjusted keyword recognition model and in combination with the adjusted keyword set, keyword recognition processing is performed on the acquired new text to be recognized.
5. The method according to any one of claims 1 to 3, characterized in that: After obtaining the corresponding recognition result, the method further includes: When the recognition result indicates that the keywords hit by the to-be-recognized text meet at least one of the preset warning conditions, based on the recognition result, corresponding warning information is generated, and a level identifier is set for the warning information; wherein the level identifier corresponds to the level of the warning condition; Based on the level identifier of the alarm information and the publishing channel corresponding to the level identifier, the alarm information is sent to a target publishing channel, and the sending time and receiving information of the alarm information are obtained.
6. A device for keyword recognition, characterized in that: include: An acquisition module, used for acquiring text to be recognized and inputting the text to be recognized into a trained keyword recognition model; A recognition module, used to perform keyword recognition processing on the text to be recognized by combining the keyword recognition model with a preset keyword set, and obtain a corresponding recognition result; wherein the recognition result represents: the distribution of each keyword in the keyword set in the text to be recognized; A sending module, configured to send the recognition result to a target user when the recognition result indicates that the text to be recognized hits more than a preset number of keywords, so that the target user can review the recognition result based on the recognition result and the text to be recognized, and return corresponding feedback information; A processing module is used to optimize and adjust the keyword recognition model and the keyword set based on the feedback information and the recognition result.
7. The device according to claim 6, characterized in that The device further includes: an early warning module, which is used to generate corresponding warning information based on the recognition result and set a level identifier for the warning information when the recognition result indicates that the keyword hit by the to-be-recognized text meets at least one warning condition in the preset early warning condition set; wherein the level identifier corresponds to the level of the early warning condition; Based on the level identifier of the alarm information and the publishing channel corresponding to the level identifier, the alarm information is sent to a target publishing channel, and the sending time and receiving information of the alarm information are obtained.
8. An electronic device, characterized in that: include: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the method as described in any one of claims 1 to 5 by executing the instructions stored in the memory.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store instructions, and when the instructions are executed, the method according to any one of claims 1 to 5 is implemented.
10. A computer program product comprising instructions, characterized in that The computer program product stores instructions, and when the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 5.