Document compliance detection method and device, equipment and storage medium
Patent Information
- Application Number
- CN202510409508.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-08-08
AI Technical Summary
[0005]本申请提供一种文档合规性的检测方法、装置、设备及存储介质,用以解决现有的文档合规性的检测方法的效率低下和准确率较低的技术问题
[0051]本申请提供的文档合规性的检测方法、装置、设备及存储介质,获取产品需求文档,并将产品需求文档转换为标记语言格式的待识别文本,将待识别文本和合规性规则输入预先训练的识别模型中,由识别模型基于对待识别文本的内容识别结果和合规性规则输出产品需求文档的合规性识别结果,其中,合规性规则用于指示内容识别结果和合规性识别结果的对应关系,合规性识别结果包括是否合规以及不合规情况下的不合规原因;该方法不仅提高了文档合规性的检测效率,且提高了处理复杂的文档结构和内容时的检测准确率。
Smart Images

Figure CN120449857A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and more specifically, to a document compliance detection method, apparatus, device, and storage medium. Background Art
[0002] A Product Requirements Document (PRD) is a formal document that defines the objectives, functionality, behavior, and user interface of a product development project. It captures key information from conception to implementation. A compliant PRD provides the R&D team with clear and specific development guidance, ensuring the product is developed according to established goals and requirements. However, an inadequate document can distort team members' understanding of product requirements, leading to frequent revisions during development and increased development costs and time.
[0003] In the existing technology, the judgment of document compliance mainly relies on manual review, which is very inefficient. In addition, the document compliance detection method based on rule classifiers is prone to inaccurate detection when dealing with complex document structures and content, such as diverse content and constantly changing formats.
[0004] Therefore, it is necessary to design a document compliance detection method to solve the above problems. Summary of the Invention
[0005] The present application provides a document compliance detection method, apparatus, device and storage medium to solve the technical problems of low efficiency and low accuracy of existing document compliance detection methods.
[0006] In a first aspect, the present application provides a method for detecting document compliance, comprising:
[0007] Obtaining a product requirement document and converting the product requirement document into a text to be recognized in a markup language format;
[0008] The text to be recognized and the compliance rules are input into a pre-trained recognition model, and the recognition model outputs the compliance recognition result of the product requirement document based on the content recognition result of the text to be recognized and the compliance rules, wherein the compliance rules are used to indicate the correspondence between the content recognition result and the compliance recognition result, and the compliance recognition result includes whether it is compliant and the reason for non-compliance if it is non-compliant.
[0009] In some embodiments, the outputting, by the recognition model, a compliance recognition result of the product requirement document based on a content recognition result of the to-be-recognized text and the compliance rules includes:
[0010] Extracting content identified as a function description from the text to be recognized by the recognition model, and if a first content identified as a function description is extracted, deleting tags and line breaks in the first content to obtain content to be recognized;
[0011] Identifying and deleting the template content in the content to be identified to obtain second content;
[0012] A compliance identification result of the product requirement document is output based on the content identification result of the second content and the compliance rule.
[0013] In some embodiments, outputting the compliance identification result based on the content identification result of the second content and the compliance rule includes:
[0014] If the content identification result of the second content is that the second content is related to the product requirements, and the description content in the second content is not a file link and the number of words or sentences is greater than or equal to a preset threshold, then the compliance identification result of the product requirement document is determined to be compliant.
[0015] In some embodiments, outputting the compliance identification result based on the content identification result of the second content and the compliance rule includes:
[0016] If the content identification result of the second content is that the second content is irrelevant to the product requirement, determining that the compliance identification result of the product requirement document is non-compliant, and the reason for non-compliance is that the content is irrelevant to the product requirement;
[0017] If the content identification result of the second content is that the second content is related to the product requirements, but the number of words or sentences in the description of the second content is less than a preset threshold, then the compliance identification result of the product requirements document is determined to be non-compliant, and the reasons for non-compliance are failure of solution verification and non-compliance of the content quantity with the specification;
[0018] If the content identification result of the second content indicates that the second content is related to the product requirement, but the description in the second content is a file link, then the compliance identification result of the product requirement document is determined to be non-compliant, and the reason for the non-compliance is that the solution verification failed and only a file link was added;
[0019] If the second content is empty, it is determined that the compliance identification result of the product requirement document is non-compliant, and the reason for the non-compliance is that the solution verification failed and the content was not added.
[0020] In some embodiments, the outputting of the compliance recognition result of the product requirement document by the recognition model based on the content recognition result of the text to be recognized and the compliance rules further includes:
[0021] If no content identified as a function description is extracted, then deleting tags and line breaks in the text to be identified to obtain third content;
[0022] A compliance identification result of the product requirement document is output based on the content identification result of the third content and the compliance rule.
[0023] In some embodiments, outputting the compliance identification result of the product requirement document based on the content identification result of the third content and the compliance rule includes:
[0024] If the content identification result of the third content is that the third content is related to the product requirements, and the description content in the third content is not a file link and the number of words or sentences is greater than or equal to a preset threshold, then the compliance identification result of the product requirement document is determined to be compliant.
[0025] In some embodiments, the method further comprises:
[0026] Get a sample of the product requirements document;
[0027] Inputting the product requirement document sample and the compliance rules into the recognition model, and having the recognition model output a compliance recognition result of the product requirement document sample based on a content recognition result of the product requirement document sample and the compliance rules;
[0028] The compliance rules are adjusted according to the compliance identification result of the product requirement document sample.
[0029] In a second aspect, the present application provides a document compliance detection device, comprising:
[0030] An acquisition module, configured to acquire a product requirement document and convert the product requirement document into a text to be recognized in a markup language format;
[0031] A processing module is used to input the text to be recognized and the compliance rules into a pre-trained recognition model, and the recognition model outputs the compliance recognition result of the product requirement document based on the content recognition result of the text to be recognized and the compliance rules, wherein the compliance rules are used to indicate the correspondence between the content recognition result and the compliance recognition result, and the compliance recognition result includes whether it is compliant and the reason for non-compliance if it is non-compliant.
[0032] In some embodiments, the processing module is further configured to extract, by the recognition model, content identified as a function description from the text to be recognized, and, when extracting first content identified as a function description, delete tags and line breaks from the first content to obtain content to be recognized;
[0033] The processing module is further configured to identify and delete the template content in the content to be identified to obtain the second content;
[0034] The processing module is further configured to output a compliance recognition result of the product requirement document based on a content recognition result of the second content and the compliance rule.
[0035] In some embodiments, the processing module is also used to determine that the compliance identification result of the product requirement document is compliant when the content identification result of the second content is that the second content is related to the product requirements, and the descriptive content in the second content is not a file link and the number of words or sentences is greater than or equal to a preset threshold.
[0036] In some embodiments, the processing module is further configured to, when the content identification result of the second content is that the second content is irrelevant to the product requirement, determine that the compliance identification result of the product requirement document is non-compliant, and the reason for non-compliance is that the content is irrelevant to the product requirement;
[0037] The processing module is further configured to, if the content identification result of the second content is that the second content is related to the product requirements, but the number of words or sentences in the description of the second content is less than a preset threshold, determine that the compliance identification result of the product requirements document is non-compliant, and the reason for the non-compliance is that the solution verification fails and the content quantity does not meet the specifications;
[0038] The processing module is further configured to, if the content identification result of the second content indicates that the second content is related to the product requirement, but the description in the second content is a file link, determine that the compliance identification result of the product requirement document is non-compliant, and the reason for the non-compliance is that the solution verification failed and only the file link was added;
[0039] The processing module is further configured to, when the second content is empty, determine that the compliance identification result of the product requirement document is non-compliant, and the reason for the non-compliance is that the solution verification fails and the content is not added.
[0040] In some embodiments, the processing module is further configured to, if no content identified as a function description is extracted, delete tags and line breaks in the text to be identified to obtain third content;
[0041] The processing module is further configured to output a compliance recognition result of the product requirement document based on a content recognition result of the third content and the compliance rule.
[0042] In some embodiments, the processing module is also used to determine that the compliance identification result of the product requirement document is compliant when the content identification result of the third content is that the third content is related to the product requirements, and the descriptive content in the third content is not a file link and the number of words or sentences is greater than or equal to a preset threshold.
[0043] In some embodiments, the acquisition module is further used to obtain a sample of a product requirement document;
[0044] The processing module is further configured to input the product requirement document sample and the compliance rules into the recognition model, and the recognition model outputs a compliance recognition result of the product requirement document sample based on a content recognition result of the product requirement document sample and the compliance rules;
[0045] The processing module is further configured to adjust the compliance rules according to the compliance identification result of the product requirement document sample.
[0046] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0047] The memory stores computer-executable instructions;
[0048] The processor executes the computer-executable instructions stored in the memory to implement the document compliance detection method as described in the first aspect and various possible implementations of the first aspect.
[0049] In a fourth aspect, the present application provides a computer-readable storage medium comprising a stored program, which, when run, executes the document compliance detection method as described in the first aspect and various possible implementations of the first aspect.
[0050] In a fifth aspect, the present application provides a program product, including a computer program, which implements the document compliance detection method as described above when executed by a processor.
[0051] The document compliance detection method, apparatus, device and storage medium provided in the present application obtain product requirement documents and convert the product requirement documents into text to be recognized in a markup language format, input the text to be recognized and the compliance rules into a pre-trained recognition model, and the recognition model outputs the compliance recognition results of the product requirement documents based on the content recognition results of the text to be recognized and the compliance rules, wherein the compliance rules are used to indicate the correspondence between the content recognition results and the compliance recognition results, and the compliance recognition results include whether the compliance is met and the reasons for non-compliance in the case of non-compliance; this method not only improves the efficiency of document compliance detection, but also improves the detection accuracy when processing complex document structures and contents. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0053] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0054] Figure 1 A schematic diagram of the hardware environment for the document compliance detection method provided for this application;
[0055] Figure 2 Schematic diagram of the process of testing the compliance of the documents provided for this application Figure 1 ;
[0056] Figure 3 Schematic diagram of the process of testing the compliance of the documents provided for this application Figure 2
[0057] Figure 4 A schematic diagram of the structure of the document compliance detection device provided for this application;
[0058] Figure 5 This is a schematic diagram of the structure of the electronic device provided in this application. DETAILED DESCRIPTION
[0059] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0060] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0061] According to one aspect of the embodiment of the present application, a method for detecting document compliance is provided. The method for detecting document compliance is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residence (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned method for detecting document compliance can be applied to Figure 1 In the hardware environment shown in FIG. 1 , which is composed of a terminal device 102 and a server 104. Figure 1 As shown, the server 104 is connected to the terminal device via a network, and can be used to provide services (such as application services, etc.) for the terminal or the client installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0062] The aforementioned network may include, but is not limited to, at least one of the following: a wired network and a wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: a wide area network, a metropolitan area network, and a local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity) and Bluetooth. The terminal device 102 may include, but is not limited to, a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing machine, a smart dishwasher, a smart projector, a smart TV, a smart clothes drying rack, smart curtains, a smart audio / video system, a smart socket, a smart speaker, a smart fresh air system, smart kitchen and bathroom equipment, smart bathroom equipment, a smart robot vacuum, a smart window cleaning robot, a smart robot mop, a smart air purifier, a smart steamer, a smart microwave oven, a smart kitchen appliance, a smart purifier, a smart water dispenser, a smart door lock, and the like.
[0063] A Product Requirements Document (PRD) typically documents key information from the product's conception to implementation. The primary purpose of a PRD is to provide clear, specific development guidance to the R&D team, ensuring the product is developed according to established goals and requirements.
[0064] Current document compliance testing methods, which primarily rely on manual review, are not only extremely inefficient but also prone to errors. Furthermore, rule-based classifiers are less flexible when dealing with documents with complex structures, diverse content, and frequently changing formats, making them prone to misjudgments or missed detections, resulting in low accuracy.
[0065] The document compliance detection method provided in this application is intended to solve the above technical problems in the prior art.
[0066] The present application provides a method for detecting document compliance, which uses pre-labeled compliant documents and non-compliant documents, including the definition, description content, document template and other information of product requirement documents, and initial compliance rules to be input into an initial recognition model to obtain a trained recognition model and adjusted compliance rules. When the recognition model is subsequently used to detect product requirement documents, the target document is converted into a text to be recognized in a markup language format that can be recognized by the recognition model. Based on the adjusted compliance rules and the text to be recognized, the recognition model outputs a compliance recognition result for the target document, including: whether the document is compliant and the reason for non-compliance if it is non-compliant; the method realizes automatic detection of document compliance, reduces manual intervention, and improves processing efficiency. At the same time, the recognition model is used to improve the ability to understand the document content, recognize complex semantics and structural information, and enhance the accuracy of recognition.
[0067] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0068] Figure 2 Schematic diagram of the process of detecting document compliance provided in the embodiment of this application Figure 1 The execution subject of this embodiment may be, for example, a document compliance detection device. Figure 2 As shown, the document compliance detection method provided in this embodiment includes:
[0069] S201: Obtain a product requirement document and convert the product requirement document into a text to be recognized in a markup language format.
[0070] The markup language format refers to a text format that can be recognized by the recognition model, such as HTML format, MD format, etc. The product requirements document is the core document in the product development process, used to describe the product's functional requirements, performance indicators, user interface design, operating environment requirements, and integration requirements with other systems.
[0071] The product requirements document consists of the following sections: an introduction, a product overview, and a functional description. The introduction briefly describes the product's background, objectives, market positioning, and its relationship to other products. The product overview details key features such as the product's functionality, performance, user interface, and interaction methods. The functional description details all functional requirements, including function descriptions, input conditions, processing flow, and output results. It should be understood that the functional description is the core content of the product requirements document and the primary basis for the R&D team's development.
[0072] The essence of this step is to perform format parsing on the product requirement document, thereby converting the product requirement document into text to be recognized in a markup language format that can be recognized by the recognition model. For example, converting the product requirement document in DOC or DOCX format into text to be recognized in HTML or MD format.
[0073] Optionally, in the process of converting the product requirement document into the text to be recognized in the markup language format, for large documents, they can be divided into multiple parts and parsed using parallel processing technology, such as multi-threading or distributed computing, which can reduce the peak memory consumption and increase the parsing speed; during the parsing process, by setting up exception handling mechanisms and retry mechanisms, it is ensured that when a parsing error occurs, the error information can be recorded and the parsing of other parts can continue. At the same time, for the part that failed to parse, the parsing parameters can be adjusted or the parsing strategy can be changed to re-parse it, so as to improve the success rate of the language format conversion of the product requirement document.
[0074] S202: Input the text to be recognized and the compliance rules into a pre-trained recognition model, and the recognition model outputs a compliance recognition result of the product requirement document based on the content recognition result of the text to be recognized and the compliance rules.
[0075] Among them, the compliance identification results include whether it is compliant and the reasons for non-compliance if it is non-compliant. The content identification results include whether the content of the text to be identified is related to the product requirement document and the content described. The compliance rules are used to indicate the correspondence between the content identification results and the compliance identification results.
[0076] In the embodiment of the present application, the content recognition results may be, for example: the document content is irrelevant to the product requirement document, the document content is relevant to the product requirement document but the description is only one sentence, the document content is relevant to the product requirement document but the description lacks a functional description, etc. The compliance rules include: if the document content is irrelevant to the product requirement document, it is judged as non-compliant and the compliance recognition result is output as "non-compliant, reason: the document content is irrelevant to the product design"; if the document content is relevant to the product requirement document but the description is only one sentence, it is judged as non-compliant and the compliance recognition result is output as "non-compliant, reason: the solution verification failed, it is only a one-sentence solution."
[0077] It can be understood that the recognition model can perform content recognition on the text to be recognized in the above-mentioned markup language format, and judge the text features in the content recognition results according to predefined compliance rules, and verify each compliance rule one by one to evaluate whether the product requirement document complies with all compliance rules. If all compliance rules are met, the compliance recognition result is output as compliant; if there are non-compliant items, non-compliance and the corresponding reasons for non-compliance are output.
[0078] In some embodiments, the document compliance detection method also includes a rule calibration process, which includes: obtaining a product requirement document sample, inputting the product requirement document sample and the compliance rules into a recognition model, and having the recognition model output the compliance recognition result of the product requirement document sample based on the content recognition result of the product requirement document sample and the compliance rules, and adjusting the compliance rules according to the compliance recognition result of the product requirement document sample.
[0079] Among them, product requirement document samples are used as training samples, and various types of product requirement documents are collected from different projects, including documents filled in according to preset templates and documents not filled in according to preset templates. After the collection is completed, labels are added to each product requirement document sample to clearly identify which contents are compliant and which are non-compliant, and provide specific reasons for non-compliance. Then, all document samples are preprocessed, and the preprocessed text and compliance rules are input into the recognition model together to obtain the compliance recognition results of each sample output by the recognition model based on the content recognition results of the sample documents and the preset compliance rules.
[0080] Compare the compliance recognition results output by the model with the true, manually annotated labels to evaluate the recognition model's performance and identify errors, particularly those that are mistakenly deemed compliant but are actually non-compliant, as well as conflicts and overlaps between rules. Adjustments to compliance rules can include refining, merging, prioritizing, adding, and deleting rules.
[0081] Here, refining rules means adding more specific conditions or exceptions to vague or broadly defined rules to make them more precise; merging rules means merging rules with the same or very similar conditions into a more general rule to avoid excessive overlap between rules; setting priorities is to ensure that when multiple rules apply to the same situation, rules with higher priorities are given priority to resolve conflicts between rules; adding new rules means adding new compliance rules based on identified new problems or changing trends; deleting rules means removing rules that are no longer applicable or cause frequent false positives.
[0082] The document compliance detection method provided in this embodiment obtains a product requirement document and converts the product requirement document into a text to be recognized in a markup language format, inputs the text to be recognized and the compliance rules into a pre-trained recognition model, and the recognition model outputs the compliance recognition result of the product requirement document based on the content recognition result of the text to be recognized and the compliance rules, wherein the compliance rules are used to indicate the correspondence between the content recognition result and the compliance recognition result, and the compliance recognition result includes whether it is compliant and the reason for non-compliance in the case of non-compliance; this method not only improves the efficiency of document compliance detection, but also improves the detection accuracy when processing complex document structures and contents.
[0083] Figure 3 Schematic diagram of the process of testing the compliance of the documents provided for this application Figure 2 ,like Figure 3 As shown, this embodiment Figure 2 Based on the embodiment, a document compliance detection method is described in detail. The document compliance detection method provided in this embodiment includes:
[0084] S301: Obtain a product requirement document and convert the product requirement document into a text to be recognized in a markup language format.
[0085] Step S301 is similar to the above-mentioned step S201 and will not be described again here.
[0086] S302: Input the text to be recognized and the compliance rules into a pre-trained recognition model, and let the recognition model extract the content identified as the function description in the text to be recognized.
[0087] The functional specification includes all functional requirements of the product, such as functional descriptions, page prototypes, interface logic descriptions, and field / element descriptions. Field / element descriptions include detailed requirements for each element field on the prototype page, divided into editable and read-only types. For editable element fields, such as those on the add and modify pages, the descriptions focus on input restrictions and interaction logic. For read-only element fields, such as those on the view details page and read-only lists, the descriptions focus on the information display logic.
[0088] It should be understood that in the entire product requirement document, compared with the introduction and product overview, the functional description content is the core content of the entire product requirement document and the main basis for the R&D team to carry out development. Therefore, by testing the compliance of the functional description content, the compliance results of the product requirement document can be determined.
[0089] This step essentially involves extracting the detailed functional description from the entire text to be recognized. For example, a recognition model trained on a natural language model searches for common functional description tags (such as "functional requirements," "functional description," and "Features") within the text to be recognized. This model understands domain-specific terminology and expressions, enabling more accurate recognition of functional descriptions.
[0090] S303: If the first content identified as the function description is extracted, delete the tags and line breaks in the first content to obtain the content to be identified.
[0091] The first content refers to the function description content using a preset template. After extracting the first content identified as the function description, all HTML tags, line breaks and other redundant blank characters are deleted, and finally the cleaned content to be identified is returned.
[0092] It is understandable that the deleted labels and line breaks do not carry semantic information, but increase the complexity of the text. The purpose of this step is to prevent labels and line breaks from interfering with the recognition model's understanding of the text, thereby preventing misjudgment.
[0093] S304: Identify and delete the template content in the content to be identified to obtain the second content.
[0094] Among them, the second content refers to the content in the first content other than the template content, that is, the text content part filled in by the user. The template content refers to the fixed structure part pre-defined in the product requirement document for guiding information input and formatting. The template content can contain placeholders, sample text, format instructions, titles, subtitles, etc. Its function is to ensure that the final generated product requirement document is consistent and standardized.
[0095] While template content helps with document generation and organization, it doesn’t directly help the recognition model understand specific functional descriptions. Therefore, removing this template content improves the recognition model’s understanding and classification accuracy of actual functional descriptions.
[0096] S305: Output a compliance recognition result of the product requirement document according to the content recognition result of the second content and the compliance rules.
[0097] As an example, a specific implementation method for outputting a compliance identification result of a product requirement document based on the content identification result of the second content and the compliance rule is provided below, including:
[0098] (1) If the content identification result of the second content is that the second content is related to the product requirements, and the description content in the second content is not a file link and the number of words or sentences is greater than or equal to the preset threshold, then the compliance identification result of the product requirements document is determined to be compliant.
[0099] Among them, it is possible to determine whether the second content is relevant to the product requirements by identifying and extracting common function description keywords, such as "function requirements", "implementation methods", "user interaction", etc., analyzing sentence structure, identifying typical function description sentence patterns, and using the context understanding ability of the recognition model to capture semantic information. Then, after identifying and determining that the description content in the second content is a non-file link (such as HTTP / HTTPS link, FTP link, etc.), calculate the total number of words or sentences in the second content to determine whether it meets the preset minimum word count threshold or minimum sentence count threshold.
[0100] This rule ensures that the functional description part of the product requirement document not only contains a detailed description but is not a simple file link, thereby ensuring the quality and integrity of the product requirement document.
[0101] (2) If the content identification result of the second content is that the second content is irrelevant to the product requirements, then the compliance identification result of the product requirement document is determined to be non-compliant, and the reason for the non-compliance is that the content is irrelevant to the product requirements.
[0102] If the recognition model fails to recognize and extract words related to the functional description from the second content, the compliance recognition result of the product requirement document is determined to be non-compliant, and the reason for non-compliance is output as irrelevant to the product requirements.
[0103] (3) If the content recognition result of the second content is that the second content is related to the product requirements, but the number of words or sentences in the description of the second content is less than the preset threshold, then the compliance recognition result of the product requirement document is determined to be non-compliant, and the reasons for non-compliance are that the solution verification fails and the amount of content does not meet the specifications.
[0104] For example, even if the second content is related to product requirements, but the description is only one sentence, the product requirement document is not a clear, accurate, and comprehensive product requirement plan, and product development cannot be carried out based on the plan. In this case, it is also judged as non-compliant with the specifications. At the same time, the reason for the non-compliant output is that the plan verification failed and the amount of content does not meet the specifications.
[0105] (4) If the content identification result of the second content is that the second content is related to the product requirements, but the description content in the second content is a file link, then the compliance identification result of the product requirement document is determined to be non-compliant, and the reason for non-compliance is that the solution verification failed and only the file link was added.
[0106] Since the product requirement document needs to include detailed functional descriptions, user needs, technical requirements and other information, if the content recognition result of the second content is that the second content is related to the product requirements, but the second content only contains a file link, it means that the product requirement document does not comply with the specifications, and developers cannot directly obtain the necessary information from such a document without substantive content, which increases the difficulty of reading and understanding. At this time, the recognition model will output the compliance recognition result as non-compliant, and the reason for non-compliance is that the solution verification failed and only the file link was added.
[0107] (5) If the second content is empty, the compliance identification result of the product requirement document is determined to be non-compliant, and the reason for non-compliance is that the solution verification failed and the content was not added.
[0108] Among them, when the template content in the content to be identified is deleted and the second content obtained is empty, it means that although the text to be identified is a product requirement document that uses a preset template, the user did not fill in the product-related content according to the guidance of the template. The empty document cannot provide any key information about product goals, functional requirements, technical requirements, etc. Therefore, the recognition model will output the compliance recognition result of the document as non-compliant, and the reason for non-compliance is that the solution verification failed and no content was added.
[0109] S306: If no content identified as a function description is extracted, delete the tags and line breaks in the text to be identified to obtain the third content.
[0110] If the user does not use the preset template to fill out the product requirement document, it is impossible to extract the content identified as the functional description from the entire text to be recognized. At this time, the entire text to be recognized can only be used as the recognition target, and HTML tags and line breaks are deleted to obtain the third content.
[0111] S307: Outputting a compliance recognition result of the product requirement document according to the content recognition result of the third content and the compliance rules.
[0112] As an example, a specific implementation method for outputting the compliance identification result of the product requirement document based on the content identification result of the third content and the compliance rules is given below, including:
[0113] (1) If the content identification result of the third content is that the third content is related to the product requirements, and the description content in the third content is not a file link and the number of words or sentences is greater than or equal to the preset threshold, then the compliance identification result of the product requirements document is determined to be compliant.
[0114] For example, the recognition model can identify whether the description content in the third content contains a file link in URL format, then segment the text of the third content into a word list and calculate the number of words, or calculate the total number of sentences by identifying sentence end symbols (such as periods, question marks, and exclamation marks) and counting the number of occurrences of these symbols, and finally determine whether the total number of words meets a preset minimum word count threshold, or whether the total number of sentences meets a minimum sentence count threshold.
[0115] (2) If the content identification result of the third content is that the third content is irrelevant to the product requirements, the compliance identification result of the product requirement document is determined to be non-compliant, and the reason for non-compliance is that the document is not filled out according to the template and the content is irrelevant to the product requirements.
[0116] For example, if the recognition model identifies the text content of the third content as irrelevant to the product requirements, the compliance recognition result is directly output as non-compliant, and the reason for non-compliance is that the document is not filled out according to the template and the content is irrelevant to the product requirements.
[0117] (3) If the content identification result of the third content is that the third content is related to the product requirements, but the number of words or sentences in the description of the third content is less than the preset threshold, then the compliance identification result of the product requirements document is determined to be non-compliant, and the reason for non-compliance is that the document is not filled out according to the template and the amount of content does not meet the specifications.
[0118] For example, when the description in the third content is only one sentence, the product requirement document is not filled out according to the template and is unable to provide relevant personnel with an effective product requirement plan. Therefore, the recognition model determines it as non-compliant with the specifications. At the same time, the reason for the non-compliance output is that the document is not filled out according to the template and the amount of content does not meet the specifications.
[0119] (4) If the content identification result of the third content is that the third content is related to the product requirements, but the description content in the third content is a file link, then the compliance identification result of the product requirements document is determined to be non-compliant, and the reason for non-compliance is that the document is not filled out according to the template and only a file link is added.
[0120] For example, if the third content is related to product requirements, but there is no other substantive descriptive content in the third content except the file link, it means that the product requirement document does not comply with the specifications. At this time, the recognition model will output the compliance recognition result as non-compliant, and the reason for non-compliance is that the document is not filled out according to the template and only the file link is added.
[0121] The document compliance detection method provided in this embodiment converts a product requirement document into text to be recognized, and then inputs the converted text into a pre-trained recognition model together with compliance rules. The recognition model extracts the content identified as functional description from the text to be recognized, wherein the text to be recognized is divided into two categories: filled in according to a preset template and not filled in according to the preset template. For the text to be recognized filled in according to the preset template, the recognition model can extract the first content identified as functional description, delete the tags and line breaks in the first content, and then delete the template content, retaining only the second content filled in by the user, thereby outputting the compliance recognition result of the product requirement document based on the content recognition result of the second content and the compliance rules. For the text to be recognized not filled in according to the preset template, the recognition model cannot extract the content identified as functional description, deletes the tags and line breaks in the text to be recognized, obtains the third content, and outputs the compliance recognition result of the product requirement document based on the content recognition result of the entire third content and the compliance rules. This method not only improves the efficiency of document compliance detection, but also improves the detection accuracy when processing complex document structures and content.
[0122] Figure 4 This is a schematic diagram of the structure of the document compliance detection device provided in this application. Figure 4 As shown, the present application provides a document compliance detection device, and the document compliance detection device 400 includes:
[0123] An acquisition module 401 is configured to acquire a product requirement document and convert the product requirement document into a text to be recognized in a markup language format;
[0124] Processing module 402 is used to input the text to be recognized and the compliance rules into a pre-trained recognition model, and the recognition model outputs the compliance recognition result of the product requirement document based on the content recognition result of the text to be recognized and the compliance rules, wherein the compliance rules are used to indicate the correspondence between the content recognition result and the compliance recognition result, and the compliance recognition result includes whether it is compliant and the reason for non-compliance if it is non-compliant.
[0125] In some embodiments, the processing module 402 is further configured to extract, by the recognition model, content identified as a function description from the text to be recognized, and, when extracting first content identified as a function description, delete tags and line breaks from the first content to obtain content to be recognized;
[0126] The processing module 402 is further configured to identify and delete the template content in the content to be identified to obtain the second content;
[0127] The processing module 402 is further configured to output a compliance recognition result of the product requirement document based on the content recognition result of the second content and the compliance rule.
[0128] In some embodiments, the processing module 402 is also used to determine that the compliance identification result of the product requirement document is compliant when the content identification result of the second content is that the second content is related to the product requirements, and the descriptive content in the second content is not a file link and the number of words or sentences is greater than or equal to a preset threshold.
[0129] In some embodiments, the processing module 402 is further configured to, if the content identification result of the second content is that the second content is irrelevant to the product requirement, determine that the compliance identification result of the product requirement document is non-compliant, and the reason for non-compliance is that the content is irrelevant to the product requirement;
[0130] The processing module 402 is further configured to, if the content identification result of the second content indicates that the second content is related to the product requirement, but the number of words or sentences in the description of the second content is less than a preset threshold, determine that the compliance identification result of the product requirement document is non-compliant, and the reason for the non-compliance is that the solution verification fails and the content quantity does not meet the specification;
[0131] The processing module 402 is further configured to, if the content identification result of the second content indicates that the second content is related to the product requirement, but the description in the second content is a file link, determine that the compliance identification result of the product requirement document is non-compliant, and the reason for the non-compliance is that the solution verification failed and only the file link was added;
[0132] The processing module 402 is further configured to determine, when the second content is empty, that the compliance identification result of the product requirement document is non-compliant, and the reasons for the non-compliance are failure of solution verification and no content added.
[0133] In some embodiments, the processing module 402 is further configured to, if no content identified as a function description is extracted, delete tags and line breaks in the text to be identified to obtain third content;
[0134] The processing module 402 is further configured to output a compliance recognition result of the product requirement document based on the content recognition result of the third content and the compliance rule.
[0135] In some embodiments, the processing module 402 is also used to determine that the compliance identification result of the product requirement document is compliant when the content identification result of the third content is that the third content is related to the product requirements, and the descriptive content in the third content is not a file link and the number of words or sentences is greater than or equal to a preset threshold.
[0136] In some embodiments, the acquisition module 401 is further used to acquire a sample of a product requirement document;
[0137] The processing module 402 is further configured to input the product requirement document sample and the compliance rules into the recognition model, and the recognition model outputs a compliance recognition result of the product requirement document sample based on a content recognition result of the product requirement document sample and the compliance rules;
[0138] The processing module 402 is further configured to adjust the compliance rules according to the compliance identification result of the product requirement document sample.
[0139] Figure 5 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 5 As shown, the present application provides an electronic device, which includes a receiver 501, a transmitter 502, a processor 503 and a memory 504.
[0140] Receiver 501, for receiving instructions and data;
[0141] Transmitter 502, used to send instructions and data;
[0142] Memory 504, for storing computer-executable instructions;
[0143] The processor 503 is configured to execute the computer-executable instructions stored in the memory 504 to implement the various steps of the document compliance detection method in the above embodiment. For details, please refer to the relevant description of the document compliance detection method embodiment.
[0144] Optionally, the memory 504 may be independent or integrated with the processor 503 .
[0145] When the memory 504 is independently provided, the electronic device further includes a bus for connecting the memory 504 and the processor 503 .
[0146] The implementation principle and technical effects of the electronic device provided in this embodiment can be found in the aforementioned embodiments and will not be described in detail here.
[0147] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the document compliance detection method described in any of the aforementioned embodiments is implemented.
[0148] An embodiment of the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the document compliance detection method described in any of the aforementioned embodiments.
[0149] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules is merely a logical function division. In actual implementation, other division methods may be used. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not implemented.
[0150] The integrated modules implemented in the form of software functional modules can be stored in a computer-readable storage medium. The software functional modules stored in a storage medium include a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute some of the steps of the methods described in various embodiments of the present application.
[0151] It should be understood that the processor described above may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), or application-specific integrated circuits (ASICs). A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the application may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor. The memory may include high-speed RAM memory, and may also include non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard drive, a read-only memory, a magnetic disk, or an optical disk.
[0152] The storage medium may be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0153] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.
[0154] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0155] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0156] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of this application, or the part that contributes to the existing technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of this application.
[0157] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for detecting document compliance, characterized in that: The method comprises: Obtaining a product requirement document and converting the product requirement document into a text to be recognized in a markup language format; The text to be recognized and the compliance rules are input into a pre-trained recognition model, and the recognition model outputs the compliance recognition result of the product requirement document based on the content recognition result of the text to be recognized and the compliance rules, wherein the compliance rules are used to indicate the correspondence between the content recognition result and the compliance recognition result, and the compliance recognition result includes whether it is compliant and the reason for non-compliance if it is non-compliant.
2. The method according to claim 1, characterized in that Outputting the compliance recognition result of the product requirement document by the recognition model based on the content recognition result of the text to be recognized and the compliance rule includes: Extracting content identified as a function description from the text to be recognized by the recognition model, and if a first content identified as a function description is extracted, deleting tags and line breaks in the first content to obtain content to be recognized; Identifying and deleting the template content in the content to be identified to obtain second content; A compliance identification result of the product requirement document is output based on the content identification result of the second content and the compliance rule.
3. The method according to claim 2, characterized in that Outputting the compliance identification result according to the content identification result of the second content and the compliance rule includes: If the content identification result of the second content is that the second content is related to the product requirements, and the description content in the second content is not a file link and the number of words or sentences is greater than or equal to a preset threshold, then the compliance identification result of the product requirement document is determined to be compliant.
4. The method according to claim 2, characterized in that Outputting the compliance identification result according to the content identification result of the second content and the compliance rule includes: If the content identification result of the second content is that the second content is irrelevant to the product requirement, determining that the compliance identification result of the product requirement document is non-compliant, and the reason for non-compliance is that the content is irrelevant to the product requirement; If the content identification result of the second content is that the second content is related to the product requirements, but the number of words or sentences in the description of the second content is less than a preset threshold, then the compliance identification result of the product requirements document is determined to be non-compliant, and the reasons for non-compliance are failure of solution verification and non-compliance of the content quantity with the specification; If the content identification result of the second content indicates that the second content is related to the product requirement, but the description in the second content is a file link, then the compliance identification result of the product requirement document is determined to be non-compliant, and the reason for the non-compliance is that the solution verification failed and only a file link was added; If the second content is empty, it is determined that the compliance identification result of the product requirement document is non-compliant, and the reason for the non-compliance is that the solution verification failed and the content was not added.
5. The method according to claim 2, characterized in that The step of outputting the compliance recognition result of the product requirement document by the recognition model based on the content recognition result of the text to be recognized and the compliance rule further includes: If no content identified as a function description is extracted, then deleting tags and line breaks in the text to be identified to obtain third content; A compliance identification result of the product requirement document is output based on the content identification result of the third content and the compliance rule.
6. The method according to claim 5, characterized in that Outputting the compliance identification result of the product requirement document based on the content identification result of the third content and the compliance rule includes: If the content identification result of the third content is that the third content is related to the product requirements, and the description content in the third content is not a file link and the number of words or sentences is greater than or equal to a preset threshold, then the compliance identification result of the product requirement document is determined to be compliant.
7. The method according to any one of claims 1 to 6, characterized in that Also includes: Get a sample of the product requirements document; Inputting the product requirement document sample and the compliance rules into the recognition model, and having the recognition model output a compliance recognition result of the product requirement document sample based on a content recognition result of the product requirement document sample and the compliance rules; The compliance rules are adjusted according to the compliance identification result of the product requirement document sample.
8. A document compliance detection device, characterized in that: include: An acquisition module, configured to acquire a product requirement document and convert the product requirement document into a text to be recognized in a markup language format; A processing module is used to input the text to be recognized and the compliance rules into a pre-trained recognition model, and the recognition model outputs the compliance recognition result of the product requirement document based on the content recognition result of the text to be recognized and the compliance rules, wherein the compliance rules are used to indicate the correspondence between the content recognition result and the compliance recognition result, and the compliance recognition result includes whether it is compliant and the reason for non-compliance if it is non-compliant.
9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the document compliance detection method according to any one of claims 1 to 7 through the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the document compliance detection method according to any one of claims 1 to 7 when running.
Citation Information
Cited By
Intelligent document standard compliance automatic verification method and system
CN122242482A
An intelligent document standard compliance automatic checking method and system
CN122242482B