Compliance knowledge base construction method, compliance question and answer method, compliance question and answer device and electronic equipment

By extracting and sorting content from compliance documents, identifying and dividing appropriate second content, extracting its features and saving it in the knowledge base, the problem of inaccurate answers in the prior art is solved, and a more accurate question-and-answer service is achieved.

CN119886299APending Publication Date: 2025-04-25BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411865588.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The prior art has difficulty in effectively handling and returning accurate answers when building a knowledge base and providing a Q&A service, resulting in users being misleading when looking for legal or compliance issues.

Method used

By extracting and sorting content from compliance documents, identifying the identified content and dividing the appropriate second content, extracting its features and saving it in the knowledge base, returning accurate answers during the question and answer process.

Benefits of technology

Improves the accuracy of answers during the Q&A process, ensures that users can obtain directly related legal or compliance clauses, and reduces the possibility of misleading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119886299A_ABST
    Figure CN119886299A_ABST
Patent Text Reader

Abstract

The invention provides a compliance knowledge base construction method, a compliance question and answer method and device and electronic equipment, and relates to the technical field of computers, in particular to the field of artificial intelligence. According to the specific implementation scheme, multiple pieces of first content are extracted from a compliance document, and the first content comprises text content; sorting the first contents according to the positions of the first contents in the compliance document to obtain a sorted document; determining a plurality of contents conforming to a first preset regular rule in the sorted document as identification contents; dividing a plurality of second contents from the sorted document according to the identification contents; respectively extracting a first feature of each second content, and correspondingly storing each second content and the first feature of each second content in a knowledge base. According to the method, the compliance document can be split according to the clause granularity, so that the accuracy of subsequent questions and answers is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, in particular to artificial intelligence, and more particularly to a compliance knowledge base construction method, a compliance question-and-answer method, a device, and an electronic device. Background Art

[0002] When a user wants to know the answer to a question, he or she can input the natural language used to describe the question into the computer in the form of voice, text, etc. The computer will search for content that is adapted to the natural language input by the user from a pre-built knowledge base and display this content to the user as the answer. Summary of the Invention

[0003] The present disclosure provides a compliance knowledge base construction method, a compliance question-and-answer method, a device, and an electronic device.

[0004] According to a first aspect of the present disclosure, a method for constructing a compliance knowledge base is provided, comprising:

[0005] extracting a plurality of first contents from a compliance document, wherein the first contents include text contents;

[0006] sorting the first contents according to their positions in the compliant document to obtain a sorted document;

[0007] Determining a plurality of contents that conform to a first preset regular rule in the sorted document as identification contents, wherein the first preset regular rule includes: containing a preset character for indicating a sequence in the document;

[0008] Dividing a plurality of second contents from the sorted document according to the identification content, wherein each second content consists of an identification content and content between the identification content and the next identification content;

[0009] The first features of each second content are extracted respectively, and each second content and the first features of each second content are correspondingly stored in a knowledge base.

[0010] According to a second aspect of the present disclosure, a compliance question-and-answer method is provided, comprising:

[0011] Obtaining a question text for representing a compliance issue and extracting a second feature of the question text;

[0012] Determining, in a knowledge base pre-constructed according to any one of the methods of the first aspect, a first feature that matches the second feature;

[0013] The second content corresponding to the determined first feature is determined as an answer to the compliance question.

[0014] According to a third aspect of the present disclosure, there is provided a device for constructing a compliance knowledge base, comprising:

[0015] an extraction module, configured to extract a plurality of first contents from a compliant document, wherein the first contents include text contents;

[0016] a sorting module, configured to sort each of the first contents according to a position of each of the first contents in the compliant document to obtain a sorted document;

[0017] an identification module, configured to identify a plurality of contents that conform to a first preset regular rule in the sorted document as identification contents, wherein the first preset regular rule includes: characters that are preset to indicate the order in the document;

[0018] a splitting module, configured to divide the sorted document into a plurality of second contents according to the identification content, wherein each second content consists of an identification content and content between the identification content and the next identification content;

[0019] The storage module is used to extract the first features of each second content respectively, and store each second content and the first features of each second content in a knowledge base in correspondence.

[0020] According to a fourth aspect of the present disclosure, a compliance question-and-answer device is provided, comprising:

[0021] an acquisition module, configured to acquire a question text representing a compliance issue and extract a second feature of the question text;

[0022] a matching module, configured to determine, in a knowledge base pre-constructed according to any one of the methods of the first aspect, a first feature that matches the second feature;

[0023] A determination module is configured to determine the second content corresponding to the determined first feature as an answer to the compliance question.

[0024] According to a fourth aspect of the present disclosure, there is provided an electronic device, including:

[0025] at least one processor; and

[0026] a memory communicatively connected to the at least one processor; wherein,

[0027] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any one of the methods of the first aspect or the second aspect.

[0028] According to a fifth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, including: the computer instructions are used to enable the computer to execute the method according to any one of the first aspect or the second aspect above.

[0029] According to a sixth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of the first aspect or the second aspect.

[0030] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0032] Figure 1 A diagram of scenarios where users can solve legal problems through the Q&A platform;

[0033] Figure 2a A schematic diagram of the window generated during the process of building the knowledge base;

[0034] Figure 2b Another schematic diagram of the windows generated during the knowledge base construction process;

[0035] Figure 3 A flowchart of the method for constructing a compliance knowledge base provided for this application;

[0036] Figure 4a A schematic diagram of the first content in a single-column document;

[0037] Figure 4b A schematic diagram of the first content in a multi-column document;

[0038] Figure 4c A schematic diagram of a sorted document obtained by sorting the first content in a single-column document;

[0039] Figure 4d A schematic diagram of a sorted document obtained by sorting the first content in a multi-column document;

[0040] Figure 5 A schematic diagram of a process for dividing the second content when the sorted document provided in this application is a document generated based on a markup language;

[0041] Figure 6 Another flowchart of the compliance knowledge base construction method provided for this application;

[0042] Figure 7a The first schematic diagram of the knowledge base management interface provided for this application;

[0043] Figure 7b The second schematic diagram of the knowledge base management interface provided for this application;

[0044] Figure 7c A third schematic diagram of the knowledge base management interface provided for this application;

[0045] Figure 7d A fourth schematic diagram of the knowledge base management interface provided for this application;

[0046] Figure 7e The fifth schematic diagram of the knowledge base management interface provided for this application;

[0047] Figure 7f The sixth schematic diagram of the knowledge base management interface provided for this application;

[0048] Figure 7g The seventh schematic diagram of the knowledge base management interface provided for this application;

[0049] Figure 7h The eighth schematic diagram of the knowledge base management interface provided for this application;

[0050] Figure 8 Another flowchart of the compliance knowledge base construction method provided for this application;

[0051] Figure 9 A schematic diagram of the document outline provided for this application;

[0052] Figure 10a A schematic diagram of a flow chart of the first content extraction method provided by this application;

[0053] Figure 10b Schematic diagram of the recognition results;

[0054] Figure 10c is a schematic diagram of the recognition result after removal;

[0055] Figure 11 Another flowchart of the method for constructing a compliance knowledge base provided for this application;

[0056] Figure 12 A flowchart of the compliance question-and-answer method provided for this application;

[0057] Figure 13 A schematic diagram of the structure of the compliance knowledge base construction device provided in this application;

[0058] Figure 14A schematic diagram of the structure of the compliance question-and-answer device provided for this application;

[0059] Figure 15 It is a block diagram of an electronic device used to implement the compliance knowledge base construction method or the compliance question and answer method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0060] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0061] To more clearly illustrate the compliance knowledge base construction method provided in this application, the following uses the application scenario of legal consulting as an example to illustrate possible application scenarios of the compliance knowledge base construction method provided in this application. It is understood that legal consulting is only one possible application scenario of the compliance knowledge base construction method provided in this application. In other possible embodiments, the compliance knowledge base construction method provided in this application can also be applied to scenarios other than legal consulting, such as company system query, company system evolution analysis, product compliance testing, etc.

