Document processing method and apparatus, electronic device, and storage medium
By using keyword extraction instructions based on multi-level classification labels, and leveraging large-scale language model algorithms, entities and relationships in unstructured data documents are automatically extracted, solving the problem of high manual annotation costs and achieving efficient and accurate knowledge graph construction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-21
- Publication Date
- 2026-03-20
AI Technical Summary
In existing technologies, when constructing knowledge graphs of unstructured data documents, manual data annotation is required, resulting in high labor costs and difficulty in efficiently extracting entities and relationships.
By using multi-level classification labels based on unstructured data document sets, keyword extraction instructions for large-scale language model algorithms are determined, and keyword extraction is performed automatically to obtain data extraction results, including entities and relationships.
It reduces labor costs, improves the efficiency of constructing knowledge graphs from unstructured data document collections, and results in higher accuracy of data extraction.
Smart Images

Figure CN117271698B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular to a document processing method and device, electronic equipment and a storage medium. BACKGROUND
[0002] At present, more and more industries need to have knowledge of informatization as a whole, form a knowledge system, deposit industry experience, and provide intelligent applications that can empower the industry and reduce the labor cost of the industry on the basis of the knowledge system. Knowledge graph is a relatively popular knowledge system organization form in the industry in recent years. Many industry customers with certain technical power expect or are conducting graphing work of the industry knowledge system. In the prior art, when constructing a knowledge graph composed of unstructured data documents, it is necessary to manually annotate data when extracting unstructured data entities and relationships, which is difficult to extract and has high labor cost. SUMMARY
[0003] The embodiments of the present application provide a document processing method, device, electronic equipment and storage medium to solve the problem of high labor cost caused by manual annotation when extracting entities and relationships of unstructured data documents in the prior art.
[0004] In a first aspect, the embodiments of the present application provide a document processing method, which comprises:
[0005] determining a keyword extraction instruction corresponding to a large language model algorithm according to a multi-level classification label corresponding to a set of unstructured data documents;
[0006] performing a keyword extraction operation on the set of unstructured data documents based on the keyword extraction instruction to obtain a data extraction result corresponding to the set of unstructured data documents, wherein the data extraction result includes entities and relationships.
[0007] In a second aspect, the embodiments of the present application also provide a document processing device, which comprises:
[0008] an instruction determination module configured to determine a keyword extraction instruction corresponding to a large language model algorithm according to a multi-level classification label corresponding to a set of unstructured data documents;
[0009] a keyword extraction module configured to perform a keyword extraction operation on the set of unstructured data documents based on the keyword extraction instruction to obtain a data extraction result corresponding to the set of unstructured data documents, wherein the data extraction result includes entities and relationships.
[0010] In a third aspect, an electronic device is provided, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the document processing method described above is implemented.
[0011] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the document processing method described above is implemented.
[0012] The embodiments of the present application at least have the following technical effects:
[0013] The technical scheme of the embodiments of the present application determines the keyword extraction instruction corresponding to the large language model algorithm based on the multi-level classification labels corresponding to the unstructured data document set, and processes the unstructured data document set through the keyword extraction instruction to obtain the data extraction result, so that manual data labeling is not required in the data extraction process, the labor cost is reduced, and the construction efficiency of the knowledge graph composed of the unstructured data document set is improved. BRIEF DESCRIPTION OF DRAWINGS
[0014] In order to more clearly illustrate the technical schemes in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced.
[0015] Figure 1 is a flowchart of the document processing method provided by the embodiments of the present application;
[0016] Figure 2 is a structural diagram of the document processing device provided by the embodiments of the present application;
[0017] Figure 3 is a block diagram of the electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION
[0018] The technical schemes in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0019] It should be understood that the reference herein to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described is included in at least one embodiment of the application. Therefore, appearances of “in one embodiment” or “in an embodiment” at various places throughout the specification are not necessarily referring to the same embodiment. Furthermore, the particular features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.
[0020] In various embodiments of the present application, it should be understood that the size of the serial number of the following processes does not mean the order of execution, and the execution order of the processes should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0021] As shown in Figure 1 The embodiments of the present application provide a document processing method, which comprises:
[0022] In step 101, a keyword extraction instruction corresponding to a large language model algorithm is determined according to a multi-level classification label corresponding to a set of unstructured data documents.
[0023] Large language model (LLM) is a model based on machine learning and natural language processing technology. These models can be transferred to many downstream tasks through fine-tuning because they have been trained on a large amount of unsupervised and unstructured data. The core idea of LLM is to learn the patterns and language structures of natural language through large-scale unsupervised training, which can simulate human language cognition and generation process to some extent. Compared with traditional natural language processing (NLP) models, LLM can better understand and generate natural text, and also show certain logical thinking and reasoning ability.
[0024] In the embodiments, the large language model algorithm can be ChatGLM-6B model algorithm. ChatGLM-6B model is an open source dialogue language model supporting Chinese and English, based on general language model (GLM) architecture, with 6.2 billion parameters. Combined with model quantization technology, users can deploy it locally on consumer-grade graphics cards (only 6GB video memory is required under INT4 quantization level). ChatGLM-6B uses similar technology as ChatGPT and is optimized for Chinese question answering and dialogue. After about 1T Chinese and English training, supplemented by supervised fine-tuning, feedback self-help, human feedback reinforcement learning and other technologies, ChatGLM-6B with 6.2 billion parameters can generate answers that are quite in line with human preferences.
[0025] In this embodiment, each data document in the set of unstructured data documents includes a multi-level classification label. Specifically, the multi-level classification label can include a first-level classification label, a second-level classification label, a third-level classification label, and a fourth-level classification label. For example, when the set of unstructured data documents is documents accumulated in daily work of an automobile company's after-sales department, the corresponding first-level classification label can include but is not limited to the following labels: repair materials, maintenance information, general information, collaborative management, and video area. For each first-level classification label, there are multiple second-level classification labels. For example, when the first-level classification label is repair materials, the corresponding second-level classification labels include but are not limited to the following labels: repair manual, circuit diagram, engine manual, tool instruction, other materials, and intelligent repair manual. When the first-level classification label is maintenance information, the corresponding second-level classification labels include but are not limited to the following labels: maintenance manual and common knowledge. When the first-level classification label is general information, the corresponding second-level classification labels include but are not limited to the following labels: disassembly manual and power battery information. When the first-level classification label is collaborative management, the corresponding second-level classification labels include but are not limited to the following labels: vehicle networking information query, guide manual, topic material, technical news, activity manual, technical data compilation, technical report, repair case management, software repair archive query, disassembly step query, and maintainability problem feedback. The classification method can have various forms and is not limited to the above-mentioned several forms, which will not be listed and described here.
[0026] Specifically, the data documents in the set of unstructured data documents can be unstructured data. For example, the set of unstructured data documents can be a large number of unstructured data documents accumulated in the daily work process of the automobile company's after-sales department. The formats of such documents include pdf, word, xls, etc.
[0027] In the embodiments of the present application, the keyword extraction instruction corresponding to the large language model algorithm can be determined according to the multi-level classification labels corresponding to the set of unstructured data documents. Considering that there are many third-level classification labels and fourth-level classification labels of the unstructured data documents constituting the set of unstructured data documents, the priority of the documents can be determined based on the frequency of use in daily work, and the corresponding prompt engineering instruction, i.e., the keyword extraction instruction, is written in combination with the priority, and the prompt engineering instruction is written into the corresponding execution script through Python. The data output path, i.e., the data extraction result acquisition path, is set in the execution script.
[0028] In step 102, a keyword extraction operation is performed on the set of unstructured data documents based on the keyword extraction instruction to obtain a data extraction result corresponding to the set of unstructured data documents, wherein the data extraction result includes entities and relationships.
[0029] After the keyword extraction instruction is determined, the unstructured data document set can be processed through the keyword extraction instruction to obtain a corresponding data extraction result. Specifically, the data extraction result includes entities and relationships.
[0030] In the embodiments of the present application, the keyword extraction instruction corresponding to the large language model algorithm is determined based on the multi-level classification labels corresponding to the unstructured data document set, and the unstructured data document set is processed through the keyword extraction instruction to obtain a data extraction result. Therefore, during the data extraction process, manual data labeling is not required, the labor cost is reduced, and the construction efficiency of the knowledge graph composed of the unstructured data document set is improved.
[0031] In an optional embodiment of the present application, before the keyword extraction operation is performed on the unstructured data document set based on the keyword extraction instruction, the method further comprises:
[0032] obtaining an extraction accuracy corresponding to the keyword extraction instruction;
[0033] In the case where the extraction accuracy is less than a preset threshold, the keyword extraction is adjusted to obtain a new keyword extraction instruction, until the extraction accuracy corresponding to the new keyword extraction instruction is greater than or equal to the preset threshold, and the new keyword extraction instruction is used to replace the keyword extraction instruction.
[0034] Before the keyword extraction operation is performed on the unstructured data document set based on the keyword extraction instruction, the extraction accuracy of the keyword extraction instruction needs to be determined. If the extraction accuracy is less than a preset threshold, it indicates that the current keyword extraction instruction has a problem and needs to be adjusted. The keyword extraction instruction is adjusted to obtain a new keyword extraction instruction, and the extraction accuracy of the new keyword extraction instruction is obtained, until the extraction accuracy corresponding to the new keyword extraction instruction obtained by adjustment is greater than or equal to the preset threshold, and the new keyword extraction instruction obtained by adjustment is used to replace the keyword extraction instruction.
[0035] In the above embodiments of the present application, the extraction accuracy of the keyword extraction instruction is obtained, so that the extraction accuracy of the instruction for performing the keyword extraction operation on the unstructured data document set is greater than the preset threshold, and the accuracy of the keyword extraction result obtained based on the keyword extraction instruction can be improved.
[0036] In an optional embodiment of the present application, obtaining the extraction accuracy corresponding to the keyword extraction instruction comprises:
[0037] selecting at least one data document from the unstructured data document set to obtain a test data document set, and obtaining a target data extraction result corresponding to the test data document set;
[0038] processing the test data document set through the keyword extraction instruction to obtain a test data extraction result;
[0039] According to the test data result and the target data extraction result, the extraction accuracy corresponding to the keyword extraction instruction is determined.
[0040] Specifically, when obtaining the extraction accuracy corresponding to the keyword extraction instruction, at least one data document can be selected from the unstructured data document set to obtain a test data document set, and the target data extraction result corresponding to the test data document set is obtained, wherein the target data extraction result here is the ideal data extraction result corresponding to the test data document set; the test data document set is processed through the keyword extraction instruction, that is, the test data document set is input into the large language model algorithm, and the output corresponding to the output path of the large language model algorithm is viewed through the keyword extraction instruction, that is, the test data extraction result; according to the test data extraction result and the target data extraction result, specifically, the test data extraction result and the target data extraction result can be compared to determine the extraction accuracy corresponding to the keyword extraction instruction.
[0041] The above embodiments of the present application determine the test data document set, so as to determine the extraction accuracy corresponding to the keyword extraction instruction through the test data document set and the keyword extraction instruction, which facilitates timely adjustment when the extraction accuracy does not meet the condition, and improves the accuracy of the final obtained data extraction result.
[0042] In an optional embodiment of the present application, before determining the keyword extraction instruction corresponding to the large language model algorithm according to the multi-level classification labels corresponding to the unstructured data document set, the method further comprises:
[0043] receiving an initial unstructured data document set including a first-level classification label and a second-level classification label;
[0044] training a natural language processing classifier through the first-level classification label and the second-level classification label to obtain a target classifier;
[0045] processing the initial unstructured data document set through the target classifier to sequentially obtain a third-level classification label and a fourth-level classification label corresponding to each data document set in the initial unstructured data document set;
[0046] According to the third-level classification label and the fourth-level classification label corresponding to each data document in the initial unstructured data document set and the initial unstructured data document set, the unstructured data document set is obtained.
[0047] Specifically, before determining the keyword extraction instruction corresponding to the large language model algorithm, it is necessary to first determine the unstructured data document set including multiple classification labels. The documents in the initial unstructured data document set received by the server usually only include two-level classification labels, i.e., first-level classification labels and second-level classification labels. At this time, the initial unstructured data document set needs to be further classified by a target classifier to obtain third-level classification labels and fourth-level classification labels, and then based on the third-level classification labels and the fourth-level classification labels corresponding to each data document in the initial structured data document set and the initial unstructured data document set, the unstructured data document set including multiple classification labels is obtained.
[0048] The target classifier is obtained by training a natural language processing (NLP) classifier based on the first-level classification labels and the second-level classification labels. During the training process, the classification results output by the model can be sorted by label and compared with the second-level classification labels. After obtaining the target classifier, the initial unstructured data document set can be processed by the target classifier to obtain the third-level classification labels and the fourth-level classification labels corresponding to each data document in turn, thereby realizing the construction of the third-level classification labels and the fourth-level classification labels.
[0049] The above embodiments of the present application train a natural language processing classifier model based on first-level classification labels and second-level classification labels to obtain a target classifier, so that the construction of third-level classification labels and fourth-level classification labels can be based on the target classifier, without manual labeling, thereby reducing labor costs.
[0050] In an optional embodiment of the present application, the method further comprises:
[0051] deploying a distributed computing cluster on the server;
[0052] deploying the large language model algorithm on the distributed computing cluster and configuring path information corresponding to the large language model algorithm, the path information including an input path corresponding to each classification label in the multi-level classification labels and an output path corresponding to the data extraction result.
[0053] Specifically, the document processing method provided in the embodiments of the present application is executed on a server, a distributed computing cluster can be deployed on the server, the distributed computing cluster can be a Spark distributed computing cluster, and a corresponding master node and worker node are deployed, and the server can be multiple high-computing servers. After deploying the distributed cluster, each node corresponding to the distributed cluster needs to be tested, a preset data processing program can be deployed on the cluster, the program is executed, and the running result is viewed to determine whether the nodes corresponding to each cluster can normally run. After the distributed cluster is tested, a large language model algorithm is deployed on the distributed computing cluster, the large language model algorithm can be a ChatGLM-6B model algorithm, and then path information corresponding to the large language model algorithm is configured, the path information includes an input path and an output path, and a corresponding parameter path, a parameter type and the like of the large language model algorithm are debugged. The input path needs to be consistent with a path corresponding to the unstructured data document set, and the output path needs to be configured to a specific named path corresponding to the distributed computing cluster. After the path information is configured, a large language model algorithm start command is executed, and whether the algorithm runs normally is viewed in a log configuration path. If the log shows that the algorithm runs normally, it indicates that the large language model algorithm is deployed.
[0054] According to the above-mentioned embodiments of the present application, by deploying a distributed computing cluster on a server, deploying a large language model algorithm on the distributed computing cluster, and configuring path information corresponding to the large language model algorithm, the server deployed with the large language model algorithm can be used to process an unstructured data document set to obtain a corresponding knowledge graph, and the deployment of the distributed computing cluster can further improve the construction efficiency of the knowledge graph.
[0055] In an optional embodiment of the present application, after obtaining the data extraction result corresponding to the unstructured data document set, the method further includes:
[0056] The data extraction result is subjected to data governance to obtain a triple relationship set, wherein each triple relationship in the triple relationship set includes entity, relationship and attribute information.
[0057] According to the triple relationship set, a knowledge graph corresponding to the unstructured data document set is constructed.
[0058] Specifically, after obtaining the data extraction result, the data extraction result is subjected to data governance to obtain a triple relationship set.
[0059] The embodiment of the application extracts keywords from the unstructured data document set composed of unstructured data documents through a large language model algorithm to obtain a data extraction result, and then performs data governance on the data extraction result to obtain a triple relationship set, and further constructs a knowledge graph corresponding to the unstructured data document set based on the obtained triple relationship set. Since the large language model algorithm can learn the patterns and language structures of natural language through large-scale unsupervised training, it can simulate human language cognition and generation processes, thereby enabling the extraction of entities and relationships from unstructured data through the large language model algorithm without manual data labeling, and the accuracy of the obtained data extraction result is higher, thereby improving the accuracy of the knowledge graph established based on the triple relationship set obtained from the data extraction result. At the same time, the use of the large language model algorithm can also improve the construction efficiency of the knowledge graph.
[0060] In an optional embodiment of the application, the data extraction result is subjected to data governance to obtain a triple relationship set, including:
[0061] The entities included in the data extraction result are subjected to splitting, combining, and integrating operations to obtain metadata, and the metadata is stored in a preset data lake;
[0062] The metadata stored in the preset data lake is subjected to data governance to obtain log records corresponding to each data governance process;
[0063] For each entity included in the metadata, the log records are traced to obtain relationship and attribute information corresponding to the entity, and a triple relationship including the entity, the relationship, and the attribute information is determined;
[0064] The triple relationship set is determined according to the triple relationship corresponding to each entity.
[0065] Specifically, when the data extraction result is subjected to data governance to obtain a triple relationship set, the entities in the data extraction result are first processed, which includes splitting, combining, integrating, and other operations to obtain metadata, and the metadata is stored in a preset data lake. Then, the metadata stored in the preset data lake is subjected to governance to obtain log records corresponding to each data governance process. In the data governance process, for each entity included in the metadata, the data source can be traced according to the log records to obtain relationship and attribute information corresponding to the entity, and further obtain a triple relationship set composed of triple relationships including entities, relationships, and attribute information.
[0066] According to the data governance on the data extraction result, the corresponding triad relation set can be obtained, and the knowledge graph can be constructed based on the triad relation set, and a knowledge system is formed.
[0067] In an optional embodiment of the present application, according to the triad relation set, a knowledge graph corresponding to the unstructured data document set is constructed, comprising:
[0068] Each triad relation included in the triad relation set is sequentially imported into a preset graph database to obtain an initial knowledge graph.
[0069] The initial knowledge graph is subjected to entity disambiguation processing and spot check verification processing to obtain the knowledge graph, wherein the data extraction result includes entities and relations.
[0070] Specifically, after obtaining the triad relation set, a commonly used Nebula graph database can be selected as a knowledge graph storage graph database, that is, a preset graph database, and the structures and fields of entities, relations, attributes, etc. are designed. When selecting a graph database, it can be selected according to a specific application scenario, and it can also be other graph databases such as Neo4j and TigerGraph, which are not limited in the present application. Then, by writing a Python script, the obtained triad relation set is imported into the preset graph database according to the designed field relationship to obtain an initial knowledge graph.
[0071] After obtaining the initial knowledge graph, it can be checked whether the graph relations imported into the preset graph database are correct to ensure that the relations between entities in the graph are correct.
[0072] In order to further improve the accuracy of the knowledge graph, the initial knowledge graph can be subjected to entity disambiguation processing by a clustering method based on multi-source heterogeneous semantic knowledge fusion and an artificial spot check clustering method to obtain the knowledge graph, and the effect of unique, complete and diversified representation of entity information is realized. The following will be introduced respectively.
[0073] The clustering method based on multi-source heterogeneous semantic knowledge fusion unifies the entity names in each business field of the specific industry to realize unique unified names, and the corresponding relations of the same and similar entity names are fused into a unified entity name. The corresponding attributes can be aggregated and fused together by using the similarity degree. The entity name can be named by industry professional terms, professional vocabulary and abbreviations, and the data source is noted in the attribute value.
[0074] The artificial spot-check clustering method verifies entity, relation and attribute information in the knowledge graph according to the content of the three-level and four-level classification label results of the unstructured data document, and implements entity information aggregation and classification of entities and relations corresponding to cross-classification semantics similar to each other by referring to professional name naming.
[0075] In the embodiments of the present application, a subdivision field can also be spot-checked, and Nebula graph database data is queried through related entity information. Whether the graph information obtained by the query is consistent with the expected effect is viewed. The final result is verified through multiple rounds of spot-checking. After the graph construction is completed, the internal online, the business department can continuously improve the graph entity information in the process of use.
[0076] The above-mentioned embodiments of the present application realize the graph construction of the unstructured data document set by importing the triple relation set into the preset graph database to obtain the knowledge graph, which facilitates the data document query and other operations of the business department.
[0077] The above introduces the document processing method provided by the embodiments of the present application, and the document processing device provided by the embodiments of the present application will be introduced below in combination with the drawings.
[0078] As shown in Figure 2 The present application also provides a document processing device, which comprises:
[0079] The instruction determination module 201 is configured to determine a keyword extraction instruction corresponding to a large language model algorithm according to a multi-level classification label corresponding to the unstructured data document set;
[0080] The keyword extraction module 202 is configured to perform a keyword extraction operation on the unstructured data document set based on the keyword extraction instruction to obtain a data extraction result corresponding to the unstructured data document set.
[0081] Optionally, before the keyword extraction operation on the unstructured data document set based on the keyword extraction instruction, the device further comprises:
[0082] The acquisition module is configured to acquire an extraction accuracy rate corresponding to the keyword extraction instruction;
[0083] The first processing module is configured to adjust the keyword extraction to obtain a new keyword extraction instruction in a case where the extraction accuracy rate is less than a preset threshold, until the extraction accuracy rate corresponding to the new keyword extraction instruction is greater than or equal to the preset threshold, and replace the keyword extraction instruction with the new keyword extraction instruction.
[0084] Optionally, the acquisition module comprises:
[0085] The first obtaining sub-module is configured to select at least one data document from the unstructured data document set to obtain a test data document set, and obtain a target data extraction result corresponding to the test data document set.
[0086] The first processing sub-module is configured to process the test data document set according to the keyword extraction instruction to obtain a test data extraction result.
[0087] The first determining sub-module is configured to determine an extraction accuracy corresponding to the keyword extraction instruction according to the test data extraction result and the target data extraction result.
[0088] Optionally, before determining the keyword extraction instruction corresponding to the large language model algorithm according to the multi-level classification labels corresponding to the unstructured data document set, the apparatus further comprises:
[0089] The receiving module is configured to receive an unstructured data document set including a first-level classification label and a second-level classification label.
[0090] The second processing module is configured to train a natural language processing classifier according to the first-level classification label and the second-level classification label to obtain a target classifier.
[0091] The third processing module is configured to process the unstructured data document set according to the target classifier to sequentially obtain a third-level classification label and a fourth-level classification label corresponding to each data document set in the unstructured data document set.
[0092] The determining module is configured to determine the unstructured data document set according to the third-level classification label and the fourth-level classification label corresponding to each data document set in the initial unstructured data document set and the initial unstructured data document set.
[0093] Optionally, the apparatus further comprises:
[0094] The deploying module is configured to deploy a distributed computing cluster on a server.
[0095] The configuring module is configured to deploy the large language model algorithm on the distributed computing cluster, and configure path information corresponding to the large language model algorithm, wherein the path information includes an input path corresponding to each first-level classification label in the multi-level classification label and an output path corresponding to the data extraction result.
[0096] Optionally, after obtaining the data extraction result corresponding to the unstructured data document set, the apparatus further comprises:
[0097] The data governance module is configured to perform data governance on the data extraction result to obtain a set of triple relationships, wherein each triple relationship in the set of triple relationships comprises entity, relationship and attribute information.
[0098] The knowledge graph construction module is configured to construct a knowledge graph corresponding to the set of unstructured data documents according to the set of triple relationships.
[0099] Optionally, the data governance module comprises:
[0100] The second processing submodule is configured to perform splitting, combining and integrating operations on the entities included in the data extraction result to obtain metadata, and store the metadata in a preset data lake.
[0101] The third processing submodule is configured to perform data governance on the metadata stored in the preset data lake to obtain log records corresponding to each data governance process.
[0102] The second determining submodule is configured to trace the origin of each entity included in the metadata through the log records to obtain relationship and attribute information corresponding to the entity, and determine a triple relationship comprising the entity, the relationship and the attribute information.
[0103] The third determining submodule is configured to determine the set of triple relationships according to the triple relationship corresponding to each entity.
[0104] Optionally, the knowledge graph construction module comprises:
[0105] The import submodule is configured to sequentially import each triple relationship included in the set of triple relationships into a preset graph database to obtain an initial knowledge graph.
[0106] The fourth processing submodule is configured to perform entity disambiguation processing and spot-checking verification processing on the initial knowledge graph to obtain the knowledge graph, wherein the data extraction result comprises entities and relationships.
[0107] The document processing apparatus provided by the present application determines the keyword extraction instruction corresponding to the large language model algorithm based on the multi-level classification labels corresponding to the set of unstructured data documents, and processes the set of unstructured data documents through the keyword extraction instruction to obtain the data extraction result, so that manual data labeling is not required during the data extraction process, the labor cost is reduced, and the construction efficiency of the knowledge graph composed of the set of unstructured data documents is improved.
[0108] The embodiment of the present application also provides an electronic device, comprising: a processor, a memory, a computer program stored in the memory and executable on the processor, when the computer program is executed by the processor, each process of the above-mentioned document processing method embodiment is realized, and the same technical effects can be achieved. To avoid repetition, it will not be repeated here.
[0109] For example, Figure 3 An entity structure diagram of an electronic device is shown.
[0110] As Figure 3 shown, the electronic device can include: a processor 310, a communications interface 320, a memory 330, and a communications bus 340, wherein the processor 310, the communications interface 320, and the memory 330 complete mutual communication through the communications bus 340. The processor 310 can call logical instructions in the memory 330, and the processor 310 is used to perform the following steps: determining a keyword extraction instruction corresponding to a large language model algorithm according to a multi-level classification label corresponding to a set of unstructured data documents; performing a keyword extraction operation on the set of unstructured data documents based on the keyword extraction instruction to obtain a data extraction result corresponding to the set of unstructured data documents, wherein the data extraction result includes entities and relationships.
[0111] In addition, the logical instructions in the memory 330 described above can be implemented in the form of a software function unit and sold or used as an independent product, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0112] The embodiment of the present application also provides a computer readable storage medium, and the computer readable storage medium stores a computer program, when the computer program is executed by the processor, each process of the above-mentioned document processing method embodiment is realized, and the same technical effects can be achieved. To avoid repetition, it will not be repeated here.
[0113] It should be noted that, in the present document, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0114] Those skilled in the art can clearly understand that the above-mentioned embodiment method can be realized by means of software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a plurality of instructions for making a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) execute the method described in each embodiment of the present application.
[0115] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are only illustrative, not restrictive, and those skilled in the art can make many forms under the inspiration of the present application without departing from the purpose of the present application and the scope protected by the claims.
[0116] Those skilled in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present application can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solutions. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0117] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0118] In the embodiments of the present application, it should be understood that the disclosed apparatus and method can be implemented in other manners. For example, the embodiments of the apparatus described above are merely schematic, and the division of the units is merely logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0119] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0120] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can be physically present separately, or two or more units can be integrated into one unit.
[0121] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the part of the present application that essentially contributes to the prior art or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk, and various storage media that can store program codes.
[0122] The above description is merely a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A document processing method, characterized in that, include: Based on the multi-level classification labels corresponding to the unstructured data document set, determine the keyword extraction instructions corresponding to the large language model algorithm; Based on the keyword extraction instruction, a keyword extraction operation is performed on the unstructured data document set to obtain the data extraction result corresponding to the unstructured data document set, wherein the data extraction result includes entities and relations; Before determining the keyword extraction instructions for the large language model algorithm based on the multi-level classification labels corresponding to the unstructured data document set, the method further includes: Receive an initial collection of unstructured data documents, including primary category labels and secondary category labels; The natural language processing classifier is trained using the primary classification labels and the secondary classification labels to obtain the target classifier; The target classifier processes the initial unstructured data document set to obtain the third-level and fourth-level classification labels corresponding to each data document set in the initial unstructured data document set. The unstructured data document set is determined based on the third-level and fourth-level classification labels corresponding to each data document set in the initial unstructured data document set and the initial unstructured data document set itself.
2. The document processing method according to claim 1, characterized in that, Before performing keyword extraction on the unstructured data document set based on the keyword extraction instruction, the method further includes: Obtain the extraction accuracy corresponding to the keyword extraction instruction; If the extraction accuracy is less than a preset threshold, the keyword extraction is adjusted to obtain a new keyword extraction instruction until the extraction accuracy corresponding to the new keyword extraction instruction is greater than or equal to the preset threshold, and the new keyword extraction instruction replaces the original keyword extraction instruction.
3. The document processing method according to claim 2, characterized in that, Obtaining the extraction accuracy corresponding to the keyword extraction instruction includes: At least one data document is selected from the unstructured data document set to obtain a test data document set, and the target data extraction result corresponding to the test data document set is obtained; The test data document set is processed by the keyword extraction instruction to obtain the test data extraction result; Based on the test data results and the target data extraction results, the extraction accuracy corresponding to the keyword extraction instruction is determined.
4. The document processing method according to claim 1, characterized in that, The method further includes: Deploy a distributed computing cluster on the server; The large-scale language model algorithm is deployed on the distributed computing cluster, and the path information corresponding to the large-scale language model algorithm is configured. The path information includes the input path corresponding to each level of classification label in the multi-level classification label and the output path corresponding to the data extraction result.
5. The document processing method according to claim 1, characterized in that, After obtaining the data extraction results corresponding to the unstructured data document set, the method further includes: The data extraction results are processed to obtain a set of triple relations, wherein each triple relation in the set of triple relations includes entity, relation and attribute information; Based on the set of triple relationships, construct a knowledge graph corresponding to the set of unstructured data documents.
6. The document processing method according to claim 5, characterized in that, Data processing is performed on the extracted data to obtain a set of triplet relations, including: After splitting, combining, and integrating the entities included in the data extraction results, metadata is obtained and stored in a preset data lake; Data governance is performed on the metadata stored in the preset data lake to obtain log records corresponding to each data governance process; For each entity included in the metadata, the log records are used to trace the source to obtain the relationship and attribute information corresponding to the entity, and to determine the triple relationship including the entity, the relationship and the attribute information; The set of triplet relations is determined based on the triplet relations corresponding to each entity.
7. The document processing method according to claim 5, characterized in that, Based on the set of triple relations, a knowledge graph corresponding to the set of unstructured data documents is constructed, including: Each triplet relation included in the triplet relation set is sequentially imported into a preset graph database to obtain an initial knowledge graph. The initial knowledge graph is subjected to entity disambiguation processing and random sampling verification processing to obtain the knowledge graph.
8. A document processing apparatus, characterized in that, include: The instruction determination module is used to determine the keyword extraction instructions corresponding to the large language model algorithm based on the multi-level classification labels corresponding to the unstructured data document set. The keyword extraction module is used to perform keyword extraction operations on the unstructured data document set based on the keyword extraction instruction, and obtain the data extraction results corresponding to the unstructured data document set, wherein the data extraction results include entities and relations; Before determining the keyword extraction instructions corresponding to the large language model algorithm based on the multi-level classification labels corresponding to the unstructured data document set, the device further includes: The receiving module is used to receive a collection of unstructured data documents, including primary category labels and secondary category labels; The second processing module is used to train the natural language processing classifier using the first-level classification label and the second-level classification label to obtain the target classifier; The third processing module is used to process the unstructured data document set through the target classifier to obtain the third-level classification label and the fourth-level classification label corresponding to each data document set in the unstructured data document set in sequence; The determination module is used to determine the unstructured data document set based on the third-level and fourth-level classification labels corresponding to each data document set in the initial unstructured data document set and the initial unstructured data document set.
9. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the document processing method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the document processing method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Knowledge graph construction method, knowledge graph construction system and computing equipment
CN114817553A