Sensitive word detection method and its device, equipment, medium, and product

By using dictionary tree structure and scene type tags in cross-border e-commerce platforms for sensitive word detection, the problem of poor detection of sensitive word in the existing technology is solved, and rapid response and accurate recognition is achieved, suitable for cross-border e-commerce Sensitive word detection for independent stations.

CN114186567BActive Publication Date: 2024-12-17GUANGZHOU HUADUO NETWORK TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202111509258.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-10
Publication Date
2024-12-17
Estimated Expiration
2041-12-10

AI Technical Summary

Technical Problem

The existing technology has poor detection of sensitive words in cross-border e-commerce platforms, the neural network model training cost is high and it is difficult to adapt to multi-scenario compatibility, and it is difficult to refinely identify sensitive words with a single classification function.

Method used

The dictionary tree is used to convert sensitive words into a fast-responsive storage structure, and the keyword matching is combined with scene type tags to achieve fast query and accurate recognition of sensitive words.

Benefits of technology

It realizes rapid response and accurate recognition of sensitive word detection in cross-border e-commerce platforms, adapts to the judgment of sensitive word in different scenarios and languages, reduces the detection cost, and is especially suitable for sensitive word detection of cross-border e-commerce independent websites.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114186567B_ABST
    Figure CN114186567B_ABST
Patent Text Reader

Abstract

The present application discloses a sensitive word detection method and its device, equipment, medium, and product. The matching method includes: creating a dictionary tree according to sensitive words in a sensitive word database, representing each sensitive word as a storage path to an end node in the dictionary tree, and each end node is used to store corresponding sensitive word information, including the sensitive word and its scene type label and sensitive type label; responding to a sensitive word detection request, obtaining a text to be detected and a scene type label; querying the dictionary tree to determine the end node of the storage path that matches multiple keywords in the text to be detected and the scene type label to determine the sensitive word; outputting result information, the result information includes the mapping relationship data of the sensitive word and its corresponding sensitive type label. The present application can realize sensitive word detection based on the dictionary tree in an economical way, fully consider the meaning and role of each keyword in a specific scene during the sensitive word detection process, and achieve the effect of accurate detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of e-commerce information technology, and in particular to a sensitive word detection method and its corresponding device, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] Sensitive word detection is crucial for the operation and maintenance of Internet sites. The detection dimensions mainly include violence, terrorism, pornography, vulgar insults, etc. Sensitive word detection is also crucial in cross-border e-commerce. Sensitive words on e-commerce platforms may appear widely in product titles, product descriptions, text on product pictures, and comment areas; at the same time, since cross-border e-commerce is mostly operated 24 hours a day around the world in the form of independent websites, the sensitive word detection system for cross-border e-commerce should also have the ability to dynamically manage sensitive word libraries and make them effective immediately; in addition, independent websites are oriented to multiple countries and regions with different cultures, so sensitive word detection must have multi-scenario compatibility, that is, it must have the adaptive ability to determine whether each word is a sensitive word in different contexts.

[0003] In the prior art, neural network models are often used to perform classification mapping based on the deep semantic information of the text to be detected, and the text to be detected is mapped to different sensitive type labels. As we all know, the training cost of neural network models is high and they rely heavily on training samples. However, in cross-border e-commerce platforms, the corpus of each independent station is very limited, making it difficult to apply artificial intelligence solutions. In addition, the neural network model determines sensitive type labels based on the semantic level, and it is easy to ignore the value of the word meaning level. Moreover, since the classification function of a single neural network model is relatively single, it is often difficult to effectively perform fine word recognition on the text to be detected, and it is even more difficult to make the model compatible with multiple scenarios. Therefore, although the technology related to the neural network model is more cutting-edge, the overall effect is not good when it comes to adapting to the needs of cross-border e-commerce service scenarios.

[0004] In view of this, the applicant has explored the relevant technologies, obtained relevant results and filed this application. Summary of the invention

[0005] The primary purpose of the present application is to solve at least one of the above problems and provide a sensitive word detection method and its corresponding device, computer equipment, computer-readable storage medium, and computer program product.

[0006] In order to meet the various objectives of this application, this application adopts the following technical solutions:

[0007] A sensitive word detection method provided for one of the purposes of this application includes the following steps:

[0008] Create a dictionary tree based on the sensitive words in the sensitive word database, represent each sensitive word as a storage path to an end node in the dictionary tree, and each end node is used to store corresponding sensitive word information, wherein the sensitive word information includes the sensitive word and its scene type label and sensitive type label;

[0009] In response to a sensitive word detection request, obtain the text to be detected and the scene type label corresponding to the request, wherein the scene type label is a label corresponding to any one or more of the business scenario, geographical scenario, and interaction scenario of the online service that generates the text to be detected;

[0010] Querying the dictionary tree to determine the end node of the storage path that matches the multiple keywords in the text to be detected and the scene type label, determining the matching keywords as sensitive words, and obtaining the sensitive type label of each sensitive word from the corresponding end node;

[0011] Output result information to respond to the sensitive word detection request, the result information including mapping relationship data between the sensitive word and its corresponding sensitive type label.

[0012] In the extended embodiment, after the step of creating a dictionary tree according to the sensitive words in the sensitive word database, the following steps are included:

[0013] The sensitive word update event used to store the sensitive word database is monitored through a message queue, and the corresponding storage path in the dictionary word is updated in response to the sensitive word corresponding to the sensitive word update event.

[0014] In a further embodiment, responding to a sensitive word detection request and obtaining the text to be detected and scene information corresponding to the request include the following steps:

[0015] Respond to the sensitive word detection request and obtain the text to be detected and the scene type label carried by the sensitive word detection request;

[0016] The text to be detected is segmented using a pre-trained neural network model or a preset matching rule to obtain multiple keywords.