[0062] Users often face legal issues in their daily lives and work, and they want to understand the relevant provisions in legal documents to help them resolve these issues. For example, if a product they purchased has quality issues, they may want to understand whether the relevant legal documents allow returns or exchanges, so they can negotiate with the seller about post-sales procedures.

[0063] However, users often lack legal expertise and are unclear about which legal document these relevant provisions are specifically contained in, nor are they clear about which section, article, or clause of the legal document the relevant provisions are located in. Therefore, if users want to understand the relevant provisions in a legal document by reading it, they need to carefully read the legal document from beginning to end to find the relevant provisions.

[0064] Since it takes a lot of time to carefully read legal documents from beginning to end, users often choose to turn to AI-based question-answering platforms when faced with the above situation. Figure 1 , Figure 1The diagram shows a scenario where a user solves a legal problem through a question-and-answer platform, which includes a terminal 100, a question-and-answer platform 200, and a knowledge base 300. The terminal 100 can be a mobile phone, or an electronic device such as a desktop computer, a tablet computer, a smart watch, or smart glasses, and this application does not impose any restrictions on this. In addition, it is understood that Figure 1 The diagram shown is only a possible scenario diagram. In other possible embodiments, the database 300 may also be integrated into the question-and-answer platform 200.

[0065] The user enters a description of the legal issue they are facing into terminal 100 through voice input, text input, or other means. This description is expressed in natural language. Terminal 100 sends this description to question-and-answer platform 200, which embeds it, extracts features from it (hereinafter referred to as the embedding process, or feature extraction process), and sends the extracted features to knowledge base 300.

[0066] The knowledge base 300 pre-stores various text contents and the features corresponding to each text content. How to obtain the features corresponding to each text content will be explained below and will not be repeated here. After receiving the features sent by the question-and-answer platform 200, the knowledge base 300 will search for features that match the received features in the pre-stored features, determine the text content corresponding to the searched features, and return the determined text content to the question-and-answer platform 200. The question-and-answer platform 200 returns the received text content as an answer to the terminal 100, and the terminal 100 displays the answer through its own display screen or broadcasts the answer through its own speaker.

[0067] The following will explain how to obtain the corresponding features of each text content in the related art:

[0068] The administrator of the knowledge base 300 first needs to prepare the documents of each legal document and input these documents into the knowledge base 300. The knowledge base 300 performs the following steps for each input document:

[0069] Step S1: Generate a window at the starting position of the document.

[0070] For example, Figure 2a As shown, the generated window 23 is located in the upper half of the first page 21 in the document, and does not cover the lower half of the first page 21 or the second page 22 in the document.

[0071] Step S2: extract the text contents in the window, extract the features of the text contents, and save the extracted text contents and features accordingly.

[0072] like Figure 2aAs shown, the text content extracted at this time is "Article 1: ...; Article 2: ...; Article 3: ...;", the features of "Article 1: ...; Article 2: ...; Article 3: ...;" are extracted, and the extracted features are recorded as feature 1. The knowledge base will correspondingly save "Article 1: ...; Article 2: ...; Article 3: ...;" and feature 1.

[0073] Step S3: If the window is not at the bottom of the document, slide the window downward and return to step S2.

[0074] The window after sliding down should have a certain overlap area with the window before sliding down, so that all the text content in the document can be extracted. For example, Figure 2b As shown, Figure 2b In the figure, the window 24 after sliding downward is shown in a solid frame, and the window 23 before sliding downward is shown in a dotted frame. Figure 2b As shown, the text content extracted when returning to execute step S2 this time will be "Article 3: ...; Article 4: ...; Article 5: ...; Article 6...;", and the feature obtained by extracting "Article 3: ...; Article 4: ...; Article 5: ...; Article 6...;" will be recorded as feature 2, and the knowledge base will correspondingly save "Article 3: ...; Article 4: ...; Article 5: ...; Article 6...;" and feature 2.

[0075] If the window is located at the bottom of the document, it means that all text contents in the document and the features corresponding to all text contents have been extracted, so the processing of the document can be ended at this time.

[0076] From the above explanation about how to obtain the corresponding features of each text content, it can be seen that each text content stored in the knowledge base is all the text content extracted from a window. It is understandable that the lengths of different clauses are often different, so it is impossible to reasonably set the size of the window so that the window always contains only the text content of one clause. Instead, as mentioned above, Figure 2a 、 Figure 2b The window shown includes text contents of multiple clauses at the same time, which will also cause each text content stored in the knowledge base to be text contents of multiple clauses.

[0077] As mentioned above regarding the scenario where users solve legal problems through the question-and-answer platform, the question-and-answer platform returns a text content in the knowledge base as the answer to the user terminal, and a text content in the knowledge base is the text content of multiple clauses. Therefore, the answer will be the text content of multiple clauses. Although these multiple clauses include clauses that can answer the legal problems faced by users, they also include clauses that cannot answer the legal problems. For users who lack legal expertise, they are easily misled by these clauses that cannot answer legal problems, which leads to the inability to effectively solve the legal problems based on the answers.

[0078] For example, let's consider the aforementioned scenario where a product purchased by a user has certain quality issues. Assume the returned answer includes the text of three clauses. Clause 1 states: In case A, the consumer can request an unconditional return; Clause 2 states: In case B, the consumer can request a replacement; and Clause 3 states: In case C, the consumer can request a replacement and an extension of the warranty period.

[0079] However, users may not be able to accurately determine whether the situation they are facing is situation A, situation B, or situation C. Therefore, based on this answer, users are still unclear about how to negotiate with the seller.

[0080] It can be seen that in order to reduce the possibility of misleading users, it is necessary to reasonably construct the knowledge base so that the answer returned during the question-answering process only includes one clause. Based on this, this application provides a method for constructing a compliant knowledge base, such as Figure 3 Shown, including:

[0081] Step S301: extracting a plurality of first contents from a compliant document.

[0082] The first content includes text content.

[0083] Step S302 : sorting the first contents according to their positions in the compliant document to obtain a sorted document.

[0084] Step S303: Determine a plurality of contents that meet the first preset regular rule in the sorted document as identification contents.

[0085] The first preset regular rule includes: containing preset characters for indicating the order in the document.

[0086] Step S304: Divide the sorted documents into a plurality of second contents according to the identified contents.

[0087] Each second content consists of an identification content and content between the identification content and the next identification content.

[0088] In step S305 , the first features of each second content are extracted respectively, and each second content and the first features of each second content are correspondingly stored in the knowledge base.

[0089] In this embodiment, a sorted document is obtained by sorting the contents in the compliance document, so that the clauses in the compliance document are arranged in order in the sorted document, and the identification content is determined in the sorted document using the first preset regular rule. Since the first preset regular rule includes: containing preset characters for indicating the order in the document, the identification content that can be determined will include "Chapter X", "Section X", "Article X", etc. in the sorted document. Compliance documents such as company rules and regulations, legal documents, etc. often use characters such as "Chapter X", "Section X", "Article X" to separate different clauses. Therefore, it can be considered that the content between two identification contents is the content of one clause. Since the clauses in the sorted document are arranged in order, the first of the two identification contents can be regarded as the serial number of the clause. Therefore, the combination of an identification content and the content between the identification content and the next identification content can be regarded as the combination of the content of a clause and the serial number of a clause. Therefore, each second content obtained by the combination can be regarded as a clause. Therefore, the first features of each extracted second content can be regarded as the features of each individual clause. By storing each second content and the first features of each second content in the knowledge base, since the second content corresponding to each first feature can be regarded as a clause, the answer in the subsequent question-and-answer process can include only one clause, which effectively improves the accuracy of the answer.

