Information detection method and device, and electronic device

CN122528899APending Publication Date: 2026-08-07NAT COMP NETWORK & INFORMATION SECURITY MANAGEMENT CENT +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NAT COMP NETWORK & INFORMATION SECURITY MANAGEMENT CENT
Filing Date
2026-04-09
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0004]本申请实施例的目的在于提供一种信息检测方法、装置及电子设备,以解决现有的信息检测方法严重依赖于敏感词库的完整性和时效性,导致检测结果的漏检率和误检率较高的技术问题

Benefits of technology

[0016]本申请实施例提供的上述技术方案,获取待检测内容;基于待检测内容确定词组列表和待检测内容对应的主题标签;依据词组列表和待检测内容对应的主题标签,从预设异构知识库中确定检索知识列表,预设异构知识库包括关键词库、指令库和案例库;根据待检测内容和检索知识列表,生成结构化提示文本;基于结构化提示文本对待检测内容进行检测,生成检测结果。如此依据词组列表和待检测内容对应的主题标签,确定检索知识列表,以构建结构化提示文本,基于结构化提示文本对待检测内容进行检测,可以提高检测结果的准确性,解决现有的信息检测方法严重依赖于敏感词库的完整性和时效性,导致检测结果的漏检率和误检率较高的技术问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122528899A_ABST
    Figure CN122528899A_ABST
Patent Text Reader

Abstract

The application provides an information detection method and device and electronic equipment, and belongs to the technical field of artificial intelligence. The method comprises the following steps: obtaining to-be-detected content; determining a word group list and a subject label corresponding to the to-be-detected content based on the to-be-detected content; determining a search knowledge list from a preset heterogeneous knowledge base according to the word group list, the to-be-detected content and the subject label corresponding to the to-be-detected content, wherein the preset heterogeneous knowledge base comprises a keyword library, an instruction library and a case library; generating a structured prompt text according to the to-be-detected content and the search knowledge list; and detecting the to-be-detected content based on the structured prompt text to generate a detection result. In this way, the search knowledge list is determined according to the word group list and the subject label corresponding to the to-be-detected content, the structured prompt text is constructed, the to-be-detected content is detected based on the structured prompt text, and the accuracy of the detection result can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to an information detection method, device and electronic device. Background Technology

[0002] With the rapid development of internet platforms and social media, the scale and speed of user-generated content have exploded, inevitably including negative information. This negative information not only affects user experience but may also pose social risks. Therefore, it is necessary to monitor user-generated content and process it based on the monitoring results.

[0003] In related technologies, existing information detection methods mainly determine the detection results by comparing the content to be detected with a sensitive word database. Although this method is highly efficient, it heavily relies on the completeness and timeliness of the sensitive word database, resulting in a high rate of missed detections and false detections. Summary of the Invention

[0004] The purpose of this application is to provide an information detection method, apparatus, and electronic device to solve the technical problem that existing information detection methods heavily rely on the completeness and timeliness of sensitive word databases, resulting in high false negative and false positive rates. The specific technical solution is as follows: In a first aspect of this application, an information detection method is provided, the method comprising: Obtain the content to be detected; Based on the content to be detected, a list of phrases and topic tags corresponding to the content to be detected are determined; Based on the phrase list and the topic tags corresponding to the content to be detected, a search knowledge list is determined from a preset heterogeneous knowledge base, which includes a keyword library, an instruction library, and a case library. Based on the content to be detected and the list of searchable knowledge, generate structured prompt text; The content to be detected is detected based on the structured prompt text, and a detection result is generated.

[0005] In an optional implementation, determining the list of phrases and the topic tags corresponding to the content to be detected based on the content to be detected includes: The content to be detected is identified to obtain the topic tags corresponding to the content to be detected. The content to be detected is segmented into words to generate candidate content for detection; Based on a preset filtering strategy, the candidate detection content is filtered to determine the word group list.

[0006] In an optional implementation, determining the retrieval knowledge list from a preset heterogeneous knowledge base based on the phrase list and the topic tags corresponding to the content to be detected includes: Based on the phrase list, M candidate keywords are determined from the keyword database, where M is a positive integer; Based on the topic tags corresponding to the content to be detected, N candidate rules are determined from the instruction library, where N is a positive integer; Based on the content to be detected, K case information is determined from the case library, where K is a positive integer; The M candidate keywords, N candidate rules, and K case information are integrated to obtain the retrieval knowledge list.

[0007] In an optional implementation, determining M candidate keywords from the keyword library based on the phrase list includes: The words in the phrase list are matched with the keywords in the keyword database to obtain at least one initial keyword; Based on the risk level corresponding to at least one of the initial keywords, sort the at least one initial keyword to obtain a keyword list; M candidate keywords are determined from the keyword list.