[0017] In a further embodiment, the dictionary tree is queried to determine the terminal node of the storage path that matches the multiple keywords in the text to be detected and the scene type label, the matching keywords are determined as sensitive words, and the sensitive type label of each sensitive word is obtained from the corresponding terminal node, including the following steps:

[0018] For each of the keywords, searching the dictionary tree to determine the storage path corresponding to the keyword;

[0019] For each storage path corresponding to the keyword, obtain sensitive word information stored in the terminal node corresponding to the storage path;

[0020] For each of the keywords, determine whether it contains a sensitive word in the sensitive word information of its storage path, and determine whether its scene type tag contains any scene type tag in the sensitive word information. When both are true, determine that the keyword is a sensitive word;

[0021] The sensitive type label of each sensitive word is obtained from the corresponding terminal node, and the keyword determined as a sensitive word and the sensitive type label in the corresponding sensitive word information are constructed as mapping relationship data.

[0022] In a specific embodiment, the sensitive word database stores preset sensitive words, as well as sensitive type labels, scene type labels, and mapping relationship data corresponding to the effective states of the sensitive words.

[0023] In a preferred embodiment, in the process of creating a dictionary tree based on sensitive words in the sensitive word database, only sensitive words whose effective status indicates that they are effective are added to the dictionary tree, and sensitive words whose effective status indicates that they are invalid are excluded from the dictionary tree.

[0024] A sensitive word detection device provided to meet one of the purposes of the present application includes: a dictionary creation module, a response processing module, a query matching module, and a result output module, wherein the dictionary creation module is used to create a dictionary tree according to the sensitive words in the sensitive word database, and each sensitive word is represented as a storage path to an end node in the dictionary tree, and each end node is used to store corresponding sensitive word information, and the sensitive word information includes the sensitive word and the scene type label and sensitive type label to which it belongs; the response processing module is used to respond to a sensitive word detection request, and obtain the text to be detected and the scene type label corresponding to the request, and the scene type label is used to mark any one or any multiple corresponding labels of the business scenario, geographical scenario, and interactive scenario of the online service that generates the text to be detected; the query matching module is used to query the dictionary tree to determine the end node of the storage path that matches multiple keywords in the text to be detected and the scene type label, determine the matching keywords as sensitive words, and obtain the sensitive type label of each sensitive word from the corresponding end node; the result output module is used to output result information to respond to the sensitive word detection request, and the result information includes the mapping relationship data of the sensitive word and its corresponding sensitive type label.

[0025] In an extended embodiment, the sensitive word detection device of the present application includes: a queue monitoring module, which is used to monitor the sensitive word update event used to store the sensitive word database through a message queue, and respond to the sensitive word corresponding to the sensitive word update event to update the corresponding storage path in the dictionary word.

[0026] In a further embodiment, the response processing module includes: a request response sub-module, which is used to respond to a sensitive word detection request and obtain the text to be detected and the scene type label carried by the sensitive word detection request; a word segmentation extraction module, which is used to use a pre-trained neural network model or a preset matching rule to perform word segmentation processing on the text to be detected and obtain multiple keywords therein.

[0027] In a further embodiment, the query matching module includes: a dictionary retrieval submodule, which is used to search the dictionary tree for each of the keywords and determine the storage path corresponding to the keyword; a path access submodule, which is used to obtain the sensitive word information stored in the terminal node corresponding to the storage path corresponding to each of the keywords; a part-of-speech analysis submodule, which is used to determine whether each of the keywords contains sensitive words in the sensitive word information of its storage path, and whether its scene type label contains any scene type label in the sensitive word information. When both are true, the keyword is determined to be a sensitive word; a risk association submodule, which is used to obtain the sensitive type label of each sensitive word from the corresponding terminal node, and construct the keyword determined as a sensitive word and the sensitive type label in the corresponding sensitive word information as mapping relationship data.

[0028] In a specific embodiment, the sensitive word database stores preset sensitive words, as well as sensitive type labels, scene type labels, and mapping relationship data corresponding to the effective states of the sensitive words.

[0029] In a preferred embodiment, in the process of creating a dictionary tree based on sensitive words in the sensitive word database, only sensitive words whose effective status indicates that they are effective are added to the dictionary tree, and sensitive words whose effective status indicates that they are invalid are excluded from the dictionary tree.

[0030] A computer device provided to meet one of the purposes of the present application includes a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the sensitive word detection method or the product information publishing method described in the present application.

[0031] A computer-readable storage medium is provided to meet another purpose of the present application, which stores a computer program implemented according to the sensitive word detection method or product information publishing method in the form of computer-readable instructions. When the computer program is called and executed by a computer, the steps included in the method are executed.

[0032] A computer program product provided to meet another purpose of the present application includes a computer program / instruction, which, when executed by a processor, implements the steps of the method described in any embodiment of the present application.

[0033] Compared with the prior art, the advantages of this application are as follows:

[0034] This application first converts the sensitive words in the sensitive word database into a dictionary tree with fast response characteristics, and then responds to the sensitive word detection request, and searches and matches the terminal nodes corresponding to the corresponding sensitive words in the dictionary tree according to the text to be detected and the scene information corresponding to the request, so as to achieve the purpose of fast query and make a judgment on whether multiple keywords in the text to be detected are sensitive words. Then, for each keyword determined to be a sensitive word, on the basis of quickly querying and obtaining the sensitive word information of the corresponding terminal node, the corresponding keyword is further associated with the sensitive type label to which it belongs, so as to realize the annotation of the sensitive type label to which each keyword in the text to be detected belongs, thereby completing the sensitive word classification detection.

[0035] In this process, the present application uses the specific data of the scene type label to realize the carrying of different types of scene information, for example, including business scenes, geographical scenes, interaction scenes, etc., so that in the sensitive word identification, it can adapt to different scenes and determine the semantics of keywords, thereby adapting to different countries or regions, different businesses, and different interaction processes while considering the specific meaning and specific function expressed by the keywords, so as to make a more accurate judgment on whether the keywords are sensitive words.