[0090] The above steps S301 to S305 will be described below respectively:

[0091] Among them, in step S301, the compliance document may refer to an electronic document of company rules and regulations, legal documents, department documents, standard documents, etc., and the formats include but are not limited to PDF (Portable Document Format), text documents, pictures, Word (a document editor) documents, etc.

[0092] The first content includes at least text content, and may also include other content such as table content, image content, etc. Exemplarily, the first content may be text content, text content and table content, text content and image content, or text content, image content and table content.

[0093] How to extract the first content from the compliance document will be exemplified below and will not be elaborated here.

[0094] In step S302, there are two cases:

[0095] Case 1: The compliance document is as follows Figure 4a The single-column document shown.

[0096] Case 2: The compliance document is as follows Figure 4b The multi-column document shown.

[0097] The following describes how to sort documents in Case 1 and Case 2 respectively:

[0098] For case 1, since the reading order of a single-column document is from top to bottom, when sorting the first content, it is sorted according to the order from top to bottom in the compliant document. For example, Figure 4a As shown in FIG, there are three first contents in the compliance document, which are recorded as content 41, content 42 and content 43. Since content 41 is above content 42, and content 42 is above content 43, content 41 is placed first, content 42 is placed second, and content 43 is placed third when sorting. The sorted document is as follows: Figure 4c shown.

[0099] For case 2, since the reading order of multi-column documents is from top to bottom and from left to right, when sorting the first content, it is sorted according to the order from top to bottom and from left to right in the compliant document. For example, Figure 4b As shown, there are four first contents in the compliant document, which are recorded as content 44, content 45, content 46 and content 47 respectively. Since content 44 and content 45 are located to the left of content 46 and content 47, content 44 and content 45 are placed before content 46 and content 47 when sorting. Since content 44 is located above content 45, content 44 is placed before content 45 when sorting. Since content 46 is located above content 47, content 46 is placed before content 47 when sorting. That is, the order of content 44, content 45, content 46 and content 47 is followed. The sorted document obtained by sorting is shown as follows: Figure 4d shown.

[0100] By using the aforementioned method for situation 2, multi-column documents can be sorted into single-column sorted documents. Since computers are more efficient in processing single-column documents, the efficiency of the knowledge base construction method can be effectively improved.

[0101] It is understandable that the aforementioned Case 1 and Case 2 are merely two possible examples. In other possible embodiments, multi-column compliant documents may also be sorted into multi-column sorted documents, and this application does not impose any limitation on this.

[0102] How to obtain the position of the first content in the compliant document will be exemplified below and will not be described in detail here.

[0103] The above has explained how to sort in step S302 according to different situations. Figure 3 The subsequent steps of step S302 are described as follows:

[0104] Among them, in step S303, the characters used to represent the order in the document include but are not limited to: "1.", "2.", "3.", "1," "2," "3," "1:," "2:," "3:," "Chapter 1," "Chapter 2," "Chapter 3," "Section 1," "Section 2," "Section 3," "Part 1," "Part 2," "Part 3," "Article 1," "Article 2," "Article 3," "Paragraph 1," "Paragraph 2," "Paragraph 3."

[0105] The characters "1", "2", "3", "one", "two", and "three" listed above can be replaced by any characters that can represent the order, such as "4", "five", "sixth", "seven", "H", "α", etc. This application does not impose any restrictions on this.

[0106] In step S304, each second content is composed of two parts: one part is the identification content, and the other part is the content between the identification content and the next identification content. If the identification content is the last identification content in the sorted document, the other part is the content between the identification content and the end of the sorted document.

[0107] For example, assuming that there is "The first article: XXXXX; The second article: YYYYYYYY." in the sorted document, it can be seen from the above description of step S303 that "The first article" and "The second article" comply with the first preset regular rule, so "The first article" and "The second article" are identification content, and assuming that there is no content that complies with the first preset regular rule in "XXXXX" and "YYYYYYYY", and "." is the end of the entire sorted document, then for the identification content "The first article", the content between it and the next identification content (i.e., "The second article") is ":XXXXX", so the second content "The first article:XXXXX" can be divided out, and for the identification content "The second article", it is the last identification content in the sorted document, and the content between it and the end of the sorted document is ":YYYYYYYY", so the second content "The second article:YYYYYYYY" can be divided out.

[0108] Among them, in step S305, the first feature of the second content can be extracted according to any feature extraction method, but the same feature extraction method should be adopted for the second content of the same type. For example, assuming that there are 5 second contents in total, respectively recorded as second contents 1-5, second contents 1-3 only contain text content, and second contents 4 and 5 contain not only text content but also image content, then the first feature extraction model can be used to extract the first features of second contents 1-3, and the second feature extraction model can be used to extract the first features of second contents 4 and 5, wherein the first feature extraction model is a model with the ability to extract text features, and the second feature is a model with the ability to extract text and image features.

[0109] The above has been Figure 3 Steps S301 to S305 in the compliance knowledge base construction method shown are explained respectively. From the above explanation, it can be seen that sorting documents is an indispensable part of implementing the compliance knowledge base construction method provided by this application. Therefore, the following will explain how to construct the sorted documents and how to divide the second content from the sorted documents.

[0110] In one possible embodiment, in order to facilitate the distinction between identification content and non-identification content in the sorted document, the generated sorted document may be a document generated based on a markup language, such as a markdown (a lightweight markup language) document, an XML (Extensible Markup Language) document, etc. Documents generated based on a markup language can mark the content in the document, and then, by marking the identification content or non-identification content in the document, the distinction between the two can be conveniently achieved, thereby effectively improving the efficiency of the candidate classifying the second content based on the identification content, and thus improving the efficiency of building the compliance knowledge base.

[0111] In the case where the sorted documents are not generated based on a markup language, identification content and non-identification content may also be distinguished in other computer-recognizable ways, such as by setting the fonts of identification content and non-identification content to different fonts.

[0112] For the convenience of description, the following only explains how to divide the second content when the sorted document is a document generated based on a markup language. The principle is the same when the sorted document is not a document generated based on a markup language. The only difference is the way of distinguishing between identification content and non-identification content.

[0113] See also Figure 5 , Figure 5 The figure shows a flow chart of dividing the second content when the sorted document provided by the present application is a document generated based on a markup language, including:

[0114] Step S501: Add a classification mark to each identified content in the sorted document.

[0115] because Figure 5 In the example shown, the sorting document is a document generated based on a markup language, so it is possible to add a markup to each identification content in the sorting document.

[0116] Step S502: determining a plurality of intermediate contents in the sorted document according to the hierarchical tags.

[0117] The middle content is the content between two adjacent classification marks and the content between the last classification mark and the end of the sorted document.

[0118] Step S503: Combine each intermediate content with the identification content marked by the previous adjacent classification mark to obtain a plurality of second contents.

[0119] Figure 5 Steps S502 and S503 are the aforementioned Figure 3 An implementation of step S304.

[0120] The above has respectively explained how to construct a sorting document and how to divide the second content from the sorting document. It is understandable that if the constructed sorting document is not accurate enough, it may lead to the inability to accurately divide the second contents based on the sorting document, which may result in the divided part of the second content including multiple clauses, or only including part of the content of one clause.

[0121] Based on this, in a possible embodiment, the compliance knowledge base construction method provided by this application can be as follows: Figure 6 Shown, including:

[0122] Step S301: extracting a plurality of first contents from a compliant document.

[0123] The first content includes text content.

[0124] Step S302 : sorting the first contents according to their positions in the compliant document to obtain a sorted document.

[0125] Step S303: Determine a plurality of contents that meet the first preset regular rule in the sorted document as identification contents.

[0126] The first preset regular rule includes: containing preset characters for indicating the order in the document.

