Key value generation method, knowledge graph generation method, device, equipment and medium
By parsing documents and extracting features using deep learning models, the key-value pair type is determined, solving the standard definition problem in key-value pair generation across multiple industries and improving industry reusability and development efficiency.
Patent Information
- Application Number
- CN202210754072.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-28
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2042-06-28
AI Technical Summary
In the construction of knowledge graphs across multiple industries, existing technologies lack standardized definitions for key-value pair extraction tasks, resulting in poor industry reusability, low development efficiency, and an inability to effectively support the key-value pair generation needs of multiple industries.
By parsing the document to be processed, determining the target key-value pair type, and using a deep learning model to extract feature vectors, the standard definition and type determination of key-value pairs are realized, supporting the key-value pair generation needs of multiple industries and improving industry reusability and development efficiency.
It enables clear extraction of key-value pairs across multiple industry scenarios, improving the industry reusability and development efficiency of key-value pair generation and reducing the need for repetitive development.
Smart Images

Figure CN115146070B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer data processing and the technical field of artificial intelligence, in particular to artificial intelligence, natural language processing and deep learning technology. Specifically, it relates to a key-value generation method, a knowledge graph generation method, an apparatus, an electronic device and a storage medium. BACKGROUND
[0002] The knowledge extraction task is one of the tasks in the construction of a knowledge graph. Through automatic or semi-automatic technology, available knowledge units can be extracted from natural language texts to supplement the entity attributes and entity relationships in the knowledge graph.
[0003] The knowledge unit can be in the form of an SPO triple. The SPO triple can include S (i.e., an entity), P (an entity attribute or a relationship between entities), and O (an entity attribute value or an associated entity). SUMMARY
[0004] The present disclosure provides a key-value generation method, a knowledge graph generation method, an apparatus, an electronic device and a storage medium.
[0005] According to an aspect of the present disclosure, a key-value generation method is provided, comprising: obtaining a target document according to a to-be-processed document; parsing the target document to obtain a target key-value pair; determining a target key-value pair type according to the target key-value pair; and obtaining a key-value result for the to-be-processed document according to the target key-value pair and the target key-value pair type.
[0006] According to another aspect of the present disclosure, a knowledge graph generation method is provided, comprising: performing entity recognition on a target document to obtain a target entity; generating a key-value result using the method described above; generating a knowledge unit according to the key-value result and the target entity; and generating a knowledge graph according to the knowledge unit.
[0007] According to another aspect of the present disclosure, a key-value generation apparatus is provided, comprising: a first obtaining module configured to obtain a target document according to a to-be-processed document; a parsing module configured to parse the target document to obtain a target key-value pair; a determining module configured to determine a target key-value pair type according to the target key-value pair; and a second obtaining module configured to obtain a key-value result for the to-be-processed document according to the target key-value pair and the target key-value pair type.
[0008] According to another aspect of the present disclosure, there is provided a knowledge graph generation apparatus, comprising: an entity recognition module configured to perform entity recognition on a target document to obtain a target entity; a first generation module configured to generate a key-value result using the apparatus according to the present disclosure; a second generation module configured to generate a knowledge unit based on the key-value result and the target entity; and a third generation module configured to generate a knowledge graph based on the knowledge unit.
[0009] According to another aspect of the present disclosure, there is provided an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the present disclosure.
[0010] According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to perform the method according to the present disclosure.
[0011] According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the method according to the present disclosure.
[0012] It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0013] The accompanying drawings are used to better understand the present scheme, and do not limit the present disclosure. Among them:
[0014] Figure 1 An exemplary system architecture to which the key-value generation method, the knowledge graph generation method and apparatus according to embodiments of the present disclosure can be applied is schematically shown;
[0015] Figure 2 A flowchart of the key-value generation method according to embodiments of the present disclosure is schematically shown;
[0016] Figure 3A An exemplary schematic diagram of the training process of the classification model in the case where the deep learning model comprises a first language module according to embodiments of the present disclosure is schematically shown;
[0017] Figure 3B An exemplary schematic diagram of the training process of the classification model in the case where the deep learning model comprises a second language module and a first feature fusion module according to embodiments of the present disclosure is schematically shown;
[0018] Figure 3C An example schematic diagram of a training process of a classification model is schematically shown in the case where the deep learning model comprises a third language module and a first pre-training module according to an embodiment of the present disclosure;
[0019] Figure 3D An example schematic diagram of a training process of a classification model is schematically shown in the case where the deep learning model comprises a fourth language module and a third fusion module according to an embodiment of the present disclosure;
[0020] Figure 4 A flowchart of a knowledge graph generation method is schematically shown according to an embodiment of the present disclosure;
[0021] Figure 5 An example schematic diagram of generating a knowledge graph is schematically shown according to an embodiment of the present disclosure;
[0022] Figure 6 A block diagram of a key-value generation apparatus is schematically shown according to an embodiment of the present disclosure;
[0023] Figure 7 A block diagram of a knowledge graph generation apparatus is schematically shown according to an embodiment of the present disclosure; and
[0024] Figure 8 A block diagram of an electronic device suitable for implementing the key-value generation method and the knowledge graph generation method is schematically shown according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to help the understanding of the present disclosure. These should be considered in the context of the overall description and should not be considered limiting in any way. Thus, it will be apparent to one of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Also, for the sake of brevity and clarity, descriptions of well-known functions and constructions are omitted from the following description.
[0026] Key-value pair knowledge plays an important role in the construction of industry knowledge graphs. On the one hand, key-value (KV) is an important carrier of document knowledge data, which can provide SPO knowledge to assist graph construction. On the other hand, the construction cost of industry ontology is high, and KV extraction does not depend on industry ontology, and can also be a high-quality source of industry ontology.
[0027] The task target of KV extraction is to parse the document according to the distribution rule of the industry document, obtain the KV candidate pair through the document parsing rule, and then filter the non-knowledge noise data included in the KV candidate pair by relying on human customization rule. The entity extraction interface is called, the entity association strategy is developed according to the industry document rule, the SPO candidate data is output, and the artificial correction data is utilized.
[0028] Since the KV extraction task does not give a clear definition of the standard of KV and KV type SPO, the generalization of the industry extraction strategy is poor. In the case of facing multiple industry extraction tasks, different parsing rules, filtering rules and entity association rules need to be configured according to different industry knowledge, so that the industry reusability is poor and the development efficiency is low.
[0029] Therefore, the embodiment of the present disclosure proposes a key value generation method. For example, according to the to-be-processed document, the target document is obtained. The target document is parsed to obtain the target key value pair. According to the target key value pair, the type of the target key value pair is determined. According to the target key value pair and the type of the target key value pair, the key value result for the to-be-processed document is obtained, which realizes the determination of the key value pair type, gives a clear definition of the standard of KV and KV type SPO, so that the extraction target is clear, when facing multiple industry extraction tasks, the key value pair generation demand of each industry can be supported, without repeated development, and the industry reusability and development efficiency are improved.
[0030] Figure 1 An exemplary system architecture to which the key value generation method, the knowledge graph generation method and the device according to the embodiments of the present disclosure can be applied is schematically shown.
[0031] It should be noted that, Figure 1 The system architecture shown is only an example of the system architecture to which the embodiments of the present disclosure can be applied, to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure cannot be applied to other devices, systems, environments or scenarios. For example, in another embodiment, the exemplary system architecture to which the key value generation method, the knowledge graph generation method and the key value generation device, the knowledge graph generation device can be applied can include a terminal device, but the terminal device can not need to interact with the server, and can implement the key value generation method, the knowledge graph generation method and the key value generation device, the knowledge graph generation device provided by the embodiments of the present disclosure.
[0032] As Figure 1 shown, the system architecture 100 according to the embodiment can include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used as a medium to provide a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 can include various connection types, such as wired and / or wireless communication links, etc.
[0033] The user can use the terminal devices 101, 102, and 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 101, 102, and 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (only as examples).
[0034] The terminal devices 101, 102, and 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smartphones, tablet computers, laptop computers, desktop computers, etc.
[0035] The server 105 can be a server providing various services, such as a background management server providing support for the content browsed by the user using the terminal devices 101, 102, and 103 (only as an example). The background management server can analyze and process the received user requests and other data, and feed back the processing results (such as web pages, information, or data, etc. obtained or generated according to the user requests) to the terminal devices.
[0036] It should be noted that the key value generation method and the knowledge graph generation method provided by the embodiments of the present disclosure can generally be executed by the terminal devices 101, 102, or 103. Correspondingly, the key value generation apparatus and the knowledge graph generation apparatus provided by the embodiments of the present disclosure can also be arranged in the terminal devices 101, 102, or 103.
[0037] Alternatively, the key value generation method and the knowledge graph generation method provided by the embodiments of the present disclosure can also be executed by the server 105. Correspondingly, the key value generation apparatus and the knowledge graph generation apparatus provided by the embodiments of the present disclosure can generally be arranged in the server 105. The key value generation method and the knowledge graph generation method provided by the embodiments of the present disclosure can also be executed by a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, and 103 and / or the server 105. Correspondingly, the key value generation apparatus and the knowledge graph generation apparatus provided by the embodiments of the present disclosure can also be arranged in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, and 103 and / or the server 105.
[0038] For example, the terminal device 101, 102, 103 can obtain a target document from a to-be-processed document, send the obtained target document to the server 105, and obtain a target key-value pair by parsing the target document by the server 105; determine a target key-value pair type according to the target key-value pair; and obtain a key-value result for the to-be-processed document according to the target key-value pair and the target key-value pair type. Or the target document is parsed by a server or server cluster capable of communicating with the terminal device 101, 102, 103 and / or the server 105, and finally the key-value result is obtained.
[0039] It should be understood that Figure 1 The number of terminal devices, networks and servers in the above description is only illustrative. Any number of terminal devices, networks and servers can be provided according to the needs of implementation.
[0040] It should be noted that the serial numbers of the operations in the following method are only used to represent the operations for description, and should not be regarded as representing the execution sequence of the operations. Unless explicitly stated, the method does not need to be executed in the order shown.
[0041] Figure 2 A flowchart of a key-value generation method according to an embodiment of the present disclosure is schematically shown.
[0042] As Figure 2 shown, the method 200 includes operations S210-S240.
[0043] In operation S210, a target document is obtained according to a to-be-processed document.
[0044] In operation S220, the target document is parsed to obtain a target key-value pair.
[0045] In operation S230, a target key-value pair type is determined according to the target key-value pair.
[0046] In operation S240, a key-value result for the to-be-processed document is obtained according to the target key-value pair and the target key-value pair type.
[0047] According to an embodiment of the present disclosure, the document to be processed can be a structured document, an unstructured document, or a semi-structured document. For example, the structured document can include document information managed in the form of a relational database table. The unstructured document can include at least one of a DOC (Document), an XML (Extensible Markup Language), a DOCX, a PDF (Portable Document Format), an XLS, an XLSX, and a CAJ (China Academic Journals), and the like. The semi-structured document can include at least one of a log file, a JOSN (JavaScript Object Notation) document, and an Email (i.e., an email), and the like.
[0048] According to an embodiment of the present disclosure, the target document can be a document obtained after the document to be processed is preprocessed. The target document can also be a structured document, an unstructured document, or a semi-structured document.
[0049] According to an embodiment of the present disclosure, the key-value pair can be semi-structured text representing key-value (i.e., KV) information. Compared with unstructured data and structured data, semi-structured data has a certain structural nature on the text level and the semantic level, the expression type is flexible and rich, the data format is more standardized, and there is a specific distribution rule.
[0050] According to an embodiment of the present disclosure, the key-value pair can be a text segment that can be expressed in a single line of text and has a strong format separator. On the text level, the key-value pair has multiple distribution formats, covers a wide range in industry documents, emphasizes key information in multiple segments in the document by means of structural characteristics, is an important source of knowledge, and the distribution format can be represented as Key[separator]Value, for example, list title-list item. On the semantic level, the key-value pair can match multiple binary tuple relationships (i.e., binary Schema) conforming to the Key-Value slot, the structural characteristics are significant, the industry semantics are weak, the key information can be intuitively emphasized by the structural characteristics, and the user lacking industry background can be assisted to understand knowledge, and the Schema expression characteristics in various industries have universality.
[0051] According to an embodiment of the present disclosure, after the target document is obtained, a general key-value pair analysis strategy can be used to identify multiple target key-value pairs from each independent paragraph statement in the target document. The form of the target key-value pair is semi-structured data.
[0052] According to an embodiment of the present disclosure, the key-value pair type can be a binary schema in which key-value pairs match in a semantic layer, used to record text pairs with different relationships. The key-value pair type can be divided into attribute-value, noun-explanation, and non-KV classes according to key-value pairs. The key-value pair type can be further classified according to a judgment standard. For example, the non-KV class classification can include at least one of the following: content-explanation (follow-up), theme-opinion, and date-event, and the like. Table 1 schematically shows a classification table of key-value pair types.
[0053]
[0054] Table 1
[0055] According to an embodiment of the present disclosure, after determining the target key-value pair type, the key-value result of the to-be-processed document can be generated in combination with the target key-value pair. The key-value result can represent the values of various attributes of the to-be-processed document. It can be represented as (K, V, key-value pair type).
[0056] According to an embodiment of the present disclosure, according to the to-be-processed document, the target document is obtained, the target document is parsed to obtain the target key-value pair, the target key-value pair type is determined according to the target key-value pair, and the key-value result for the to-be-processed document is obtained according to the target key-value pair and the target key-value pair type. The key-value pair type is determined, the standard of KV and KV class SPO is clearly defined, so that the extraction target is clear, and the key-value pair generation requirement of each industry can be supported when facing multi-industry extraction tasks, without repeated development, and the industry reusability and development efficiency are improved.
[0057] According to an embodiment of the present disclosure, operation S230 can include the following operations.
[0058] The target key-value pair is feature extracted to obtain a target key-value pair feature vector. The target key-value pair type is determined according to the target key-value pair feature vector.
[0059] According to an embodiment of the present disclosure, the key field in the target key-value pair can be used to store an attribute, and the value field in the target key-value pair is used to store the value of the attribute. For example, the target key-value pair is "design unit, xx two company", in which the attribute is "design unit" and the value is "xx two company".
[0060] According to an embodiment of the present disclosure, a deep network learning model can be used to feature extract the target key-value pair to obtain a target key-value pair feature vector. The target key-value pair feature vector can represent the relationship information between the attribute and the value in the target key-value pair, and the target key-value pair type is determined according to the relationship information between the attribute and the value.
[0061] According to an embodiment of the present disclosure, feature extraction on the target key-value pair to obtain a target key-value pair feature vector can include the following operations.
[0062] Object encoding is performed on the objects in the target key-value pair to obtain a target object feature vector. Position encoding is performed on the target key-value pair to obtain a target position feature vector. Segment encoding is performed on the target key-value pair to obtain a target segment feature vector. The target key-value pair feature vector is obtained according to the target object feature vector, the target position feature vector, and the target segment feature vector.
[0063] According to an embodiment of the present disclosure, after the key and the value in the target key-value pair are spliced into a piece of text through [SEP] and converted into a vocabulary after word segmentation, each vocabulary can be regarded as an object in the target key-value pair, object encoding is performed on each object in the target key-value pair to obtain a target object feature vector; position encoding and segment encoding are performed on the target key-value pair to obtain a target position feature vector and a target segment feature vector.
[0064] According to an embodiment of the present disclosure, the target object feature vector, the target position feature vector, and the target segment feature vector of the target key-value pair are input into a language prediction model to obtain a target key-value pair feature vector.
[0065] According to an embodiment of the present disclosure, determining the target key-value pair type according to the target key-value pair feature vector can include the following operations.
[0066] According to the target key-value pair, expected feature data is created. Feature extraction is performed on the expected feature data to obtain an expected feature vector. The target key-value pair type is determined according to the target key-value pair feature vector and the expected feature vector.
[0067] According to an embodiment of the present disclosure, expected feature data can be created according to the extracted feature categories of the target key-value pair. The extracted feature categories can include object (i.e., token) granularity, part-of-speech granularity, and word class granularity. The expected feature data can be created according to the identification rules of multiple dimensions of each feature category.
[0068] According to an embodiment of the present disclosure, based on the badcase analysis of the general verification set, 54-dimensional expected feature data can be created according to the identification rules, for example, the 54-dimensional expected feature data can include 32-dimensional token granularity, 16-dimensional part-of-speech granularity, and 6-dimensional word class granularity. The expected feature data has significant guidance significance, and high-level semantic features (part-of-speech, word class) can be directly received by using the expected feature data. For example, Table 2 schematically shows a scheme table for creating expected feature data.
[0069]
[0070]
[0071]
[0072] Table 2
[0073] It should be noted that the above creation dimensions of the expected feature data are only exemplary and do not limit the number of dimensions of the present disclosure.
[0074] According to an embodiment of the present disclosure, the expected feature data is obtained according to the above-mentioned expected feature data creation scheme table, feature extraction is performed on the expected feature data to obtain an expected feature vector, and feature fusion is performed on the target key-value pair feature vector and the expected feature vector to obtain a target key-value pair type.
[0075] According to an embodiment of the present disclosure, the feature extraction on the expected feature data to obtain an expected feature vector can include the following operations.
[0076] The expected feature data is densely coded to obtain a dense feature vector. The dense feature vector is factorized to obtain an expected feature vector.
[0077] According to an embodiment of the present disclosure, the dense coding of the expected feature data can include: the created 54-dimensional expected feature data, which can include 32-dimensional token granularity expected feature data, 16-dimensional part-of-speech granularity expected feature data, and 6-dimensional word class granularity expected feature data. The 54-dimensional expected feature data can be divided into 120-dimensional 0 / 1 features and then input for dense coding to obtain a dense feature vector.
[0078] According to an embodiment of the present disclosure, the factorization of the dense feature vector can include: inputting the dense feature vector into a factor layer for factorization to obtain an expected feature vector.
[0079] According to an embodiment of the present disclosure, determining a target key-value pair type according to a target key-value pair can include the following operations.
[0080] The target key-value pair is processed by a classification model to obtain a target key-value pair type. The classification model can be obtained by training a deep learning model using sample document data.
[0081] According to an embodiment of the present disclosure, the classification model can be a model for determining a target key-value pair type of a target document. The classification model can be obtained by training a deep learning model using sample document data.
[0082] According to an embodiment of the present disclosure, the sample document data can be data for training a deep learning model, and the structure of the sample document data can be structured data, semi-structured data, and unstructured data.
[0083] According to an embodiment of the present disclosure, the target key-value pair is input into the classification model, and a type of the target key-value pair is obtained through encoding processing and prediction analysis on the target key-value pair.
[0084] According to an embodiment of the present disclosure, the deep learning model can include a first language module.
[0085] According to an embodiment of the present disclosure, the classification model can be obtained by training the first language module based on a first loss function according to a first sample classification result and a sample label value. The first sample classification result is obtained by processing sample document data by using the first language module.
[0086] According to an embodiment of the present disclosure, the sample label value can be a true value of the sample document data. The first classification result can be a sample classification prediction value obtained by processing the sample document data based on the first language module.
[0087] According to an embodiment of the present disclosure, the first language module can be a first text classification model. The first language module is trained based on the adjusted parameters, until the first loss function satisfies a predetermined end condition, the training of the first language module is completed, and the classification model is obtained.
[0088] According to an embodiment of the present disclosure, the predetermined end condition can be that a maximum number of iterations is satisfied, or a predetermined convergence condition is satisfied.
[0089] According to an embodiment of the present disclosure, the deep learning model can include a second language module and a first feature fusion module.
[0090] According to an embodiment of the present disclosure, the classification model can be obtained by training the second language module and the first feature fusion module based on a second loss function according to a second sample classification result and a sample label value. The second sample classification result is obtained according to a first expected sample feature vector and a first sample feature vector. The first expected sample feature vector is obtained by processing expected sample feature data by using the first feature fusion module. The expected sample feature data is created according to the sample document data. The expected sample feature data includes feature data of at least one granularity of object granularity, part-of-speech granularity, and part-of-speech class granularity. The first sample feature vector is obtained by processing the sample document data by using the second language module.
[0091] According to an embodiment of the present disclosure, the second language module can be a second text classification module, and the first feature fusion module can be a first feature fusion optimization module.
[0092] According to an embodiment of the present disclosure, the second sample classification result can be a sample prediction classification result determined by a first sample feature vector obtained by processing the expected sample document data based on the second language module and a first expected sample feature vector obtained by processing the expected sample data based on the first feature fusion module. The sample label value can be a true value of the sample document data.
[0093] According to an embodiment of the present disclosure, the expected sample data can be created by identifying rules based on the badcase analysis of the general verification set, using the sample document data. The expected sample data can be multi-dimensional expected sample data, and the expected sample data can include feature data of at least one of object granularity, part-of-speech granularity, and word class granularity.
[0094] According to an embodiment of the present disclosure, the second language module and the first feature fusion module are parameter-adjusted based on the second sample classification result and the sample label value, and then trained based on the adjusted parameters until the second loss function meets a predetermined end condition, thereby completing the training of the second language module and the first feature fusion module and obtaining the classification model.
[0095] According to an embodiment of the present disclosure, the first feature fusion can directly fuse the expected sample data into the encoding result of the second language module, learn the optimal proportion of statistical features and semantic features, and improve the model learning efficiency, so that in the prediction process, the statistical features and semantic features of the text data to be predicted can be better fused, and the prediction efficiency is improved.
[0096] According to an embodiment of the present disclosure, the deep learning model can include a third language module and a first pre-training module.
[0097] According to an embodiment of the present disclosure, the classification model can be obtained by training the third language module based on a third loss function according to a third sample classification result and a fourth sample classification result. The third sample classification result is obtained by processing the sample document data using the third language module. The fourth sample classification result is obtained by processing the sample document data using the first pre-training module.
[0098] According to an embodiment of the present disclosure, the third language module can be a third text classification module, and the first pre-training module can be a first pre-training language module. The first pre-training language module has fixed weight parameters.
[0099] According to an embodiment of the present disclosure, the third language module has a better representation of general semantics and can support MLM (Mask Language Model) prediction, but is prone to deviation during large-scale data training, so as to overfit sample document data. In combination with the first pre-training module, the third language module can maintain similar language representation capability as the first pre-training module during classification task training of the third language module, so as to improve the generalization capability of the model.
[0100] According to an embodiment of the present disclosure, the third sample classification result can be a sample prediction classification result obtained by processing the sample document data based on the third language module. The fourth sample classification result can be a sample classification result obtained by processing the sample document data based on the first pre-training language module.
[0101] According to an embodiment of the present disclosure, since the weight parameters of the first pre-training language module are fixed values, the third language module can be adjusted in parameters based on the third sample classification result and the fourth sample classification result, and the third language module can be trained based on the adjusted parameters until the third loss function meets a predetermined end condition, the training of the third language module is completed, and classification is obtained in combination with the first pre-training language module.
[0102] According to an embodiment of the present disclosure, the deep learning model can include a fourth language module, a second feature fusion module, and a second pre-training module.
[0103] According to an embodiment of the present disclosure, the classification model includes the fourth language module and the second feature fusion module obtained in a case where the model parameters of the fourth language module and the second feature fusion module are adjusted according to the output value until a predetermined end condition is met.
[0104] According to an embodiment of the present disclosure, the output value can be determined according to a first output value and a second output value. The first output value is obtained based on a fourth loss function according to a fifth sample classification result and a sample label value. The second output value is obtained based on a fifth loss function according to a sixth sample classification result and a seventh sample classification result. The fifth sample classification result is obtained according to a second expected sample feature vector and a second sample feature vector. The second expected sample feature vector is obtained by processing expected sample feature data using the second feature fusion module. The expected sample feature data is created according to the sample document data. The second sample feature vector is obtained by processing the sample document data using the fourth language module. The sixth sample classification result is obtained by processing the sample document data using the fourth language module. The seventh sample classification result is obtained by processing the sample document data using the second pre-training module.
[0105] According to an embodiment of the present disclosure, the fourth language module can be a fourth text classification module. The second feature fusion module can be a second feature fusion optimization module. The second pre-training module can be a second pre-training language module. The second pre-training language module has fixed weight parameters.
[0106] According to an embodiment of the present disclosure, the first output value can be an output value obtained by processing the sample document data based on the second feature fusion module and the fourth language module. The second output value can be an output value obtained by processing the sample document data based on the fourth language module and the second pre-training module.
[0107] According to an embodiment of the present disclosure, the fifth sample classification result can be a sample prediction classification result determined by obtaining a second expected sample feature vector based on processing the expected sample feature data based on the second feature fusion module and obtaining a second sample feature vector based on processing the sample document data based on the fourth language module. The sample label value can be a true value of the sample document data.
[0108] According to an embodiment of the present disclosure, the sixth sample classification result can be a sample prediction classification result obtained by processing the sample document data based on the fourth language module. The seventh sample classification result can be obtained by processing the sample document data based on the second pre-training language module.
[0109] According to an embodiment of the present disclosure, based on the fourth loss function, the first output value is determined according to the fifth sample classification result and the sample label value. Based on the fifth loss function, the second output value is determined according to the sixth sample classification result and the seventh sample classification result. The output value of the classification model can be determined according to the first output value and the second output value. The fourth language module and the second feature fusion module are adjusted in model parameters again according to the output value. The fourth language module and the second feature fusion module are trained again based on the adjusted model parameters. When the model parameters meet the predetermined end condition, the training of the fourth language module and the second feature fusion module is completed, and the classification model is obtained.
[0110] According to an embodiment of the present disclosure, the predetermined end condition can be that the maximum number of iterations is met, or the predetermined convergence condition is met.
[0111] The training process of the classification model according to the embodiments of the present disclosure will be further described below with reference to Figure 3A-3D
[0112] An example schematic diagram of the training process of the classification model according to an embodiment of the present disclosure is schematically shown in the case where the deep learning model includes a first language module. Figure 3A As
[0113] Figure 3A As shown in Figure 300A, the classification model 302 may include a first language module 302_1. Sample text data 301 can be input into the first language module 302_1 to obtain a first sample classification result 303. The first sample classification result 303 and sample label values 304 are input into a first loss function 305 to obtain a third output value 306. The model parameters of the first language module 302_1 can be adjusted based on the third output value 306 until a predetermined termination condition is met, thus obtaining the classification module 302.
[0114] Figure 3B The illustration shows an example diagram of the training process of a classification model according to an embodiment of the present disclosure, in the case where the deep learning model includes a second language module and a first feature fusion module.
[0115] like Figure 3B As shown in Figure 300B, the classification model 308 may include a second language module 308_1 and a first feature fusion module 308_2. Sample document data 307 can be input into the second language module 308_1 to obtain a first sample feature vector 309. Expected sample feature data 310 can be input into the first fusion module 308_2 to obtain a first predicted sample feature vector 311. Based on the first sample feature vector 309 and the first expected sample feature vector 311, a first sample fused feature vector 312 is obtained. Based on the first sample fused feature vector 312, a second sample classification result 313 is obtained. The second sample classification result 313 and the sample label value 314 are input into a second loss function 315 to obtain a fourth output value 316. The model parameters of the second language module 308_1 and the first feature fusion module 308_2 can be adjusted based on the fourth output value 316 until a predetermined termination condition is met, thus obtaining the classification module 308.
[0116] Figure 3C The illustration shows an example diagram of the training process of a classification model according to an embodiment of the present disclosure, in the case where the deep learning model includes a third language module and a first pre-training module.
[0117] like Figure 3C As shown in Figure 300C, the classification model 318 may include a third language module 318_1. Sample document data 317 can be input into the third language module 318_1 to obtain a third sample classification result 319. Sample document data 317 can be input into the first pre-training module 320 to obtain a fourth sample classification result 321. The third sample classification result 319 and the fourth sample classification result 321 can be input into a third loss function 322 to obtain a fifth output value 323. The model parameters of the third language module 318_1 can be adjusted based on the fifth output value 323 until a predetermined termination condition is met, thus obtaining the classification module 318.
[0118] Figure 3D The illustration shows an example diagram of the training process of a classification model according to an embodiment of the present disclosure, in the case where the deep learning model includes a fourth language module and a third fusion module.
[0119] like Figure 3D As shown, in 300D, the classification model 325 may include a fourth language module 325_1 and a third fusion module 325_2. Sample document data 324 can be input into the fourth language module 325_1 to obtain a second sample feature vector 326. Based on the second sample feature vector 326, a sixth sample classification result 327 can be obtained. Expected sample feature data 328 is input into the third fusion module 325_2 to obtain a second expected sample feature vector 329. Based on the second sample feature vector 326 and the second expected sample feature vector 329, a second sample fusion feature vector 330 is obtained. Based on the second sample fusion feature vector 330, a fifth sample classification result 331 is obtained. The fifth sample classification result 331 and the sample label value 332 are input into a fourth loss function 333 to obtain a first output value 334.
[0120] The sample document data 324 can be input into the second pre-training module 335 to obtain the seventh sample classification result 336. The sixth sample classification result 327 and the seventh sample classification result 336 are input into the fifth loss function 337 to obtain the second output value 338. The output value 339 can be obtained based on the first output value 334 and the second output value 338. The model parameters of the fourth language module 335_1 and the second feature fusion module 325_2 can be adjusted based on the output value 339 until the predetermined termination condition is met, thus obtaining the classification module 325.
[0121] According to embodiments of this disclosure, sample document data may include at least one of the following: sample key-value pairs and non-sample key-value pairs. Sample key-value pairs may include at least one of the following: sample key-value pairs formed by attributes and attribute values, and sample key-value pairs formed by nouns and name interpretations.
[0122] According to embodiments of this disclosure, sample document data is used to train a classification model, and the selection of sample document data for training is crucial to the model's capabilities. When selecting sample document data, the labels should be as accurate as possible to avoid the model being affected by a large amount of noisy data. The distribution of the sample document data should conform to the task objective distribution to improve data completeness and cover as many patterns as possible. Finally, sample document data of the same type should not be overly similar, i.e., data diversity should be maintained to avoid overfitting.
[0123] According to an embodiment of the present disclosure, the sample document data can include sample key-value pairs and non-sample key-value pairs. The sample key-value pairs can include sample key-value pairs formed by attributes and attribute values, i.e., "attribute-value", and sample key-value pairs formed by nouns and name explanations, i.e., "noun-explanation". In addition, the sample document data can also include non-sample key-value pairs, i.e., non-KV.
[0124] According to an embodiment of the present disclosure, when constructing the "attribute-value" type sample document data, since the task lacks labeled data and the data demand is large, automatic generation can be selected from a high-confidence data source.
[0125] According to an embodiment of the present disclosure, when constructing the "attribute-value" type sample document data, the following operations can be included.
[0126] First, the "attribute-value" type basic data is derived from the information box (infobox) of a high-frequency page view (PV) webpage. According to research, most high-frequency infoboxes are high-quality human review data, but the provider does not provide direct fields to distinguish the data boundaries of human review and strategy generation, so the overall quality is improved by PV constraints, and the quality of high-PV infoboxes is higher by default.
[0127] Second, the sample diversity is improved by improving the industry coverage of high-frequency page view webpages: based on the core set concept system, high-frequency page view webpages should cover as many and as detailed concepts as possible to improve sample diversity. Therefore, we sample based on the KgIsA label to ensure that concepts with fine granularity and small data volume have a higher probability of being retained.
[0128] Finally, since page view webpages are more like encyclopedias that describe general knowledge of social figures, works, etc., the distribution of their infobox data is biased, and does not match the expected distribution of general and industry data. Therefore, when sampling keys, we choose equal sampling to increase the coverage of low-frequency keys.
[0129] According to an embodiment of the present disclosure, when constructing the "noun-explanation" type sample document data, since the data machine labeling is difficult, whether the data is from the KV structure can not be considered, and the "noun-explanation" type sample document data can be generated based on the logical relationship.
[0130] According to an embodiment of the present disclosure, in the selection of "noun-explanation" type data sources, more preference is given to the definition and description of objects, methods and functions, rather than word explanation, character experience, etc.
[0131] According to an embodiment of the present disclosure, when constructing the "noun-explanation" type sample document data, a Wikipedia page can be selected as a data construction source, and the Wikipedia page can be filtered based on a concept system. A Wikipedia summary (i.e., bdbksummary) is an explanation of a Wikipedia title (i.e., bdbklemma title), but the summary is usually a combination of multiple texts, which does not conform to the data distribution of the KV type value basic question form. Based on this, the "noun-explanation" rule strategy mining result of the Wikipedia text on the Wikipedia entry can be selected to generate the "noun-explanation" type sample document data.
[0132] According to an embodiment of the present disclosure, the "noun-explanation" type sample document data can also be constructed based on the mining result of the key homonym Wikipedia page by memorizing the high-frequency key of the "attribute-value" type, so as to avoid model overfitting and enhance model generalization.
[0133] According to an embodiment of the present disclosure, when constructing the "non-KV" type sample document data, the non-KV type can be divided into subcategories, and a strategy can be designed for each subcategory to construct sample document data. Not only the data completeness is ensured to pass each subcategory signal to the model, but also the data diversity is ensured to avoid single mode overfitting.
[0134] For example, Table 3 schematically shows a construction scheme table of each type of sample document data.
[0135]
[0136]
[0137] Table 3
[0138] According to an embodiment of the present disclosure, after the key-value pair type and the non-key-value pair type sample document data included in the sample document data are constructed, a test set can be constructed in a general field, and the test set can be constructed by sampling 2.5% of the sample document data to detect the iteration effect of the model; the sample document data sampled by 2.5% is used as a validation set to select an optimal model, so as to realize the evaluation of the sample document data.
[0139] For example, an industry test data set of the power industry, the financial industry and the JG industry can be constructed to verify the model generalization ability. The industry test data set of the power industry and the financial industry can be derived from real business documents. For example, it can be obtained by parsing the documents in a high recall manner and manually annotating the KV type and SPO. The test data of the JG industry can be derived from Wikipedia pages.
[0140] For example, Table 4 schematically shows a statistical table of each industry test set.
[0141] Industry Data Source Document Number KV Number SPO Number diff S diff P Power Nanwang Standard Document 6 351 166 33 117 Finance Zhonghui Document 4 1381 937 329 179 JG Wiki 23 747 691 61 344
[0142] Table 4
[0143] According to an embodiment of the present disclosure, the parsing of the target document to obtain the target key-value pair can include the following operations.
[0144] The target document is divided into target sentences, and the target sentences are divided into target key-value pairs.
[0145] According to an embodiment of the present disclosure, the target document can be a paragraph text that needs to be identified by KV. The target sentence can be text that meets the sentence division strategy.
[0146] According to an embodiment of the present disclosure, the sentence division of the target document can include: performing sentence granularity division on the target document based on a basic division strategy, and determining a sentence that meets the basic division strategy and the sentence granularity division as a target sentence.
[0147] According to an embodiment of the present disclosure, the key-value pair division of the target sentence can include: performing key-value pair division on the target sentence based on a KV granularity division strategy, and determining a key-value pair that meets the KV granularity strategy as a target key-value pair.
[0148] According to an embodiment of the present disclosure, the sentence division of the target document to obtain the target sentence can include the following operations. The target document is divided into target sentences based on a sentence division delimiter.
[0149] According to an embodiment of the present disclosure, the sentence division delimiter includes a first-level sentence division delimiter and a second-level sentence division delimiter.
[0150] According to an embodiment of the present disclosure, the sentence division of the target document based on the sentence division delimiter to obtain the target sentence can include the following operations.
[0151] The target document is divided into intermediate sentences based on the first-level sentence division delimiter. In a case where it is determined that the intermediate sentences contain the second-level sentence division delimiter, the intermediate sentences are divided into target sentences.
[0152] According to an embodiment of the present disclosure, the sentence delimiter can be used to identify the position of the character separation in the sentence text.
[0153] According to an embodiment of the present disclosure, the first-level sentence division delimiter can be “.”, “!”, “!”, “?”, and “?”. The second-level sentence division delimiter can be a split text containing 0 or more than 2 colons.
[0154] According to an embodiment of the present disclosure, the target document can be divided into sentences based on a basic segmentation strategy and a sentence granularity segmentation strategy. Based on the basic segmentation strategy, before traversing the target document, a symbol stack is initialized to save left brackets during the traversal process, and the top element of the stack is removed when a matching right bracket is encountered. A character stack is initialized to save characters during the traversal process, and is added when a delimiter is encountered and the symbol stack is empty.
[0155] According to an embodiment of the present disclosure, the text characters of the target document are sequentially traversed. If a left bracket is encountered, it is added to the symbol stack. If a right bracket is encountered, the top element of the symbol stack matches, and the top element of the stack is removed. If a normal text is encountered, it is added to the character stack. If a delimiter is encountered and the symbol stack is empty, the character stack is added. Finally, the result is added to the output set as an intermediate sentence. If no right bracket is encountered, an error is reported and the program exits.
[0156] According to an embodiment of the present disclosure, when dividing the target document into sentences, special processing is performed on the matching problem of the brackets in the target document. In the case of complete matching of left and right brackets, the target document is divided into sentences, otherwise an error is reported and the program exits. Thus, the noise data introduced by the brackets is avoided to cause segmentation errors. For example, the Boeing Company (English name: Boeing) and the colon delimiter are segmented. If special processing is performed on the matching problem of the brackets, “English name” and “Boeing” are segmented. If no special processing is performed, an error segmentation result of “Boeing Company (English name” and “Boeing)” is obtained.
[0157] According to an embodiment of the present disclosure, based on the sentence granularity segmentation strategy, the basic segmentation strategy is called to divide the target document into sentences to obtain intermediate sentences. In a case where it is determined that the intermediate sentences contain a second-level sentence division delimiter, it can be judged whether the intermediate sentences contain 0 or more than 2 colons. If yes, the intermediate sentences are segmented based on the second-level sentence division delimiter to obtain target sentences.
[0158] According to an embodiment of the present disclosure, the target sentences are divided into key-value pairs to obtain target key-value pairs, which can include: dividing the target sentences into key-value pairs based on a key-value pair division delimiter to obtain target key-value pairs, wherein the key-value pair division delimiter includes a colon.
[0159] According to an embodiment of the present disclosure, the key-value pair division delimiter can be a half / whole angle colon as a delimiter.
[0160] According to an embodiment of the present disclosure, the key-value pair division separator-based key-value pair division on the target sentence can include: calling a basic segmentation strategy, segmenting the target sentence in the case of complete matching of left and right brackets, and determining that the segmented sentence text exists in the case of a half / full angle colon as a separator, performing segmentation in turn in the KV granularity, segmenting the segmented sentence text into a KV binary tuple, and determining the KV binary tuple as a target key-value pair. In addition, based on the setting of the sentence granularity segmentation strategy, it can be defaulted that at most one KV binary tuple is included in a text sentence.
[0161] According to an embodiment of the present disclosure, according to the to-be-processed document, the target document can be obtained by the following operations.
[0162] The document processing interface corresponding to the to-be-processed document is called. The to-be-processed document is processed by using the document processing interface to obtain a document interface class object. According to the document interface class object, the target document is obtained.
[0163] According to an embodiment of the present disclosure, the document processing interface is a general interface provided when a document is preprocessed.
[0164] According to an embodiment of the present disclosure, the to-be-processed document is parsed by using the document processing interface to obtain a document interface class object. The document interface class object can include a document representation class (that is, a Document class) and a document paragraph representation class (that is, a Node class).
[0165] According to an embodiment of the present disclosure, the meta empty dictionary is included in the Document class structure, so as to transparently pass the key information relied on by the subsequent module. For example, Table 5 schematically shows a document representation class structure attribute information table.
[0166] Property Name Type Definition title str Document Title Name root node Document Root Node nodes list[Node] Document Full Node List kvs list[KVpair] Document Full KV List meta dict Other Information
[0167] Table 5
[0168] According to an embodiment of the present disclosure, the Node class (in units of line feeds) is a basic element of a document tree. For example, Table 6 schematically shows a Node class structure attribute information table.
[0169]
[0170]
[0171] Table 6
[0172] According to an embodiment of the present disclosure, after the to-be-processed document is parsed and processed by using the document processing interface to obtain a document interface class object, the target document is determined based on the document interface class object.
[0173] According to an embodiment of the present disclosure, processing the to-be-processed document by using the document processing interface to obtain a document interface class object can include the following operations.
[0174] Processing the to-be-processed document by using the document processing script corresponding to the to-be-processed document to obtain the document interface class object.
[0175] According to an embodiment of the present disclosure, the to-be-processed document and the document processing script corresponding to the to-be-processed document can be input to a document preprocessing module, and the to-be-processed document is converted into an interface class object by using the document processing script to obtain the document interface class object.
[0176] According to an embodiment of the present disclosure, the document interface class object can include at least one of a Document class and a Node class. The Document class can be used to save a document object converted by the document processing interface. The Node class can be used as a basic element constituting a document tree. The process of hierarchizing the document tree can include creating a node and creating an edge. The above are all completed by the document processing script.
[0177] According to an embodiment of the present disclosure, the document processing script can return the Document class as a unified interface. The reason is that, on the one hand, the processing flow of input documents of different types and different structures can be simplified, and the user only needs to configure the hierarchical parsing script by himself and input in the form of configuration. On the other hand, the user has a high degree of freedom in the hierarchical parsing script, because the current class design includes a meta field, which can support the user to directly pass the key field to the subsequent module in the script without modifying the code.
[0178] Figure 4 A flowchart of a knowledge graph generation method according to an embodiment of the present disclosure is schematically shown.
[0179] As shown in Figure 4 , the method 400 can include operations S410-S440.
[0180] In operation S410, entity recognition is performed on a target document to obtain a target entity.
[0181] In operation S420, the key-value generation method is used to generate a key-value result.
[0182] In operation S430, a knowledge unit is generated according to the key-value result and the target entity.
[0183] In operation S440, a knowledge graph is generated according to the knowledge unit.
[0184] According to an embodiment of the present disclosure, the target entity can be an entity belonging to a key-value pair in the current document. The entity recognition on the target document can include performing entity recognition on the target document by using an entity extraction module, and outputting the target entity related to the key-value pair.
[0185] According to an embodiment of the present disclosure, the key-value result can include the target key-value pair and the target key-value pair type, and the method flow of generating the target key-value result by using the key-value pair generation method is described in detail in the above key-value generation method, which will not be repeated here.
[0186] According to an embodiment of the present disclosure, the knowledge unit can be composed of a target entity and a key-value result, and the target entity is described, limited or explained by the target key-value pair and the target key-value pair type stored in the key-value result.
[0187] According to an embodiment of the present disclosure, after obtaining the target entity and the target key-value result in the target document, the obtained key-value result and the target entity are associated by using an entity association module, the extraction of SPO is completed, and the knowledge unit is generated. In this process, one target entity can correspond to multiple key-value pairs, or each target entity can correspond to one key-value pair.
[0188] According to an embodiment of the present disclosure, the target entity is obtained by performing entity recognition on the target document. The target key-value pair and the target key-value pair type are obtained by analyzing the target document, and the key-value result is generated according to the target key-value pair and the target key-value pair type. The knowledge unit is generated according to the target entity and the key-value result, so as to obtain the knowledge graph. The key-value pair generation demand of various industries is supported by determining the key-value pair type, so as to realize the reuse on the to-be-processed documents in various industries, and the basic SPO data is output by combining the association with the target entity.
[0189] According to an embodiment of the present disclosure, the entity recognition on the target document to obtain the target entity can include the following operations.
[0190] According to the predetermined configuration information, the entity recognition region and the entity recognition strategy are determined. According to the entity recognition strategy, the entity recognition is performed on the entity recognition region of the target document to obtain the target entity.
[0191] According to an embodiment of the present disclosure, the entity extraction module can mark the entity related to the KV. Since the entity extraction cannot be generalized, the entity extraction is realized by using the predetermined configuration information, and the basic function configurations such as cache, named entity model and rule recognition are supported.
[0192] According to an embodiment of the present disclosure, the predetermined configuration information can be information for determining an entity recognition region and an entity recognition strategy. The entity recognition region can be a region for target entity recognition of the target document. The entity recognition strategy can be a strategy for target entity recognition of the target document.
[0193] According to an embodiment of the present disclosure, based on the entity recognition strategy, the target entity recognition region of the target document is subjected to entity recognition, to obtain a target entity of the target entity recognition region in the target document.
[0194] According to an embodiment of the present disclosure, the entity recognition strategy can include at least one of a named entity recognition strategy, a rule recognition strategy, and a blacklist recognition strategy.
[0195] According to an embodiment of the present disclosure, entity recognition on an industry document generally relies on a NER (Named Entity Recognition) model trained based on an industry corpus. The named entity recognition strategy can include a named entity recognition action region and a named entity recognition interface address. In addition, in some entity recognition tasks, entities are derived from artificially annotated results, and therefore, a cache configuration can be set, which can include a cache action region and a cache file address. For example, Table 7 schematically shows configuration items of the named entity recognition strategy.
[0196]
[0197] Table 7
[0198] According to an embodiment of the present disclosure, compared with the NER interface or the cache of artificial annotation, both of which require a process of accumulation of a large amount of industry data, manual annotation, or training, and are not suitable for an industry cold start stage, the rule recognition strategy can support rapid data output and correction through configuration of a matching rule, and can be adapted to the industry cold start stage. For example, Table 8 schematically shows configuration items of the rule recognition strategy.
[0199]
[0200] Table 8
[0201] According to an embodiment of the present disclosure, the blacklist recognition strategy can support deletion of an error entity or an error category entity through configuration of a regular expression rule, to increase entity recognition accuracy. For example, Table 9 schematically shows configuration items of the blacklist recognition strategy.
[0202]
[0203] Table 9
[0204] According to an embodiment of the present disclosure, based on the key-value result and the target entity, a knowledge unit is generated, which can include the following operations.
[0205] In a case where it is determined that the target key-value pair type is the expected key-value pair type, the target key-value pair and the target entity are associated based on a predetermined association order and a position of the target entity in the target document, to obtain a knowledge unit.
[0206] According to an embodiment of the present disclosure, the expected key-value pair type can be a key-value pair type associated with the target entity. The predetermined association order can be an order in which the target key-value pair and the target entity are associated according to the position of the target entity in the target document. For example, the position can include a sentence, a paragraph title, a chapter title, and the like. The position has an association priority corresponding to the position.
[0207] According to an embodiment of the present disclosure, associating the target key-value pair and the target entity can include: associating the target key-value pair and the target entity through an entity association strategy. The entity association strategy supports association order configuration. For example, Table 10 schematically shows a configuration item of the entity association strategy.
[0208]
[0209] Table 10
[0210] According to an embodiment of the present disclosure, a configuration example of a JG industry can be taken as an example: in terms of NER configuration, since the JG industry does not deploy an NER service, the NER result is read through offline caching; to supplement the NER missed entity, two precise matching rules of the title (i.e., theme) area are set for entity extraction; to solve the NER accuracy problem, the identification rule of removing the bk (i.e., encyclopedia) prefix is set for the value (i.e., value) area, and the rule of excluding time, troops, and xx type is set for the type area. In the entity association stage, the priorities from low to high are document title, title level, and user-specified area.
[0211] According to an embodiment of the present disclosure, a configuration example of a power industry can be taken as an example: in terms of NER configuration, the NER result is obtained through an api interface call; to supplement the NER missed entity, precise matching and suffix matching methods for the document title and the title level are set; in the entity association stage, the priorities from low to high are document title, title level, and user-specified area.
[0212] Figure 5 An example schematic diagram of generating a knowledge graph according to an embodiment of the present disclosure is schematically shown.
[0213] As Figure 5As shown in the schematic diagram 500, the document processing script 501 processes the document to be processed 502 to obtain the target document 503. The target document 503 is parsed to obtain target key-value pairs 504. Based on the target key-value pairs 504, the target key-value pair type 505 is determined. Based on the target key-value pairs 504 and the target key-value pair type 505, the key-value result 506 is determined. Entity recognition is performed on the target document 503 to obtain the target entity 507. Based on the key-value result 506 and the target entity 507, a knowledge unit 508 is generated. Based on the knowledge unit 508, a knowledge graph 509 is generated.
[0214] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0215] The above are merely exemplary embodiments, but are not limited thereto. Other key-value generation methods and knowledge graph generation methods known in the art may also be included, as long as they can improve the clarity of the extracted target, industry reusability, and development efficiency.
[0216] Figure 6 A block diagram of a key-value generation apparatus according to an embodiment of the present disclosure is shown schematically.
[0217] like Figure 6 As shown, the key value generation device 600 may include a first acquisition module 610, a parsing module 620, a determining module 630, and a second acquisition module 640.
[0218] The first acquisition module 610 is used to obtain the target document based on the document to be processed.
[0219] Parsing module 620 is used to parse the target document and obtain the target key-value pairs.
[0220] The determination module 630 is used to determine the type of the target key-value pair based on the target key-value pair.
[0221] The second acquisition module 640 is used to obtain key-value results for the document to be processed based on the target key-value pair and the target key-value pair type.
[0222] According to embodiments of this disclosure, the determining module 630 may include an extraction submodule and a first determining submodule.
[0223] The extraction submodule is used to extract features from the target key-value pairs to obtain the feature vector of the target key-value pairs.
[0224] The first determination submodule is used to determine the type of the target key-value pair based on the feature vector of the target key-value pair.
[0225] According to an embodiment of the present disclosure, the extraction submodule can include an object encoding unit, a position encoding unit, a segment encoding unit, and an acquisition unit.
[0226] The object encoding unit is configured to perform object encoding on the object in the target key-value pair to obtain a target object feature vector.
[0227] The position encoding unit is configured to perform position encoding on the target key-value pair to obtain a target position feature vector.
[0228] The segment encoding unit is configured to perform segment encoding on the target key-value pair to obtain a target segment feature vector.
[0229] The acquisition unit is configured to obtain a target key-value pair feature vector according to the target object feature vector, the target position feature vector, and the target segment feature vector.
[0230] According to an embodiment of the present disclosure, the first determination submodule can include a creation unit, an extraction unit, and a determination unit.
[0231] The creation unit is configured to create expected feature data according to the target key-value pair.
[0232] The extraction unit is configured to perform feature extraction on the expected feature data to obtain an expected feature vector.
[0233] The determination unit is configured to determine the target key-value pair type according to the target key-value pair feature vector and the expected feature vector.
[0234] According to an embodiment of the present disclosure, the extraction unit can include a dense encoding subunit and a decomposition subunit.
[0235] The dense encoding subunit is configured to perform dense encoding on the expected feature data to obtain a dense feature vector.
[0236] The decomposition subunit is configured to perform factor decomposition on the dense feature vector to obtain the expected feature vector.
[0237] According to an embodiment of the present disclosure, the determination module 630 can include a first processing submodule.
[0238] The first processing submodule is configured to process the target key-value pair by using a classification model to obtain the target key-value pair type. The classification model is obtained by training a deep learning model by using sample document data.
[0239] According to an embodiment of the present disclosure, the deep learning model includes a first language module.
[0240] According to an embodiment of the present disclosure, the classification model is obtained by training the first language module based on a first loss function according to a first sample classification result and a sample label value. The first sample classification result is obtained by processing sample document data by using the first language module.
[0241] According to an embodiment of the present disclosure, the deep learning model comprises a second language module and a first feature fusion module.
[0242] According to an embodiment of the present disclosure, the classification model is obtained by training the second language module and the first feature fusion module based on a second loss function according to a second sample classification result and a sample label value. The second sample classification result is obtained according to a first expected sample feature vector and a first sample feature vector. The first expected sample feature vector is obtained by processing expected sample feature data by using the first feature fusion module. The expected sample feature data is created according to sample document data. The expected sample feature data comprises feature data of at least one of object granularity, part-of-speech granularity and word class granularity. The first sample feature vector is obtained by processing the sample document data by using the second language module.
[0243] According to an embodiment of the present disclosure, the deep learning model comprises a third language module and a first pre-training module.
[0244] According to an embodiment of the present disclosure, the classification model is obtained by training the third language module based on a third loss function according to a third sample classification result and a fourth sample classification result. The third sample classification result is obtained by processing sample document data by using the third language module. The fourth sample classification result is obtained by processing the sample document data by using the first pre-training module.
[0245] According to an embodiment of the present disclosure, the deep learning model comprises a fourth language module, a second feature fusion module and a second pre-training module.
[0246] According to an embodiment of the present disclosure, the classification model comprises the fourth language module and the second feature fusion module obtained in a case where model parameters of the fourth language module and the second feature fusion module are adjusted according to an output value until a predetermined end condition is satisfied.
[0247] According to an embodiment of the present disclosure, the output value is determined according to a first output value and a second output value. The first output value is obtained according to a fifth sample classification result and a sample label value based on a second fourth loss function. The second output value is obtained according to a sixth sample classification result and a seventh sample classification result based on a third fifth loss function. The fifth sample classification result is obtained according to a second expected sample feature vector and a second sample feature vector. The second expected sample feature vector is obtained by processing expected sample feature data by using a second feature fusion module. The expected sample feature data is created according to sample document data. The second sample feature vector is obtained by processing the sample document data by using a fourth language module. The sixth sample classification result is obtained by processing the sample document data by using the fourth language module. The seventh sample classification result is obtained by processing the sample document data by using a second pre-training module.
[0248] According to an embodiment of the present disclosure, the sample document data comprises at least one of a sample key-value pair and a non-sample key-value pair. The sample key-value pair comprises at least one of a sample key-value pair formed by an attribute and an attribute value and a sample key-value pair formed by a noun and a name explanation.
[0249] According to an embodiment of the present disclosure, the parsing module 620 can comprise a first division sub-module and a second division sub-module.
[0250] The first division sub-module is configured to perform sentence division on the target document to obtain a target sentence.
[0251] The second division sub-module is configured to perform key-value pair division on the target sentence to obtain a target key-value pair.
[0252] According to an embodiment of the present disclosure, the first division sub-module can comprise a first division unit.
[0253] The first division unit is configured to perform sentence division on the target document based on a sentence division delimiter to obtain a target sentence.
[0254] According to an embodiment of the present disclosure, the sentence division delimiter comprises a first-level sentence division delimiter and a second-level sentence division delimiter.
[0255] According to an embodiment of the present disclosure, the division unit can comprise a first division sub-unit and a second division sub-unit.
[0256] The first division sub-unit is configured to perform sentence division on the target document based on the first-level sentence division delimiter to obtain an intermediate sentence.
[0257] The second division sub-unit is configured to perform sentence division on the intermediate sentence to obtain a target sentence in a case where it is determined that the second-level sentence division delimiter exists in the intermediate sentence.
[0258] According to embodiments of this disclosure, the second partitioning submodule may include a second partitioning unit.
[0259] The second partitioning unit is used to partition the target statement into key-value pairs based on the key-value pair partitioning delimiter, thus obtaining the target key-value pairs. The key-value pair partitioning delimiter includes a colon.
[0260] According to embodiments of this disclosure, the first acquisition module 610 may include a calling submodule, a second processing submodule, and an acquisition submodule.
[0261] Call the submodule to invoke the document processing interface corresponding to the document to be processed.
[0262] The second processing submodule is used to process the document to be processed using the document processing interface to obtain a document interface class object.
[0263] The `get` submodule is used to obtain the target document based on the document interface class object.
[0264] According to embodiments of this disclosure, the second processing submodule may include a processing unit.
[0265] The processing unit is used to process the document to be processed using the document processing script corresponding to the document to be processed, and obtain a document interface class object.
[0266] Figure 7 A block diagram of a knowledge graph generation apparatus according to an embodiment of the present disclosure is shown schematically.
[0267] like Figure 7 As shown, the knowledge graph generation device 700 may include an entity recognition module 710, a first generation module 720, a second generation module 730, and a third generation module 740.
[0268] The entity recognition module 710 performs entity recognition on the target document to obtain the target entity.
[0269] The first generation module 720 is used by the aforementioned key-value generation device to generate key-value results.
[0270] The second generation module 730 is used to generate knowledge units based on the key-value results and the target entity.
[0271] The third generation module 740 is used to generate a knowledge graph based on knowledge units.
[0272] According to embodiments of this disclosure, the entity recognition module 710 may include a second determining submodule and an identification submodule.
[0273] The second determination submodule is used to determine the entity recognition area and entity recognition strategy based on the pre-defined configuration information.
[0274] The identifying sub-module is configured to perform entity identification on the entity identification region of the target document according to an entity identification strategy, to obtain a target entity.
[0275] According to an embodiment of the present disclosure, the entity identification strategy comprises at least one of the following: a named entity identification strategy, a rule identification strategy, and a blacklist identification strategy.
[0276] According to an embodiment of the present disclosure, the key-value result comprises a target key-value pair and a target key-value pair type.
[0277] According to an embodiment of the present disclosure, the second generating module 730 can comprise an associating sub-module.
[0278] The associating sub-module is configured to, in a case where it is determined that the target key-value pair type is an expected key-value pair type, associate the target key-value pair and the target entity based on a predetermined association order and a position of the target entity in the target document, to obtain a knowledge unit.
[0279] According to an embodiment of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium, and a computer program product.
[0280] According to an embodiment of the present disclosure, an electronic device comprises at least one processor, and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method as described above.
[0281] According to an embodiment of the present disclosure, a non-transitory computer readable storage medium stores computer instructions, wherein the computer instructions are used to enable a computer to perform the method as described above.
[0282] According to an embodiment of the present disclosure, a computer program product comprises a computer program, and the computer program, when executed by a processor, implements the method as described above.
[0283] Figure 8 A block diagram schematically illustrates an electronic device suitable for implementing the key-value generation method and the knowledge graph generation method according to an embodiment of the present disclosure. The electronic device is intended to represent a variety of forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent a variety of forms of mobile devices, such as personal digital assistants, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present disclosure described and / or claimed in this document.
[0284] As Figure 8As shown, the device 800 includes a computing unit 801 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. Various programs and data required for the operation of the device 800 can also be stored in the RAM 803. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0285] A plurality of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0286] The computing unit 801 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 801 performs various methods and processes described above, such as the key-value generation method and the knowledge graph generation method. For example, in some embodiments, the key-value generation method and the knowledge graph generation method can be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the key-value generation method and the knowledge graph generation method described above can be performed. Alternatively, in other embodiments, the computing unit 801 can be configured to perform the key-value generation method and the knowledge graph generation method by any other appropriate means, such as by means of firmware.
[0287] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0288] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, partially on a machine and partially on a remote machine or entirely on a remote machine or server.
[0289] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0290] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0291] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0292] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server is generally established by computer programs running on the respective computers and having a client-server relationship to each other. The servers can be cloud servers, servers of distributed systems, or servers combined with blockchains.
[0293] It should be understood that various forms of flow shown above can be used, with steps reordered, added, or removed. For example, the steps recited in the present disclosure can be performed in parallel, in series, or in a different order, without limitation, as long as the desired results of the technology disclosed in the present disclosure are achieved.
[0294] The specific embodiments described above are not intended to limit the scope of the present disclosure. Those skilled in the art will understand that various modifications, combinations, sub-combinations, and alternatives can be made to the specific embodiments without departing from the spirit and principles of the present disclosure. Any further modifications, equivalent substitutions, improvements, and the like, either presently known or later developed, that do not depart from the spirit and principles of the present disclosure are to be encompassed within the scope of the present disclosure.
Claims
1. A key-value generation method, comprising: obtaining a target document according to a document to be processed; parsing the target document to obtain a target key-value pair; determining a target key-value pair type according to the target key-value pair; and obtaining a key-value result for the document to be processed according to the target key-value pair and the target key-value pair type, wherein the determining of the target key-value pair type according to the target key-value pair comprises: extracting features of the target key-value pair to obtain a target key-value pair feature vector; and determining the target key-value pair type according to the target key-value pair feature vector, wherein the extracting of the features of the target key-value pair to obtain the target key-value pair feature vector comprises: object encoding of an object in the target key-value pair to obtain a target object feature vector; position encoding of the target key-value pair to obtain a target position feature vector; fragment encoding of the target key-value pair to obtain a target fragment feature vector; and obtaining the target key-value pair feature vector according to the target object feature vector, the target position feature vector, and the target fragment feature vector, and wherein the determining of the target key-value pair type according to the target key-value pair feature vector comprises: creating expected feature data according to a feature category extracted from the target key-value pair and according to a plurality of dimensions of recognition rules of each feature category, wherein the feature category includes object granularity, word class granularity, and word type granularity; extracting features of the expected feature data to obtain an expected feature vector; and determining the target key-value pair type according to the target key-value pair feature vector and the expected feature vector. The extracting of the features of the expected feature data to obtain the expected feature vector comprises:
2. The method of claim 1, wherein, dense coding of the expected feature data to obtain a dense feature vector; and factor decomposition of the dense feature vector to obtain the expected feature vector. The determining of the target key-value pair type according to the target key-value pair comprises:
3. The method of claim 1, wherein, processing the target key-value pair by using a classification model to obtain the target key-value pair type, wherein the classification model is obtained by training a deep learning model using sample document data. The deep learning model comprises a first language module; 4. The method of claim 3, wherein, The classification model is obtained by training the first language module based on a first loss function according to a first sample classification result and a sample label value; The first sample classification result is obtained by processing the sample document data using the first language module. The deep learning model comprises a second language module and a first feature fusion module; 5. The method of claim 3, wherein, The classification model is obtained by training the second language module and the first feature fusion module based on a second loss function according to a second sample classification result and a sample label value; The second sample classification result is obtained according to a first expected sample feature vector and a first sample feature vector; The first expected sample feature vector is obtained by processing the expected sample feature data by using the first feature fusion module, the expected sample feature data is created according to the sample document data, and the expected sample feature data includes feature data of at least one of object granularity, part-of-speech granularity, and part-of-speech granularity; The first sample feature vector is obtained by processing the sample document data by using the second language module.
6. The method of claim 3, wherein, The deep learning model includes a third language module and a first pre-training module; The classification model is obtained by training the third language module based on a third loss function according to a third sample classification result and a fourth sample classification result; The third sample classification result is obtained by processing the sample document data by using the third language module; The fourth sample classification result is obtained by processing the sample document data by using the first pre-training module.
7. The method of claim 3, wherein, The deep learning model includes a fourth language module, a second feature fusion module, and a second pre-training module; The classification model includes a fourth language module and a second feature fusion module obtained under the condition that the model parameters of the fourth language module and the second feature fusion module are adjusted according to an output value until a predetermined end condition is met; The output value is determined according to a first output value and a second output value; The first output value is obtained based on a fourth loss function according to a fifth sample classification result and a sample label value; The second output value is obtained based on a fifth loss function according to a sixth sample classification result and a seventh sample classification result; The fifth sample classification result is obtained according to a second expected sample feature vector and a second sample feature vector; The second expected sample feature vector is obtained by processing the expected sample feature data by using the second feature fusion module, and the expected sample feature data is created according to the sample document data; The second sample feature vector is obtained by processing the sample document data by using the fourth language module; The sixth sample classification result is obtained by processing the sample document data by using the fourth language module; The seventh sample classification result is obtained by processing the sample document data by using the second pre-training module.
8. The method of any one of claims 3-7, wherein, The sample document data includes at least one of a sample key-value pair and a non-sample key-value pair, and the sample key-value pair includes at least one of a sample key-value pair formed by an attribute and an attribute value and a sample key-value pair formed by a noun and a name explanation.
9. The method of any one of claims 1-8, wherein, The target document is parsed to obtain a target key-value pair, including: The target document is divided into target sentences; and The target sentences are divided into key-value pairs to obtain the target key-value pairs.
10. The method of claim 9, wherein, The target document is divided into target sentences, including: The target document is divided into target sentences based on a sentence division separator.
11. The method of claim 10, wherein, The sentence division separator includes a first-level sentence division separator and a second-level sentence division separator; The target document is divided into target sentences based on a sentence division separator, including: performing sentence segmentation on the target document based on the first-level sentence segmentation delimiter, to obtain an intermediate sentence; and in a case where it is determined that the second-level sentence segmentation delimiter exists in the intermediate sentence, performing sentence segmentation on the intermediate sentence, to obtain the target sentence.
12. The method of any one of claims 9-11, wherein, The performing key-value pair segmentation on the target sentence to obtain the target key-value pair comprises: performing key-value pair segmentation on the target sentence based on a key-value pair segmentation delimiter, to obtain the target key-value pair, wherein the key-value pair segmentation delimiter comprises a colon.
13. The method of any one of claims 1-11, wherein, The obtaining the target document from the to-be-processed document comprises: calling a document processing interface corresponding to the to-be-processed document; processing the to-be-processed document by using the document processing interface, to obtain a document interface class object; and obtaining the target document according to the document interface class object.
14. The method of claim 13, wherein, The processing the to-be-processed document by using the document processing interface to obtain a document interface class object comprises: processing the to-be-processed document by using a document processing script corresponding to the to-be-processed document, to obtain the document interface class object.
15. A knowledge graph generation method, comprising: performing entity recognition on a target document to obtain a target entity; generating a key-value result by using any one of the methods in claims 1-14; generating a knowledge unit according to the key-value result and the target entity; and generating a knowledge graph according to the knowledge unit. The performing entity recognition on a target document to obtain a target entity comprises:
16. The method of claim 15, wherein, determining an entity recognition region and an entity recognition strategy according to predetermined configuration information; and performing entity recognition on the entity recognition region of the target document according to the entity recognition strategy, to obtain the target entity. The entity recognition strategy comprises at least one of the following: a named entity recognition strategy, a rule recognition strategy, and a blacklist recognition strategy.
17. The method of claim 16, wherein, The key-value result comprises a target key-value pair and a target key-value pair type.
18. The method of any one of claims 15-17, wherein, In a case where it is determined that the target key-value pair type is an expected key-value pair type, the knowledge unit is obtained by associating the target key-value pair and the target entity based on a predetermined association order and a position of the target entity in the target document.
19. A key-value generation apparatus, comprising: a first obtaining module configured to obtain a target document from a to-be-processed document; a parsing module configured to parse the target document to obtain a target key-value pair; a determining module configured to determine a target key-value pair type according to the target key-value pair; and a second obtaining module configured to obtain a key-value result for the to-be-processed document according to the target key-value pair and the target key-value pair type, wherein the determining module comprises an extracting submodule configured to perform feature extraction on the target key-value pair to obtain a target key-value pair feature vector, and a first determining submodule configured to determine the target key-value pair type according to the target key-value pair feature vector, The extraction submodule includes: an object encoding unit configured to perform object encoding on an object in the target key-value pair to obtain a target object feature vector; a position encoding unit configured to perform position encoding on the target key-value pair to obtain a target position feature vector; a segment encoding unit configured to perform segment encoding on the target key-value pair to obtain a target segment feature vector; and an obtaining unit configured to obtain the target key-value pair feature vector according to the target object feature vector, the target position feature vector, and the target segment feature vector, and The first determination submodule includes: a creating unit configured to create expected feature data according to a feature category extracted from the target key-value pair and according to identification rules of multiple dimensions of each feature category, wherein the feature category includes object granularity, word class granularity, and word type granularity; an extraction unit configured to perform feature extraction on the expected feature data to obtain an expected feature vector; and a determination unit configured to determine the target key-value pair type according to the target key-value pair feature vector and the expected feature vector.
20. A knowledge graph generation apparatus, comprising: an entity recognition module configured to perform entity recognition on a target document to obtain a target entity; a first generation module configured to generate a key-value result by using the apparatus according to claim 19; a second generation module configured to generate a knowledge unit according to the key-value result and the target entity; and a third generation module configured to generate a knowledge graph according to the knowledge unit.
21. An electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-18. The computer instructions are used to enable the computer to perform the method of any one of claims 1-18.
22. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, 23. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1-18.
Citation Information
Patent Citations
A pathological picture classification device and method based on GAN and transfer learning
CN109711426A
Text classification method and device, storage medium and equipment
CN111444709A
Text classification method and device, electronic equipment and readable storage medium
CN113505227A
Knowledge unit extraction method and device, equipment and medium
CN114265942A