[0008] In an optional implementation, determining N candidate rules from the instruction library based on the topic tags corresponding to the content to be detected includes: For any rule in the instruction library, the topic tag corresponding to the content to be detected is matched with the rule to obtain the similarity corresponding to the rule; Obtain the rule weight corresponding to the rule, and use the product of the similarity corresponding to the rule and the rule weight corresponding to the rule as the matching degree corresponding to the rule; Based on the matching degree of each rule in the instruction library, N candidate rules are determined.

[0009] In an optional implementation, determining K case information from the case library based on the content to be detected includes: Feature extraction is performed on the content to be detected to obtain the detection vector; For any case in the case library, the vector corresponding to the case is matched with the vector to be detected to obtain the similarity of the case. Obtain the case weight corresponding to the case, and use the product of the similarity corresponding to the case and the case weight corresponding to the case as the matching degree corresponding to the case; Based on the matching degree of each case in the case library, determine K case information.

[0010] In an optional implementation, generating structured prompt text based on the content to be detected and the search knowledge list includes: Get the preset prompt template; The content to be detected and the list of searchable knowledge are filled into the preset prompt template to generate the structured prompt text.

[0011] In an optional implementation, the method further includes: Obtain the manual review results corresponding to the content to be tested; Based on the manual review results corresponding to the content to be detected and the detection results, the preset heterogeneous knowledge base is updated.

[0012] In a second aspect of this application, an information detection device is also provided, the device comprising: The content acquisition module is used to acquire the content to be detected; The phrase list and topic tag determination module is used to determine a phrase list and topic tags corresponding to the content to be detected based on the content to be detected. The knowledge list determination module is used to determine the knowledge list from a preset heterogeneous knowledge base based on the phrase list, the content to be detected, and the topic tags corresponding to the content to be detected. The preset heterogeneous knowledge base includes a keyword library, an instruction library, and a case library. The structured prompt text generation module is used to generate structured prompt text based on the content to be detected and the search knowledge list; The detection module is used to detect the content to be detected based on the structured prompt text and generate detection results.

[0013] In a third aspect of the embodiments of this application, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When a processor executes a program stored in memory, it implements the information detection method described in any one of the first aspects above.

[0014] In a fourth aspect of the embodiments of this application, a storage medium is also provided, wherein the storage medium stores instructions that, when executed on a computer, cause the computer to perform any of the information detection methods described in the first aspect above.

[0015] In a fifth aspect of the embodiments of this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the information detection methods described in the first aspect above.

[0016] The technical solution provided in this application involves: acquiring the content to be detected; determining a list of phrases and corresponding topic tags based on the content to be detected; determining a search knowledge list from a preset heterogeneous knowledge base, including a keyword database, an instruction database, and a case database, based on the list of phrases and the corresponding topic tags; generating structured prompt text based on the content to be detected and the search knowledge list; and detecting the content to be detected based on the structured prompt text to generate detection results. By determining the search knowledge list based on the list of phrases and the corresponding topic tags to construct structured prompt text, and then detecting the content to be detected based on this structured prompt text, the accuracy of the detection results can be improved. This solves the technical problem that existing information detection methods heavily rely on the completeness and timeliness of sensitive word databases, leading to high false negative and false positive rates. Attached Figure Description

[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0020] Figure 1 A schematic diagram illustrating the implementation process of an information detection method provided in this application embodiment; Figure 2 A schematic diagram illustrating the implementation process of another information detection method provided in this application embodiment; Figure 3 A schematic diagram illustrating the implementation process of another information detection method provided in this application embodiment; Figure 4 This is a schematic diagram of the structure of an information detection device provided in an embodiment of this application; Figure 5This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0022] The following disclosure provides numerous different embodiments or examples for implementing various structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0023] To address the technical problem that existing information detection methods heavily rely on the completeness and timeliness of sensitive word databases, leading to high false negative and false positive rates, this application provides an information detection method, apparatus, and electronic device. The method involves: acquiring the content to be detected; determining a list of phrases and corresponding topic tags based on the content; determining a retrieval knowledge list from a pre-defined heterogeneous knowledge base, including a keyword database, an instruction database, and a case database, based on the phrase list, the content to be detected, and the corresponding topic tags; generating structured prompt text based on the content to be detected and the retrieval knowledge list; and performing detection on the content to be detected based on the structured prompt text to generate detection results. By determining the retrieval knowledge list based on the phrase list and the corresponding topic tags to construct the structured prompt text, and then performing detection on the content to be detected based on the structured prompt text, the accuracy of the detection results can be improved.