[0127] Step S306: display the sorted documents.

[0128] The identification contents in the sorted document are shown in a first style, and the other contents except the identification contents are shown in a second style, and the first style is different from the second style.

[0129] Step S3041 : In response to the input storage instruction for the displayed sorted document, a plurality of second contents are divided from the sorted document according to the identification contents.

[0130] Each second content consists of an identification content and content between the identification content and the next identification content.

[0131] In step S305 , the first features of the second contents are extracted respectively, and each second content and the first feature of each second content are correspondingly stored in the knowledge base.

[0132] Figure 6 and Figure 3 The difference is that it also includes step S306, and step S304 is refined into step S3041. Therefore, only steps S306 and S3041 are described below. Other steps can be found in Figure 3 The relevant instructions in will not be repeated here.

[0133] Among them, in step S306, the display of the sorted documents can be displayed on the local display screen of the execution entity of the compliance knowledge base construction method of this application, or on the display screen of other devices that have established a communication connection with the execution entity.

[0134] For example, assuming that the execution entity of the compliance knowledge base construction method of this application is a server, the sorted documents can be displayed through the local display screen of the server, or the server can be remotely accessed through the desktop computer of the relevant personnel to obtain the sorted documents from the server and display them.

[0135] Furthermore, in one possible embodiment, step S306 may be executed immediately after step S303 is completed. In another possible embodiment, step S306 is not executed immediately after step S303 is completed, but is executed after receiving a user's display instruction for sorting documents.

[0136] For example, in one possible embodiment, when a user needs to use multiple compliance documents to build a compliance knowledge base, the user can remotely access the knowledge base through his or her desktop computer and open the knowledge base management page, or open the knowledge base management page locally in the knowledge base.

[0137] The knowledge base management page is initially as follows Figure 7a As shown, a document upload control 701 is displayed. When the user clicks the document upload control 701, the knowledge base management page is initially displayed as Figure 7bAs shown, a document upload sub-interface 720 is displayed, which includes a path selection sub-interface 721 , a document selection sub-interface 722 , a confirm upload control 723 , and a cancel upload control 724 .

[0138] The user can enter a path selection instruction through the path selection sub-interface 721 to select a specific path. The document selection sub-interface 722 will display the corresponding documents under the path. The user selects the document that he wants to use to build the knowledge base in the document selection sub-interface 722 and clicks the confirm upload control 723 to upload the selected document to the knowledge base. If the user does not want to upload any document to the knowledge base, he can click the cancel upload control 724 to close the document upload sub-interface 720. At this time, the knowledge base management page will be as follows: Figure 7a shown.

[0139] Assume that the user selects the first compliant document in the document selection sub-interface 722 and clicks the confirm upload control 723. At this time, the document upload sub-interface 720 will be closed, and the knowledge base will use the first compliant document as the compliant document and execute the above steps S301-S303. At this time, the knowledge base management page will be as follows: Figure 7c As shown, the document name of the first compliance document and a progress bar 702 for indicating the processing progress of the first compliance document are displayed. The processing progress is used to indicate the progress of the knowledge base executing the aforementioned steps S301-S303.

[0140] When the knowledge base completes the above steps S301-S303, the progress bar 702 will disappear. At this time, the knowledge base management page will be as shown below. Figure 7d As shown, a browsing control 703 and an import control 704 corresponding to the first compliance document are displayed, and the status of the first compliance document is displayed. At this time, the status of the first compliance document is not entered.

[0141] If the user clicks the browse control 703, the aforementioned step S306 will be executed, that is, the sorted documents generated based on the first compliant document will be displayed. Figure 7e As shown, a first browsing window 730 is displayed, in which a sorted document generated based on the first compliant document is displayed.

[0142] The user browses the sorted documents through the first browsing window 730 and closes the first browsing window 730 after confirming that the sorted documents are correct. At this time, the knowledge base management page will be as follows: Figure 7dAs shown, the user clicks the import control 704, which is equivalent to inputting an import instruction. At this time, the knowledge base will continue to execute steps S3041 and S305, and after completing steps S3041 and S305, the status of the first compliance document will be changed from unentered to entered. At this time, the knowledge base management page will be as shown below. Figure 7f As shown, since the first compliance document has been entered, there is no need to continue to display the entry control 704 corresponding to the first compliance document on the knowledge base management page.

[0143] The user can subsequently continue to enter other compliance documents in addition to the first compliance document through the aforementioned operations. Since the principles are the same, they will not be repeated here. The user can also upload or upload and enter other compliance documents before completing the entry of the first compliance document. This application does not impose any restrictions on this.

[0144] The above has been combined Figure 7a-7f The execution timing of the aforementioned step S306 and step S3041 is exemplified. It can be understood that: Figure 7a-7f The knowledge base management page and its interaction mode shown are only one possible example. In other possible embodiments, the style of the knowledge base management page can be different from the following. Figure 7a-7f Different, and the interaction method of the knowledge base management page can also be the same Figure 7a-7f This application does not impose any limitation on this.

[0145] Please see again below Figure 6 After the above exemplary description of the execution timing of step S306 and step S3041, step S306 and step S3041 will be further described:

[0146] In step S306, the first style may be bold, underlined, or italic, and correspondingly, the second style may be non-bold, non-underlined, or non-italic.

[0147] By displaying identification content and non-identification content in different styles, users can quickly determine whether the identification content in the sorted document is accurate. For example, assuming that the first style is bold and the second style is non-bold, if the user finds that "Article 4: The weight of the finished product should be between 10g and 11g" is not bold when browsing the sorted document, the user can confirm that the identification content in the sorted document is not accurate. If the user confirms that the identification content in the sorted document is not accurate, the user can manually modify the sorted document or control the execution entity to re-execute the aforementioned steps S301 to S303.

[0148] Among them, in step S307, the warehousing instruction can be considered to be input by the user when it is confirmed that there are no errors in the sorting document. Therefore, re-partitioning the second content in response to the warehousing instruction can effectively avoid the situation where the second content includes multiple clauses or only partial content of one clause due to inaccurate sorting documents, thereby improving the stability of the compliance knowledge base construction method.

[0149] Moreover, it can be understood that the inaccuracy in the sorting document may stem from the inaccuracy in determining the identification content or the inaccuracy in extracting the first content. Exemplarily, the text content in the compliance document is "Article 1: The energy of this product includes solar energy and electric energy", but when extracting the first content, "太" is incorrectly identified as "大", resulting in the text content in the sorting document being "Article 1: The energy of this product includes 大阳能 and electric energy".

[0150] Based on this, in a possible embodiment, when displaying the sorting document, the compliance document will also be synchronously displayed.

[0151] Exemplarily, the aforesaid Figure 7e The shown knowledge base management page may also be as Figure 7g shown, including a second browsing window 740, and the second browsing window 740 is used to synchronously display the compliance document.

[0152] Selecting this embodiment, by synchronously displaying the sorting document and the compliance document, it is convenient for the user to effectively discover the errors in the sorting document by comparing the compliance document and the sorting document, further improving the accuracy of the sorting document, and thus improving the accuracy of the constructed knowledge base.

[0153] As described in the aforesaid step S306, when it is confirmed that the identification content in the sorting document is not accurate enough, the user can manually modify the sorting document. Therefore, in a possible embodiment, the compliance knowledge base construction method provided by this application may also be as Figure 8 shown, including:

[0154] Step S301, extracting multiple first contents from the compliance document.

[0155] Among them, the first content includes text content.

[0156] Step S302, sorting each first content according to its position in the compliance document to obtain a sorting document.

[0157] Step S303, determining multiple contents that conform to the first preset regular rule in the sorting document as identification contents.

[0158] Among them, the first preset regular rule includes: containing preset characters for indicating the order in the document.