[0036] In addition, since the dictionary tree has the characteristics of fast query and takes scenario factors into consideration in the process of judging whether a keyword is a sensitive word, the technical solution of the present application is more economical and effective than implementation with the help of a neural network model, and is particularly suitable for detecting sensitive words in the text to be detected on cross-border e-commerce independent sites. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0038] Figure 1 A flowchart of a typical embodiment of the sensitive word detection method of the present application;

[0039] Figure 2 A flowchart of a process for determining whether a keyword is a sensitive word in an embodiment of the present application;

[0040] Figure 3 This is a principle block diagram of the sensitive word detection device of this application;

[0041] Figure 4 A schematic diagram of the structure of a computer device used in this application. DETAILED DESCRIPTION

[0042] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.

[0043] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0044] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.

[0045] It will be understood by those skilled in the art that the "client", "terminal" and "terminal device" used herein include both devices with wireless signal receivers, which are devices with only wireless signal receivers without transmission capabilities, and devices with receiving and transmitting hardware, which are devices with receiving and transmitting hardware capable of two-way communication on a two-way communication link. Such devices may include: cellular or other communication devices such as personal computers, tablet computers, which have single-line displays or multi-line displays or cellular or other communication devices without multi-line displays; PCS (Personal Communications Service, personal communication system), which can combine voice, data processing, fax and / or data communication capabilities; PDA (Personal Digital Assistant, personal digital assistant), which may include a radio frequency receiver, pager, Internet / intranet access, web browser, notepad, calendar and / or GPS (Global Positioning System, global positioning system) receiver; conventional laptop and / or palmtop computers or other devices, which have and / or include a conventional laptop and / or palmtop computer or other device with and / or including a radio frequency receiver. The "client", "terminal" and "terminal device" used herein may be portable, transportable, installed in a vehicle (air, sea and / or land), or suitable for and / or configured to run locally, and / or in a distributed form, at any other location on the earth and / or in space. The "client", "terminal" and "terminal device" used herein may also be a communication terminal, an Internet terminal, a music / video playing terminal, for example, a PDA, a MID (Mobile Internet Device) and / or a mobile phone with a music / video playing function, or a smart TV, a set-top box and other devices.

[0046] The hardware referred to by the names such as "server", "client", and "service node" in this application is essentially an electronic device with the equivalent capabilities of a personal computer. It is a hardware device with the necessary components revealed by the von Neumann principle, such as a central processing unit (including an arithmetic unit and a controller), a memory, an input device, and an output device. The computer program is stored in its memory, and the central processing unit calls the program stored in the external memory into the internal memory for execution, executes the instructions in the program, and interacts with the input and output devices to complete specific functions.

[0047] It should be pointed out that the concept of "server" referred to in this application can also be extended to the case of server clusters. According to the network deployment principle understood by those skilled in the art, the servers should be logically divided. In physical space, these servers can be independent of each other but can be called through interfaces, or integrated into a physical computer or a set of computer clusters. Those skilled in the art should understand this flexibility, and should not use it to restrict the implementation of the network deployment method of this application.

[0048] Unless expressly specified, one or more technical features of the present application can be deployed on a server for implementation and accessed by a client through a remote call to obtain an online service interface provided by the server, or can be directly deployed and run on a client for access.

[0049] The neural network models referenced or may be referenced in this application, unless expressly specified, can be deployed on a remote server and remotely called on the client, or can be deployed and directly called on a client with sufficient device capabilities. In some embodiments, when it runs on the client, its corresponding intelligence can be obtained through transfer learning to reduce the requirements for the client's hardware operating resources and avoid excessive occupation of the client's hardware operating resources.

[0050] Unless explicitly specified, the various data involved in this application can be stored remotely on a server or on a local terminal device, as long as it is suitable for being called by the technical solution of this application.

[0051] Those skilled in the art should be aware that, although the various methods of the present application are described based on the same concept and thus present commonality to each other, unless otherwise specified, these methods can be independently executed. Similarly, for each embodiment disclosed in the present application, they are all proposed based on the same inventive concept, therefore, concepts with the same expression, and concepts that are appropriately changed for convenience despite different expressions, should be understood as equivalent.

[0052] Unless the mutually exclusive relationship between the embodiments to be disclosed in this application is explicitly stated, the relevant technical features involved in each embodiment can be cross-combined to flexibly construct a new embodiment, as long as such combination does not deviate from the creative spirit of this application and can meet the needs of the prior art or solve certain deficiencies in the prior art. Those skilled in the art should be aware of this flexibility.

[0053] A sensitive word detection method of the present application can be programmed as a computer program product and deployed in a server for execution, so that the method can be executed by accessing an interface opened after the computer program product is executed and performing human-computer interaction with the computer program product through a graphical user interface.

[0054] See also Figure 1 The sensitive word detection method of the present application comprises the following steps:

[0055] Step S1100: Create a dictionary tree based on the sensitive words in the sensitive word database, and represent each sensitive word as a storage path to an end node in the dictionary tree. Each end node is used to store corresponding sensitive word information, and the sensitive word information includes the sensitive word and its scene type label and sensitive type label:

[0056] In a typical application scenario, the computer program product implemented by the technical solution of the present application is deployed in the server of the cross-border e-commerce service platform to provide basic services for various online services of the service platform, specifically, to detect whether the text to be detected submitted by other online services contains any type of sensitive words. When deploying the computer program product, it can be implemented as a centralized basic service, opening standardized interfaces for other online services, or it can be configured as an independent basic service module of any independent station in the cross-border e-commerce platform, dedicated to the corresponding independent station, and providing basic services for the online services of the independent station.