[0024] like Figure 1 The diagram shown is a schematic representation of the implementation process of an information detection method provided in this application, which may specifically include the following steps: S101, Obtain the content to be detected.

[0025] The aforementioned content to be detected refers to text content on the internet that requires security analysis. Examples include user posts on social media, comment sections of news websites, chat messages in instant messaging software, posts on online forums, and bullet comments on video platforms.

[0026] In an embodiment of the present application, the content to be detected is obtained. Specifically, text data can be received in real time or near real time from various data sources (such as the content review queue of a social media platform, the message cache of an instant messaging server, the data interface of a third-party content distribution system, etc.) through an application programming interface or a data stream method. The received text data is encoded into a unified format (such as a UTF-8 string) to obtain the content to be detected. The embodiments of the present application do not limit this.

[0027] S102. Determine a phrase list and the topic tags corresponding to the content to be detected based on the content to be detected.

[0028] In an embodiment of the present application, a phrase list and the topic tags corresponding to the content to be detected are determined based on the content to be detected. The phrase list refers to a set of words or phrases with specific meanings extracted from the content to be detected. When extracting, stop words without actual semantics (such as "de", "le", "a", etc.) are removed, and core nouns, verbs, adjectives, and special feature words are retained. For example, for the content to be detected "The quality of this product is simply terrible, and it is strongly recommended that everyone not buy it!", the phrase list obtained after processing includes: ["product", "quality", "terrible", "terrible", "strongly", "recommend", "everyone", "not", "buy"]. The topic tags refer to an abstract generalization of the field or topic to which the content to be detected belongs. For example, for the content to be detected "The quality of this product is simply terrible, and it is strongly recommended that everyone not buy it!", the corresponding topic tags are consumer evaluation and product complaint.

[0029] Specifically, the content to be detected can be first preprocessed by word segmentation,词性标注, and stop word removal to obtain core vocabulary and combine them into valid phrases to form a phrase list; then the preprocessed content to be detected is input into a lightweight text classification model, and in combination with a preset tag system and the domain feature words in the phrase list, one or more topic tags are output, and at the same time, tag weights are assigned to represent the matching degree.

[0030] S103. Determine a retrieval knowledge list from a preset heterogeneous knowledge base according to the phrase list, the content to be detected, and the topic tags corresponding to the content to be detected. The preset heterogeneous knowledge base includes a keyword library, an instruction library, and a case library.

[0031] It should be noted that the "词性标注" in the original text is not clear. It may be a misspelling. If it is "词性标注" in Chinese, it should be "word tagging" in English. Here, it is temporarily translated as "词性标注" for the sake of following the original text. You can adjust it according to the correct information.In this embodiment, a search knowledge list can be determined from a pre-defined heterogeneous knowledge base based on a list of phrases, the content to be detected, and the corresponding topic tags. The pre-defined heterogeneous knowledge base may include a keyword library, an instruction library, and a case library. The keyword library contains sensitive words, violation-specific words, and variant slang terms (including homophones, similar-looking words, and abbreviations) from various fields, and each word is associated with metadata such as word form, part of speech, category, risk level (high / medium / low), synonym mapping table, and applicable scenario tags. The instruction library contains structured instructions such as information detection judgment rules, execution logic, and penalty standards. Each instruction is associated with metadata such as rule identifier, rule content, applicable scenario tags, matching weight, and judgment result (violation / compliance / suspected violation). For example, if a high-risk keyword A appears in news text, it is judged as a violation; if a moderately abusive word appears three or more times, it is judged as a suspected violation. The case library contains paragraph-level texts including various violation cases, compliance examples, and judgment criteria explanations. Each case is associated with metadata such as case identifier, case content, case type, risk level, judgment reason, applicable scenario tags, and text vector identifiers, covering typical scenarios of different types of short and long texts.

[0032] Specifically, the field specifications and storage formats of the three core knowledge dimensions—instructions, keywords, and paragraphs—can be determined. Violation / compliance related data from all fields across the entire network can be collected, including heterogeneous data such as structured rule tables, semi-structured case documents, and unstructured text descriptions. The heterogeneous data can be transformed into standardized knowledge items through a unified knowledge representation model, thereby constructing a keyword library, instruction library, and case library based on the standardized knowledge items.

[0033] S104. Generate structured prompt text based on the content to be detected and the list of knowledge to be retrieved.

[0034] In this embodiment, structured prompt text is generated based on the content to be detected and the list of retrieved knowledge. This structured prompt text serves as detection prompts for the large language model, providing clear criteria, reference cases, and matching rules for information checking. It guides the large language model to combine external knowledge to make accurate judgments about the content to be detected, avoiding false positives and false negatives caused by the large language model relying solely on its own pre-trained knowledge.

