Text examination method, device, storage medium, and program product
By building a domain knowledge base and implementing a two-level screening process, the problem of low efficiency in text review was solved, achieving efficient and accurate text review and ensuring the identification and correction of illegal content.
Patent Information
- Application Number
- CN202511668367.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-11-14
AI Technical Summary
Existing text review methods are inefficient and cannot effectively identify and correct potential violations.
A domain knowledge base is constructed, which includes a set of high-risk words and element-related knowledge. A two-level screening process is used: first, candidate paragraphs are screened based on high-risk words, and then a detailed verification is carried out based on element-related knowledge to generate the paragraph review results.
It improves the efficiency of text review while ensuring the accuracy and comprehensiveness of the review, and can quickly identify and correct potential violations.
Smart Images

Figure CN121117859B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and particularly relates to a text review method, device, storage medium and program product. BACKGROUND
[0002] With the development of information technology and the explosive growth of Internet content, text information has become an important way for people to communicate, learn and acquire knowledge. Before the text is published, the text needs to be reviewed for compliance to avoid negative effects caused by the published text containing illegal content.
[0003] The current text review method has low review efficiency. SUMMARY
[0004] In view of the above problems, the present application provides a text review method, device, storage medium and program product to improve the text review efficiency. The specific scheme is as follows:
[0005] The first aspect of the present application provides a text review method, comprising:
[0006] determining a candidate paragraph in a target text based on a high-risk word set in a domain knowledge base; the high-risk word set includes illegal words and corresponding illegal types, and words that need to be checked for elements; each candidate paragraph is a paragraph containing high-risk words in the high-risk word set, and the contained high-risk words meet a preset dangerous condition;
[0007] checking elements of each candidate paragraph based on element-related knowledge in the domain knowledge base to obtain an element checking result of each candidate paragraph; the element-related knowledge includes a provision of essential elements of a compliant text, and a compliant expression suggestion when the compliant text involves a target description;
[0008] generating a review result of each candidate paragraph, wherein the review result of each candidate paragraph includes illegal words contained in the candidate paragraph and corresponding illegal types, and an element checking result corresponding to the candidate paragraph.
[0009] In a possible implementation, checking elements of the i th candidate paragraph based on the element-related knowledge in the domain knowledge base comprises:
[0010] generate an element checklist corresponding to the i-th candidate paragraph according to the i-th candidate paragraph and the element-related knowledge; the element checklist includes at least one entry corresponding to the i-th candidate paragraph, each entry corresponding to a target checking element, and each entry including a plurality of checking items; the plurality of checking items include: a first type of checking item for checking whether the i-th candidate paragraph includes the target checking element, and a second type of checking item for checking whether the i-th candidate paragraph includes a compliance-required element corresponding to the target checking element; the target checking element is an element that needs to be checked;
[0011] perform element checking on each target checking element in the i-th candidate paragraph based on the element checklist, to obtain an element checking result corresponding to the i-th candidate paragraph.
[0012] In a possible implementation, generating an element checklist corresponding to the i-th candidate paragraph according to the i-th candidate paragraph and the element-related knowledge includes:
[0013] perform entity recognition on the i-th candidate paragraph;
[0014] generate the element checklist corresponding to the i-th candidate paragraph based on the recognized entities and each element template generated based on the regulation content in the element-related knowledge; each element template includes: a target checking element determined based on the regulation content, and checking items and applicable conditions, compliance requirements, or compliance expression suggestions corresponding to the target checking element;
[0015] In the element checklist corresponding to the i-th candidate paragraph, the target checking element corresponding to each entry is an entity belonging to the target checking element that is recognized, and each entry is used to perform at least one of the following verifications on the corresponding target checking element: existence of a required element, integrity of the required element, saliency of the required element, and consistency between expression of the target checking element and a preset related expression.
[0016] In a possible implementation, the method further includes:
[0017] If it is determined based on the element checklist that any target checking element in the i-th candidate paragraph has a missing required element, query a relationship graph in the domain knowledge base to determine whether the any target checking element and the missing required element are a conflict concept pair having a conflict relationship; nodes in the relationship graph are entities, and edges between entities record association relationships and association degrees between entities; the association relationships between entities include: a conflict relationship, a dependency relationship, a synonymous relationship, a hyponym-hypernym relationship, and a positive association relationship;
[0018] if the identified conflict concept pair, obtaining a conflict weight of the conflict concept pair based on at least two of the following: a degree of association of the conflict concept pair in the relationship graph, a context consistency of the conflict concept pair in the target text, a position saliency of the conflict concept pair in the target text, and a sentiment intensity of the target check element;
[0019] adding the conflict concept pair and the conflict weight thereof to the review result of the ith candidate paragraph.
[0020] In a possible implementation, the method further includes:
[0021] if the gth identified entity does not belong to the target check element, obtaining all antonyms of the gth entity, and entities in the relationship graph in the domain knowledge base that have a semantic similarity greater than a threshold to the obtained antonyms, and constructing a candidate concept set;
[0022] traversing the candidate concept set, and checking whether each candidate concept in the candidate concept set and the gth entity are in a conflict relationship according to the relationship graph; if the hth candidate concept and the gth entity are in a conflict relationship, determining that the gth entity and the hth candidate concept form a conflict concept pair, and obtaining a conflict weight of the conflict concept pair based on at least two of the following: a degree of association of the conflict concept pair in the relationship graph, a context consistency of the conflict concept pair in the target text, a position saliency of the conflict concept pair in the target text, and a sentiment intensity of the target check element;
[0023] adding the conflict concept pair and the conflict weight thereof to the review result of the ith candidate paragraph.
[0024] In a possible implementation, the candidate paragraph is determined based on a high-risk word set in the domain knowledge base in the target text, including:
[0025] for the jth paragraph in the target text, detecting a high-risk word in the high-risk word set in the jth paragraph;
[0026] determining a risk index of the jth paragraph according to a number of high-risk words contained in the jth paragraph and a length of the jth paragraph;
[0027] if the risk index of the jth paragraph is greater than a risk threshold, determining that the jth paragraph is a candidate paragraph.
[0028] In a possible implementation, the high-risk word in the high-risk word set is detected in the jth paragraph, including:
[0029] adding each high-risk word in the high-risk word set to a Bloom filter;
[0030] for each word in the jth paragraph, querying whether the word is in the Bloom filter;
[0031] If the query result indicates that the word is not in the Bloom filter, it is determined that the word does not belong to the high-risk word set;
[0032] If the query result indicates that the word may be in the Bloom filter, the word is searched in the high-risk word set; if found, it is determined that the word belongs to the high-risk word; if not found, it is determined that the word does not belong to the high-risk word.
[0033] In a possible implementation, before determining the risk index of the jth paragraph, further comprising:
[0034] An inverted index is constructed according to the high-risk words contained in each paragraph; the inverted index indicates the position of each high-risk word in the target text;
[0035] The number of high-risk words in each paragraph is determined based on the inverted index.
[0036] In a possible implementation, further comprising:
[0037] Among the transition words appearing in the target text, a target transition word satisfying an abnormal transition condition is determined;
[0038] For different two paragraphs in the target text, the logical coherence of the two paragraphs is calculated based on the total number of target transition words appearing in the two paragraphs; the logical coherence of the two paragraphs is negatively correlated with the total number of target transition words appearing in the two paragraphs;
[0039] If the logical coherence of the two paragraphs is less than a first coherence threshold, the two paragraphs are determined as a pair of contradictory paragraphs;
[0040] The identification information of the pair of contradictory paragraphs containing the ith candidate paragraph is added to the review result of the ith candidate paragraph.
[0041] In a possible implementation, at least one of the different two paragraphs is a candidate paragraph.
[0042] In a possible implementation, before calculating the logical coherence between paragraphs, further comprising:
[0043] The logical coherence of the target text is calculated based on the number of target transition words in all paragraphs in the target text;
[0044] If the logical coherence of the target text is less than a second coherence threshold, the logical coherence between paragraphs is calculated.
[0045] In a possible implementation, the process of determining the target transition word satisfying the abnormal transition condition comprises:
[0046] For the kth transition word appearing in the target text, an initial confidence score of the kth transition word is determined based on a frequency of all transition words in a paragraph to which the kth transition word belongs and a position of the kth transition word in the paragraph;
[0047] If the initial confidence score of the kth transition word is greater than the score threshold, a contrast relation of a head and a transition in syntax structure to which the kth transition word is syntactically connected is analyzed;
[0048] If the contrast relation of the head and the transition in the syntax structure is a contrast or contrast structure, a first text segment containing the head and a second text segment containing the transition are extracted in the paragraph to which the kth transition word belongs; and a semantic change value of the second text segment relative to the first text segment is calculated;
[0049] If the semantic change value is greater than a change threshold, the kth transition word is determined as a target transition word.
[0050] In a possible implementation, the method further includes:
[0051] A first risk score of the ith candidate paragraph is obtained according to a frequency of a high-risk word appearing in the ith candidate paragraph and a weight of the high-risk word obtained from the domain knowledge base; the first risk score is positively correlated with the frequency and the weight of the high-risk word appearing in the ith candidate paragraph;
[0052] A second risk score of the ith candidate paragraph is determined according to a logical coherence between contradictory paragraph pairs containing the ith candidate paragraph; the second risk score is negatively correlated with the logical coherence between the contradictory paragraph pairs;
[0053] A third risk score of the ith candidate paragraph is determined according to a weight of each violation type in the element checking result obtained from the domain knowledge base; the third risk score is positively correlated with the weight of each violation type;
[0054] A fourth risk score of the ith candidate paragraph is determined according to a weight of an edge between a conflict concept pair determined in a relation graph; the fourth risk score is positively correlated with the weight of the edge between the conflict concept pair;
[0055] The first risk score, the second risk score, the third risk score, and the fourth risk score are weighted and summed to obtain an overall risk score of the ith candidate paragraph.
[0056] In a possible implementation, before the candidate paragraphs and the contradictory paragraph pairs are determined in the target text, the method further includes:
[0057] The target text is classified to determine a document type to which the target text belongs;
[0058] The element checking on each candidate paragraph based on the element-related knowledge in the domain knowledge base comprises:
[0059] The element checking on each candidate paragraph based on the element-related knowledge in the domain knowledge base corresponding to the document type.
[0060] The second aspect of the present application provides a computer program product comprising computer readable instructions, which, when executed on an electronic device, cause the electronic device to implement the text review method of the first aspect or any implementation manner of the first aspect.
[0061] The third aspect of the present application provides an electronic device comprising at least one processor and a memory connected to the processor, wherein:
[0062] The memory is configured to store a computer program;
[0063] The processor is configured to execute the computer program to enable the electronic device to implement the text review method of the first aspect or any implementation manner of the first aspect.
[0064] The fourth aspect of the present application provides a computer storage medium, the storage medium carrying one or more computer programs, which, when executed by an electronic device, can enable the electronic device to implement the text review method of the first aspect or any implementation manner of the first aspect.
[0065] By the above technical solution, the text review method, device, storage medium and program product provided by the present application pre-construct a domain knowledge base, which includes a high-risk word set and element-related knowledge. The high-risk word set includes: rule-breaking words and their corresponding rule-breaking types, and words that need to be checked for elements. The element-related knowledge includes the provisions of essential elements of a compliant text, and suggestions for compliant expressions when a compliant text involves a target description. When reviewing a target text, first, based on the high-risk word set in the domain knowledge base, determine the paragraphs in the target text that contain high-risk words that meet the preset dangerous conditions as candidate paragraphs. Then, based on the element-related knowledge, perform element checking on each candidate paragraph to obtain the element checking result of each candidate paragraph, generate a review result for each candidate paragraph, and the review result of each candidate paragraph includes: the rule-breaking words contained in the candidate paragraph and their corresponding rule-breaking types, and the element checking result corresponding to the candidate paragraph. The present application first screens candidate paragraphs based on high-risk words, and then performs element checking on the candidate paragraphs based on element-related knowledge. Through two-level screening, the review efficiency is improved while ensuring the accuracy of the review. BRIEF DESCRIPTION OF DRAWINGS
[0066] The above described and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description. The same or similar reference numerals are used throughout the drawings to represent the same or similar elements. It should be understood that the drawings are not necessarily to scale.
[0067] Figure 1 A partial example of the tree structure knowledge provided by the present application in the medical propaganda field;
[0068] Figure 2 An implementation flowchart of the text review method provided by the present application;
[0069] Figure 3 An implementation flowchart of the element review of the i th candidate paragraph based on the element-related knowledge in the domain knowledge base provided by the present application;
[0070] Figure 4 An implementation flowchart of the generation of the element check table corresponding to the i th candidate paragraph according to the i th candidate paragraph and the element-related knowledge provided by the present application;
[0071] Figure 5 A partial example of the relationship graph provided by the present application;
[0072] Figure 6 An implementation flowchart of the determination of the candidate paragraph in the target text based on the high-risk word set in the domain knowledge base provided by the present application;
[0073] Figure 7 An implementation flowchart of the detection of the high-risk word in the high-risk set in the j th paragraph provided by the present application;
[0074] Figure 8 An implementation flowchart of the determination of the target transition word satisfying the abnormal transition condition provided by the present application;
[0075] Figure 9 An implementation flowchart of the determination of the target transition word satisfying the abnormal transition condition provided by the present application; DETAILED DESCRIPTION
[0076] The embodiments of the present application are described below with reference to the accompanying drawings. The terms used in the embodiment part of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0077] The embodiments of the present application are described below with reference to the accompanying drawings. It is known to those skilled in the art that as technology develops and new scenarios appear, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0078] The terms "first", "second", and the like in the description and in the claims of the present application and above drawings are used to distinguish similar objects and are not necessarily used to describe a specific sequential or chronological order. It should be understood that the terms so used are interchangeable under appropriate circumstances and are merely employed in the descriptions of embodiments of the present application for the purpose of differentiation among like objects. Moreover, the terms "comprising", "having", "including", and "containing" are to be construed as open-ended terms (i.e., meaning "including, but not limited to") unless otherwise noted to have a closed- ended meaning. All methods, systems and processes described herein can be performed by or with one or more computers or computing devices other than a human being. The term "or" in reference to a list of items shall be interpreted as inclusive of at least one of the items in the list.
[0079] The text review method provided by the present application pre-constructs a domain knowledge base according to domain knowledge. Different domain knowledge is used to construct different domain knowledge bases. The domains of the present application can include but are not limited to the following domains: financial advertising domain, medical propaganda domain, academic plagiarism checking domain, etc. The knowledge of each domain is the regulatory provisions of the domain, including but not limited to: regulations, specifications, guidelines, etc.
[0080] Each domain knowledge base can store domain knowledge in a tree structure, such as Figure 1 as shown, which is a partial example of the tree structure knowledge of the medical propaganda domain provided by an embodiment of the present application. In the tree structure, the root node is hung with the clause identifiers in the regulations, specifications, and guidelines. Each clause identifier node is hung with two types of nodes: violation type (also referred to as violation mode) and element template. The violation type node is hung with high-risk words belonging to the violation type and their weights, and the element template node is hung with the mandatory elements of the compliance text specified by the clause and / or the compliance expression suggestions when the compliance text involves target description.
[0081] The weight of the high-risk word can be determined based on the frequency (i.e., word frequency) of the high-risk word appearing in the target text and the harm level of the high-risk word. The weight of the high-risk word is positively correlated with the word frequency of the high-risk word and the harm level of the high-risk word. As an example, the word frequency and the harm level of the high-risk word can be weighted and summed to obtain the weight of the high-risk word. Optionally, the weight of the word frequency of the high-risk word is greater than the weight of the harm level of the high-risk word. For example, the weight of the word frequency of the high-risk word is 0.7, and the weight of the harm level of the high-risk word is 0.3. The harm level of the high-risk word can be calibrated by experts based on the importance of the relevant regulations, the penalty level, historical cases, etc. The value of the harm level can be mapped to the range [0, 1].
[0082] Optionally, the node recording the clause identifier can also be associated with industry metadata, which can include but is not limited to: applicable domain, effective date, penalty level, etc.
[0083] The two types of nodes under a clause identifier, namely violation type and element template, constitute a complete digital interpretation of a regulation. It also supports two review modes: rapid initial screening (quickly identifying candidate paragraphs) and in-depth verification (conducting element verification on candidate paragraphs).
[0084] The domain knowledge base also stores a set of high-risk words determined based on the aforementioned tree-structured knowledge. This set includes: prohibited words (e.g.,...). Figure 1 The terms "superior", "best", "cure", "refund if ineffective" under the violation type node and words requiring element verification (e.g., Figure 1 The high-risk keyword set includes terms such as "industry-leading," "outstanding market performance," "highly favored by users," and "top-ranked" under the element template node; it also includes the violation types corresponding to the high-risk keywords. Of course, the high-risk keywords in this application are not limited to the few listed above, but may also include other high-risk keywords, such as "leading," "excellent," "first-of-its-kind," "unique," and "most."
[0085] The element template can be a structured JSON or XML object. For example, a financial risk warning element template might contain:
[0086] json
[0087] {
[0088] "element_name": "risk_disclosure",
[0089] "required": true,
[0090] "salience_rules": [
[0091] {"type": "font_size", "comparison": ">=", "base": "body_text", "ratio": 1.0},
[0092] {"type": "position", "not_in": ["footer", "margin"]}
[0093] ],
[0094] "consistency_rules": [
[0095] {"type": "semantic_similarity", "threshold": 0.8, "reference_text": "Market risks exist; invest with caution"}
[0096] } ”.
[0097] The present application performs text review based on the above-mentioned domain knowledge base. As shown in the figure, an implementation flowchart of a text review method provided by an embodiment of the present application can include the following steps: Figure 2
[0098] Step S201: determining candidate paragraphs in the target text based on the high-risk word set in the domain knowledge base; each candidate paragraph is a paragraph containing a high-risk word in the high-risk word set and containing a high-risk word satisfying a preset dangerous condition. The process of determining candidate paragraphs can be referred to as parent search.
[0099] The target text is a text to be reviewed, and the candidate paragraph is a paragraph with suspected violations in the target text. If a paragraph in the target text does not contain a high-risk word, the paragraph is a compliance paragraph; if the paragraph contains a high-risk word, the paragraph is not necessarily a paragraph with suspected violations, and it is necessary to further determine whether the paragraph satisfies the preset dangerous condition based on the high-risk word contained in the paragraph. If the preset dangerous condition is satisfied, the paragraph is determined to be a suspected violation paragraph, otherwise the paragraph is determined to be a compliance paragraph.
[0100] Step S202: performing element checking on each candidate paragraph based on the element-related knowledge in the domain knowledge base to obtain an element checking result of each candidate paragraph; the element-related knowledge includes the provisions of essential elements of compliance texts and compliance expression suggestions when the compliance text involves target description. The process of performing element checking on the candidate paragraph can be referred to as sub-search.
[0101] Performing element checking on each candidate paragraph mainly includes judging whether the paragraph contains an essential element corresponding to an element checking word (for convenience of description and distinction, referred to as element checking word) and whether the essential element is compliant if the essential element exists. Therefore, the element checking result of each candidate paragraph represents whether the candidate paragraph contains an essential element corresponding to an element checking word and whether the essential element is compliant if the essential element exists.
[0102] Step S203: generating a review result of each candidate paragraph, which includes: the violation words contained in the candidate paragraph and the corresponding violation types, and the element checking result corresponding to the candidate paragraph.
[0103] The review result of each candidate paragraph includes at least two aspects of review results: the first aspect of review results represents whether there is a violation word in the candidate paragraph and the violation type if there is a violation word; the second aspect of review results represents whether there is an essential element in the candidate paragraph and whether the essential element is compliant if the essential element exists.
[0104] Further, the review result of each candidate paragraph can also include the review basis, i.e., the corresponding regulation clause, specification clause or guideline clause, etc.
[0105] The text review method provided in the application pre-constructs a domain knowledge base, which includes a high-risk word set and element-related knowledge. The high-risk word set includes violation words and their corresponding violation types, and words that need to be checked for elements. The element-related knowledge includes the provisions for essential elements of a compliance text, and compliance expression suggestions when a compliance text involves target description. When reviewing a target text, first, based on the high-risk word set in the domain knowledge base, determine the paragraphs in the target text that contain high-risk words and meet the preset dangerous conditions as candidate paragraphs. Then, based on the element-related knowledge, check the elements of each candidate paragraph to obtain the element check result of each candidate paragraph, and generate the review result of each candidate paragraph. The review result of each candidate paragraph includes the violation words contained in the candidate paragraph and their corresponding violation types, and the element check result corresponding to the candidate paragraph. The application first screens candidate paragraphs based on high-risk words, and then checks the elements of the candidate paragraphs based on element-related knowledge. Through two-level screening, the review efficiency is improved while ensuring the accuracy of the review.
[0106] The application checks the elements of each candidate paragraph in the same way. The following describes the process of checking the elements of a candidate paragraph by taking the ith candidate paragraph as an example. In an optional embodiment, based on the element-related knowledge in the domain knowledge base, an implementation flowchart for checking the elements of the ith candidate paragraph is as shown in Figure 3
[0107] Step S301: Generate the element check table corresponding to the ith candidate paragraph according to the ith candidate paragraph and the element-related knowledge.
[0108] The element check table contains at least one entry corresponding to the ith candidate paragraph. Each entry corresponds to a target check element (i.e., the aforementioned element check word, such as an entity describing quality, effect, size, etc.), and each entry contains multiple check items. The multiple check items include: a first type of check item for checking whether the ith candidate paragraph contains the target check element, and a second type of check item for checking whether the ith candidate paragraph contains a compliance essential element corresponding to the target check element. The first type of check item contains at least one, and the second type of check item contains at least one. That is, each entry contains the first type of check item and the second type of check item. The first type of check item is used to check whether the ith candidate paragraph contains the target check element, and the second type of check item is used to check whether the ith candidate paragraph contains a compliance essential element corresponding to the target check element.
[0109] The element check list corresponding to the i-th candidate paragraph is a "to-do list" or "verification instruction" for the i-th candidate paragraph, which contains all specific items that need to be checked for the i-th candidate paragraph.
[0110] For example, for a financial advertising paragraph, an entry in its corresponding element check list can be:
[0111] [ {check item: "whether there is a profit promise", regulation ID: "Article Y of XX Law"}, {check item: "whether the risk prompt is sufficient and prominent", regulation ID: "Article Z of XX Law", requirement: "font size not less than body text, located at the end of the text"},... ].
[0112] Among them, "{check item: "whether there is a profit promise", regulation ID: "Article Y of XX Law"}" is the first type of check item, which is used to check whether the element "profit promise" in the financial advertising paragraph needs to be checked. "{check item: "whether the risk prompt is sufficient and prominent", regulation ID: "Article Z of XX Law", requirement: "font size not less than body text, located at the end of the text"}" is the second type of check item, which is used to check whether the compliance required element "sufficient and prominent risk prompt" corresponding to the target check element "profit promise" exists in the financial advertising paragraph.
[0113] Optionally, the i-th candidate paragraph and the element-related knowledge can be processed by the large model to generate the element check list corresponding to the i-th candidate paragraph. As an example, the element-related knowledge related to the i-th candidate paragraph can be searched from the domain knowledge base, the i-th candidate paragraph and its related element-related knowledge are added to the prompt word template to obtain the prompt word, and the prompt word template also includes a task instruction indicating the large model to generate the element check list corresponding to the i-th candidate paragraph according to the element-related knowledge. The prompt word is input into the large model to obtain the element check list corresponding to the i-th candidate paragraph generated by the large model.
[0114] Step S302: Based on the element check list, each target check element in the i-th candidate paragraph is checked for elements to obtain the element check result corresponding to the i-th candidate paragraph.
[0115] Each item of the i-th candidate paragraph can be checked according to each item in the element check list, so that the candidate paragraph can be clearly and completely checked for elements, ensuring the comprehensiveness of the element check.
[0116] In an optional embodiment, an implementation flowchart of the above-mentioned generation of the element check list corresponding to the i-th candidate paragraph according to the i-th candidate paragraph and the element-related knowledge can be as shown in Figure 4 , which can include:
[0117] Step S401: performing entity recognition on the ith candidate paragraph.
[0118] The entity recognition on the ith candidate paragraph can be performed by a large model, or the entity recognition on the ith candidate paragraph can be performed by a pre-trained entity recognition model.
[0119] Step S402: generating an element checklist corresponding to the ith candidate paragraph based on the identified entities and each element template generated based on the regulatory content in the element-related knowledge.
[0120] Each element template includes a target checking element determined based on the regulatory content, and a corresponding checking item and applicable condition, compliance requirement, or compliance expression suggestion, etc.
[0121] For financial advertisements, the element templates in the knowledge base can include but are not limited to: risk prompt templates, income basis templates, etc.
[0122] For medical propaganda, the element templates in the knowledge base can include but are not limited to: contraindication templates, indication templates, etc.
[0123] For academic papers, the element templates in the knowledge base can include but are not limited to: citation standardization element templates, originality declaration element templates, data and method transparency element templates, consent declaration element templates, etc. Among them, the citation standardization element template is used to check whether the paper has the standard elements of identifying other people's work to ensure that all citations are clearly and normatively identified; the originality declaration element template is used to check whether the specific part of the paper contains the necessary originality declaration to ensure that the author clearly declares the innovative part of his work; the data and method transparency element template is used to check the transparency and repeatability of experimental data and method description to prevent data tampering, forgery or unclear method description of academic misconduct; the consent declaration element template is used to check whether a specific compliance description is required and included to ensure that the research complies with the academic.
[0124] As an example, a violation example of lacking citation standardization elements is: missing citation identification, such as using other people's opinions, data, formulas or text fragments in the paper, but not labeling the citation (such as “[1]”) or not listing in the reference list; missing citation guide words, such as directly copying the text without the citation signal words such as “research shows” and “according to X”. A violation example of lacking originality elements is: in the introduction or conclusion part, the difference and innovation point of the work from the existing research is not clearly stated. A violation example of lacking data and method transparency elements is: missing data source, such as using a data set that is not publicly available or not marked with a source; key parameters are hidden, intentionally omitting key steps or parameters in the experimental method, making it impossible to reproduce.
[0125] The target checking element corresponding to each entry in the element checklist corresponding to the i-th candidate paragraph is an identified entity belonging to the target checking element, and each entry is used to check the corresponding target checking element in at least one of the following aspects: existence of essential elements (i.e., existence check), integrity of essential elements (i.e., integrity check), salience of essential elements (i.e., salience check), consistency of the expression of the target checking element with a preset related expression (i.e., consistency check).
[0126] The existence check aims to confirm whether the core entity or keyword required by the element template is contained in the i-th candidate paragraph, i.e., to detect whether the i-th candidate paragraph contains the essential element defined by the element template. Optionally, a predefined dictionary, a regular expression, or a named entity recognition (NER) model can be used to scan the i-th candidate paragraph to determine whether an entity belonging to the essential element exists (for example, "risk", "invest with caution", "capital may be lost", etc.). The output of the existence check can be a Boolean value (True / False), and if the output is False, it is directly marked as "element missing" and bound to the regulation ID, and subsequent checks (integrity, salience, and consistency) do not need to be performed.
[0127] The integrity check aims to confirm whether the essential element is complete based on the existence of the essential element, without omission or fuzzy processing to evade review. Optionally, more complex patterns or rules can be used for checking. For example, only the word "risk" is not enough to pass the integrity check, and a complete and unambiguous phrase (such as "past performance does not represent future performance, the market is risky, and investment is required with caution") must be matched to pass the integrity check. The output of the integrity check can also be a Boolean value (True / False), and if the output is False, it is directly marked as "element expression incomplete".
[0128] The salience check aims to confirm whether the presentation of the essential element is sufficiently eye-catching to attract the attention of ordinary consumers. Optionally, if the target text is pure text, the position of the essential element (such as whether it is at the beginning or end of the paragraph) can be checked; if the input includes layout information (such as input in PDF, image, etc.), metadata (such as {font-size: 10px, position: [x1, y1, x2, y2]} ) can be obtained through OCR or layout analysis technology, and the following checks can be performed:
[0129] Font size (font-size): For example, whether the font size of the risk prompt is not less than the font size of the main text, if less than the main text, the font size is not in compliance. The font size of the main text can be the average font size of all the words in the main text.
[0130] Color contrast: whether the contrast of the color with the background color meets the readability standard (such as the WCAG standard) or not. If it does not meet the readability standard, the color contrast is non-compliant.
[0131] Position: whether the risk prompt is located in a prominent position, rather than in the footer or edge of the dense small letters. If it is located in the footer or edge of the dense small letters, the position is non-compliant.
[0132] The output of the prominence check is a conclusion of compliance or non-compliance, and can be quantified according to the preset rules.
[0133] The preset relevant expression can be a compliant example, and accordingly, the consistency of the target check element with the preset relevant expression can be the semantic consistency of the target check element with the compliant example.
[0134] The preset relevant expression can be a relevant expression in other paragraphs in the target text, such as checking whether the element (such as the income promise) in this paragraph is logically consistent with the element (such as the risk prompt) in other places of the document.
[0135] The purpose of the consistency check is to confirm whether the expression of the essential element is consistent, unambiguous, and contradictory with the expression in the knowledge base and / or the relevant expression of other paragraphs. Obviously, the consistency check includes internal consistency and external consistency, wherein the internal consistency is to check whether the expression of the essential element itself is highly consistent in semantics with the compliant example stored in the element template of the domain knowledge base; the expression of the essential element itself can be subjected to semantic similarity (such as cosine similarity) calculation with the compliant example to obtain a semantic consistency score, and if the semantic consistency score is less than a threshold value, it indicates that the essential element is non-compliant; the external consistency is linked with the aforementioned "element checking on candidate paragraphs" and the "paragraph contradiction judgment" below, and mainly checks whether the target check element (such as the income promise) of the i-th candidate paragraph is logically consistent with the element (such as the risk prompt) of other paragraphs in the target text; the association relationship and association weight between the target check element and the element of other paragraphs can be obtained through the relationship graph provided below, and the logical consistency score is determined according to the association relationship and association weight, and if the logical consistency score is less than a threshold value, it is marked as "not consistent with the compliant expression" or "contradictory with the content of xx paragraph". The target check element and the element of other paragraphs and the association relationship and association weight therebetween can be input into a consistency scoring model to obtain a logical consistency score output by the model.
[0136] After the check is completed, a structured check result can be output, such as the following format:
[0137] {Element name: "risk_disclosure", Missing items: [], Violation items: ["font_size", "semantic_similarity"], Evidence location: [...]}.
[0138] The above verification result can also be bound to the corresponding regulation ID.
[0139] The present application converts the subjective "significance" and "consistency" requirements into objective and calculable indicators, making the audit results more explicit.
[0140] Further, the element-related knowledge includes regulation ID or specification ID or guideline ID, etc.; accordingly, the element checklist can also include regulation ID or specification ID or guideline ID, etc.
[0141] Further, the element-related knowledge includes compliance examples and counterexamples; accordingly, the element checklist can also include compliance examples and counterexamples, etc.
[0142] Further, the element-related knowledge includes the score or weight corresponding to the inspection item (which can be determined by domain experts), which represents the degree of violation in the case of non-compliance; accordingly, the element checklist can also include the score or weight corresponding to the inspection item. For example, for the "risk prompt" element, the weight of complete absence may be 1.0 (serious violation), the weight of insufficient font size may be 0.6 (general violation), and the weight of non-significant position may be 0.4 (slight violation).
[0143] Further, the element-related knowledge includes mutual exclusion / dependence relationships between elements; accordingly, the element checklist can also include mutual exclusion / dependence relationships between elements. For example, for mutual exclusion, in the element template of a certain drug advertisement, the "indication" and "contraindication" sections cannot have the same disease description. If both appear, even if they are individually compliant, it is a logical error. For dependence, in the element template of a certain financial advertisement, if the "profit promise" element appears, the "risk prompt" element must also appear. This is a strong dependence relationship, and the check of "risk prompt" depends on whether "profit promise" exists.
[0144] To increase the explainability of the review results, the present application adds a relationship graph to the knowledge base, where the nodes are entities (or concepts), and the edges between entities record the association relationship and association degree between entities. The association relationship between entities can include but is not limited to: conflict relationship, dependence relationship, synonymous relationship, hierarchical relationship, positive association relationship, etc.
[0145] Among them, "synonymity" indicates that two entities have the same or very similar meaning in a specific context. It can be used for semantic anti-plagiarism. For example, the graph records "convolutional neural network" and "CNN model" as synonyms with high weight. When the target text replaces "convolutional neural network" with "CNN model" in existing text (text different from the target text) without citing it, the system can detect this "synonymous substitution" plagiarism through synonymity.
[0146] "Hypernyx relationship" indicates that one entity is a superordinate (more abstract) or subordinate (more concrete) concept of the other. For example, "fruit" is a superordinate noun of "orange." This can be used to detect "conceptual manipulation" or "scope expansion." For instance, in medical advertising, claiming that an ingredient proven effective for "a specific type of apple" is effective for all "fruits" constitutes exaggerated advertising (a type of conflict) through a hypernyx relationship.
[0147] A positive association indicates that two entities typically appear in the same context, have consistent semantics, and support each other. Examples include "investment" and "returns," "treatment" and "efficacy." It is used to verify the validity of a "dependency" relationship. For example, in financial advertisements, if both "investment" and "returns" appear, and their positive association weight is high, this is expected; however, if only "returns" appear without "risk," it triggers an alert for a missing "dependency" relationship, because "returns" and "risk" are dependent.
[0148] like Figure 5 The image shown is a partial example of a relationship graph provided in an embodiment of this application. Figure 5 In the example shown, the entity "Free Trial" and the entity "Automatic Renewal" have a conflict relationship, with a conflict weight (representing the degree of conflict) of 0.98; the entities "Free Trial" and "Seven-Day No-Reason Request" have a dependency relationship, with a dependency weight (representing the degree of dependency) of 0.15.
[0149] The degree of association between entities in a relationship graph can be determined in the following ways:
[0150] For any two entities in the domain corpus, calculate the point mutual information (PMI) value between the two entities.
[0151] Corpus data in the field of financial advertising may include, but is not limited to: financial news, publications, and advertising copy.
[0152] Corpora in the field of medical publicity can include, but are not limited to: medical news, publications, and medical advertisements.
[0153] Corpora in the field of academic papers may include, but are not limited to: news, journals, and academic papers in the academic field.
[0154] Assuming that any two entities are a first entity and a second entity, the PMI value of the two entities can be calculated by the probability of the first entity appearing independently in the field corpus, the probability of the second entity appearing independently in the field corpus, and the probability of the two entities appearing in the same context window. The PMI value of the two entities can be calculated by the following formula:
[0155] PMI(u, v) = log( P(u, v) / (P(u)×P(v)) );
[0156] Wherein, u and v represent any two entities, P(u) is the probability of entity u appearing independently, P(v) is the probability of entity v appearing independently, and P(u, v) is the probability of entity u and v appearing in the same context window.
[0157] The higher the PMI value, the more positively correlated the two entities are, and the lower or negative value indicates no correlation or negative correlation. In this application, the entity pair belonging to the "conflict relationship" is the concept pair with a significantly negative PMI value.
[0158] The arbitrary two entities, the PMI value of the two entities, the context of the two entities, and the syntactic features of the two entities are input into the pre-trained weight prediction model to obtain the correlation relationship and weight value predicted by the weight prediction model.
[0159] The weight prediction model is trained based on high-quality data samples manually annotated. The training samples include: entity pairs and their PMI values, contexts of entities, syntactic features, manually annotated true relationships and weights, such as {PMI value: -100, stable profit, investment risk, syntactic features, conflict: 0.95}. The input of the weight prediction model includes: PMI value, entity pair, context of entity, syntactic feature; the output of the weight prediction model is the correlation relationship and weight between the input entity pairs predicted by the weight prediction model. The correlation relationship and weight between the entity pairs predicted by the weight prediction model tend to approach the manually annotated true relationship and weight in the training sample, and the parameters of the weight prediction model are updated.
[0160] The weight prediction model can be a gradient boosting decision tree GBDT or a neural network model.
[0161] The weight prediction model can correct the shortcomings of PMI, for example, two words rarely co-occur but are indeed in conflict in semantics. In this case, PMI may miss the judgment, but the weight prediction model can learn.
[0162] Based on the preset weight rule base and the correlation relationship predicted by the weight prediction model, the weight value predicted by the weight prediction model is fine-tuned to obtain a target weight between the two entities as the correlation degree between the two entities.
[0163] The preset weight rule base is constructed by domain experts, and the purpose is to ensure that the business meaning of the weight is absolutely accurate and meets the regulations and industry standards.
[0164] For key entity pairs in the field (such as conflicts explicitly prohibited in regulations), the weight must be finally reviewed and calibrated by domain experts (such as financial compliance officers, medical auditors, etc.). For example, “any expression containing ‘radical cure’ and ‘individual differences’ conflict weight is directly calibrated to 0.99”.
[0165] Optionally, the rules in the above weight rule base can be hard-coded into the system to cover or fine-tune the weight obtained in the second step, ensuring that the core logic is correct.
[0166] The present application accurately determines the relationship and correlation weight between entities in the relationship graph by integrating statistics (PMI), supervised learning and expert calibration, and takes into account data objectivity and business accuracy.
[0167] To distinguish, the aforementioned domain knowledge base stored in a tree structure can be referred to as a rule knowledge base, and the knowledge stored through the relationship graph can be referred to as a semantic knowledge base, that is, the domain knowledge base of the present application includes a rule knowledge base and a semantic knowledge base.
[0168] Based on the above relationship graph, in an optional embodiment, the text auditing method provided by the present application can further include:
[0169] If it is determined based on the element checklist that any target check element in the i th candidate paragraph has a missing essential element problem, query in the relationship graph in the domain knowledge base whether the any target check element and the missing essential element are a conflict concept pair having a conflict relationship.
[0170] Taking a financial advertisement as an example, a compliant advertisement requires that in the case of a profit promise, a risk prompt needs to be prominently marked (such as in the same paragraph). If a financial advertisement contains a profit promise in a paragraph, but does not mark a risk prompt in the paragraph where the profit promise is located, it is considered that the paragraph where the profit promise is located has a missing essential element problem.
[0171] If there is a risk prompt in the relationship graph that has a conflict relationship with the profit promise, it means that the profit promise and the risk prompt are a conflict concept pair.
[0172] If it is a conflict concept pair, a conflict weight of the conflict concept pair is calculated based on at least two of the following information: a correlation degree of the conflict concept pair in the relationship graph, a context consistency of the conflict concept pair in the target text, a position significance of the conflict concept pair, and a sentiment intensity of any one of the target checking elements.
[0173] The context consistency of the conflict concept pair in the target text is represented by a semantic similarity of the conflict concept pair in the target text. The lower the similarity, the more acute the conflict of the conflict concept pair in the current context is represented. The semantic similarity can be represented by a cosine similarity of semantic vectors of the conflict concept pair. The smaller the cosine similarity, the lower the semantic similarity is represented. Optionally, if there is no essential element in the entire target text, the context consistency of the conflict concept pair in the target text can be a value that tends to zero, for example, the context consistency of the conflict concept pair in the target text can be greater than zero and less than a first preset value.
[0174] The position significance can be determined based on layout analysis and / or position rules. For example, if both parties in the conflict concept pair appear in the main body of the text, it means that the position is significant, and the position significance is 1.0; if one party appears in the main text and the other party is in the footer and the font size is smaller than the main text, it means that the position is not significant, and the significance value is 0.2. The specific value of the position significance can be obtained according to a pre-defined rule mapping table, which defines the corresponding relationship between the font size ratio of the two parties in the conflict concept pair and the compliance font size and the position coordinates of the two parties in the conflict concept pair in the target text and the position significance. Optionally, if there is no essential element in the entire target text, the position significance of the essential element is 0.
[0175] The sentiment intensity can be judged using a strength classification model. Specifically, any one of the above target checking elements can be input into a pre-trained strength classification model to obtain a score representing the degree of absolute or exaggeration of the sentiment output by the strength classification model (the value range can be [0.0, 1.0]), for example, the score of “absolute effectiveness” is 0.95, and the score of “better effect” is 0.6.
[0176] Optionally, the conflict weight of the conflict concept pair is positively correlated with the correlation degree of the conflict concept pair in the relationship graph, the conflict weight of the conflict concept pair is negatively correlated with the context consistency of the conflict concept pair in the target text, the conflict weight of the conflict concept pair is negatively correlated with the position significance of the conflict concept pair, and the conflict weight of the conflict concept pair is negatively correlated with the sentiment intensity of any one of the target checking elements.
[0177] As an example, the conflict weight of the conflict concept pair can be calculated by the following formula:
[0178] W Final =W Mapx (1 - Context_Consistency) x (1 - Position_Salience) x Tone_Intensity.
[0179] wherein W Final is the conflict weight of the conflict concept pair; W Map is the correlation degree of the conflict concept pair in the relation graph; Context_Consistency is the context consistency of the conflict concept pair in the target text; Position_Salience is the position salience of the conflict concept pair; and Tone_Intensity is the tone intensity of any of the target check elements. This is a multi-factor joint decision model, which ensures that the maximum weight can comprehensively and accurately reflect the severity of the violation. The greater the conflict weight of the conflict concept pair, the more acute the conflict represents, and the greater the risk of violation (i.e., the more serious the violation).
[0180] The conflict concept pair and its conflict weight are added to the review results of the ith candidate paragraph.
[0181] The conflict concept pair and its conflict weight are added to the review results of the ith candidate paragraph, so that the user can more clearly understand the severity of the violation of any target check element in terms of the absence of essential elements.
[0182] In an optional embodiment, if the gth entity identified does not belong to the target check element, all the antonyms of the gth entity are obtained, and entities in the relation graph that have a semantic similarity greater than a threshold value with the obtained antonyms constitute a candidate concept set corresponding to the gth entity.
[0183] That is, the candidate concept set includes all the antonyms of the gth entity, and entities in the relation graph that have a semantic similarity greater than a threshold value with each of the antonyms of the gth entity. As an example, for each antonym of the gth entity, all entities in the relation graph that have a semantic similarity greater than a threshold value with the antonym can be obtained, and the entities obtained based on each antonym are de-duplicated to obtain entities in the relation graph that have a semantic similarity greater than a threshold value with the obtained antonyms. For example, the gth entity is “the strongest”, and its antonyms can include “the weakest”, and entities in the relation graph that have a semantic similarity greater than a threshold value with “the weakest” can include “weak”, “industry bottom” and the like; the present application adds “the weakest”, “weak” and “industry bottom” and the like to the candidate concept set.
[0184] All the antonyms of the gth entity can be found in the antonym dictionary.
[0185] Traverse the candidate concept set, and check whether the candidate concept and the gth entity are in conflict relation according to the relation graph atlas; if the hth candidate concept and the gth entity are in conflict relation, determine that the gth entity and the hth candidate concept constitute a conflict concept pair, and calculate a conflict weight of the conflict concept pair based on at least two of the following information: an association degree of the conflict concept pair in the relation graph atlas, a context consistency in the target text, a position saliency, and a tone intensity.
[0186] The process of specifically obtaining the conflict weight of the conflict concept pair can refer to the foregoing embodiments, which will not be described here again.
[0187] The conflict concept pair and the conflict weight thereof are added to the review result of the ith candidate paragraph.
[0188] For the target review elements that are not defined in the knowledge base, i.e., unknown or newly emerging concepts, the potential contradictions in the target text can be found by the foregoing method, and the comprehensiveness of the text review is further improved.
[0189] In an optional embodiment, an implementation flowchart for determining the candidate paragraph in the target text based on the high-risk word set in the domain knowledge base is as shown in Figure 6 , which can include the following steps.
[0190] Step S601: For any paragraph in the target text (for the sake of description, denoted as the jth paragraph), detect the high-risk words in the high-risk word set in the jth paragraph.
[0191] That is, query whether the high-risk words in the high-risk word set exist in the jth paragraph.
[0192] Step S602: Determine a danger index of the jth paragraph according to the number of high-risk words contained in the jth paragraph and the length of the jth paragraph.
[0193] The danger index of the jth paragraph is positively correlated with the number of high-risk words contained in the jth paragraph and is negatively correlated with the length of the jth paragraph.
[0194] Optionally, a ratio of the number of high-risk words contained in the jth paragraph to the length (the number of words contained in the jth paragraph) of the jth paragraph can be determined as the danger index of the jth paragraph. Based on this, the influence of the paragraph length on the result can be eliminated, otherwise, a long normal paragraph can be misjudged only because it contains a few high-risk words, and a short violation paragraph can be missed because the number of high-risk words contained is not high in absolute value. The danger index of the present application reflects the “density” or “concentration” of the high-risk words, rather than the absolute number, and the judgment is more fair and accurate.
[0195] Step S603: If the risk index of the jth paragraph is greater than the risk threshold, determine the jth paragraph as a candidate paragraph, i.e., a paragraph suspected of violating the regulation.
[0196] If the risk index of the jth paragraph is less than or equal to the risk threshold, determine that the jth paragraph is not a candidate paragraph, i.e., the jth paragraph is a compliance paragraph.
[0197] In this application, the risk threshold is greater than or equal to zero. The risk threshold can be a configurable parameter.
[0198] The goal of screening candidate paragraphs is to quickly narrow down the scope of review at the lowest cost, from 100% full-text focus to a small number of extremely high-risk areas. If a very long paragraph (such as 1000 words) contains only one high-risk word, the risk index will be very low (1 / 1000 = 0.001). This usually means that the high-risk word may be mentioned unintentionally, appear in a non-key description, or appear in a negative sentence. Its urgency and severity of violation are far lower than the case where multiple (such as 3) high-risk words appear densely in a short paragraph (such as 10 words) (3 / 10 = 0.3). Prioritizing high-density paragraphs can capture the most serious violations at the lowest computational cost, which is the most efficient strategy for mass content review that requires "second-level response".
[0199] For scenarios with extremely high compliance requirements, the risk threshold can be set to a very low value, or even zero, to ensure that most or even all paragraphs containing high-risk words are candidate paragraphs, but this will sacrifice efficiency.
[0200] Using "risk index" for screening is an "catch big and release small" engineering optimization strategy that selects and abandons paragraphs with lower violation suspicion in exchange for extremely fast response to paragraphs with high violation suspicion. This is a balance between accuracy, recall rate, and efficiency.
[0201] In an optional embodiment, an implementation flowchart for detecting high-risk words in the jth paragraph in the high-risk set is as shown in Figure 7 may include:
[0202] Step S701: Add each high-risk word in the high-risk word set to the Bloom filter.
[0203] The specific implementation process can refer to the existing scheme, which will not be repeated here. The false positive rate of the Bloom filter can be set to less than 0.001%.
[0204] Step S702: For each word in the jth paragraph, query whether the word is in the Bloom filter.
[0205] If a word is in the Bloom filter, it means that the word is likely to belong to the high-risk word set; if the word is not in the Bloom filter, it means that the word certainly does not belong to the high-risk word set. Generally, high-risk words in a paragraph account for a small proportion, and non-high-risk words account for a large proportion. Therefore, the Bloom filter can be used to quickly determine which words certainly do not belong to the high-risk word set, thereby improving the efficiency of candidate paragraph determination.
[0206] Step S703: If the query result indicates that the word is not in the Bloom filter, it is determined that the word does not belong to the high-risk word set.
[0207] Step S704: If the query result indicates that the word is likely to be in the Bloom filter, the word is searched in the high-risk word set; if the word is found, it is determined that the word belongs to the high-risk word; if the word is not found, it is determined that the word does not belong to the high-risk word.
[0208] In order to save storage space, the high-risk word set can be stored in the form of a prefix tree.
[0209] In an optional embodiment, before determining the risk index of the jth paragraph, the following steps can be further included:
[0210] An inverted index is constructed according to the high-risk words contained in each paragraph, and the inverted index indicates the position of each high-risk word in the target text.
[0211] Optionally, the inverted index indicates the paragraph to which each high-risk word belongs in the target text.
[0212] Alternatively, the inverted index indicates the offset of each high-risk word relative to the first character in the target text.
[0213] The number of high-risk words in each paragraph is determined based on the inverted index.
[0214] Based on the inverted index, the memory occupancy rate of the target text can be reduced, and the number of high-risk words in each paragraph can be quickly determined.
[0215] In an optional embodiment, the text review method provided in the present application can further include:
[0216] Among the transition words appearing in the target text, the target transition word satisfying the abnormal transition condition is determined.
[0217] The target text can be scanned based on a pre-constructed transition word dictionary to determine the transition words appearing in the target text.
[0218] The transition words included in the transition word dictionary can include but are not limited to: but, however, although, yet, instead, only, etc.
[0219] If a transition word satisfies the abnormal condition, it means that the context of the transition word constitutes an abnormal transition event.
[0220] For the two different paragraphs in the target text, the logical coherence of the two paragraphs is calculated based on the total number of target transition words appearing in the two paragraphs; the logical coherence of the two paragraphs is negatively correlated with the total number of target transition words appearing in the two paragraphs.
[0221] Optionally, the logical coherence of the two paragraphs can be calculated by the following formula:
[0222] S = 1-min(1,freq_abn / N) (1)
[0223] Wherein, S represents the logical coherence, the value of freq_abn is the total number of target transition words appearing in the two paragraphs; N is the number of paragraphs, since it is two paragraphs, N = 2.
[0224] If the logical coherence of the two paragraphs is less than the first coherence threshold, it is determined that the two paragraphs are a pair of contradictory paragraphs, that is, the two paragraphs cannot be true at the same time in logic.
[0225] Optionally, the value range of the first coherence threshold can be [0.6, 0.7], and the user can adjust the value of the first coherence according to the demand.
[0226] For any two paragraphs in the target text, coherence calculation can be performed, if there is no target transition word in the two paragraphs, that is, the total number of target transition words appearing in the two paragraphs is zero, the logical coherence of the two paragraphs is 1, which indicates that the two paragraphs do not belong to a pair of contradictory paragraphs.
[0227] The identification information of the pair of contradictory paragraphs containing the i-th candidate paragraph is added to the review result of the i-th candidate paragraph. The identification information of the pair of contradictory paragraphs containing the i-th candidate paragraph includes: the paragraph identification of the i-th candidate paragraph, the paragraph identification of the other paragraph in the pair of contradictory paragraphs containing the i-th candidate paragraph, and the existence of logical contradiction between the two paragraphs.
[0228] In addition to the violation detection of each paragraph, the violation detection between paragraphs can also be performed. Further improve the accuracy of text review.
[0229] Further, the review result of each candidate paragraph also includes: the coherence of the pair of contradictory paragraphs containing the candidate paragraph, and the predefined coherence threshold. Increase the explainability of the review result.
[0230] In an optional embodiment, at least one of the different two paragraphs is a candidate paragraph, that is, only whether each candidate paragraph and other paragraphs (including other candidate paragraphs and other non-candidate paragraphs) exist logical contradiction can be detected.
[0231] In an optional embodiment, before calculating the logical coherence between paragraphs, the following steps can also be included:
[0232] The logical coherence of the target text is calculated based on the number of target transitional words in all paragraphs in the target text.
[0233] Optionally, the logical coherence of the target text can be calculated using the aforementioned formula (1), in which case the value of freq_abn is the total number of target transitional words appearing in the target text; the value of N is the total number of paragraphs included in the target text. By normalizing the number of target transitional words included in the document by freq_abn / N, the influence of document length on the calculation result can be eliminated, making the coherence scores between documents of different lengths comparable. Otherwise, a long document will naturally have a higher number of target transitional words and a lower logical coherence simply because it has more paragraphs and a greater absolute chance of encountering abnormal transitions, which does not necessarily mean that its logical coherence is necessarily worse than that of a short document. By dividing the number of target transitional words included in the document by the number of paragraphs, the frequency of target transitional words is obtained, making the evaluation more fair.
[0234] Optionally, a sliding window can be created, and the logical coherence of the text within the window is calculated each time the window is slid. After traversing the target text, multiple logical coherences are obtained. The length of the sliding window refers to the number of paragraphs, i.e., each time the window is slid, the sliding window covers the same number of paragraphs, and the sliding step can be one paragraph. For example, if the length of the sliding window is 3 paragraphs, then from the first paragraph of the target text, the sliding window covers the first, second, and third paragraphs. After sliding the window once, the sliding window covers the second, third, and fourth paragraphs. After sliding the window again, the sliding window covers the third, fourth, and fifth paragraphs, and so on, until the entire target text is traversed.
[0235] The minimum logical coherence among the multiple logical coherences can be taken as the logical coherence of the target text; this approach can effectively capture the most serious local problems.
[0236] Alternatively, the average of the logical coherences of each sliding window can be taken as the logical coherence of the target text. This approach can reflect the overall average performance, and the result is smoother.
[0237] The logical coherence of the text within each sliding window can be calculated using the aforementioned formula (1), in which case the value of freq_abn is the total number of target transitional words appearing in the sliding window; the value of N is the total number of paragraphs included in the sliding window.
[0238] If the logical coherence of the target text is less than the second coherence threshold, the logical coherence between paragraphs is calculated. The logical coherence of the target text being less than the second coherence threshold indicates that the target text is logically loose as a whole and has a high possibility of contradictions. The calculation of the logical coherence between paragraphs needs to be triggered to perform more detailed paragraph pair analysis to locate specific contradictory paragraph pairs.
[0239] If the logical coherence of the target text is greater than or equal to the second coherence threshold, the logical coherence between paragraphs is not calculated. The logical coherence of the target text being greater than or equal to the second coherence threshold indicates that the target text is logically coherent as a whole and has a low possibility of local sharp contradictions. The document can be directly determined to be compliant in the logical level without the calculation of the logical coherence between paragraphs, which greatly saves the computing resources and meets the requirement of low latency.
[0240] Through the global logical coherence judgment and the logical coherence between paragraphs judgment, the depth and efficiency of the review are balanced.
[0241] In an optional embodiment, an implementation flowchart for determining a target turning word satisfying an abnormal turning condition provided by the present application is shown in Figure 8 , which can include:
[0242] Step S801: For the kth turning word appearing in the target text, determine the initial confidence score of the kth turning word based on the appearance frequency of all turning words in the paragraph to which the kth turning word belongs and the appearance position of the kth turning word in the paragraph.
[0243] The appearance frequency of all turning words in a paragraph can be the ratio of the number of all turning words in the paragraph to the total number of words in the paragraph. The higher the appearance frequency of turning words in a paragraph, the more frequent the turning of the paragraph, and the abnormality of the context of a single turning word can be reduced, and the confidence score of the single turning word should be correspondingly lowered. That is, the initial confidence score of the kth turning word is negatively correlated with the appearance frequency of all turning words in the paragraph to which the kth turning word belongs.
[0244] The appearance position of the kth turning word in the paragraph includes the beginning, middle or end of the paragraph. In an advertisement script, the "but" appearing at the end is more likely to introduce a disclaimer, and its confidence score should be correspondingly increased. That is, the initial confidence score of the kth turning word is positively correlated with the appearance position of the kth turning word in the paragraph, that is, the later the appearance position of the kth turning word in the paragraph, the higher the initial confidence score of the kth turning word.
[0245] By giving each turning word an initial confidence score from the statistical (appearance frequency of turning words) and position levels, minor turns appearing in noisy contexts or minor positions can be filtered out.
[0246] Step S802: If the initial confidence score of the kth transition word is greater than the score threshold, analyze the contrast relation in syntactic structure between the original term and the transition term syntactically connected by the kth transition word.
[0247] The contrast relation in syntactic structure between the original term and the transition term syntactically connected by the kth transition word can be determined by performing syntactic analysis on the context of the kth transition word. For example, a dependency syntactic analyzer can be used to perform dependency relation recognition and structure analysis on the context of the kth transition word, so as to determine the two subjects (i.e., the original term and the transition term in the transition relation) syntactically connected by the kth transition word; and the structure analysis can determine the contrast relation in syntax between the two subjects syntactically connected by the kth transition word, and a strong abnormal transition usually forms a contrast or contrast structure in syntax between the two subjects connected.
[0248] By performing syntactic analysis, it can be verified from the grammatical structure whether the original term and the transition term syntactically connected by the kth transition word form a real and complete contrast relation, and it is ensured that it is not an isolated or weakly grammatical word.
[0249] If the initial confidence score of the kth transition word is less than or equal to the score threshold, it is determined that the kth transition word is not the target transition word, and the subsequent steps of analyzing the contrast relation in syntactic structure between the original term and the transition term syntactically connected by the kth transition word do not need to be performed.
[0250] Step S803: If the contrast relation in syntactic structure between the original term and the transition term is a contrast or contrast structure, extract a first text segment containing the original term and a second text segment containing the transition term in the paragraph to which the kth transition word belongs; and calculate a semantic change value of the second text segment relative to the first text segment.
[0251] The first text segment is a text segment containing the original term in the context of the kth transition word; and the second text segment is a text segment containing the transition in the context of the kth transition word.
[0252] Optionally, the first sentiment polarity (e.g., positive, neutral, negative, etc.) and the first sentiment intensity (which can be a confidence score) of the first text segment, and the second sentiment polarity and the second sentiment intensity of the second text segment can be calculated by using an existing sentiment analysis model; and the difference between the second sentiment intensity and the first sentiment intensity is taken as the semantic change value of the second text segment relative to the first text segment. The semantic change value is a semantic change value of the second text segment relative to the first text segment in the sentiment polarity.
[0253] Optionally, a pre-trained commitment analysis model can be used to calculate the first commitment strength of the first text segment and the second commitment strength of the second text segment. The difference between the second commitment strength and the first commitment strength can be calculated as the semantic change value of the second text segment relative to the first text segment. This semantic change value is the semantic change of the second text segment relative to the first text segment in terms of commitment strength.
[0254] As an example, a pre-trained model (such as BERT) can be used to convert the first and second text segments into high-dimensional semantic vectors (embedded vectors). The high-dimensional semantic vectors of the first and second text segments are then input into a sentiment analysis model to obtain the first sentiment polarity and first sentiment intensity of the first text segment, and the second sentiment polarity and second sentiment intensity of the second text segment. Finally, the high-dimensional semantic vectors of the first and second text segments are input into a commitment analysis model to obtain the first commitment strength of the first text segment and the second commitment strength of the second text segment.
[0255] If the original term and the transition do not form a contrast or opposition structure in terms of syntactic structure, and the k-th transition word is determined not to be the target transition word, then there is no need to perform the steps of determining the first and second text segments, calculating the semantic change values of these two text segments, and subsequent steps.
[0256] Step S804: If the semantic change value is greater than the change threshold, determine the kth transition word as the target transition word.
[0257] If the semantic change value is less than or equal to the change threshold, the k-th transition word is determined not to be the target transition word.
[0258] In an optional embodiment, when calculating the logical coherence of N paragraphs based on the total number of target transition words (freq_abn) appearing in the N paragraphs, the total number of target transition words appearing in the N paragraphs can be summed with the semantic change value corresponding to each target transition word to obtain a weighted total number of target transition words; the logical coherence of the N paragraphs is then calculated based on the weighted total number of target transition words. This can be expressed by the formula:
[0259] S = 1-min(1,(freq_abn+ΔIntensity) / N segments) (2)
[0260] Wherein, ΔIntensity is the sum of the semantic change values corresponding to each target transition word in N paragraphs.
[0261] By integrating the semantic change values corresponding to the target transition words, the accuracy of target transition word segmentation is further enhanced.
[0262] In an optional embodiment, the text review method provided by the present application can further comprise:
[0263] According to the word frequency of the high-risk word appearing in the i-th candidate paragraph and the weight of the high-risk word obtained from the domain knowledge base, a first risk score of the i-th candidate paragraph is obtained.
[0264] The first risk score is positively correlated with the word frequency and the weight of the high-risk word appearing in the i-th candidate paragraph. That is, the greater the word frequency of the high-risk word, the higher the first risk score, and the greater the weight of the high-risk word, the higher the first risk score.
[0265] According to the logical coherence between the contradictory paragraph pairs containing the i-th candidate paragraph, a second risk score of the i-th candidate paragraph is obtained.
[0266] The second risk score is negatively correlated with the logical coherence between the contradictory paragraph pairs, that is, the lower the logical coherence, the higher the second risk score.
[0267] According to the weight of each violation type in the element checking result obtained from the domain knowledge base, a third risk score of the i-th candidate paragraph is obtained.
[0268] The third risk score is positively correlated with the weight of each violation type, that is, the greater the weight of the violation type, the higher the third risk score.
[0269] According to the weight of the edge between the conflicting concept pairs determined in the relationship graph, a fourth risk score of the i-th candidate paragraph is obtained.
[0270] The fourth risk score is positively correlated with the weight of the edge between the conflicting concept pairs, that is, the greater the weight of the edge, the higher the fourth risk score.
[0271] The first risk score, the second risk score, the third risk score and the fourth risk score are weighted and summed to obtain an overall risk score of the i-th candidate paragraph.
[0272] By comprehensively considering the weighted scores of multiple evidences, a more reliable and accurate overall violation risk assessment is obtained.
[0273] Further, the overall risk score can be mapped to a preset range, so that the risk scores of different documents and different review tasks are comparable. As an example, the overall risk score can be scaled by a predefined conversion to map it to the interval [0, 1].
[0274] Further, the overall risk score of the i-th candidate paragraph can be added to the review result of the i-th candidate paragraph.
[0275] In an optional embodiment, if the i-th candidate paragraph contains all of the following three cases, the overall risk score of the i-th candidate paragraph is adjusted to the target risk score, that is, the target risk score is greater than the overall risk score of the i-th candidate paragraph, in the case that the overall risk score of the i-th candidate paragraph is less than the target risk score.
[0276] The above three cases are: containing a violation word, forming a contradictory paragraph pair with other paragraphs, and having a missing compliance element (i.e., missing an essential element).
[0277] If the i-th candidate paragraph contains all of the above three cases, it is an extremely strong violation signal, and therefore, the overall risk score of the i-th candidate paragraph needs to be ensured to be not lower than the target risk score. Based on this, if the overall risk score of the i-th candidate paragraph is lower than the target risk score, the overall risk score of the i-th candidate paragraph is adjusted to the target risk score, otherwise, the overall risk score of the i-th candidate paragraph remains unchanged.
[0278] In the review result of the i-th candidate paragraph, the three violation types of violation words, contradictory paragraph pairs, and element missing are included, which form an irrefutable evidence chain.
[0279] Further, the review results of each candidate paragraph can be output in the form of a structured report for the convenience of users to view.
[0280] Further, before outputting the structured report, the context semantic analysis of each violation word in the i-th candidate paragraph can be further performed to determine whether the semantic of the sentence in which each violation word in the i-th candidate paragraph is located is the same as the semantic of the violation word. If not (for example, the semantics are opposite), it is determined that the violation word does not constitute a violation, and the violation word is deleted from the report.
[0281] In an optional embodiment, before determining the candidate paragraph and the contradictory paragraph, the target text can also be classified by the present application to determine the document type to which the target text belongs. The document type is one of the following types: financial advertisement, medical propaganda, and academic paper.
[0282] Optionally, the FastText analyzer can be used to classify the target text to realize the second-level document type identification. As an example, the target text can be preprocessed (such as word segmentation, stop word filtering, etc.) first, and the embedding features of the preprocessed target text are input into the FastText analyzer to obtain the document type of the target text predicted by the FastText analyzer.
[0283] Correspondingly, when performing element checking on each candidate paragraph based on the element-related knowledge in the domain knowledge base, the element checking is performed on each candidate paragraph based on the element-related knowledge in the domain knowledge base corresponding to the document type.
[0284] That is, the text review method of the present application can be applied to compliance review of financial advertisements, compliance review of medical propaganda, and compliance review of academic papers.
[0285] Taking the review of a financial advertisement script as an example, suppose that the content of the second paragraph (denoted as P2) of a financial advertisement script is “Investment is a sure win! The annual yield is as high as 20%!” and the content of the seventh paragraph (denoted as P7) is “Note: The market is risky, and investment should be cautious.”. Based on the present application, one implementation process for processing the financial advertisement script can be as follows:
[0286] Full-text layer: use the FastText analyzer to classify the financial advertisement script and determine that the document type is a financial advertisement.
[0287] Based on the classification result of the full-text layer, load the rule knowledge base of the financial advertisement domain.
[0288] Paragraph layer: including parent retrieval and child retrieval.
[0289] Among them, the parent retrieval: based on the inverted index and the rule type node in the rule knowledge base, it is determined that the P2 paragraph contains the violation word “sure win”, and the violation type is “guaranteed return”; P2 paragraph is determined as a candidate paragraph. The parent retrieval result is: {P2: guaranteed return}.
[0290] Child retrieval: according to the parent retrieval result, and the element template node in the rule knowledge base, it is determined that the P2 paragraph contains a yield description (i.e., sure win), which needs to be checked for risk prompt, so the “risk prompt” element template is requested from the rule base to check whether the risk prompt element exists in the P2 paragraph. According to the “risk prompt” element template, it is found that there is no risk prompt that must exist in the P2 paragraph, so it can be determined that the P2 paragraph not only contains the “guaranteed return” violation, but also contains a more serious violation item: “element missing”. Through parent-child retrieval, the review efficiency is significantly improved.
[0291] The “risk prompt” element template defines the complete verification rules of the “risk prompt” element, for example:
[0292] “Element name: risk_disclosure;
[0293] Must exist: yes;
[0294] Completeness requirement: must contain the “risk” keyword and at least one explicit risk type (such as “capital loss” and “market fluctuations”);
[0295] Significance requirement: It shall not be presented in a non-significant manner such as footnotes or extra-small fonts;
[0296] Associated regulation ID: Article X, Paragraph Y of the "XX Specification for Financial Advertising".
[0297] Generate an element checklist corresponding to paragraph P2 according to the "Risk Warning" element template.
[0298] Perform existence, integrity, and significance verification on paragraph P② based on the element checklist. For the specific verification process, refer to the foregoing embodiments and will not be elaborated here. Since there is no risk warning, the integrity verification will be skipped.
[0299] Inter-paragraph layer: Calculate the semantic consistency between "guaranteed profit without loss" in paragraph P2 and the relevant description "investment is risky" in paragraph P7, and determine that there is a semantic conflict between paragraph P2 and paragraph P7; Calculate the logical coherence score S between paragraph P2 and paragraph P7, and determine that S < P (threshold) (due to no transition words and conflicting commitment intensities). Through the judgment of the logical coherence score and semantic consistency across paragraphs, the detection rate of logical contradictions in text review is significantly improved.
[0300] Generate verification result: The "Risk Warning" element is missing. This result is also bound to the associated regulation ID defined in the "Risk Warning" element template to form a clear evidence of violation:
[0301] {Violation type: "Element missing", Missing element: "Risk Warning", Regulatory basis: "Article X, Paragraph Y of the 'XX Specification for Financial Advertising'", Evidence paragraph: "P2"}.
[0302] In addition, semantic verification can also be performed on paragraphs P2 and P7 according to the relationship graph. The conflict weight between "guaranteed profit without loss" and "risky" can be calculated based on the edge weight between "guaranteed profit without loss" and "investment is risky" in the relationship graph, the context consistency, position significance, and tone intensity of "guaranteed profit without loss" and "investment is risky" in the above financial advertising copy, assuming it is 0.85. Input the conflict weight and the inspection results of the foregoing links into the report generation module. The conflict weight and the verification result jointly support the final violation determination of paragraph P2 and generate a final structured report.
[0303] An example of the final structured report for paragraph P2 is as follows:
[0304] {"para": "P2",
[0305] "issue": ["Principal protection commitment", "Element missing", "Contradiction with P7"], / / Problems existing in paragraph P2;
[0306] "hits": [{"term":"guaranteed profit","pos":[...]}], / / High-risk words in paragraph P2;
[0307] "graph": [{"u":"Guaranteed principal","v":"Investment involves risk","type":"conflict","w":0.85}], / / Conflicting pair of concepts in the relationship graph: "Guaranteed principal" and "Investment involves risk"; conflict weight is 0.85;
[0308] "coherence": {"S_pair(P2,P7)": 0.41, "P": 0.6}, / / The logical coherence score of paragraphs P2 and P7 is 0.41, and the threshold is 0.6;
[0309] "checklist": {"risk_disclosure":"absent"}, / / The result of the element checklist: the "risk warning" element is missing;
[0310] "law_ids": ["Financial Advertisement XX"], / / Law ID;
[0311] "salience": {"same_paragraph": false, "font_ratio": 0.6} / / Salience check result: Not in the same paragraph, the ratio of font size to body text font size is 0.6;
[0312] }
[0313] The structured report described above is a machine-readable report.
[0314] Based on existing technology, only violations starting with "guaranteed profit" can be detected, while violations such as "missing elements" and "contradictory to P7" cannot be detected.
[0315] Corresponding to the method embodiments, this application also provides an electronic device. (See reference...) Figure 9 The diagram illustrates a structural schematic of an electronic device suitable for implementing embodiments of this application. The electronic device in these embodiments can be a terminal device (e.g., an in-vehicle infotainment system, a large-screen device, a mobile phone, a tablet computer, a laptop computer, a desktop computer, etc.) or a server (which can be a single server, a server cluster, or a cloud server, etc.). Figure 9 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0316] like Figure 9As shown, the electronic device can include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901 that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 902 or loaded into a random access memory (RAM) 903 from a storage device 908. In a state in which the electronic device is powered on, various programs and data required for operation of the electronic device are also stored in the RAM 903. The processing device 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0317] Generally, the following devices can be connected to the I / O interface 905: input devices 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 908 including, for example, a memory card, a hard disk, etc.; and communication devices 909. The communication devices 909 can allow the electronic device to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 9 The electronic device is shown with various devices, but it should be understood that not all of the shown devices are required to be implemented or present. More or fewer devices can alternatively be implemented or present.
[0318] The embodiment of the present application further provides a computer program product comprising computer readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the text review methods provided by the embodiments of the present application.
[0319] The embodiment of the present application further provides a computer readable storage medium, which carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement any of the text review methods provided by the embodiments of the present application.
[0320] It should be noted that the device embodiments described above are merely illustrative, and the units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments. In addition, in the device embodiment provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which can be implemented as one or more communication buses or signal lines.
[0321] Those skilled in the art can clearly understand that the application can be implemented by means of software plus necessary universal hardware, and of course can also be implemented by means of dedicated hardware including special integrated circuit, special CPU, special memory, special component, etc. Generally, any function completed by computer program can be easily implemented by corresponding hardware, and the specific hardware structure for implementing the same function can be various, such as analog circuit, digital circuit or special circuit, etc. However, for the application, the software program implementation is a better embodiment. Based on such understanding, the technical solution of the application or the part of the application which makes contribution to the prior art can be embodied in the form of software product, which is stored in a readable storage medium, such as floppy disk, U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., and includes a plurality of instructions for making a computer device (which can be personal computer, training device or network device, etc.) execute the method described in each embodiment of the application.
[0322] In the above embodiments, the implementation can be realized by software, hardware, firmware or any combination thereof, in whole or in part. When implemented by software, the implementation can be realized in the form of a computer program product, in whole or in part. The skilled person can use different methods for each specific solution to implement the described functions, but such implementation should not be considered beyond the scope of the application.
[0323] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the flow or function described in the embodiments of the application is generated in whole or in part. 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 computer-readable storage medium or transmitted from one computer-readable storage medium to another, for example, the computer instructions can be transmitted from one website, computer, training device or data center to another website, computer, training device or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be stored by a computer or a data storage device such as a training device, a data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk, magnetic tape), optical media (such as DVD) or semiconductor media (such as solid state disk (SSD)) and the like.
[0324] The various embodiments described in this specification are intended to be illustrative only and in no way limit the scope of the application. Changes and modifications can be made by those skilled in the art, which employ the principles of the application, without departing from the scope of the application. Accordingly, the application is not limited to the embodiments described herein, but instead has scope to encompass any choice whatsoever that is dependent on, or can be substituted in, any one or more of the technical features disclosed in this specification, in any combination.
[0325] The above description of disclosed embodiments is intended to be illustrative only and not limiting of the application. Numerous modifications to these embodiments can be made by those skilled in the art without departing from the spirit or scope of the application. The scope of the application is not limited to the embodiments described herein, but rather extends to any that are dependent on, or can be substituted in, any one or more of the technical features disclosed in this specification, in any combination.
Claims
1. A text review method characterized by, The method comprises the following steps: determining candidate paragraphs in the target text based on a high-risk word set in a domain knowledge base; the high-risk word set comprises: rule violation words and corresponding rule violation types, and words that need to be checked for elements; each candidate paragraph is a paragraph that contains high-risk words in the high-risk word set and contains high-risk words that meet a preset danger condition; checking each candidate paragraph for elements based on element-related knowledge in the domain knowledge base to obtain an element checking result for each candidate paragraph; the element-related knowledge comprises regulations on essential elements of a compliance text, and compliance expression suggestions when a compliance text involves a target description; generating an examination result for each candidate paragraph, which comprises: rule violation words contained in the candidate paragraph and corresponding rule violation types, and the element checking result corresponding to the candidate paragraph; wherein, checking the i-th candidate paragraph for elements comprises: generating an element check list corresponding to the i-th candidate paragraph according to the i-th candidate paragraph and the element-related knowledge; the element check list contains at least one item corresponding to the i-th candidate paragraph, each item corresponds to a target checking element, and each item contains a plurality of checking items; the plurality of checking items comprise: a first type of checking item for checking whether the i-th candidate paragraph contains the target checking element, and a second type of checking item for checking whether the i-th candidate paragraph contains a compliance essential element corresponding to the target checking element; the target checking element is an element that needs to be checked for elements; checking each target checking element in the i-th candidate paragraph for elements based on the element check list to obtain the element checking result corresponding to the i-th candidate paragraph.
2. The method of claim 1, wherein, Generating an element check list corresponding to the i-th candidate paragraph according to the i-th candidate paragraph and the element-related knowledge comprises: performing entity recognition on the i-th candidate paragraph; generating an element check list corresponding to the i-th candidate paragraph based on the recognized entities and each element template generated based on the regulation content in the element-related knowledge; each element template comprises: a target checking element determined based on the regulation content, and corresponding checking items and applicable conditions, compliance requirements or compliance expression suggestions; In the element check list corresponding to the i-th candidate paragraph, the target checking element corresponding to each item is an entity belonging to the target checking element, and each item is used to check the corresponding target checking element for at least one of the following: existence of an essential element, integrity of an essential element, saliency of an essential element, and consistency between expression of a target checking element and a preset related expression.
3. The method of claim 2, wherein, Further comprising: if it is determined based on the element check list that any target checking element in the i-th candidate paragraph has an essential element missing problem, querying a relationship graph in the domain knowledge base to determine whether the any target checking element and the missing essential element are a conflict concept pair having a conflict relationship; the nodes in the relationship graph are entities, and the edges between entities record the association relationship and the association degree between entities; the association relationship between entities comprises: conflict relationship, dependency relationship, synonym relationship, hierarchical relationship, and positive association relationship. If the conflict concept pair, based on the association degree of the conflict concept pair in the relationship graph, the context consistency in the target text, the position saliency and the emotional intensity of the any target check element, obtains the conflict weight of the conflict concept pair; Add the conflict concept pair and its conflict weight to the review result of the i th candidate paragraph.
4. The method of claim 2, wherein, Also includes: If the identified g th entity does not belong to the target check element, obtain all antonyms of the g th entity, and the entities in the relationship graph in the domain knowledge base which have semantic similarity greater than a threshold with the obtained antonyms constitute a candidate concept set; Traverse the candidate concept set, and check whether the candidate concept and the g th entity are in conflict relationship according to the relationship graph; if the h th candidate concept and the g th entity are in conflict relationship, determine that the g th entity and the h th candidate concept constitute a conflict concept pair, and based on the association degree of the conflict concept pair in the relationship graph, the context consistency in the target text, the position saliency and the emotional intensity of the any target check element, obtain the conflict weight of the conflict concept pair; Add the conflict concept pair and its conflict weight to the review result of the i th candidate paragraph.
5. The method of claim 1, wherein, Based on the high-risk word set in the domain knowledge base, determine the candidate paragraph in the target text, including: For the j th paragraph in the target text, detect the high-risk words in the high-risk word set in the j th paragraph; According to the number of high-risk words contained in the j th paragraph and the length of the j th paragraph, determine the risk index of the j th paragraph; If the risk index of the j th paragraph is greater than the risk threshold, determine that the j th paragraph is a candidate paragraph.
6. The method of claim 5, wherein, Detecting the high-risk words in the high-risk word set in the j th paragraph includes: Add each high-risk word in the high-risk word set to the Bloom filter; For each word in the j th paragraph, query whether the word is in the Bloom filter; If the query result indicates that the word is not in the Bloom filter, determine that the word does not belong to the high-risk word set; If the query result indicates that the word may be in the Bloom filter, search for the word in the high-risk word set; if found, determine that the word belongs to the high-risk word; if not found, determine that the word does not belong to the high-risk word.
7. The method of claim 6, wherein, Before determining the risk index of the j th paragraph, also includes: Build an inverted index according to the high-risk words contained in each paragraph; the inverted index represents the position of each high-risk word in the target text; Determine the number of high-risk words in each paragraph based on the inverted index.
8. The method according to any one of claims 1 to 7, characterized in that, Also includes: Among the transition words appearing in the target text, determine the target transition word that meets the abnormal transition condition; For two different paragraphs in the target text, based on the total number of target transition words appearing in the two paragraphs, calculate the logical coherence of the two paragraphs; the logical coherence of the two paragraphs is negatively related to the total number of target transition words appearing in the two paragraphs; If the logical coherence of the two paragraphs is less than the first coherence threshold, determine that the two paragraphs are a pair of contradictory paragraphs. Add the identification information of the contradictory paragraph pair containing the i-th candidate paragraph to the review result of the i-th candidate paragraph.
9. The method of claim 8, wherein, At least one of the two different paragraphs is a candidate paragraph.
10. The method of claim 8, wherein, Before calculating the logical coherence between paragraphs, the following is also included: The logical coherence of the target text is calculated based on the number of target transition words in all paragraphs of the target text; If the logical coherence of the target text is less than the second coherence threshold, the logical coherence between paragraphs is calculated.
11. The method of claim 8, wherein, The process of identifying target transition words that satisfy the abnormal transition conditions includes: For the kth transition word appearing in the target text, the initial confidence score of the kth transition word is determined based on the frequency of all transition words in the paragraph to which the kth transition word belongs and the position of the kth transition word in the paragraph to which the kth transition word belongs. If the initial confidence score of the kth transition word is greater than the score threshold, analyze the syntactic opposition between the original and transition words connected by the kth transition word. If the original term and the transformed term have a contrasting or opposing syntactic relationship, extract a first text segment containing the original term and a second text segment containing the transformed term from the paragraph to which the k-th transition word belongs; calculate the semantic change value of the second text segment relative to the first text segment; If the semantic change value is greater than the change threshold, the kth transition word is determined as the target transition word.
12. The method of claim 8, wherein, Also includes: The first risk score of the i-th candidate paragraph is obtained based on the word frequency of high-risk words appearing in the i-th candidate paragraph and the weight of high-risk words obtained from the domain knowledge base. The first risk score is positively correlated with the word frequency and weight of high-risk words appearing in the i-th candidate paragraph; The second risk score of the i-th candidate paragraph is determined based on the logical coherence between the contradictory paragraph pairs containing the i-th candidate paragraph. The second risk score is negatively correlated with the logical coherence between contradictory paragraphs; The third risk score of the i-th candidate paragraph is determined based on the weight of each violation type in the element verification results obtained from the domain knowledge base. The third risk score is positively correlated with the weight of each type of violation. The fourth risk score of the i-th candidate paragraph is determined based on the weights of the edges between conflicting concept pairs identified in the relational graph in the domain knowledge base. The fourth risk score is positively correlated with the weight of the edge between the conflict concept pairs; The conflict concept pair is two concepts in the relationship graph that have a conflict relationship, including: the target element that has a missing essential element problem in the i-th candidate paragraph and the essential element that corresponds to the missing target element; The first risk score, the second risk score, the third risk score, and the fourth risk score are weighted and summed to obtain the overall risk score of the i-th candidate paragraph.
13. The method of claim 1, wherein, Before identifying candidate paragraphs and contradictory paragraph pairs in the target text, the following steps are also included: The target text is classified to determine the document type to which it belongs; The step of performing element verification on each candidate paragraph based on element-related knowledge in the domain knowledge base includes: Based on the element related knowledge in the domain knowledge base corresponding to the document type, element checking is performed on each candidate paragraph.
14. An electronic device, comprising: The electronic device includes at least one processor, and a memory connected to the processor; wherein: The memory is configured to store a computer program; The processor is configured to execute the computer program, so that the electronic device can implement the text review method according to any one of claims 1 to 13.
15. A computer program product, characterised in that, The computer readable instructions, when executed on an electronic device, cause the electronic device to implement the text review method according to any one of claims 1 to 13.
16. A computer storage medium, comprising, The storage medium carries one or more computer programs, which, when executed by an electronic device, can cause the electronic device to implement the text review method according to any one of claims 1 to 13.
Citation Information
Patent Citations
Medical semantic analysis method, electronic equipment, storage medium, and system
CN107610740A
Text auditing method and device
CN113010637A