[0057] The cross-border e-commerce service platform maintains a sensitive word database, which pre-stores a large amount of sensitive word corresponding and related information, typically including the string of each sensitive word itself, the effective status of the sensitive word, the scene type label to which it belongs, and the sensitive type label to which it belongs.

[0058] The effective state is used to indicate whether a corresponding sensitive word participates in the construction of the dictionary tree, that is, whether it participates in the detection, and can be set to two states: "enabled" and "disabled". The former indicates that the corresponding sensitive word is in an enabled state and can participate in the detection, and the latter indicates that the corresponding sensitive word is in a disabled state and is no longer involved in the detection.

[0059] The scene type label is used to indicate the scene that needs to be associated when the corresponding sensitive word is detected, that is, to indicate in what specific scene the sensitive word is considered a sensitive word. The data corresponding to the scene type label is essentially a scene label set according to one or more scene types, and different specific scenes are indicated by scene labels under different scene types. In the sensitive word database and dictionary tree of the present application, the scene type label corresponding to each sensitive word can be expressed as including one or more of the scene labels, that is, a sensitive word can correspond to one or more of the scene type labels. For scene type labels, multiple categories of specific scene types can be formulated according to different classification criteria, and each category of specific scene type can be further subdivided into multiple specific scenes. It can be seen that there is a scene classification system in advance, and there are multiple scene type labels of multiple levels under the entire system for call.

[0060] The exemplary first category of scenario types is used to define business scenarios, which are used to indicate the specific business of the online service to which the sensitive words apply. Based on this principle, scenario type labels corresponding to the business scenario types are formulated, such as "live broadcast page", "online business page", "terminal page", "product details page", etc., which are used to indicate the business types corresponding to the live broadcast entrance, website entrance, and mobile terminal entrance, respectively. The significance of considering specific business scenarios when detecting sensitive words is mainly reflected in the fact that for scenarios such as live broadcast, words that are personal attacks on the anchor user may be more likely to appear. Therefore, the sensitivity of individual words should theoretically be increased accordingly, and the system should respond to them quickly. For example, the Chinese word "a pig" may not be very obvious if it appears on a website page, but if it appears in a live broadcast room, it may be scolding the anchor user, and the latter is obviously more sensitive.

[0061] The exemplary second category of scene types is used to define geographical scenes, which are used to indicate the countries and / or regions to which sensitive words apply. The corresponding scene type labels formulated may be, for example, "United States", "Arab countries", "Chinese area", "English area", etc., which are used to indicate different geographical areas, and usually correspond to different languages, systems or customs. It is not difficult to understand that under different languages, systems and customs, the meaning of the same word and the role it indicates may be different, so its sensitivity is also different. Therefore, it is of positive significance to consider geographical scenes when detecting sensitive words. For example, the English word "shabby" may mainly play the role of the original meaning of an adjective in the United Kingdom and the United States, but in the Chinese context, it is suspected of being a homophonic insult. Therefore, different language countries should also consider their geographical regions when marking sensitive words.

[0062] An exemplary third type of scenario type is used to define an interaction scenario, which is used to indicate an interaction process that generates sensitive words. The corresponding scenario type tags formulated can be, for example, "user comment", "product information", etc. Among them, "user comment" can correspond to the information generation scenario of the user comment area, and "product information" can correspond to the information generation scenario of the product information configuration page. Considering the role of this interaction scenario in the sensitive word detection process facilitates determining the information generation party or the information generation area, so as to accordingly mark the sensitivity of the sensitive word. For example, if a Chinese word "The products of competing companies are too bad" appears in the product information released by a merchant, its sensitivity is relatively high. If it appears in the comment area, its sensitivity can be correspondingly reduced and not be included as a sensitive word.

[0063] Comprehensive example, if the scenario type tags of a word are simultaneously marked as "product detail page", "USA", it can be indicated according to the preset logical relationship between the tags that when this word appears on the product detail page of a product in the USA, or when this word appears on an independent website in the USA or on the product detail page of an independent website, it should be regarded as a sensitive word.

[0064] Based on the examples of scenario type tags here, those skilled in the art can also expand other scenario type tags, which will not be elaborated here.

[0065] The described sensitive type tag is used to indicate the specific sensitive category in the sensitivity classification system corresponding to the corresponding sensitive word. For example, the sensitivity classification system includes different sensitive categories such as "pornography", "vulgarity", "violence", "slander", etc. When storing each sensitive word, the corresponding sensitive category can be associated with it according to the meaning or function of the sensitive word.

[0066] Based on the sensitive word database described above, in this step, a trie tree is created and constructed according to the sensitive word database. The trie tree is a multi-layer structure, that is, from its root node through multiple intermediate nodes to the final end node. Among them, each path from the root node to an end node is a storage path, and each storage path is used to sequentially store each character of a sensitive word in the direction from the root node to the end node, and the final end node stores the sensitive word information corresponding to the sensitive word. In the trie tree, the sensitive word information mainly includes the string of the sensitive word itself and the preset scenario type tags and sensitive type tags in the sensitive word database corresponding to the sensitive word. Accordingly, the content in the sensitive word database is represented in a graph form through the trie tree, which is equivalent to a knowledge graph. Subsequently, retrieval can be performed according to the trie tree, and retrieving the sensitive word storage path from the root node of the trie tree is quite efficient and fast. Obviously, it helps the technical solution of this application to deploy in an e-commerce service platform to respond to a large number of detection requests, thereby reflecting the advantages of economies of scale.

[0067] In one embodiment, the effective state field in the sensitive word database plays a control role. Specifically, in the process of storing sensitive words in the dictionary tree, for sensitive words that are already in the sensitive word database and have an effective state that represents an enabled state that is in effect, they are stored in a storage path of the dictionary tree, and for sensitive words that have an effective state that represents an invalid state, they are excluded from the dictionary tree, that is, they are not stored in the dictionary tree. Therefore, the backend management user can set the effective state of each sensitive word in the sensitive word database, and realize the expansion or simplification of sensitive words in the dictionary tree according to the synchronization of the sensitive word database and the dictionary tree.