[0035] S105, Detect the content to be detected based on the structured prompt text and generate the detection results.

[0036] In this embodiment, the content to be detected is detected based on structured prompt text, generating detection results. Specifically, the structured prompt text can be input into a large language model to obtain detection results. The detection results include at least the basic information of the content to be detected (identifier, content to be detected, data source, publication time), the final judgment (compliant / violation / suspected violation), violation type and sub-label, risk level (high / medium / low, violation / suspected violation), core judgment basis (related search knowledge entries), and detection process information (large language model detection time, whether it underwent manual review, manual review time / reviewer). The detection results can be synchronously stored in the system database and fed back to the knowledge utilization and update module, providing data support for adjusting the retrieval weights of the preset heterogeneous knowledge base, marking invalid knowledge, and adding new knowledge. This embodiment does not limit this aspect.

[0037] In addition, for content that is initially suspected of being in violation, a manual review process can be initiated. Manual reviewers will conduct a second assessment based on the search knowledge list to determine the final detection result. The keyword database, instruction database, and case database can be updated based on the manual detection results.

[0038] Based on the above description of the technical solution provided in the embodiments of this application, the following steps are taken: obtaining the content to be detected; determining a list of phrases and corresponding topic tags based on the content to be detected; determining a list of retrieval knowledge from a preset heterogeneous knowledge base based on the list of phrases and the corresponding topic tags; generating structured prompt text based on the content to be detected and the list of retrieval knowledge; and detecting the content to be detected based on the structured prompt text to generate a detection result.

[0039] By determining the search knowledge list based on the phrase list and the corresponding topic tags of the content to be detected, a structured prompt text is constructed. Detection of the content based on this structured prompt text can improve the accuracy of the detection results. This addresses the technical problem that existing information detection methods heavily rely on the completeness and timeliness of sensitive word databases, leading to high false negative and false positive rates.

[0040] like Figure 2 The diagram shown is a schematic representation of the implementation process of another information detection method provided in this application. Figure 2 exist Figure 1 Building upon this foundation, the paper details how to determine the list of phrases and the corresponding topic tags based on the content to be detected, and how to generate structured prompt text based on the content to be detected and the list of retrieved knowledge. Specifically, this may include the following: S201, Obtain the content to be detected.

[0041] In this embodiment of the application, this step is similar to step S101 above, and will not be described in detail here.

[0042] S202, Identify the content to be detected and obtain the topic tags corresponding to the content to be detected.

[0043] In this embodiment, the topic tags corresponding to the content to be detected are obtained by identifying the content to be detected. Specifically, the content to be detected can be preprocessed first, including removing meaningless special symbols, normalizing continuous repeated characters, and completing short sentences, to obtain normalized text; then, the normalized text is input into a pre-trained lightweight text topic classification model to obtain the output result. The text topic classification model is trained on corpus in the field of content security detection, and presets general topic classification systems such as entertainment, society, and technology, as well as sub-tags for illegal scenarios such as insults, discrimination, violence, and false advertising; by extracting tags with a matching degree higher than a preset threshold (such as 70%) from the output result, assigning matching degree weights to each tag and sorting them from high to low weights, the topic tags (including one or more topic tags and corresponding weights) corresponding to the content to be detected are obtained.

[0044] S203, perform word segmentation on the content to be detected to generate candidate detection content.

[0045] In this embodiment, the content to be detected is segmented into words to generate candidate detection content. Specifically, the preprocessed content to be detected can be segmented using a Chinese word segmentation tool (such as jieba, HanLP, etc.). During the segmentation process, core words, phrases, and special feature words in the content are retained, and the parts of speech (nouns, verbs, adjectives, adverbs, etc.) of the words are identified and labeled. All words and consecutive valid phrases obtained after segmentation are integrated to form a set of words / phrases without repetition, which serves as candidate detection content. This embodiment does not limit this process.

[0046] S204, Based on a preset filtering strategy, filter the candidate detection content to determine the word list.

[0047] In the embodiment of the present application, based on a preset screening strategy, candidate detection content is screened to determine a phrase list. Among them, the preset screening strategy can include a stop word removal rule, a词性 screening rule, a length screening rule, and a feature word retention rule. The stop word removal rule is used to load a special stop word library in the field of content security detection (including general meaningless stop words, domain-independent function words, etc.), and all the words in the candidate detection content that belong to the stop word library are removed. The词性 screening rule is used to retain the core词性 words with actual semantics such as nouns, verbs, adjectives, numerals, etc., and remove the words without independent semantics such as auxiliary words, conjunctions, interjections, etc. The length screening rule is used to remove single-character meaningless words (except single characters such as "的" and "啊"), and retain valid words / phrases with two or more characters. The feature word retention rule is used to directly retain the content belonging to the prefix of the violation feature word and the words related to the variant words to the candidate set regardless of the length and词性. The embodiment of the present application does not limit this.