[0159] Step S306: display the sorted documents.

[0160] The identification contents in the sorted document are shown in a first style, and the other contents except the identification contents are shown in a second style, and the first style is different from the second style.

[0161] Step S307 : in response to a modification instruction inputted for the displayed sorted document, redetermine the identification content in the sorted document and / or modify the sorted document according to the instruction of the modification instruction.

[0162] Step S30411 , in response to the input storage instruction for the displayed sorted document, a plurality of second contents are divided from the sorted document according to the latest identified contents.

[0163] Each second content consists of an identification content and content between the identification content and the next identification content.

[0164] In step S305 , the first features of the second contents are extracted respectively, and each second content and the first feature of each second content are correspondingly stored in the knowledge base.

[0165] Figure 8 and Figure 6 The difference is that it also includes step S307, and step S3041 is refined into step S30411. Therefore, only steps S307 and S30411 are described below. Other steps can be found in Figure 6 and Figure 3 The relevant instructions in will not be repeated here.

[0166] Among them, in S307, it can be as follows Figure 7e or Figure 7g The sorted documents may be modified directly in the knowledge base management page shown, or may be modified through other pages other than the knowledge base management page.

[0167] There are three situations for modification:

[0168] Case 3: The identification content in the sorting document is incorrect, and the content of the sorting document is consistent with the compliance document. The user only needs to modify the identification content. For example, the user found that the "Article 4" in the "Article 4: The weight of the finished product should be between 10g and 11g" in the sorting document was not bolded. In this case, the user can manually add "Article 4" as the identification content.

[0169] Case 4: The identification content in the sorting document is correct, and the content of the sorting document is inconsistent with the compliance document. The user only needs to modify the inconsistent parts of the sorting document to make them consistent. For example, in the example of "Article 1: The energy sources of this product include solar energy and electric energy", the user needs to manually change "solar energy" in the sorting document to "solar energy".

[0170] Case 5: The identification content in the sorted document is incorrect and the content of the sorted document is inconsistent with the compliant document. In this case, the user needs to modify the identification content and modify the inconsistent parts of the sorted document to make them consistent with the compliant document.

[0171] In step S30411, since the sorted document has already been modified in step S307, the sorted document can be considered accurate at this point. Therefore, the second content separated from the sorted document based on the latest identified content can be considered accurate second content. Therefore, this embodiment can further improve the accuracy of the sorted document by manually modifying the sorted document, thereby enhancing the stability of the compliance knowledge base construction method.

[0172] Please check back again Figure 7e or Figure 7g For short sorted documents, users can use Figure 7e or Figure 7g The first browsing window 730 in the file is used to browse the sorted documents to check whether the sorted documents are correct. Figure 7e or Figure 7g The first browsing window 730 in the process browses the sorted documents page by page, which is inefficient.

[0173] Based on this, in a possible embodiment, while displaying the sorted documents, the document outline will also be displayed synchronously, for example, Figure 7h As shown, a document outline 750 is displayed on one side of the first browsing window 730. The user can quickly locate the content to be checked in the sorted document through the document outline 750 without having to check page by page, which effectively improves the inspection efficiency and thereby improves the efficiency of the compliance knowledge base construction while improving the stability of the compliance knowledge base construction method.

[0174] The following describes how to obtain the document outline:

[0175] In this embodiment, the first preset regular rule includes a first preset sub-regular rule and a second preset sub-regular rule. The first preset sub-regular rule includes: contains preset characters for indicating the order in the document, and does not include characters for indicating clauses; the second preset sub-regular rule includes: contains preset characters for indicating the order in the document, and includes characters for indicating clauses.

[0176] The characters used to represent clauses include but are not limited to "Article 1", "Article 2", "Article 3", "Paragraph 1", "Paragraph 2", "Paragraph 3", etc. Therefore, the aforementioned "1.", "2.", "3.", "1," "2," "3," "1:," "2:," "3:," "Chapter 1," "Chapter 2," "Chapter 3," "Section 1," "Section 2," "Section 3," "Part 1," "Part 2," "Part 3," "Article 1," and "Article 2" can be regarded as containing preset characters for indicating the order in the document, and do not contain characters for representing clauses, while the aforementioned "Part 3," "Article 1," "Article 2," "Article 3," "Paragraph 1," "Paragraph 2," and "Paragraph 3" can be regarded as containing preset characters for indicating the order in the document, and contain characters for representing clauses.

[0177] For ease of description, the identification content that meets (i.e., hits) the first preset sub-regular rule is referred to as the first identification content, and the identification content that meets the second preset sub-regular rule is referred to as the second identification content. It is understandable that an outline usually does not list clauses, but only chapters, sections, parts, and articles, so the first identification content can be regarded as the identification content used to represent the outline.

[0178] Therefore, in this embodiment, each first identification content can be sorted according to its position in the compliance document to obtain the outline of the compliance document. For example, assuming that there are 6 first identification contents in the sorted document, and the order in the compliance document is "Chapter 1, AAA", "Section 1, BBB", "Section 2, CCC", "Chapter 2, DDD", "Section 1, EEE", and "Section 2, FFF", the following can be generated: Figure 9 The document outline is shown.

[0179] In this embodiment, the characteristics of the compliance document outline can be used to automatically generate a document outline, so that users can quickly locate the content to be checked in the sorted document through the document outline without having to check page by page, which effectively improves the inspection efficiency and can improve the efficiency of the compliance knowledge base construction while improving the stability of the compliance knowledge base construction method.

[0180] The above has explained how to check and modify sorted documents. It can be understood that to improve the accuracy of sorted documents, it not only depends on checking and modifying, but also depends on how to accurately extract the first content. Therefore, the following will provide an exemplary explanation of how to extract the first content from a compliant document.

[0181] See also Figure 10a , Figure 10aFIG. 1 is a flow chart of a first content extraction method provided by the present application, comprising:

[0182] Step S1001 : performing document layout recognition on a compliant document to obtain elements and categories of the elements in the compliant document.

[0183] The elements in the compliance document are: header, footer, text, title, text, picture, table in the compliance document. The category of header element is header, and the same applies to other elements. The recognition results can be as follows Figure 10b As shown, each element is marked with a detection box, and the category and confidence of the element are marked above the detection box.

[0184] Step S1002: For each element of the target category, extract the first content from the element.

[0185] The target category includes text, but does not include headers and footers. For example, the target category can be text only, text and title, text, picture, and table, text, title, picture, or text, title, picture, and table.

[0186] In one possible embodiment, the first content may be extracted from each target category element in the recognition result. In another possible embodiment, the elements of other categories other than the target category elements may be removed from the recognition result. Assuming that the target category is text, title, picture and table, the header and footer in the recognition result are removed to obtain the recognition result. Figure 10b As shown, the recognition result after removal will be as Figure 10c Since the recognition result after the removal only includes elements of the target category, the first content can be extracted from each element in the recognition result after the removal.

[0187] Selection Figure 10a The illustrated approach can remove elements that are not required by the user from the compliant document, thereby avoiding extraction of content that the user does not want to extract, that is, can improve the accuracy of the extracted first content.

[0188] In the aforementioned step S1002, if the element category is text or title, the first content extracted is text content. If the target category includes a table, if the element category is a table, the first content extracted can be text content (i.e., text content in the table) or table content (i.e., the table itself). If the target category includes a table, if the element category is an image, the first content extracted can be text content (i.e., text content in the image) or image content (i.e., the image itself).

[0189] By extracting table and pattern content from compliant documents, the knowledge stored in the knowledge base can be enriched, thereby providing richer answers in the subsequent question-and-answer process.

[0190] Furthermore, it is understandable that the compliance document may be scanned or a garbled document. In this case, the text content within each element in the compliance document is not expressed in text form, so the first content cannot be directly extracted from these elements.