[0068] Step S1200: respond to the sensitive word detection request, and obtain the text to be detected and the scene type label corresponding to the request, wherein the scene type label is a label corresponding to any one or more of the business scenario, geographical scenario, and interactive scenario of the online service that generates the text to be detected:

[0069] When any online service of the e-commerce platform calls the interface provided by the technical solution of the present application and triggers a sensitive word detection request, the text to be detected and its scene type label will be included in the detection request according to the interface specification.

[0070] Accordingly, the scene type tag may be expressed as including one or more specific scene tags, and the scene tag may be one or more specific tags in one or more specific scenes. For example, it may carry three tags, namely, "live page" in the business scene, "United States" in the geographic scene, and "user comments" in the interactive scene as described above. The scene conditions can be adapted for the judgment of sensitive words accordingly.

[0071] The text to be detected is provided by the upstream online service that calls the interface. It can be text information obtained in any business link of the online service, and the online service can pre-format the text information according to actual needs and provide it. For example, the online service can perform text recognition from the product pictures uploaded by the user, obtain the text information, and remove spaces, stop words, etc. from the text information to combine it into the text to be detected. Of course, these formatting operations can also be completed in the interface. To this end, those skilled in the art can set it flexibly. When the online service calls the interface and passes in the text to be detected and the scene type label, the interface of the present application can perform subsequent operations accordingly.

[0072] Step S1300: query the dictionary tree to determine the end node of the storage path that matches the multiple keywords in the text to be detected and the scene type label, determine the matching keywords as sensitive words, and obtain the sensitive type label of each sensitive word from the corresponding end node:

[0073] First, keyword extraction can be performed on the text to be detected to obtain multiple keywords in the text to be detected. The keyword extraction process can be implemented using a neural network model that has been pre-trained to a convergent state. The neural network model adopts a CNN or RNN architecture, which is suitable for segmenting words from a text to extract multiple keywords. Recommended specific neural network models include Bi-LSTM, Bert, Electra, and other models known to those skilled in the art. In addition to using a neural network model to implement keyword extraction, regular rules can also be used to match the text to be detected to achieve keyword extraction. By extracting vocabulary from the text to be detected and the preset word bag, the keywords can also be obtained. There are various ways to extract keywords, and those skilled in the art can flexibly implement them based on the examples disclosed herein. As for the scene type labels required for the subsequent sensitive word determination of keywords, no special processing is required.

[0074] Then, for each keyword extracted from the text to be detected, a node-by-node search is performed in the dictionary tree to find the storage path corresponding to the keyword, directly reach its terminal node, and extract the sensitive information of the sensitive word corresponding to the storage path from the terminal node. As mentioned above, in the dictionary tree, the sensitive information includes the string of the sensitive word itself, the scene type label, and the sensitive type label. It can be seen that after this step, the matching of the keyword with the sensitive word in the dictionary tree has actually been completed, and the sensitive type label in the sensitive information corresponding to each keyword has been obtained.

[0075] Step S1400: Output result information to respond to the sensitive word detection request, wherein the result information includes mapping relationship data between the sensitive word and its corresponding sensitive type label:

[0076] After obtaining the sensitive type label corresponding to each keyword, each keyword and its corresponding sensitive type label can be constructed into mapping relationship data one by one, and then the mapping relationship data of all keywords can be merged into result information, which is returned and pushed to the corresponding requesting party to complete the response to the sensitive word detection request.

[0077] It can be seen from this typical embodiment that the present application has many advantages, including but not limited to the following aspects:

[0078] This application first converts the sensitive words in the sensitive word database into a dictionary tree with fast response characteristics, and then responds to the sensitive word detection request, and searches and matches the terminal nodes corresponding to the corresponding sensitive words in the dictionary tree according to the text to be detected and the scene information corresponding to the request, so as to achieve the purpose of fast query and make a judgment on whether multiple keywords in the text to be detected are sensitive words. Then, for each keyword determined to be a sensitive word, on the basis of quickly querying and obtaining the sensitive word information of the corresponding terminal node, the corresponding keyword is further associated with the sensitive type label to which it belongs, so as to realize the annotation of the sensitive type label to which each keyword in the text to be detected belongs, thereby completing the sensitive word classification detection.

[0079] In this process, the present application uses the specific data of the scene type label to realize the carrying of different types of scene information, for example, including business scenes, geographical scenes, interaction scenes, etc., so that in the sensitive word identification, it can adapt to different scenes and determine the semantics of keywords, thereby adapting to different countries or regions, different businesses, and different interaction processes while considering the specific meaning and specific function expressed by the keywords, so as to make a more accurate judgment on whether the keywords are sensitive words.

[0080] In addition, since the dictionary tree has the characteristics of fast query and takes scenario factors into consideration in the process of judging whether a keyword is a sensitive word, the technical solution of the present application is more economical and effective than implementation with the help of a neural network model, and is particularly suitable for detecting sensitive words in the text to be detected on cross-border e-commerce independent sites.

[0081] In an extended embodiment, after the step S1100, the step of creating a dictionary tree according to the sensitive words in the sensitive word database, the following steps are included:

[0082] Step S1500: monitor the sensitive word update event for storing the sensitive word database through the message queue, respond to the sensitive word corresponding to the sensitive word update event, and update the corresponding storage path in the dictionary word:

[0083] In this embodiment, data synchronization between the sensitive word database and the dictionary tree is achieved through a message queue, and the data synchronization is achieved by monitoring the message queue.