[0048] S205, according to the phrase list, the content to be detected, and the theme label corresponding to the content to be detected, determine a retrieval knowledge list from a preset heterogeneous knowledge base, and the preset heterogeneous knowledge base includes a keyword library, an instruction library, and a case library.

[0049] In the embodiment of the present application, this step is similar to the above step S103, and the embodiment of the present application will not elaborate here.

[0050] S206, obtain a preset prompt template.

[0051] In the embodiment of the present application, a preset prompt template is obtained. Among them, the preset prompt template is a structured prompt language framework customized for the content security detection scenario, which can be stored in the template library of the detection system, supports configuring exclusive sub-templates according to the detection field (news, entertainment, etc.), and supports users to customize template fields according to actual detection needs. The preset prompt template includes fixed core fields and optional extended fields. The fixed core fields can include the content to be detected, the hit keywords, the matching judgment rule, the similar reference case, and the judgment requirement. The optional extended fields can include the theme label, the position where the word appears, the risk level reference, etc. The corresponding domain-exclusive preset prompt template can be automatically matched and retrieved according to the theme label of the content to be detected. If there is no matching domain template, the general preset prompt template can be retrieved. The embodiment of the present application does not limit this.

[0052] S207, fill the content to be detected and the retrieval knowledge list into the preset prompt template to generate a structured prompt text.

[0053] In this embodiment, the content to be detected and the list of retrieved knowledge are filled into a preset prompt template to generate structured prompt text. Specifically, the content to be detected and the list of retrieved knowledge can be structured and filled according to the field format of the preset prompt template, and the original text of the content to be detected can be completely filled into the corresponding fields; the core information of keywords, rules, case information and other items in the list of retrieved knowledge is extracted, redundant metadata is removed, and the content is filled into the corresponding fields according to the format required by the preset prompt template (such as bullet points, weighting, and abbreviated description); if there is no matching item for a certain type of knowledge in the list of retrieved knowledge, "no relevant matching content" can be marked in the corresponding field to ensure that no field is empty. After the filling is completed, the structured prompt text can be formatted, including unifying punctuation, adjusting line spacing and optimizing sentence coherence, to generate structured prompt text that meets the input requirements of the large language model, so as to be directly used as the input prompt for information detection by the large language model. This embodiment does not limit this.

[0054] S208: Detect the content to be detected based on the structured prompt text and generate the detection results.

[0055] In this embodiment of the application, this step is similar to step S105 above, and will not be described in detail here.

[0056] In addition, the manual review results corresponding to the content to be tested can be obtained; based on the manual review results and the test results, the preset heterogeneous knowledge base can be updated. The manual review results refer to the results of the reviewers' review of the suspected non-compliant content to be tested in step S208. Specifically, updating the preset heterogeneous knowledge base based on the manual review results and the test results can involve performing operations such as dynamic adjustment of search weights, invalid knowledge marking and cleaning, standardized entry of new knowledge, and optimization and correction of existing knowledge for the keyword library, instruction library, and case library in the preset heterogeneous knowledge base. Among them, the search weight adjustment refers to comparing the manual review results with the test results of step S208. If the two are consistent, the weight of the keywords, instructions, and cases hit in this test in the corresponding library can be increased; if the two are inconsistent, and the reason for the deviation is invalid search knowledge matching or incorrect reference, the weight of the keywords, instructions, and cases hit in this test in the corresponding library can be decreased. Invalid knowledge labeling and cleanup refers to statistically analyzing low-value knowledge marked in the database, combined with its matching rate and judgment deviation rate in previous tests. Knowledge that meets the invalidity judgment criteria for multiple consecutive periods is marked as invalid knowledge and is blocked by default in retrieval. Invalid knowledge that has accumulated to a preset number is permanently removed from the database after administrator review. Standardized entry of new knowledge refers to extracting new types of non-compliant keywords, variant phrases, domain-specific judgment rules, and typical violation / compliance cases not covered by the database from the results of manual review. This information is then standardized and entered according to the preset field specifications and unified knowledge representation format of the keyword database, instruction database, and case database, and assigned initial search weights and a search index is built. Existing knowledge optimization and correction refers to addressing knowledge issues found in the database during manual review. For rules in the instruction database with vague applicable scenarios or inaccurate judgment logic, scenario tags are supplemented / corrected, and rule descriptions are optimized. For cases in the case database with incomplete content or vague judgment reasons, details are supplemented, the basis is improved, and vectors are regenerated.

