Intelligent document processing method and device based on natural semantics, equipment and medium
By selecting comparative documents from the document information database for natural semantic analysis, calculating similarity values, and using classification tags or feature words for document classification, the problem of insufficient document classification accuracy is solved, and higher accuracy of automated classification is achieved.
Patent Information
- Application Number
- CN202310274500.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-20
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2043-03-20
AI Technical Summary
In existing technologies, the accuracy of document classification is highly influenced by the uploader's subjectivity, leading to inaccurate classification.
By selecting comparison documents from the document information database that match the classification tags, natural language analysis is performed to calculate the similarity value. If the similarity is within a preset range, the classification is performed using the classification tags; otherwise, the classification is performed using feature words.
It improves the accuracy of document classification, reduces errors from manual labeling, and enhances the precision of automatic computer classification.
Smart Images

Figure CN116361417B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data analysis, and in particular to an intelligent document processing method, apparatus, device, and medium based on natural semantics. Background Technology
[0002] With the development of internet technology, the amount of information on the internet has exploded. To better utilize this information, effective management of this data is necessary, and document classification is currently a widely used management technique. Document classification refers to assigning a category to each document in a document collection based on its content or certain attributes. This allows users to easily browse documents within specific categories and makes searching for articles easier by limiting the search scope.
[0003] Currently, the common method for classifying documents is as follows: the uploader of the document tags according to their own understanding, and the computer classifies the document according to the classification tags.
[0004] However, the uploader labels the documents based on their own experience, which is highly subjective and reduces the accuracy of document classification. Summary of the Invention
[0005] To improve the accuracy of document classification, this application provides a natural language intelligent document processing method, apparatus, device, and medium.
[0006] Firstly, this application provides an intelligent document processing method based on natural language semantics, employing the following technical solution:
[0007] A natural language-based intelligent document processing method includes:
[0008] Obtain the document to be categorized and its category tags;
[0009] Select at least one document in the document information database that matches the classification tag, and use the selected document as the comparison document;
[0010] Perform natural language processing on the comparison document and the document to be classified, and calculate the similarity value between the comparison document and the document to be classified.
[0011] Determine whether the similarity value is within a preset range;
[0012] If so, the document to be classified is classified based on the classification tags;
[0013] If not, then extract the feature words of the document to be classified, and classify the document based on the feature words.
[0014] By adopting the above technical solution, comparison documents matching the classification tags are selected from the document information database. Natural semantic analysis is then performed on the comparison documents and the document to be classified to obtain a similarity value. When the similarity value is within a preset range, the document to be classified is determined to have a high similarity with the comparison documents, and therefore the document to be classified is processed by the classification tags. When the similarity value is not within the preset range, the document to be classified is classified by the feature words of the document to be classified. Compared with the method of the document uploader marking the document with classification tags according to their own understanding, the computer classifies the document according to the classification tags, which improves the accuracy of document classification.
[0015] Optionally, the step of performing natural language semantic analysis on the comparison document and the document to be classified, and calculating the similarity value between the comparison document and the document to be classified, includes:
[0016] Obtain the first keyword from the document to be classified and the second keyword from the comparison document;
[0017] All primary keywords are grouped into a primary keyword set, and all secondary keywords are grouped into a secondary keyword set;
[0018] Select one of the first keywords from the first keyword set as the comparison keyword;
[0019] Perform natural language analysis on the comparison keyword and all second keywords in the second keyword set to determine whether there is a second keyword in the second keyword set that matches the comparison keyword.
[0020] If so, then increment the similarity score of the document to be classified by one;
[0021] Repeat the step of selecting one of the first keywords in the first keyword set as the comparison keyword until the natural semantic analysis of all the first keywords in the first keyword set is completed, and obtain the sum of similarity scores.
[0022] By adopting the above technical solution, the first keyword and the second keyword are used for natural semantic word segmentation to determine the sum of similarity scores of the documents to be classified, and then the classification label is determined to be suitable for the documents to be classified by the sum of similarity scores.
[0023] Optionally, determining whether the similarity value is within a preset range includes:
[0024] Obtain the preset similarity score of the document to be classified;
[0025] The similarity ratio is obtained by calculating the ratio of the sum of the similarity scores to the preset similarity scores.
[0026] Determine whether the similarity ratio exceeds a preset ratio;
[0027] If so, the similarity value is determined to be within a preset range; otherwise, the similarity value is determined to be outside the preset range.
[0028] By adopting the above technical solution, the similarity ratio is obtained by calculating the ratio of the sum of similarity scores to the preset similarity scores. By judging whether the similarity ratio is within the preset range, the method of classifying the document to be classified is determined, thereby improving the matching between the classification tags and the document to be classified.
[0029] Optionally, the classification process of the document to be classified based on the feature words includes:
[0030] The first keyword is used as the feature word;
[0031] Search the document classification thesaurus for category keywords that match the feature words;
[0032] If so, then obtain the document category corresponding to the category keyword;
[0033] Get the frequency of occurrence for each document category;
[0034] The document category of the document to be classified is determined based on the frequency of occurrence.
[0035] By adopting the above technical solution, the document category of a document can be determined by the frequency of its occurrence, thereby improving the accuracy of matching the category tags with the document to be categorized.
[0036] Optionally, determining the document category of the document to be classified based on the frequency of occurrence includes:
[0037] Check if there is an occurrence frequency less than a preset frequency;
[0038] If so, delete document categories that appear less frequently than the preset frequency.
[0039] The documents to be classified are labeled based on the remaining document categories.
[0040] Optionally, after forming a set of all the first keywords, the method further includes:
[0041] Query whether there exists a semantically identical first keyword in the first keyword set;
[0042] If so, save one of the first keywords, delete other first keywords with the same meaning, and count the number of each first keyword with the same meaning.
[0043] By adopting the above technical solution, semantically identical first keywords in the first keyword set are deleted, thereby reducing the number of times first keywords with the same meaning are compared, and thus improving the speed of first keyword analysis.
[0044] Optionally, after obtaining the documents to be categorized, the process further includes:
[0045] Check if the first serialized keyword exists in the document to be categorized;
[0046] If the first serial keyword exists, then the document to be classified is marked based on the first serial keyword;
[0047] If the serialized keyword does not exist, then query the document information database to see if there is a second serialized keyword that matches the document to be classified;
[0048] If a second serial keyword exists that matches the document to be classified, then the document corresponding to the second serial keyword is extracted and the extracted document is used as the associated document.
[0049] Associate the associated document with the document to be classified.
[0050] By adopting the above technical solution, when a user searches for a document to be categorized, related documents will be displayed, making it easier for the user to fully understand the document to be categorized.
[0051] Secondly, this application provides an intelligent document processing device based on natural language processing, which adopts the following technical solution:
[0052] A natural language-based intelligent document processing device includes:
[0053] The acquisition module is used to acquire the document to be classified and the classification tags of the document to be classified;
[0054] The selection module is used to select at least one document in the document information database that matches the classification tag, and use the selected document as the comparison document;
[0055] The analysis and calculation module is used to perform natural semantic analysis on the comparison document and the document to be classified, and to calculate the similarity value between the comparison document and the document to be classified.
[0056] The judgment module is used to determine whether the similarity value is within a preset range; if so, the document to be classified is classified based on the classification label; if not, the feature words of the document to be classified are extracted, and the document to be classified is classified based on the feature words.
[0057] By adopting the above technical solution, comparison documents matching the classification tags are selected from the document information database. Natural semantic analysis is then performed on the comparison documents and the document to be classified to obtain a similarity value. When the similarity value is within a preset range, the document to be classified is determined to have a high similarity with the comparison documents, and therefore the document to be classified is processed by the classification tags. When the similarity value is not within the preset range, the document to be classified is classified by the feature words of the document to be classified. Compared with the method of the document uploader marking the document with classification tags according to their own understanding, the computer classifies the document according to the classification tags, which improves the accuracy of document classification.
[0058] Thirdly, this application provides an electronic device that adopts the following technical solution:
[0059] An electronic device includes a processor and a memory, wherein the processor is coupled to the memory;
[0060] The processor is configured to execute a computer program stored in the memory, causing the electronic device to perform the method as described in any of the first aspects.
[0061] Fourthly, this application provides a computer-readable storage medium, which adopts the following technical solution:
[0062] A computer-readable storage medium includes a computer program or instructions that, when executed on a computer, cause the computer to perform the method as described in any of the first aspects. Attached Figure Description
[0063] Figure 1 This is a flowchart illustrating an intelligent document processing method based on natural semantics in an embodiment of this application.
[0064] Figure 2 This is a flowchart illustrating whether there are associated documents for the documents to be classified in this application.
[0065] Figure 3 This is a flowchart illustrating the sub-step S102 in the embodiments of this application.
[0066] Figure 4 This is a flowchart illustrating the sub-step S106 in the embodiments of this application.
[0067] Figure 5 This is a structural block diagram illustrating an intelligent document processing device based on natural semantics in the embodiments of this application.
[0068] Figure 6 This is a structural block diagram illustrating the electronic device in the embodiments of this application. Detailed Implementation
[0069] The present application will be further described in detail below with reference to the accompanying drawings.
[0070] This specific embodiment is merely an explanation of this application and is not intended to limit it. After reading this specification, those skilled in the art can make modifications to this embodiment without contributing any inventive step, but such modifications are protected by patent law as long as they fall within the scope of the claims of this application.
[0071] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0072] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0073] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.
[0074] This application provides a natural language-based intelligent document processing method, which can be executed by an electronic device. The electronic device can be a server or a terminal device. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smartphone, tablet computer, desktop computer, etc., but is not limited to these.
[0075] like Figure 1 As shown, a natural language-based intelligent document processing method is described in its main process flow as follows (steps S101 to S106):
[0076] Step S101: Obtain the document to be categorized and its category tags;
[0077] In this embodiment, the electronic device acquires the document uploaded by the user, uses the acquired document as the document to be categorized, and extracts the category tags of the document to be categorized. The category tags are the category names filled in by the user when uploading, such as literature, medicine, and meeting minutes.
[0078] After obtaining the documents to be categorized, such as Figure 2 As shown, it also includes the following steps (steps S201 to S205):
[0079] Step S201: Query whether the first serial keyword exists in the document to be classified. If it does, proceed to step S202; otherwise, proceed to step S203.
[0080] In this embodiment, a document to be classified is obtained, the content of the document to be classified is extracted, and natural language semantic analysis, such as NLP semantic analysis, is performed on the content of the document to be classified to determine whether there is a first serial keyword in the document to be classified. For example, "Next time to continue the discussion on topic A", "next time", "topic A" and "continue" can be used as the first serial keyword.
[0081] Step S202: Tag the documents to be categorized based on the first series of keywords;
[0082] In this embodiment, the first serialized keyword is marked on the document to be categorized so that after receiving a document associated with the document to be categorized, the two documents can be linked together to facilitate reading.
[0083] Step S203: Query the document information database to see if there is a second serial keyword that matches the document to be classified. If so, proceed to step S204.
[0084] In this embodiment, the documents that have been classified are stored in the document information database. The documents in the document information database include the document categories of the documents. Some documents may have a second series of keywords, which are the same as the first series of keywords mentioned above.
[0085] When the document to be categorized received by the electronic device does not contain the first serial keyword, the electronic device searches the document information database for a second serial keyword that matches the document to be categorized. For example, it extracts the topic name of the document to be categorized, or it extracts related words of the document to be categorized, such as topic b discussed last time. It uses natural language processing to analyze whether the topic name or related words are related to the second related words. If so, it is determined that there is a second serial keyword in the document information database that matches the document to be categorized. If there is no second serial keyword in the document information database that matches the document to be categorized, the document to be categorized can be directly stored in the document information database.
[0086] It should be noted that after the electronic device acquires the document to be categorized, it can simultaneously perform the steps of checking whether there is a second series keyword matching the document to be categorized in the document information database and checking whether there is a first series keyword in the document to be categorized, without any specific limitations.
[0087] Step S204: Extract the documents corresponding to the keywords of the second series, and use the extracted documents as related documents;
[0088] Step S205: Associate the related document with the document to be classified.
[0089] In this embodiment, the document to be categorized is associated with related documents. When a user needs to query the document to be categorized, the related documents are also displayed, which facilitates a comprehensive understanding of the document to be categorized.
[0090] Step S102: Select at least one document in the document information database that matches the category tag, and use the selected document as the comparison document;
[0091] In this embodiment, documents that match the classification tags are selected from the document information. Documents that match the classification tags refer to documents corresponding to the same document category as the classification tags. In order to improve the accuracy of classifying documents, it is necessary to compare the documents to be classified with documents of the corresponding document category.
[0092] You can select one or more comparison documents; there are no specific limitations on this.
[0093] Step S103: Perform natural language processing on the comparison document and the document to be classified, and calculate the similarity value between the comparison document and the document to be classified.
[0094] Specifically, such as Figure 3 As shown, the procedure includes the following steps (steps S1031 to S1036):
[0095] Step S1031: Obtain the first keyword from the document to be classified and the second keyword from the comparison document;
[0096] In this embodiment, the electronic device obtains the first keyword in the document to be classified and the second keyword in the comparison document through natural language processing.
[0097] Step S1032: Combine all the first keywords into a first keyword set, and combine all the second keywords into a second keyword set;
[0098] Step S1033: Select one of the first keywords from the first keyword set as the comparison keyword;
[0099] In this embodiment, all the first keywords in the document to be classified are grouped into a first keyword set, and all the second keywords in the comparison document are grouped into a second keyword set. For example, if the first keywords in the document to be classified are a1, a2, and a3, then the first keyword set includes a1, a2, and a3; if the second keywords in the comparison document are b1, b2, and b3, then the second keyword set includes b1, b2, and b3.
[0100] For example, select a1 as the comparison keyword from the first set of keywords.
[0101] It should be noted that when selecting the first keyword, the selected first keyword will be deleted from the first keyword set.
[0102] Step S1034: Perform natural semantic analysis on the comparison keyword and all the second keywords in the second keyword set to determine whether there is a second keyword in the second keyword set that matches the comparison keyword. If so, proceed to step S1035.
[0103] For example, if the comparison keyword is selected as a1, then natural semantic analysis will be performed on a1 and b1, a1 and b2, and a1 and b3 simultaneously, thereby improving the speed of judging whether there is a second keyword in the second keyword set that matches the comparison keyword. When there is no second keyword in the second keyword set that matches the comparison keyword, the similarity score of the document to be classified is increased to zero.
[0104] Step S1035: Increment the similarity score of the document to be classified by one;
[0105] In this embodiment, when there are words in the second keyword set that have the same semantics as the comparison keywords, the similarity score of the document to be classified is increased by one.
[0106] Step S1036: Repeat the step of selecting one of the first keywords in the first keyword set as the comparison keyword until the natural semantic analysis of all the first keywords in the first keyword set is completed, and the sum of similarity scores is obtained.
[0107] For example, if the first keyword set includes a1, a2, and a3, then the second keyword set includes b1, b2, and b3. The first comparison keyword is a1, and a1 and b1, a1 and b2, and a1 and b3 are compared simultaneously. The second comparison keyword is a2, and a2 and b1, a2 and b2, and a2 and b2 are compared simultaneously. The third comparison keyword is a3, and a3 and b1, a3 and b2, and a3 and b3 are compared simultaneously. After all comparisons of a1, a2, and a3 are completed, the analysis of all first keywords in the first keyword set is finished.
[0108] Sum all the similarity values to get the total similarity score. For example, if there is a second keyword in the set of second keywords that has the same meaning as a1 and a2, then the total similarity score is 2.
[0109] After grouping all the primary keywords into a primary keyword set, the following content is also included:
[0110] Specifically, query whether there are semantically identical first keywords in the first keyword set; if so, save one of the first keywords, delete the other semantically identical first keywords, and count the number of each semantically identical first keyword.
[0111] In this embodiment, in order to improve the speed of analyzing the first keyword, the first keywords with the same semantics in the first keyword set are deleted.
[0112] One method for analyzing whether there are semantically identical first keywords in the set of first keywords is to use natural semantic analysis. For example, if the set of first keywords contains a1, a2, a3, and a4, we can perform comparative analysis on a1 and a2, a1 and a3, and a1 and a4 simultaneously. When a1, a2, and a3 are semantically identical, we can delete two of the first keywords. For example, we can keep a1 and delete a2 and a3, keep a2 and delete a1 and a3, or keep a3 and delete a1 and a2. There are no specific limitations on this. In this case, there are two first keywords with the same semantic meaning as a1.
[0113] Step S104: Determine whether the similarity value is within a preset range; if yes, proceed to step S105; otherwise, proceed to step S106.
[0114] The following is a method for determining whether the similarity value is within a preset range:
[0115] Specifically, the process involves obtaining the preset similarity score of the document to be classified; calculating the ratio of the sum of the similarity scores to the preset similarity score to obtain the similarity ratio; determining whether the similarity ratio exceeds the preset ratio; if so, determining that the similarity value is within the preset range; otherwise, determining that the similarity value is not within the preset range.
[0116] In this embodiment, the preset similarity score can be determined by the number of first keywords in the first keyword set. For example, if there are 8 first keywords in the first keyword set, then the preset similarity score can be 8.
[0117] For example, if the total similarity score is 6, the total similarity score is used as the numerator, and the preset similarity score is used as the denominator. In this case, the similarity ratio is 3 / 4. In this embodiment, the preset ratio can be 1 / 2, and no specific limitation is made in this embodiment.
[0118] It should be noted that when the electronic device performs natural semantic analysis on the document to be classified and multiple comparison documents, step S105 is executed when at least 2 / 3 of the comparison documents meet the preset ratio.
[0119] Step S105: Classify the documents to be classified based on the classification tags;
[0120] In this embodiment, documents to be categorized are classified using category tags. When a user enters a category tag, the documents to be categorized will be displayed.
[0121] Step S106: Extract the feature words of the document to be classified, and perform classification processing on the document to be classified based on the feature words.
[0122] Specifically, such as Figure 4 As shown, the process includes the following sub-steps (steps S1061 to S1065):
[0123] Step S1061: Use the first keyword as a feature word;
[0124] In this embodiment, the first keyword in step S1032 is used as a feature word, and the category of the document to be classified is analyzed through the feature word.
[0125] Step S1062: Query the document classification thesaurus to see if there are category keywords that match the feature words. If so, proceed to step S1063.
[0126] Step S1063: Obtain the document category corresponding to the category keyword;
[0127] Step S1064: Obtain the frequency of occurrence for each document category;
[0128] Step S1065: Determine the document category of the document to be classified based on its frequency of occurrence.
[0129] In this embodiment, the document classification thesaurus stores category keywords corresponding to each document category, and one document category may correspond to multiple category keywords.
[0130] In this embodiment, the electronic device counts the document categories that match the extracted feature words. For example, document category a appears 5 times, document category b appears 3 times, and document category c appears once. In this case, document category c is discarded, and document categories a and b are marked on the document to be classified.
[0131] When no category keyword matching the feature word is found in the document classification thesaurus, the corresponding document to be classified can be marked and manually classified.
[0132] It should be noted that after step S105, other primary keywords can be compared with the document classification thesaurus to obtain multiple document categories and mark the documents to be classified. The comparison method is the same as that in steps S1061 to S1065, and will not be described again.
[0133] Figure 5 This application provides a structural block diagram of an intelligent document processing device 300 based on natural language semantics. (See diagram below.) Figure 5 As shown, the intelligent document processing device 300 based on natural language semantics mainly includes:
[0134] The acquisition module 301 is used to acquire the document to be classified and its classification tags;
[0135] The selection module 302 is used to select at least one document in the document information database that matches the category tag, and use the selected document as the comparison document;
[0136] The analysis and calculation module 303 is used to perform natural semantic analysis on the comparison document and the document to be classified, and to calculate the similarity value between the comparison document and the document to be classified.
[0137] The judgment module 304 is used to determine whether the similarity value is within a preset range; if so, it classifies the document to be classified based on the classification label; if not, it extracts the feature words of the document to be classified and classifies the document based on the feature words.
[0138] As an optional implementation of this embodiment, the analysis and calculation module 303 includes:
[0139] The first acquisition submodule is used to acquire the first keyword in the document to be classified and the second keyword in the comparison document;
[0140] The component submodule is used to group all the first keywords into a first keyword set and all the second keywords into a second keyword set;
[0141] The selection submodule is used to select one of the first keywords from the first keyword set as the comparison keyword.
[0142] The analysis and judgment submodule is used to perform natural semantic analysis on the comparison keyword and all the second keywords in the second keyword set to determine whether there is a second keyword in the second keyword set that matches the comparison keyword; if so, the similarity score of the document to be classified is incremented by one.
[0143] The execution submodule is used to repeatedly execute the step of selecting one of the first keywords in the first keyword set as the comparison keyword until the natural semantic analysis of all the first keywords in the first keyword set is completed, and the sum of similarity scores is obtained.
[0144] As an optional implementation of this embodiment, the determination module 304 includes:
[0145] The second acquisition submodule is used to acquire the preset similarity score of the document to be classified;
[0146] The calculation submodule is used to calculate the ratio of the sum of similarity scores to the preset similarity scores to obtain the similarity ratio.
[0147] The judgment submodule is used to determine whether the similarity ratio exceeds the preset ratio; if so, the similarity value is determined to be within the preset range; otherwise, the similarity value is determined to be outside the preset range.
[0148] As an optional implementation of this embodiment, the determination module 304 further includes:
[0149] As a submodule, it is used to use the first keyword as a feature word;
[0150] The query submodule is used to search the document classification thesaurus for whether there are category keywords that match the feature words; if so, it retrieves the document category corresponding to the category keyword.
[0151] The third submodule is used to obtain the frequency of occurrence of each document category;
[0152] The category determination submodule is used to determine the document category of a document to be classified based on its frequency of occurrence.
[0153] In this optional embodiment, the category determination submodule is specifically used for:
[0154] Check if there are any document categories with an occurrence frequency lower than the preset frequency; if so, delete the document categories with an occurrence frequency lower than the preset frequency; mark the documents to be categorized based on the remaining document categories.
[0155] As an optional implementation of this embodiment, the natural language-based intelligent document processing device 300 further includes:
[0156] The keyword acquisition module is used to query whether there are semantically identical first keywords in the first keyword set after all the first keywords are combined into a first keyword set; if so, it saves one of the first keywords, deletes the other semantically identical first keywords, and counts the number of each semantically identical first keyword.
[0157] As an optional implementation of this embodiment, the natural language-based intelligent document processing device 300 further includes:
[0158] The keyword query module is used to query whether a first serial keyword exists in the document to be categorized after obtaining the document to be categorized; if a first serial keyword exists, the document to be categorized is marked based on the first serial keyword; if no serial keyword exists, the module queries whether a second serial keyword that matches the document to be categorized exists in the document information database; if a second serial keyword that matches the document to be categorized exists, the document corresponding to the second serial keyword is extracted and the extracted document is used as the associated document.
[0159] The association module is used to associate related documents with documents to be categorized.
[0160] The functional modules in the embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part. If the function is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of a natural language-based intelligent document processing method according to various embodiments of this application.
[0161] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0162] Figure 6 This is a structural block diagram of an electronic device 400 provided in an embodiment of this application. (See diagram below.) Figure 6 As shown, the electronic device 400 includes a memory 401, a processor 402, and a communication bus 403; the memory 401 and the processor 402 are connected via the communication bus 403. The memory 401 stores a natural language-based intelligent document processing method that can be loaded and executed by the processor 402, as provided in the above embodiments.
[0163] The memory 401 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 401 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for at least one function, and instructions for implementing the intelligent document processing method based on natural language semantics provided in the above embodiments. The data storage area may store data involved in the intelligent document processing method based on natural language semantics provided in the above embodiments.
[0164] Processor 402 may include one or more processing cores. Processor 402 executes instructions, programs, code sets, or instruction sets stored in memory 401, and calls data stored in memory 401 to perform various functions and process data as described in this application. Processor 402 may be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), controller, microcontroller, and microprocessor. It is understood that, for different devices, the electronic devices used to implement the functions of processor 402 may be other types, and this application embodiment does not specifically limit the specific devices used.
[0165] The communication bus 403 may include a path for transmitting information between the aforementioned components. The communication bus 403 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 403 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 The symbol is represented by a single double arrow, but this does not mean that there is only one bus or one type of bus.
[0166] This application provides a computer-readable storage medium storing a computer program that can be loaded by a processor and executed as described in the above embodiments, a natural language-based intelligent document processing method.
[0167] In this embodiment, the computer-readable storage medium can be a tangible device that holds and stores instructions used by an instruction execution device. The computer-readable storage medium can be, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any combination thereof. Specifically, the computer-readable storage medium can be a portable computer disk, a hard disk, a USB flash drive, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), staging random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory stick, floppy disk, optical disk, magnetic disk, mechanical encoding device, or any combination thereof.
[0168] The terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0169] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the foregoing application concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions claimed in this application.
Claims
1. A method for intelligent document processing based on natural language semantics, characterized in that, include: Obtain the document to be categorized and its category tags; Select at least one document in the document information database that matches the classification tag, and use the selected document as the comparison document; Perform natural language processing on the comparison document and the document to be classified, and calculate the similarity value between the comparison document and the document to be classified. Determine whether the similarity value is within a preset range; If so, the document to be classified is classified based on the classification tags; If not, then extract the feature words of the document to be classified, and classify the document based on the feature words; The step of performing natural language semantic analysis on the comparison document and the document to be classified, and calculating the similarity value between the comparison document and the document to be classified, includes: Obtain the first keyword from the document to be classified and the second keyword from the comparison document; All primary keywords are grouped into a primary keyword set, and all secondary keywords are grouped into a secondary keyword set; Select one of the first keywords from the first keyword set as the comparison keyword; Perform natural language analysis on the comparison keyword and all second keywords in the second keyword set to determine whether there is a second keyword in the second keyword set that matches the comparison keyword. If so, then increment the similarity score of the document to be classified by one; Repeat the step of selecting one of the first keywords in the first keyword set as the comparison keyword until the natural semantic analysis of all the first keywords in the first keyword set is completed, and obtain the sum of similarity scores; After grouping all the primary keywords into a primary keyword set, the following is also included: Query whether there exists a semantically identical first keyword in the first keyword set; If so, save one of the first keywords, delete other first keywords with the same meaning, and count the number of each first keyword with the same meaning.
2. The method according to claim 1, characterized in that, The determination of whether the similarity value is within a preset range includes: Obtain the preset similarity score of the document to be classified; The similarity ratio is obtained by calculating the ratio of the sum of the similarity scores to the preset similarity scores. Determine whether the similarity ratio exceeds a preset ratio; If so, the similarity value is determined to be within a preset range; otherwise, the similarity value is determined to be outside the preset range.
3. The method according to claim 1, characterized in that, The classification process of the document to be classified based on the feature words includes: The first keyword is used as the feature word; Search the document classification thesaurus for category keywords that match the feature words; If so, then obtain the document category corresponding to the category keyword; Get the frequency of occurrence for each document category; The document category of the document to be classified is determined based on the frequency of occurrence.
4. The method according to claim 3, characterized in that, The process of determining the document category of the document to be classified based on the frequency of occurrence includes: Check if there is an occurrence frequency less than a preset frequency; If so, delete document categories that appear less frequently than the preset frequency. The documents to be classified are labeled based on the remaining document categories.
5. The method according to claim 1 or 4, characterized in that, After obtaining the documents to be categorized, the following is also included: Check if the first serialized keyword exists in the document to be categorized; If the first serial keyword exists, then the document to be classified is marked based on the first serial keyword; If the serialized keyword does not exist, then query the document information database to see if there is a second serialized keyword that matches the document to be classified; If a second serial keyword exists that matches the document to be classified, then the document corresponding to the second serial keyword is extracted and the extracted document is used as the associated document. Associate the associated document with the document to be classified.
6. A natural language-based intelligent document processing device, characterized in that, include: The acquisition module is used to acquire the document to be classified and the classification tags of the document to be classified; The selection module is used to select at least one document in the document information database that matches the classification tag, and use the selected document as the comparison document; The analysis and calculation module is used to perform natural semantic analysis on the comparison document and the document to be classified, and to calculate the similarity value between the comparison document and the document to be classified. The judgment module is used to determine whether the similarity value is within a preset range; if so, the document to be classified is classified based on the classification label. If not, then extract the feature words of the document to be classified, and classify the document based on the feature words; The analysis and calculation module includes: The first acquisition submodule is used to acquire the first keyword in the document to be classified and the second keyword in the comparison document; The component submodule is used to group all the first keywords into a first keyword set and all the second keywords into a second keyword set; The selection submodule is used to select one of the first keywords from the first keyword set as the comparison keyword. The analysis and judgment submodule is used to perform natural semantic analysis on the comparison keyword and all the second keywords in the second keyword set to determine whether there is a second keyword in the second keyword set that matches the comparison keyword; if so, the similarity score of the document to be classified is incremented by one. The execution submodule is used to repeatedly execute the step of selecting one of the first keywords in the first keyword set as the comparison keyword until the natural semantic analysis of all the first keywords in the first keyword set is completed and the sum of similarity scores is obtained; The keyword acquisition module is used to query whether there are semantically identical first keywords in the first keyword set after all the first keywords are combined into a first keyword set; if so, it saves one of the first keywords, deletes the other semantically identical first keywords, and counts the number of each semantically identical first keyword.
7. An electronic device, characterized in that, It includes a processor and a memory, wherein the processor is coupled to the memory; The processor is configured to execute a computer program stored in the memory, causing the electronic device to perform the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, It includes a computer program or instructions that, when run on a computer, cause the computer to perform the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Text clustering method and device
CN109241274A
Text classification method and device
CN110019785A
Text classification method and device, terminal equipment and storage medium
CN110851598A
Document classification method and device and computer readable storage medium
CN113806525A