[0084] Specifically, when a sensitive word update event occurs in the sensitive word database, the update event includes any one of a new event, a deletion event, and a modification event, a notification message body corresponding to the update event is constructed and added to the message queue, and the message queue dequeues the notification message body in the queue according to its preset dequeue rule, and the dequeued notification message body is consumed by its corresponding thread. In the thread, the notification message body is parsed, the update event is identified, and then the corresponding update operation is performed in the dictionary tree in response to the update event, including operations such as adding, deleting, and modifying corresponding to the update event.

[0085] When performing the update operation on the dictionary tree in response to the update event, if the sensitive word update event is a new addition event, then according to the newly added sensitive word in the notification message body, the corresponding path is searched and improved in the dictionary tree, and the necessary nodes are expanded step by step according to the string of the sensitive word to store the corresponding characters, until the terminal node corresponding to the last character is stored, and the sensitive word information corresponding to the newly added sensitive word is stored. If the sensitive word update event is a deletion event, according to the deleted sensitive word in the notification message body, its storage path is determined by searching character by character in the dictionary tree, and then, according to the string of the deleted sensitive word, its corresponding nodes are deleted in reverse order until the last node shared by other storage paths. If the sensitive word update event is a modification event, according to the updated sensitive word in the notification message body, its corresponding storage path is found, and then its storage path is readjusted and / or its sensitive word information is modified according to the string of the updated sensitive word.

[0086] This embodiment establishes a data synchronization relationship between the sensitive word database and the dictionary tree based on the event monitoring mechanism, which not only realizes the decoupling between the sensitive word database and the dictionary tree, but also realizes the timely synchronization of sensitive word data between the two, which is convenient for user management and can ensure the timely update of the dictionary tree, so that the dictionary tree always serves each independent station of the e-commerce platform with its latest status.

[0087] In a further embodiment, the step S1200, responding to a sensitive word detection request and obtaining the text to be detected and scene information corresponding to the request, includes the following steps:

[0088] Step S1210: respond to the sensitive word detection request and obtain the text to be detected and the scene type label carried by the sensitive word detection request:

[0089] The process of responding to a sensitive word detection request can be found in the previous embodiments and will not be repeated here.

[0090] Step S1220: Use a pre-trained neural network model or a preset matching rule to perform word segmentation on the text to be detected to obtain multiple keywords therein:

[0091] In this embodiment, the neural network model is recommended to be implemented using Lattice LSTM. When inputting into the model, the character vectors of the text to be detected and the word vectors of the corresponding words of each character are encoded respectively, and then the character vectors and word vectors are processed into comprehensive vectors and input into the model for representation learning. The deep semantic information obtained through representation learning is tagged with part-of-speech using conditional random fields to obtain a corresponding word sequence, and one or more keywords are determined based on the labels of these word sequences.

[0092] When the preset matching rule is used for the text to be detected, as described above, a preset word bag is applied to perform keyword matching.

[0093] This embodiment further improves the implementation effect of the present application by recommending a neural network model that is optimally tested, thereby making keyword extraction more accurate.

[0094] See also Figure 2 In a further embodiment, the step S1300, querying the dictionary tree to determine the end node of the storage path that matches the multiple keywords in the text to be detected and the scene type label, determining the matched keywords as sensitive words, and obtaining the sensitive type label of each sensitive word from the corresponding end node, includes the following steps:

[0095] Step S1310: for each of the keywords, search the dictionary tree to determine the storage path corresponding to the keyword:

[0096] For a keyword, when searching in the dictionary tree, the nodes of each level are searched word by word in the dictionary tree according to the character string of the keyword. Specifically, taking English as an example, a corresponding English letter is stored in each level node of the dictionary tree. According to the keyword, the specific node corresponding to the first English character is first determined in the upper node, and then the specific node corresponding to the second English character is determined in the lower node, and so on, until the last English character of the keyword, through multiple specific nodes, to the last terminal node, from the root node of the dictionary tree through the specific nodes to the terminal node, it constitutes the storage path of the sensitive word corresponding to the keyword.

[0097] Step S1320: for each storage path corresponding to the keyword, obtain the sensitive word information stored in the terminal node corresponding to the storage path:

[0098] In the process of searching the storage path in the previous step, if such a storage path cannot be determined, it means that the corresponding sensitive word does not exist in the dictionary tree, and it can be directly determined that the keyword is not a sensitive word defined by the platform. If a storage path corresponding to a keyword can be determined, then according to the storage rules of the dictionary tree, the terminal node of the storage path will contain the sensitive word information of the sensitive word corresponding to the storage path, so the sensitive word information can be called and obtained.

[0099] Step S1330: for each of the keywords, determine whether it contains a sensitive word in the sensitive word information of its storage path, and determine whether its scene type tag contains any scene type tag in the sensitive word information. When both are true, determine that the keyword is a sensitive word:

[0100] For keywords that have been determined to have matching storage paths, whether they constitute keywords finally recognized by this application still needs to consider whether their scene types match the corresponding sensitive word information. Accordingly, for each of the keywords, first determine whether the keyword matches the string of sensitive words in the sensitive word information of its corresponding storage path. If the keyword string contains the string of corresponding sensitive words, then further determine whether there is at least one scene type tag among the one or more scene type tags carried by the text to be detected that contains at least one scene type tag in the corresponding sensitive word information. If so, it can be determined that the scene type of the keyword matches the scene type of the sensitive word, so that it can be determined that the keyword is a sensitive word.

[0101] When making a scene type tag matching judgment, the matching method can be flexibly changed. For example, in another embodiment, for a keyword, it can be determined according to a preset rule whether all the scene type tags carried by the text to be detected fully contain all the scene type tags in the sensitive word information corresponding to the keyword. Only when all are included, it is determined that the keyword is the sensitive word. This method, by changing the logical rules required for matching, puts forward more stringent matching conditions for sensitive word identification. In another embodiment, as long as a scene type tag carried by a keyword belongs to a scene type tag in its corresponding sensitive word information, it can also be directly determined that the keyword is the sensitive word. This method is more relaxed in determining whether the keyword belongs to a sensitive word. In addition, in a relatively simplified embodiment, each text to be detected can be controlled to carry only a single scene type tag, and the sensitive word information of each sensitive word is also marked with only a single scene type tag. When matching is required, the scene type tag carried by the keyword is compared one by one with the scene type tag in its corresponding sensitive word information for determination.