[0057] like Figure 3 The diagram shown is a schematic representation of the implementation process of another information detection method provided in this application. Figure 3 exist Figure 1 , Figure 2 Building upon this foundation, the paper details how to determine the retrieval knowledge list from a pre-defined heterogeneous knowledge base based on a list of phrases and the corresponding topic tags of the content to be detected. Specifically, this may include the following: S301, Obtain the content to be detected; In this embodiment of the application, this step is similar to step S101 above, and will not be described in detail here.

[0058] S302, determine the list of phrases and the topic tags corresponding to the content to be detected based on the content to be detected.

[0059] In this embodiment of the application, this step is similar to step S102 above, and will not be described in detail here.

[0060] S303, determine M candidate keywords from the keyword library based on the phrase list, where M is a positive integer.

[0061] In this embodiment, M candidate keywords are determined from the keyword library based on a list of phrases, where M is a positive integer (e.g., M is 1, 2, 3, etc.). The value of M can be defined by the user according to the detection scenario.

[0062] Specifically, determining M candidate keywords from a keyword database based on a list of phrases may include the following steps: Step 31: Match the words in the phrase list with the keywords in the keyword database to obtain at least one initial keyword.

[0063] In this embodiment, the words in the phrase list are matched with the keywords in the keyword library to obtain at least one initial keyword. Specifically, a combination of hash matching and fuzzy matching can be used for matching: first, each word in the phrase list is precisely hash-matched with the keywords in the keyword library to find completely matching keywords; then, for words that are not precisely matched, fuzzy matching is performed using the synonym, homophone, and similar-looking word mapping tables in the keyword library to capture keywords corresponding to mutated and illegal phrases; the keywords obtained from precise matching and fuzzy matching are deduplicated and integrated to obtain at least one initial keyword; if no keyword is matched, the initial keyword set is empty.

[0064] Step 32: Based on the risk level corresponding to at least one initial keyword, sort the at least one initial keyword to obtain a keyword list.

[0065] In this embodiment, at least one initial keyword is sorted based on its risk level to obtain a keyword list. Specifically, the initial keywords can be sorted according to a primary sorting rule from high to low risk level, with high-risk keywords given priority. If multiple initial keywords have the same risk level, they are further sorted according to their frequency of occurrence in the content to be detected, with higher-frequency keywords appearing first. If the frequencies are also the same, the final sorting is performed according to the matching degree (i.e., exact match > fuzzy match), resulting in an ordered keyword list.

[0066] Step 33: Determine M candidate keywords from the keyword list.

[0067] In this embodiment of the application, M candidate keywords are determined from the keyword list. Specifically, the first M items can be extracted according to the sorting result of the keyword list to obtain M candidate keywords; if the number of keywords in the keyword list is less than M, then all keywords in the list are considered as candidate keywords.

[0068] S304, determine N candidate rules from the instruction library based on the topic tags corresponding to the content to be detected, where N is a positive integer.

[0069] In this embodiment, N candidate rules are determined from the instruction library based on the topic tags corresponding to the content to be detected, where N is a positive integer (e.g., N is 1, 2, 3, etc.). The value of N can be defined by the user according to the detection scenario.

[0070] Specifically, determining N candidate rules from the instruction library based on the topic tags corresponding to the content to be detected may include the following steps: Step 41: For any rule in the instruction library, match the topic tags corresponding to the content to be detected with the rule to obtain the similarity corresponding to the rule.

[0071] In this embodiment, for any rule in the instruction library, the topic tags corresponding to the content to be detected are matched with the rule to obtain the similarity corresponding to the rule. Specifically, the scene tags corresponding to the rule can be obtained and vectorized to obtain scene vectors. The topic tags corresponding to the content to be detected are also vectorized to obtain topic vectors. The similarity corresponding to the rule is obtained by calculating the cosine similarity between the scene vectors and the topic vectors.

[0072] Step 42: Obtain the rule weight corresponding to the rule, and use the product of the similarity corresponding to the rule and the rule weight corresponding to the rule as the matching degree corresponding to the rule.

[0073] In this embodiment, the rule weight corresponding to a rule is obtained, and the product of the similarity of the rule and the rule weight is used as the matching degree of the rule. The rule weight is a fixed value pre-configured and stored in the rule metadata of the instruction library. Its magnitude can be set according to the rule's detection universality, judgment accuracy, and scene importance; this embodiment does not limit this setting.