[0191] Based on this, in a possible embodiment, if the compliant document is scanned, or the compliant document is a garbled document, optical character recognition is performed on the position of the element in each text category in the compliant document, and the recognition result is obtained as the first content.

[0192] Furthermore, in this embodiment, if the compliant document is not scanned and is not a garbled document, the text content in the element is directly extracted as the first content.

[0193] By selecting this embodiment, whether the compliant document is scanned or a garbled document, the first content can be accurately extracted therefrom, thereby effectively improving the applicability of the knowledge base construction method provided by this application.

[0194] Please check back again Figure 3 , Figure 3 The second contents in step S305 may refer to all the divided second contents or to part of the divided second contents. For example, in a possible embodiment, step S305 includes:

[0195] Step S3051: Determine content that meets a second preset regular rule among all second content as the third content.

[0196] The second preset regular rule includes: containing characters used to represent non-clause content, and non-clause content includes any one or more of: annexes, scope, normative references, terms, definitions, and glossaries. For example, the non-clause content can be annexes, scope, and terms, or normative references, terms, definitions, and glossaries, or can also be annexes, scope, normative references, terms, definitions, and glossaries.

[0197] Step S3052 : extracting content features of each fourth content respectively, and storing each fourth content and its content features in a corresponding manner in a knowledge base.

[0198] The fourth content is the second content excluding the third content. In other words, the fourth content can also be regarded as content that does not contain characters used to represent non-clause content.

[0199] In this embodiment, the second preset regularization rule can be used to filter out content containing characters that are not clause content from the second content. This content obviously does not include clauses and is therefore useless in the subsequent question-and-answer process. Therefore, by filtering out this second content and storing only the remaining second content (i.e., the fourth content) in the knowledge base, it is possible to avoid storing useless content and corresponding features in the knowledge base, thereby reducing the storage pressure of the knowledge base and improving the accuracy of subsequent questions and answers.

[0200] The above has described each step of the knowledge base construction method provided by the present application. In order to more clearly illustrate the knowledge base construction method provided by the present application, the following will use an example to illustrate the complete process of the knowledge base construction method again. Figure 11 In this example, the compliance document is a PDF document. The steps include:

[0201] Step S1101: layout detection.

[0202] That is the aforementioned step S1001.

[0203] Step S1102: table recognition.

[0204] In this example, the target category includes tables. Table recognition is to extract table content from elements of each table category as the first content extracted from each element.

[0205] Step S1103: image recognition.

[0206] In this example, the target category includes pictures. Picture recognition is to extract picture content from elements of each picture category as the first content extracted from each element.

[0207] Step S1104: Determine whether the compliant document is scanned or a garbled document. If yes, proceed to step S1105; if no, proceed to step S1106.

[0208] Step S1105: optical character recognition extraction.

[0209] In this example, the target category includes text. Optical character recognition extraction involves performing optical character recognition on the location of each element in the compliant document for each text category, obtaining a recognition result as the first content extracted from the element.

[0210] Step S1106: text extraction.

[0211] That is, for each element of each text category, the text content of the element is directly extracted as the first content extracted from the element.

[0212] Step S1107, element filtering.

[0213] That is, elements of categories other than the target category are filtered out from the recognition results. Figure 10b 、 Figure 10c And the aforementioned Figure 10b and Figure 10c Related instructions.

[0214] Step S1108, sorting elements.

[0215] That is, the first content extracted from each element is sorted in order from top to bottom and from left to right according to the position of each element in the compliance document.

[0216] Step S1109: Convert to Markdown document.

[0217] The Markdown document in this example is the aforementioned sorted document, and steps S1108 and S1109 are equivalent to the aforementioned step S302.

[0218] Step S1110: Add outline and bold information.

[0219] That is, the first identification content and the second identification content are marked in the Mark document, wherein the first identification content is the outline and the second identification content is the bold information.

[0220] Step S1111: manually adjust the format.

[0221] That is, the aforementioned steps S306 and S307.

[0222] Step S1112: Automatically split the clauses according to the MarkDown document identifier.

[0223] That is, in the aforementioned step S304, as described above, the second content should only include one clause, so each second content can be regarded as a clause, and thus this step can be regarded as splitting the clauses.

[0224] Step S1113: prohibiting storage unless required by law.

[0225] That is, the aforementioned steps S3051 and S3052. Non-clause content can be considered as non-regulatory requirements. Since the aforementioned steps S3051 and S3052 can prevent non-clause content from being stored in the knowledge base, it can be considered as non-regulatory requirements and prohibited from being stored.

[0226] Corresponding to the compliance knowledge base construction method provided in this application, this application also provides a compliance question-and-answer method, such as Figure 12 Shown, including:

[0227] Step S1201: Obtain a question text for representing a compliance issue, and extract a second feature of the question text.

[0228] The question text can be text entered by the user or text obtained through speech recognition based on the user's input. The question text describes the compliance question that the user wishes to have answered in natural language.

[0229] Step S1202: Determine in the knowledge base a first feature that matches the second feature.

[0230] The knowledge base is pre-constructed according to any of the aforementioned compliance knowledge base construction methods.

[0231] Step S1203: Determine the second content corresponding to the determined first feature as the answer to the compliance question.

[0232] In this embodiment, since the sorted document is obtained by sorting the contents in the compliance document during the process of building the knowledge base, the clauses in the compliance document are arranged in order in the sorted document, and the identification content is determined in the sorted document using the first preset regular rule. Since the first preset regular rule includes: containing preset characters for indicating the order in the document, the identification content that can be determined will include "Chapter X", "Section X", "Article X", etc. in the sorted document, and compliance documents such as company rules and regulations, legal documents, etc. often use characters such as "Chapter X", "Section X", "Article X" to separate different clauses. Therefore, it can be considered that the content between two identification contents is the content of one clause. Since the clauses in the sorted document are arranged in order, the first of the two identification contents can be regarded as the serial number of the clause. Therefore, the combination of an identification content and the content between the identification content and the next identification content can be regarded as the combination of the content of one clause and the serial number of one clause. Therefore, each second content obtained by the combination can be regarded as one clause. Therefore, the first features of each extracted second content can be regarded as the features of each individual clause. By storing each second content and the first features of each second content in the knowledge base, since the second content corresponding to each first feature can be regarded as a clause, the answer in the compliance question-and-answer process can include only one clause, effectively improving the accuracy of the answer.

[0233] Corresponding to the compliance knowledge base construction method provided in this application, this application also provides a compliance knowledge base construction device, such as Figure 13 Shown, including:

[0234] An extraction module 1301 is configured to extract a plurality of first contents from a compliant document, wherein the first contents include text contents;

[0235] A sorting module 1302 is configured to sort the first contents according to their positions in the compliant document to obtain a sorted document;

[0236] The identification module 1303 is configured to identify a plurality of contents that meet a first preset regularization rule in the sorted document as identification contents, wherein the first preset regularization rule includes: a character that contains a preset character for indicating a sequence in the document;

[0237] A splitting module 1304 is configured to divide the sorted document into a plurality of second contents according to the identification content, wherein each second content consists of an identification content and content between the identification content and the next identification content;

[0238] The storage module 1305 is configured to extract the first features of each second content respectively, and store each second content and the first features of each second content in a knowledge base in correspondence.

[0239] In a possible embodiment, the sorted document is a document generated based on a markup language;

[0240] The device further comprises:

[0241] a tag adding module, configured to add a graded tag to each of the identified contents in the sorted document;

[0242] The splitting module divides the sorted document into a plurality of second contents according to the identified contents, including:

[0243] Based on the hierarchical marks, a plurality of intermediate contents are determined in the sorted document, wherein the intermediate contents are the contents located between two adjacent hierarchical marks and the contents located between the last hierarchical mark and the end of the sorted document; and each intermediate content is respectively combined with the identification content marked by the previous adjacent hierarchical mark to obtain a plurality of second contents.