[0102] It is not difficult to understand based on the various variations of the above embodiments that when the associated scenario information makes the final judgment on whether the keyword is a sensitive word, there are multiple implementation methods that can be flexibly set. This makes it more convenient for e-commerce servers that provide middle-office services to implement services with multiple functions, which essentially expands the service capabilities of the corresponding middle-office components.

[0103] Step S1340: Obtain the sensitive type label of each sensitive word from the corresponding terminal node, and construct the keyword determined as a sensitive word and the sensitive type label in the corresponding sensitive word information into mapping relationship data:

[0104] As mentioned above, when a keyword is determined to be a sensitive word, the sensitive type label can be extracted from the sensitive word information corresponding to the sensitive word, and then constructed as mapping relationship data with the keyword, so that the mapping relationship data of all keywords determined to be sensitive words in the text to be detected can be subsequently combined as result information and returned to the requesting party.

[0105] This embodiment discloses the matching between keywords and sensitive words in a dictionary tree, as well as the determination of whether a keyword is a sensitive word. For this purpose, a variety of variation embodiments are also disclosed. Through the introduction here, it is not difficult to understand that the present application is flexible and efficient, which helps to provide standardized services for complex e-commerce service platforms, thereby enhancing the information security service capabilities of independent sites of cross-border e-commerce platforms.

[0106] See also Figure 3, a sensitive word detection device provided for one of the purposes of the present application, comprising: a dictionary creation module 1100, a response processing module 1200, a query matching module 1300, and a result output module 1400, wherein the dictionary creation module 1100 is used to create a dictionary tree according to the sensitive words in the sensitive word database, and each sensitive word is represented as a storage path to an end node in the dictionary tree, and each end node is used to store corresponding sensitive word information, and the sensitive word information includes the sensitive word and the scene type label and sensitive type label to which it belongs; the response processing module 1200 is used to respond to a sensitive word detection request and obtain the text to be detected corresponding to the request and a scene type label, wherein the scene type label is a label corresponding to any one or more of the business scenario, geographic scenario, and interactive scenario of the online service that generates the text to be detected; the query matching module 1300 is used to query the dictionary tree to determine the end node of the storage path that matches the multiple keywords in the text to be detected and the scene type label, determine the matched keywords as sensitive words, and obtain the sensitive type label of each sensitive word from the corresponding end node; the result output module 1400 is used to output result information to respond to the sensitive word detection request, and the result information includes mapping relationship data between the sensitive words and their corresponding sensitive type labels.

[0107] In an extended embodiment, the sensitive word detection device of the present application includes: a queue monitoring module, which is used to monitor the sensitive word update event used to store the sensitive word database through a message queue, and respond to the sensitive word corresponding to the sensitive word update event to update the corresponding storage path in the dictionary word.

[0108] In a further embodiment, the response processing module 1200 includes: a request response submodule, which is used to respond to a sensitive word detection request and obtain the text to be detected and the scene type label carried by the sensitive word detection request; a word segmentation extraction module, which is used to use a pre-trained neural network model or a preset matching rule to perform word segmentation processing on the text to be detected and obtain multiple keywords therein.

[0109] In a further embodiment, the query matching module 1300 includes: a dictionary retrieval submodule, which is used to search the dictionary tree for each of the keywords and determine the storage path corresponding to the keyword; a path access submodule, which is used to obtain the sensitive word information stored in the terminal node corresponding to the storage path corresponding to each of the keywords; a part-of-speech analysis submodule, which is used to determine, for each of the keywords, whether it contains the sensitive words in the sensitive word information of its storage path, and whether its scene type label contains any scene type label in the sensitive word information. When both are true, the keyword is determined to be a sensitive word; a risk association submodule, which is used to obtain the sensitive type label of each sensitive word from the corresponding terminal node, and construct the keyword determined as a sensitive word and the sensitive type label in the corresponding sensitive word information as mapping relationship data.

[0110] In a specific embodiment, the sensitive word database stores preset sensitive words, as well as sensitive type labels, scene type labels, and mapping relationship data corresponding to the effective states of the sensitive words.

[0111] In a preferred embodiment, in the process of creating a dictionary tree based on sensitive words in the sensitive word database, only sensitive words whose effective status indicates that they are effective are added to the dictionary tree, and sensitive words whose effective status indicates that they are invalid are excluded from the dictionary tree.

[0112] In order to solve the above technical problems, the present application also provides a computer device. Figure 4 As shown, a schematic diagram of the internal structure of a computer device. The computer device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. Among them, the computer-readable storage medium of the computer device stores an operating system, a database, and computer-readable instructions. The database may store a control information sequence. When the computer-readable instructions are executed by the processor, the processor can implement a sensitive word detection method. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor can execute the sensitive word detection method of the present application. The network interface of the computer device is used to connect and communicate with a terminal. Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0113] In this embodiment, the processor is used to execute Figure 3The memory stores the program code and various data required to execute the above modules or submodules. The network interface is used to transmit data between user terminals or servers. The memory in this embodiment stores the program code and data required to execute all modules / submodules in the sensitive word detection device of this application, and the server can call the program code and data of the server to execute the functions of all submodules.

[0114] The present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the sensitive word detection method of any embodiment of the present application.

[0115] The present application also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any embodiment of the present application when executed by one or more processors.