[0074] Step 43: Determine N candidate rules based on the matching degree of each rule in the instruction library.

[0075] In this embodiment, N candidate rules are determined based on the matching degree of each rule in the instruction library. Specifically, the rules in the instruction library can be sorted in descending order of matching degree, and then the first N items of the sorted rule list can be extracted to obtain N candidate rules.

[0076] S305, determine K case information from the case library based on the content to be detected, where K is a positive integer.

[0077] In this embodiment of the application, K case information is determined from the case library based on the content to be detected, where K is a positive integer (e.g., K is 1, 2, 3, etc.). The value of K can be defined by the user according to the detection scenario.

[0078] Specifically, determining K case information from a case library based on the content to be detected may include the following steps: Step 51: Extract features from the content to be detected to obtain the detection vector.

[0079] In this embodiment of the application, feature extraction is performed on the content to be detected to obtain the detection vector. Specifically, the content to be detected can first undergo standardization preprocessing (removing meaningless special symbols, normalizing consecutive repeated characters, and unifying the text encoding format), and then a domain-fine-tuned pre-trained language model (such as BERT, RoBERTa Chinese Lightweight Edition) is used to extract semantic features to obtain the detection vector.

[0080] Step 52: For any case in the case library, match the vector corresponding to the case with the vector to be detected to obtain the similarity of the case.

[0081] In this embodiment, for any case in the case library, the vector corresponding to the case is matched with the vector to be detected to obtain the similarity between the cases. Specifically, the cosine similarity algorithm can be used to calculate the semantic similarity between the case vector and the vector to be detected, thereby obtaining the similarity between the cases.

[0082] Step 53: Obtain the case weight corresponding to the case, and use the product of the similarity of the case and the case weight as the matching degree of the case.

[0083] In this embodiment, the case weight corresponding to a case is obtained, and the product of the similarity of the case and the case weight is used as the matching degree of the case. The case weight is a fixed value (e.g., 0.5) pre-configured and stored in the case metadata of the case database. Its value can be set according to the typicality, reference value, and scenario adaptability of the case: for example, typical cases covering high-frequency violation scenarios are assigned high weights (0.8-1.0), niche scenario cases are assigned medium weights (0.6-0.8), and marginal reference cases are assigned low weights (0.4-0.6). The case weight can be dynamically adjusted based on the results of manual review.

[0084] Step 54: Determine K case information based on the matching degree of each case in the case library.

[0085] In this embodiment of the application, K case information is determined based on the matching degree corresponding to each case in the case library. Specifically, all cases in the case library that have completed the matching degree calculation can be sorted in descending order according to the matching degree from high to low; then, the first K items are extracted from the sorted case list to obtain K candidate case information.

[0086] S306 integrates M candidate keywords, N candidate rules, and K case information to obtain a list of search knowledge.

[0087] In this embodiment of the application, M candidate keywords, N candidate rules and K case information are integrated to obtain a retrieval knowledge list.

[0088] S307, Generate structured prompt text based on the content to be detected and the list of knowledge to be retrieved.

[0089] In this embodiment of the application, this step is similar to step S104 above, and will not be described in detail here.

[0090] S308: Detects the content to be detected based on structured prompt text and generates detection results.

[0091] In this embodiment of the application, this step is similar to step S105 above, and will not be described in detail here.

[0092] Corresponding to the above method embodiments, this application also provides an information detection device, such as... Figure 4 As shown, the device may include a content acquisition module 401, a phrase list and topic tag determination module 402, a retrieval knowledge list determination module 403, a structured prompt text generation module 404, and a detection module 405.

[0093] Content acquisition module 401 is used to acquire the content to be detected; The phrase list and topic tag determination module 402 is used to determine the phrase list and the topic tags corresponding to the content to be detected based on the content to be detected. The knowledge list determination module 403 is used to determine the knowledge list from a preset heterogeneous knowledge base based on the phrase list, the content to be detected, and the topic tags corresponding to the content to be detected. The preset heterogeneous knowledge base includes a keyword library, an instruction library, and a case library. The structured prompt text generation module 404 is used to generate structured prompt text based on the content to be detected and the list of knowledge to be retrieved; The detection module 405 is used to detect the content to be detected based on the structured prompt text and generate detection results.

[0094] This application also provides an electronic device, such as...Figure 5 As shown, it includes a processor 501, a communication interface 502, a memory 503, and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504. Memory 503 is used to store computer programs; In one embodiment of this application, when the processor 501 executes a program stored in the memory 503, it performs the following steps: The process involves: acquiring the content to be detected; determining a list of phrases and corresponding topic tags based on the content; determining a list of search knowledge from a pre-defined heterogeneous knowledge base, including a keyword database, an instruction database, and a case database, based on the list of phrases, the content to be detected, and the corresponding topic tags; generating structured prompt text based on the content to be detected and the search knowledge list; and performing detection on the content based on the structured prompt text to generate the detection results.