[0244] In a possible embodiment, it further includes:

[0245] a first display module for displaying the sorted document, wherein each of the identified contents in the sorted document is displayed in a first format, and other contents except the identified contents are displayed in a second format, wherein the first format is different from the second format;

[0246] The splitting module divides the sorted document into a plurality of second contents according to the identified content, including:

[0247] In response to an input warehousing instruction for the displayed sorted document, a plurality of second contents are divided from the sorted document according to the identified contents.

[0248] In a possible embodiment, it further includes:

[0249] The second display module is used to display the compliant document synchronously when displaying the sorted document.

[0250] In a possible embodiment, it further includes:

[0251] a modification module, configured to respond to a modification instruction inputted for the displayed sorted document and redefine identification content in the sorted document and / or modify the sorted document according to the modification instruction;

[0252] The division module, in response to the input storage instruction for the displayed sorted document, divides the sorted document into a plurality of second contents according to the identification content, including:

[0253] In response to an input warehousing instruction for the displayed sorted document, a plurality of second contents are divided from the sorted document according to the latest identified contents.

[0254] In a possible embodiment, the first preset regular rule includes a first preset sub-regular rule and a second preset sub-regular rule, wherein the first preset sub-regular rule includes: characters preset for indicating the order in the document, and does not include characters for indicating clauses; the second preset sub-regular rule includes: characters preset for indicating the order in the document, and includes characters for indicating clauses;

[0255] The device further comprises:

[0256] An outline module is used to sort each first identification content according to its position in the compliant document to obtain a document outline of the compliant document, wherein the first identification content is the identification content that complies with the first preset sub-regular rule; when displaying the sorted document, the document outline of the sorted document is displayed synchronously.

[0257] In a possible embodiment, the extraction module extracts the first content from the compliance document, including:

[0258] Performing document layout recognition on the compliant document to obtain elements and categories of the elements in the compliant document;

[0259] For an element of each target category, first content is extracted from the element, wherein the target category includes text but does not include a header and a footer.

[0260] In a possible embodiment, the extraction module extracts the first content from the elements of each target category, including:

[0261] For the elements of each text category, if the compliant document is scanned, or if the compliant document is a garbled document, optical character recognition is performed on the location of the element in the compliant document to obtain a recognition result as the first content;

[0262] If the compliant document is not a scanned document and is not a garbled document, the text content in the element is extracted as the first content.

[0263] In a possible embodiment, the target category further includes a table category, and the first content further includes table content; the extraction module is further configured to extract the table content from the element of each table category as the first content;

[0264] and / or,

[0265] The target category further includes a picture category, and the first content further includes picture content; the extraction module is further configured to extract the picture content from the elements of each picture category as the first content.

[0266] In a possible embodiment, the sorting module is configured to sort the first contents according to the position of the valid contents in the compliant document to obtain a sorted document, including:

[0267] According to the position of each valid content in the compliant document, the first contents are sorted in order from top to bottom and from left to right to form a single-column document as a sorted document.

[0268] In a possible embodiment, the storage module extracts content features of each second content respectively, and stores each second content and the content features of each second content in the knowledge base accordingly, including:

[0269] Determining, from all the second contents, content that meets a second preset regularization rule as the third content, wherein the second preset regularization rule includes: containing characters used to represent non-clause content, wherein the non-clause content includes: any one or more of: annexes, scope, normative references, terms, definitions, and glossaries;

[0270] Content features of each fourth content are extracted respectively, and each fourth content and its content features are correspondingly stored in a knowledge base, wherein the fourth content is the second content other than the third content.

[0271] Corresponding to the compliance question-answering method provided in this application, this application also provides a compliance question-answering device, such as Figure 14 Shown, including:

[0272] An acquisition module 1401 is configured to acquire a question text representing a compliance issue and extract a second feature of the question text;

[0273] A matching module 1402 is configured to determine a first feature that matches the second feature in a knowledge base pre-constructed according to any of the aforementioned compliance knowledge base construction methods;

[0274] The determination module 1403 is configured to determine the second content corresponding to the determined first feature as the answer to the compliance question.

[0275] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0276] Figure 15 A schematic block diagram of an example electronic device 1500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0277] like Figure 15 As shown, device 1500 includes a computing unit 1501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1502 or a computer program loaded from a storage unit 1508 into a random access memory (RAM) 1503. Various programs and data required for the operation of device 1500 can also be stored in RAM 1503. Computing unit 1501, ROM 1502, and RAM 1503 are connected to each other via a bus 1504. An input / output (I / O) interface 1505 is also connected to bus 1504.

[0278] Various components in device 1500 are connected to I / O interface 1505, including an input unit 1506, such as a keyboard and mouse; an output unit 1507, such as various types of displays and speakers; a storage unit 1508, such as a magnetic disk and optical disk; and a communication unit 1509, such as a network card, a modem, a wireless communication transceiver, etc. Communication unit 1509 allows device 1500 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0279] Computing unit 1501 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of computing unit 1501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Computing unit 1501 performs the various methods and processes described above, such as any of the aforementioned compliance knowledge base construction methods or compliance question-and-answer methods. For example, in some embodiments, any of the aforementioned compliance knowledge base construction methods or compliance question-and-answer methods can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 1508. In some embodiments, part or all of the computer program can be loaded and / or installed onto device 1500 via ROM 1502 and / or communication unit 1509. When the computer program is loaded into RAM 1503 and executed by computing unit 1501, one or more steps of the compliance knowledge base construction method or compliance question-and-answer method described above can be performed. Alternatively, in other embodiments, the computing unit 1501 may be configured in any other appropriate manner (for example, by means of firmware) to execute any of the aforementioned compliance knowledge base construction methods or compliance question-and-answer methods.

[0280] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0281] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0282] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0283] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0284] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0285] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.

[0286] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.

[0287] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A method for building a compliance knowledge base, comprising: Extracting a plurality of first contents from the compliance document, wherein the first contents include text contents; sorting the first contents according to the positions of the first contents in the compliant document to obtain a sorted document; Determining a plurality of contents that conform to a first preset regular rule in the sorted document as identification contents, wherein the first preset regular rule includes: containing preset characters for indicating the order in the document; According to the identification content, a plurality of second contents are divided from the sorted document, wherein each of the second contents consists of an identification content and content between the identification content and the next identification content; The first features of each second content are extracted respectively, and each second content and the first features of each second content are correspondingly stored in a knowledge base.

2. The method according to claim 1, wherein: The sorted document is a document generated based on a markup language; The method further comprises: Adding a classification mark to each of the identified contents in the sorting document; The step of dividing a plurality of second contents from the sorted document according to the identified contents includes: According to the classification marks, a plurality of intermediate contents are determined in the sorted document, wherein the intermediate contents are contents between two adjacent classification marks and contents between the last classification mark and the end of the sorted document; Each intermediate content is combined with the identification content marked by the previous classification mark adjacent to it to obtain a plurality of second contents.

3. The method according to claim 1, further comprising: Displaying the sorted document, wherein each of the identified contents in the sorted document is displayed in a first style, and other contents except the identified contents are displayed in a second style, and the first style is different from the second style; The step of dividing a plurality of second contents from the sorted document according to the identified contents includes: In response to a storage instruction input for the displayed sorted document, a plurality of second contents are divided from the sorted document according to the identified contents.

4. The method according to claim 3, further comprising: When displaying the sorted documents, the compliant documents are displayed synchronously.

5. The method according to claim 3, further comprising: In response to a modification instruction input for the displayed sorted document, redetermine the identification content in the sorted document and / or modify the sorted document according to the instruction of the modification instruction; In response to the input storage instruction for the displayed sorted document, dividing the sorted document into a plurality of second contents according to the identification content includes: In response to a storage instruction input for the displayed sorted document, a plurality of second contents are divided from the sorted document according to the latest identified contents.