[0116] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments of the present application can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a computer-readable storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0117] To sum up, the present application can realize sensitive word detection based on the dictionary tree in an economical way, fully consider the meaning and function of each keyword in the specific scenario during the sensitive word detection process, and achieve the effect of accurate detection. It is particularly suitable for fast and efficient sensitive word detection of text information generated by cross-border e-commerce independent sites. For cross-border e-commerce service platforms, it can achieve obvious economies of scale.

[0118] Those skilled in the art will appreciate that the various operations, methods, steps, measures, and schemes in the processes discussed in this application may be alternated, altered, combined, or deleted. Further, other steps, measures, and schemes in the various operations, methods, and processes discussed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted. Further, the steps, measures, and schemes in the prior art that are similar to those disclosed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted.

[0119] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A sensitive word detection method, It is characterized in that The steps include: Creating a dictionary tree according to the sensitive words in the sensitive word database, monitoring the sensitive word update event used to store the sensitive word database through a message queue, responding to the sensitive word corresponding to the sensitive word update event, and updating the corresponding storage path in the dictionary tree; Each sensitive word is represented as a storage path to an end node in the dictionary tree, and each end node is used to store corresponding sensitive word information, wherein the sensitive word information includes the sensitive word and the scene type label and sensitive type label to which it belongs, wherein the sensitive word in the sensitive word database whose effective state is an enabled state representing being effective is stored in a storage path of the dictionary tree, and the sensitive word in the sensitive word database whose effective state is an invalid state representing being invalid is excluded from the dictionary tree; In response to a sensitive word detection request, obtain the text to be detected and the scene type label corresponding to the request, wherein the scene type label is a label corresponding to any one or more of the business scenario, geographic scenario, and interaction scenario of the online service that generates the text to be detected; Querying the dictionary tree to determine the end node of the storage path that matches the multiple keywords in the text to be detected and the scene type label, determining the matching keywords as sensitive words, and obtaining the sensitive type label of each sensitive word from the corresponding end node; Output result information to respond to the sensitive word detection request, the result information including mapping relationship data between the sensitive word and its corresponding sensitive type label.

2. The sensitive word detection method according to claim 1, It is characterized in that Responding to a sensitive word detection request and obtaining the text to be detected and scene information corresponding to the request includes the following steps: Respond to the sensitive word detection request and obtain the text to be detected and the scene type label carried by the sensitive word detection request; The text to be detected is segmented using a pre-trained neural network model or a preset matching rule to obtain multiple keywords.

3. The sensitive word detection method according to claim 1, It is characterized in that Querying the dictionary tree to determine the end node of the storage path that matches the multiple keywords in the text to be detected and the scene type label, determining the matching keywords as sensitive words, and obtaining the sensitive type label of each sensitive word from the corresponding end node, including the following steps: For each of the keywords, searching the dictionary tree to determine the storage path corresponding to the keyword; For each storage path corresponding to the keyword, obtain sensitive word information stored in the terminal node corresponding to the storage path; For each of the keywords, determine whether it contains a sensitive word in the sensitive word information of its storage path, and determine whether its scene type tag contains any scene type tag in the sensitive word information. When both are true, determine that the keyword is a sensitive word; The sensitive type label of each sensitive word is obtained from the corresponding terminal node, and the keyword determined as a sensitive word and the sensitive type label in the corresponding sensitive word information are constructed as mapping relationship data.

4. The sensitive word detection method according to any one of claims 1 to 3, It is characterized in that The sensitive word database stores preset sensitive words, as well as sensitive type labels, scene type labels, and mapping relationship data corresponding to the effective states of the sensitive words.

5. The sensitive word detection method according to claim 4, It is characterized in that In the process of creating a dictionary tree based on sensitive words in the sensitive word database, only sensitive words whose effective status indicates that they are effective are added to the dictionary tree, and sensitive words whose effective status indicates that they are invalid are excluded from the dictionary tree.

6. A sensitive word detection device, It is characterized in that include: A dictionary creation module is used to create a dictionary tree according to sensitive words in a sensitive word database, monitor sensitive word update events used to store the sensitive word database through a message queue, respond to sensitive words corresponding to the sensitive word update event, and update corresponding storage paths in the dictionary tree; Each sensitive word is represented as a storage path to an end node in the dictionary tree, and each end node is used to store corresponding sensitive word information, wherein the sensitive word information includes the sensitive word and the scene type label and sensitive type label to which it belongs, wherein the sensitive word in the sensitive word database whose effective state is an enabled state representing being effective is stored in a storage path of the dictionary tree, and the sensitive word in the sensitive word database whose effective state is an invalid state representing being invalid is excluded from the dictionary tree; A response processing module, used to respond to a sensitive word detection request, obtain the text to be detected and the scene type label corresponding to the request, wherein the scene type label is a label corresponding to any one or more of the business scenario, geographical scenario, and interactive scenario of the online service that generates the text to be detected; A query matching module, used to query the dictionary tree to determine the end node of the storage path that matches the multiple keywords in the text to be detected and the scene type label, determine the matching keywords as sensitive words, and obtain the sensitive type label of each sensitive word from the corresponding end node; The result output module is used to output result information to respond to the sensitive word detection request, and the result information includes mapping relationship data between the sensitive words and their corresponding sensitive type labels.

7. A computer device comprising a central processing unit and a memory, It is characterized in that The central processing unit is used to call and run the computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, It is characterized in that It stores a computer program implemented according to the method described in any one of claims 1 to 5 in the form of computer-readable instructions, and when the computer program is called and executed by a computer, the steps included in the corresponding method are executed.

9. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instructions are executed by a processor, the steps of the method described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Sensitive word filtering method and device

    CN105843950A

  • Method and system for filtering sensitive words based on dynamic lexicon

    CN106909630A

  • Satellite network simulation method and device, electronic device and readable storage medium

    CN107404350A

  • Text data desensitization method and device, medium and electronic equipment

    CN111159770A

  • Text content auditing method and device, computer equipment and storage medium

    CN113688630A