[0095] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not indicate that there is only one bus or one type of bus.

[0096] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0097] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0098] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0099] In another embodiment provided in this application, a storage medium is also provided, which stores instructions that, when run on a computer, cause the computer to execute any of the information detection methods described in the above embodiments.

[0100] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the information detection methods described in the above embodiments.

[0101] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a storage medium or transmitted from one storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0102] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0103] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0104] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the protection scope of this application.

Claims

1. An information detection method, characterized in that, The method includes: Obtain the content to be detected; Based on the content to be detected, a list of phrases and topic tags corresponding to the content to be detected are determined; Based on the phrase list, the content to be detected, and the topic tags corresponding to the content to be detected, a search knowledge list is determined from a preset heterogeneous knowledge base, which includes a keyword library, an instruction library, and a case library. Based on the content to be detected and the list of searchable knowledge, generate structured prompt text; The content to be detected is detected based on the structured prompt text, and a detection result is generated.

2. The method according to claim 1, characterized in that, The process of determining the list of phrases and the topic tags corresponding to the content to be detected based on the content to be detected includes: The content to be detected is identified to obtain the topic tags corresponding to the content to be detected. The content to be detected is segmented into words to generate candidate content for detection; Based on a preset filtering strategy, the candidate detection content is filtered to determine the word group list.

3. The method according to claim 1, characterized in that, The step of determining a search knowledge list from a preset heterogeneous knowledge base based on the phrase list, the content to be detected, and the topic tags corresponding to the content to be detected includes: Based on the phrase list, M candidate keywords are determined from the keyword database, where M is a positive integer; Based on the topic tags corresponding to the content to be detected, N candidate rules are determined from the instruction library, where N is a positive integer; Based on the content to be detected, K case information is determined from the case library, where K is a positive integer; The M candidate keywords, N candidate rules, and K case information are integrated to obtain the retrieval knowledge list.

4. The method according to claim 3, characterized in that, The step of determining M candidate keywords from the keyword library based on the phrase list includes: The words in the phrase list are matched with the keywords in the keyword database to obtain at least one initial keyword; Based on the risk level corresponding to at least one of the initial keywords, sort the at least one initial keyword to obtain a keyword list; M candidate keywords are determined from the keyword list.

5. The method according to claim 3, characterized in that, The step of determining N candidate rules from the instruction library based on the topic tags corresponding to the content to be detected includes: For any rule in the instruction library, the topic tag corresponding to the content to be detected is matched with the rule to obtain the similarity corresponding to the rule; Obtain the rule weight corresponding to the rule, and use the product of the similarity corresponding to the rule and the rule weight corresponding to the rule as the matching degree corresponding to the rule; Based on the matching degree of each rule in the instruction library, N candidate rules are determined.

6. The method according to claim 3, characterized in that, The step of determining K case information from the case library based on the content to be detected includes: Feature extraction is performed on the content to be detected to obtain the detection vector; For any case in the case library, the vector corresponding to the case is matched with the vector to be detected to obtain the similarity of the case. Obtain the case weight corresponding to the case, and use the product of the similarity corresponding to the case and the case weight corresponding to the case as the matching degree corresponding to the case; Based on the matching degree of each case in the case library, determine K case information.

7. The method according to claim 1, characterized in that, The step of generating structured prompt text based on the content to be detected and the search knowledge list includes: Get the preset prompt template; The content to be detected and the list of searchable knowledge are filled into the preset prompt template to generate the structured prompt text.

8. The method according to claim 1, characterized in that, The method further includes: Obtain the manual review results corresponding to the content to be tested; Based on the manual review results corresponding to the content to be detected and the detection results, the preset heterogeneous knowledge base is updated.

9. An information detection device, characterized in that, The device includes: The content acquisition module is used to acquire the content to be detected; The phrase list and topic tag determination module is used to determine a phrase list and topic tags corresponding to the content to be detected based on the content to be detected. The knowledge list determination module is used to determine the knowledge list from a preset heterogeneous knowledge base based on the phrase list, the content to be detected, and the topic tags corresponding to the content to be detected. The preset heterogeneous knowledge base includes a keyword library, an instruction library, and a case library. The structured prompt text generation module is used to generate structured prompt text based on the content to be detected and the search knowledge list; The detection module is used to detect the content to be detected based on the structured prompt text and generate detection results.

10. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-8.