6. The method according to claim 3, wherein: The first preset regular rule includes a first preset sub-regular rule and a second preset sub-regular rule, wherein the first preset sub-regular rule includes: contains preset characters for indicating the order in the document, and does not contain characters for indicating clauses, and the second preset sub-regular rule includes: contains preset characters for indicating the order in the document, and contains characters for indicating clauses; The method further comprises: Sort the first identification contents according to their positions in the compliant document to obtain a document outline of the compliant document, wherein the first identification contents are identification contents that conform to the first preset sub-regular rule; When displaying the sorted document, the document outline of the sorted document is displayed synchronously.

7. The method according to claim 1, wherein: The extracting the first content from the compliance document includes: Performing document layout recognition on the compliant document to obtain elements and categories of the elements in the compliant document; For an element of each target category, a first content is extracted from the element, wherein the target category includes text but does not include a header and a footer.

8. The method according to claim 7, wherein: The step of extracting the first content from the elements of each target category includes: For the elements of each text category, if the compliant document is scanned, or the compliant document is a garbled document, optical character recognition is performed on the position of the element in the compliant document to obtain a recognition result as the first content; If the compliant document is not a scanned document and is not a garbled document, the text content in the element is extracted as the first content.

9. The method according to claim 8, wherein: The target category further includes a table category, and the first content further includes table content; the method further includes: for each element of the table category, extracting the table content in the element as the first content; and / or, The target category further includes a picture category, and the first content further includes picture content; the method further includes: for elements of each picture category, extracting the picture content in the element as the first content.

10. The method according to claim 1, wherein: The step of sorting the first contents according to the positions of the valid contents in the compliant document to obtain a sorted document includes: According to the positions of the valid contents in the compliant document, the first contents are sorted in order from top to bottom and from left to right to form a single-column document as a sorted document.

11. The method according to claim 1, wherein: The extracting the content features of each second content respectively and storing each second content and the content features of each second content in a knowledge base correspondingly includes: Determine the content that meets the second preset regular rule from all the second contents as the third content, wherein the second preset regular rule includes: containing characters used to represent non-clause content, wherein the non-clause content includes: any one or more of annexes, scopes, normative references, terms, definitions, and glossaries; The content features of each fourth content are extracted respectively, and each fourth content and the content features of each fourth content are correspondingly stored in the knowledge base, wherein the fourth content is the second content except the third content.

12. A compliance question-and-answer method, comprising: Obtaining a question text for representing a compliance issue, and extracting a second feature of the question text; Determining a first feature matching the second feature in a knowledge base pre-constructed according to any one of the methods of claims 1 to 11; The second content corresponding to the determined first feature is determined as an answer to the compliance question.

13. A compliance knowledge base construction device, comprising: An extraction module, configured to extract a plurality of first contents from a compliance document, wherein the first contents include text contents; A sorting module, used for sorting each of the first contents according to the position of each of the first contents in the compliant document to obtain a sorted document; an identification module, used to determine a plurality of contents that meet a first preset regular rule in the sorted document as identification contents, wherein the first preset regular rule includes: containing preset characters for indicating the order in the document; A splitting module, used for dividing a plurality of second contents from the sorted document according to the identification content, wherein each of the second contents consists of an identification content and content between the identification content and the next identification content; The storage module is used to extract the first features of each second content respectively, and store each second content and the first features of each second content in a knowledge base correspondingly.

14. The device according to claim 13, wherein: The sorted document is a document generated based on a markup language; The device also includes: A tag adding module, used for adding a classification tag to each of the identified contents in the sorted document; The splitting module divides the sorted document into a plurality of second contents according to the identification content, including: According to the classification marks, a plurality of intermediate contents are determined in the sorted document, wherein the intermediate contents are contents between two adjacent classification marks and contents between the last classification mark and the end of the sorted document; Each intermediate content is combined with the identification content marked by the previous classification mark adjacent to it to obtain a plurality of second contents.

15. The apparatus according to claim 13, further comprising: A first display module, used for displaying the sorted document, wherein each of the identified contents in the sorted document is displayed in a first style, and other contents except the identified contents are displayed in a second style, and the first style is different from the second style; The splitting module divides the sorted document into a plurality of second contents according to the identification content, including: In response to a storage instruction input for the displayed sorted document, a plurality of second contents are divided from the sorted document according to the identified contents.

16. The apparatus according to claim 15, further comprising: The second display module is used to display the compliant document synchronously when displaying the sorted document.

17. The apparatus according to claim 15, further comprising: A modification module, configured to respond to a modification instruction input for the displayed sorted document, and to redefine the identification content in the sorted document and / or modify the sorted document according to the instruction of the modification instruction; The division module responds to the storage instruction input for the displayed sorted document and divides the sorted document into a plurality of second contents according to the identification content, including: In response to a storage instruction input for the displayed sorted document, a plurality of second contents are divided from the sorted document according to the latest identified contents.

18. The device according to claim 15, wherein: The first preset regular rule includes a first preset sub-regular rule and a second preset sub-regular rule, wherein the first preset sub-regular rule includes: contains preset characters for indicating the order in the document, and does not contain characters for indicating clauses, and the second preset sub-regular rule includes: contains preset characters for indicating the order in the document, and contains characters for indicating clauses; The device also includes: An outline module is used to sort each first identification content according to its position in the compliant document to obtain a document outline of the compliant document, wherein the first identification content is the identification content that complies with the first preset sub-regular rule; when displaying the sorted document, the document outline of the sorted document is displayed synchronously.

19. The device according to claim 13, wherein: The extraction module extracts the first content from the compliance document, including: Performing document layout recognition on the compliant document to obtain elements and categories of the elements in the compliant document; For an element of each target category, a first content is extracted from the element, wherein the target category includes text but does not include a header and a footer.

20. The device according to claim 19, wherein The extraction module extracts the first content from the elements of each target category, including: For the elements of each text category, if the compliant document is scanned, or the compliant document is a garbled document, optical character recognition is performed on the position of the element in the compliant document to obtain a recognition result as the first content; If the compliant document is not a scanned document and is not a garbled document, the text content in the element is extracted as the first content.

21. The device according to claim 19, wherein The target category further includes a table category, and the first content further includes table content; the extraction module is further used to extract the table content in the element of each table category as the first content; and / or, The target category also includes a picture category, and the first content also includes picture content; the extraction module is further used to extract the picture content in the elements of each picture category as the first content.

22. The device according to claim 13, wherein: The sorting module is used to sort the first contents according to the position of each valid content in the compliant document to obtain a sorted document, including: According to the positions of the valid contents in the compliant document, the first contents are sorted in order from top to bottom and from left to right to form a single-column document as a sorted document.

23. The device according to claim 13, wherein: The storage module extracts content features of each second content respectively, and stores each second content and the content features of each second content in a knowledge base correspondingly, including: Determine the content that meets the second preset regular rule from all the second contents as the third content, wherein the second preset regular rule includes: containing characters used to represent non-clause content, wherein the non-clause content includes: any one or more of annexes, scopes, normative references, terms, definitions, and glossaries; The content features of each fourth content are extracted respectively, and each fourth content and the content features of each fourth content are correspondingly stored in the knowledge base, wherein the fourth content is the second content except the third content.

24. A compliance question-and-answer device, comprising: An acquisition module, used for acquiring a question text used to represent a compliance issue and extracting a second feature of the question text; A matching module, configured to determine, in a knowledge base pre-constructed according to the method of any one of claims 1 to 11, a first feature matching the second feature; A determination module is used to determine the second content corresponding to the determined first feature as an answer to the compliance question.

25. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 12.

26. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-12.

27. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 12.