Construction of task relevant knowledge graphs
The method of triple distillation in knowledge graph construction addresses the challenge of irrelevant data overload by iteratively masking and scoring natural language text to output only relevant triples, enhancing the efficiency of task-specific knowledge extraction and processing.
Patent Information
- Application Number
- PCT/IB2023/057062
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-20
- Filing Date
- 2023-07-10
- Publication Date
- 2024-10-24
AI Technical Summary
Existing knowledge graph construction pipelines struggle to exclude irrelevant information and rate the relevance of extracted triples, leading to overloading of humans and machines with unnecessary data, which hampers efficient task-specific knowledge extraction and processing.
A computer-implemented method for generating task-relevant knowledge graphs through triple distillation, which iteratively masks, scores, and computes importance scores for natural language text data to selectively output only relevant triples, thereby filtering out irrelevant information and providing an explainable representation of the reasoning process.
This approach enables efficient extraction and filtering of relevant knowledge, reducing the burden on humans and machines by focusing on task-specific information, improving existing pipelines by providing a mechanism to rate the importance of extracted triples and preventing hallucinations, thus enhancing data processing and synthesis efficiency.
Smart Images

Figure IB2023057062_24102024_PF_FP_ABST
Abstract
Description
CONSTRUCTION OF TASK RELEVANT KNOWLEDGE GRAPHSCROSS-REFERENCE TO RELATED APPLICATIONS
[0001] Priority is claimed to U.S. Patent Application No. 63 / 460,660, filed on April 20, 2023, the entire disclosure of which is hereby incorporated by reference herein.FIELD
[0002] The present disclosure relates to method, system and computer-readable medium for constructing task relevant knowledge graphs.BACKGROUND
[0003] Improving or fixing existing pipelines for specific tasks (e.g., vaccine design, material synthesis, and the like) can be challenging. Typically, this involves a lot of iterations of trial and error on the process, which can be time and resource consuming. The research community tries to accelerate this process by sharing findings and theories made along the experience with a certain task (e.g., vaccine design or material synthesis). The difficulty is associated with extraction of relevant knowledge over a vast amount of information, which can make it difficult if not impossible for an expert to keep up to date with all the published improvements that are applicable to the task.SUMMARY
[0004] Embodiments of the present disclosure provide a computer-implemented method for generating task-relevant knowledge graphs from natural language text data. The method includes performing triple distillation to generate a first distilled knowledge graph (KG) based on a first set of raw text and a first set of extractions. Performing triple distillation includes iteratively performing the following steps until a stop criteria is satisfied: mask the first set of raw text according to the first set of extractions to generate masked text such that each piece of text in the first set of raw text corresponding to the first set of extractions is masked or removed; score the masked text to generate masked-text scores, each of the masked-text scores indicating how related corresponding text of the mask text is for a predefined task; score the first set of raw text to generate raw-text scores, each of the raw-text scores indicating how related corresponding text of the first set of raw text is for the predefined task; compute importance scores for the first set of extractions based on the raw-text scores and the masked-text scores; select a subset of the first set of extractions to subsequently use as the first set of extractions based on the computed importance scores; and evaluate the stop criteria; and based on determining that the stop criteria is satisfied, outputting the first set of extractions as the set of extractions for the first distilled KG. The natural language text data includes the first set of raw text. The first set of extractions includes triples or n-ary extractions extracted from the first set ofraw text. The present invention can be used in a variety of applications including, but not limited to, several anticipated use cases in drug development, material synthesis, inventory of items, detection of suspects from textual messages, and medical / healthcare.BRIEF DESCRIPTION OF THE DRAWINGS
[0005] Embodiments of the present disclosure will be described in even greater detail below based on the exemplary figures. The present disclosure is not limited to the exemplary embodiments. All features described and / or illustrated herein can be used alone or combined in different combinations in embodiments of the present disclosure. The features and advantages of various embodiments of the present disclosure will become apparent by reading the following detailed description with reference to the attached drawings which illustrate the following:
[0006] FIG. 1 illustrates a method of improving an existing process for a target task using one or more machine learning models, according to an embodiment of the present disclosure.
[0007] FIG. 2 illustrates a distillation module and a method for generating a distilled knowledge graph (KG) according to an embodiment of the present disclosure; and
[0008] FIG. 3 illustrates a processing system configured according to an embodiment of the present disclosure.DETAILED DESCRIPTION
[0009] An aspect of the present disclosure provides a method for automatically extracting relevant knowledge from text data (e.g., scientific literature) in the form of a knowledge graph (KG). The method includes computing the relevance of the collected knowledge and keeping only that knowledge that is sufficiently relevant — the process that executes this function is referred to herein as distillation.
[0010] The present invention can be used in a variety of applications including, but not limited to, several anticipated use cases in drug development, material synthesis, inventory of items, detection of suspects from textual messages, and medical / healthcare.
[0011] Embodiments of the present disclosure provide an improved machine learning model that receives natural language text data as input (e.g., scientific articles) and outputs an automatically constructed and explainable knowledge graph. The knowledge graph includes triples in the (subject, relation, object)-triple format (or n-ary extractions). The knowledge graph can also include the relative importance of the triples with respect to a given task. Aspects of the present disclosure provide a “triple distillation” mechanism that automatically computes the relevance of the triples generated by an information extractor and keeps only the (sufficiently) relevant triples. Furthermore, the triple distillation mechanism can also be used as an explainer that shows what information is important for a given input document. Machine learning models implemented according to aspects of the present disclosure provide substantial improvementsover the current state of the art at least because current knowledge graph construction pipelines are incapable of excluding irrelevant information in their knowledge graphs and have no mechanism to rate the relevance of the extracted triples, while the embodiments of the present disclosure are able to provide these features.
[0012] Embodiments of the present disclosure thus provide an automatic information distillation framework that can automatically extract and filter relevant triples from unstructured sources (e.g., text) with the aim of improving existing pipelines for a given task by completing them with the knowledge in the literature. Advantageously, aspects of the present disclosure enable filtering out triples so as to not overload humans or machines with irrelevant information. Humans are not able to synthesize or even go through vast amounts of information, and existing machine-learning or graphical models tend to overfit when presented with too many features (e.g., too many triples) and two little ground truth (e.g. the correct catalyzer for a particular chemical reaction).
[0013] Aspects of the present disclosure provide a framework with a triple distillation module. The triple distillation module can be considered as an explainability module, which can highlight the relevant tokens in an input text that correspond to an extracted triple. Tokens can be words (or characters). A word can be considered relevant if removal of the word changes the text classification score significantly. Classification can depend on the entire input text (including next sentences). So there can be several relevant tokens in the input text. Thus, the triple distillation module can act as a counter-factual explainer.
[0014] The field of explainable text classification has been little studied. One known approach is to, for a given input text, train a generative model alongside a classifier to generate explanations. See, e.g., Hui Liu et al., “Towards Explainable NLP: A Generative Explanation Framework for Text Classification,” Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics (2019) (the entire contents of which are hereby incorporated by reference herein). The difficulty with such an approach is that the generative model needs to be designed in addition to the classifier, and the training loss must be adapted so that the generative model can be trained. This bears the risk that the generative model itself becomes a challenging design part. Moreover, generating explanations by a model can lead to the problem that the model may “hallucinate” such that explanations that are not present in the input text are generated. Embodiments of the present disclosure provide a machine learning model that can overcome these issues. In such a model, explanations are naturally extracted from the initial triples by a masking-scoring procedure, which is part of the model’s classification process.
[0015] Instead of creating explanations during interference as part of a model architecture (e.g., like in the aforementioned approaches), there have been attempts to create explanationspost-hoc. For instance, saliency methods such as occlusion maps, and rule extraction have been used. See, e.g., Pepa Atanasova et al., “A Diagnostic Study of Explainability Techniques for Text Classification,” Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP) (2020) (“Atanasova”); and Adam Kovacs et al, “POTATO: explainable information exTrAcTion framework,” CIKM '22: Proceedings of the 31st ACM International Conference on Information & Knowledge Management (2022) (“Kovacs”) (the entire contents of each of which are hereby incorporated by reference herein). The known rule extraction concept (see Kovacs) uses simple machine learning methods, like decision trees, that allow the extraction of rules. Such simple machine learning methods limit the degrees of freedom to create an appropriate classification model, as they may require manual and good feature engineering to reach high classification scores for complex tasks. In the models implemented according to aspects of the present disclosure, the feature engineering is performed by a deep neural network that is trained end-to-end so that task dependent features are extracted.
[0016] Aspects of the present disclosure include a masking approach to create explanations. The masking approach is inspired by the concept of occlusion maps, which has been used to explain text classifiers (see Atanasova). However, compared to the existing occlusion approach, which is a post-hoc explanation method (that is, explanations are generated separately to the model), the masking concept according to embodiments of the present disclosure is part of the model pipeline. This has the advantage that the generated explanations are faithful to the input text (e.g., showing the true reasoning process of the model), which is not necessarily true for post-hoc explanations (e.g., some extracted explanations can be incorrect for the predicted class). See, e.g., Julius Adebayo et al., “Sanity Checks for Saliency Maps,” 32nd Conference on Neural Information Processing Systems (NeurlPS 2018) (2018) (the entire contents of which is hereby incorporated by reference herein).
[0017] According to a first aspect of the present disclosure, a machine learning model and method is provided for executing a pipeline to generate a knowledge graph from an unrefined process description. The pipeline may include an initialization (training) pipeline, and an inference pipeline.
[0018] According to a first implementation of the first aspect of the present disclosure, the initialization (training) pipeline includes the following steps: labeling a collection of text documents with a certain class (e.g., automatically labelled by a text classifier); running a text preprocessing pipeline (optional); running an information extractor on text data that extracts triples from natural language text data;given the collection of text documents and a set of extractions, executing the following triple distillation steps: executing a text masker to mask the text according to the extractions; running a text scorer on the masked text; running a text scorer on unmasked (original) text; computing the triples’ importances; running a triple selector; and outputting the selected triples; and / or running knowledge graph completion algorithm (optional).
[0019] According to a second implementation of the first aspect of the present disclosure, the inference pipeline includes the following steps: receiving as an input an unrefined process description; running a text preprocessing pipeline (optional); running an information extractor on the data that extracts triples from natural language text data; running the trained triple distillation module; running a knowledge graph differentiator between the distilled knowledge graph from the initialization pipeline and the distilled knowledge graph from the inference pipeline; and / or transforming the resulting knowledge graph to text (optional).
[0020] According to a second aspect of the present disclosure, a triple distillation module includes: a text masker, a text scorer, and a triple importance module that computes the contribution of each triple for the given task. The triple distillation module further comprises an iterative triple selector that iteratively learns to distillate the relevant triples for the given task.
[0021] According to a third aspect of the present disclosure, a system is provided including at least one processor configured to perform at least one of the methods implemented according to aspects of the present disclosure. According to a fourth aspect of the present disclosure, a non-transitory computer readable medium is provided, which stores instructions, that when executed by a computer, cause one or more of the methods implemented according to aspects of the present disclosure to be executed.
[0022] According to a fifth aspect of the present disclosure, a computer-implemented method for generating task-relevant knowledge graphs from natural language text data is provided. This method includes: performing triple distillation to generate a first distilled knowledge graph (KG) based on a first set of raw text and a first set of extractions. Performing triple distillation includes iteratively performing the following steps until a stop criteria issatisfied: mask the first set of raw text according to the first set of extractions to generate masked text such that each piece of text in the first set of raw text corresponding to the first set of extractions is masked or removed; score the masked text to generate masked-text scores, each of the masked-text scores indicating how related corresponding text of the mask text is for a predefined task; score the first set of raw text to generate raw-text scores, each of the raw-text scores indicating how related corresponding text of the first set of raw text is for the predefined task; compute importance scores for the first set of extractions based on the raw-text scores and the masked-text scores; select a subset of the first set of extractions to subsequently use as the first set of extractions based on the computed importance scores; and evaluate the stop criteria. The method further includes, based on determining that the stop criteria is satisfied, outputting the first set of extractions as the set of extractions for the first distilled KG. The natural language text data includes the first set of raw text. The first set of extractions includes triples or n-ary extractions extracted from the first set of raw text.
[0023] According to a first implementation of the method of the fifth aspect of the present disclosure, the first set of raw text includes unrefined process description for the predefined task. The natural language text data further includes a second set of raw text comprising a collection of text documents. A second set of extractions includes triples or n-ary extraction extracted from the second set of raw text. The method further includes: performing triple distillation to generate a second distilled knowledge graph (KG) based on the second set of raw text and the second set of extractions; and generating a process-refined knowledge graph (KG) by comparing the first subset of extractions corresponding to the first distilled KG with the second subset of extractions corresponding to the second distilled KG. The process-refined KG includes extractions that indicate steps that are missing in the unrefined process or steps in the unrefined process that are incorrect.
[0024] According to a second implementation, the method of the fifth aspect according to any of the above implementations further includes, prior to performing triple distillation to generate the second distilled KG, extracting the second set of extractions from the second set of raw text by converting the second set of raw text to the triples of the n-ary extractions.
[0025] According to a third implementation, the method of the fifth aspect according to any of the above implementations further includes, before generating the process-refined knowledge graph, executing a knowledge base completion algorithm on the second distilled KG.
[0026] According to a fourth implementation, in the method of the fifth aspect according to any of the above implementations, before executing the information extractor algorithm on the collection of text documents, each text document of the plurality of text documents is labeled with a class.
[0027] According to a fifth implementation, the method of the fifth aspect according to any of the above implementations further includes executing a knowledge-graph-to-text algorithm on the process-refined KG to convert the process-refined KG to text.
[0028] According to a sixth implementation, in the method of the fifth aspect according to any of the above implementations, generating the importance scores includes, for each of the respective masked-text scores, computing a difference between a respective one of the raw-text scores and the respective masked-text score.
[0029] According to a seventh implementation, in the method of the fifth aspect according to any of the above implementations, during triple distillation, selecting the subset of the first set of extractions is performed by an extractor selector model, the extractor selector model being iteratively trained based on the importance scores.
[0030] According to an eighth implementation, in the method of the fifth aspect according to any of the above implementations, the extractor selector model is trained by optimizing a set of weights to minimize a loss function. The loss function relates to the set of weights and the importance scores. Each respective weight corresponds to a respective extraction of the first set of extractions. The extractor selector model is configured to remove one or more extractions from the first set of extractions to update the first set of extractions, based on the set of weights after optimization.
[0031] According to a ninth implementation, in the method of the fifth aspect according to any of the above implementations, the extractor selector model is configured to remove one or more extractions that have zero or negative weights from the first set of extractions.
[0032] According to a tenth implementation, the method of the fifth aspect according to any of the above implementations further includes, prior to performing triple distillation, extracting the first set of extractions from the first set of raw text by converting the first set of raw text to the triples of the n-ary extractions.
[0033] According to a eleventh implementation, the method of the fifth aspect according to any of the above implementations further includes, before executing the information extractor algorithm, pre-processing the input natural language text data by performing at least one of text formation, name entity recognition, coreference resolution, or meta-data processing.
[0034] According to a twelfth implementation, in the method of the fifth aspect according to any of the above implementations, the predefined task includes one of drug development, material synthesis, inventory of items, or detection of suspects from textual messages.
[0035] According to a sixth aspect of the present disclosure, a computer system is provided. The computer system of this aspect includes one or more hardware processors which, alone or in combination, are configured to provide for execution of the following steps: performing tripledistillation to generate a first distilled knowledge graph (KG) based on a first set of raw text and a first set of extractions. Performing triple distillation includes: iteratively performing the following steps until a stop criteria is satisfied: mask the first set of raw text according to the first set of extractions to generate masked text such that each piece of text in the first set of raw text corresponding to the first set of extractions is masked or removed; score the masked text to generate masked-text scores, each of the masked-text scores indicating how related corresponding text of the mask text is for a predefined task; score the first set of raw text to generate raw-text scores, each of the raw-text scores indicating how related corresponding text of the first set of raw text is for the predefined task; compute importance scores for the first set of extractions based on the raw-text scores and the masked-text scores; select a subset of the first set of extractions to subsequently use as the first set of extractions based on the computed importance scores; and evaluate the stop criteria. The method further includes, based on determining that the stop criteria is satisfied, outputting the first set of extractions as the set of extractions for the first distilled KG. The natural language text data includes the first set of raw text. The first set of extractions includes triples or n-ary extractions extracted from the first set of raw text.
[0036] According to a seventh aspect of the present disclosure, a tangible, non-transitory computer-readable medium is provided. The computer-readable medium according to this aspect includes instructions thereon which, upon being executed by one or more hardware processors, alone or in combination, provide for execution of the following steps: performing triple distillation to generate a first distilled knowledge graph (KG) based on a first set of raw text and a first set of extractions. Performing triple distillation includes: iteratively performing the following steps until a stop criteria is satisfied: mask the first set of raw text according to the first set of extractions to generate masked text such that each piece of text in the first set of raw text corresponding to the first set of extractions is masked or removed; score the masked text to generate masked-text scores, each of the masked-text scores indicating how related corresponding text of the mask text is for a predefined task; score the first set of raw text to generate raw-text scores, each of the raw-text scores indicating how related corresponding text of the first set of raw text is for the predefined task; compute importance scores for the first set of extractions based on the raw-text scores and the masked-text scores; select a subset of the first set of extractions to subsequently use as the first set of extractions based on the computed importance scores; and evaluate the stop criteria. The method further includes, based on determining that the stop criteria is satisfied, outputting the first set of extractions as the set of extractions for the first distilled KG. The natural language text data includes the first set of rawtext. The first set of extractions includes triples or n-ary extractions extracted from the first set of raw text.
[0037] Embodiments of the present disclosure provide a machine learning mechanism to rate the importance of an extracted triple in its original context without possible hallucinations. The proposed masking approach can overcome the hallucination side effect of the existing approaches based on generative models. In the context of machine learning, hallucination refers to the limitation of machine learning systems that can generate outputs that sound reasonable but are not grounded in reality or are inconsistent with real-world knowledge.
[0038] One advantage provided by aspects of the present disclosure is that no additional training is needed for a generative model. This results in a cost reduction in data acquisition, and a reduction in the use of computing recourses.
[0039] The masking approach for creating explanations, as described herein, is more advantageous than the existing post-hoc explanation methods. This is because the present masking concept is part of the model pipeline, resulting in the generated explanations being faithful to the true reasoning process of the model. This is not necessarily true for post-hoc explanations, as the extracted explanation can be incorrect for the predicted class.
[0040] Aspects of the present disclosure therefore provide technical improvements to existing specialty computing machine learning systems. As described above, and illustrated below, aspects of the present disclosure enable machine learning systems to more efficiency process and synthesize data in a manner that was heretofore not possible.
[0041] Aspects of the present disclosure provide a machine learning model (and a method for executing the same) for automatically extracting knowledge from literature. In some embodiments, the extracted knowledge is in the form of knowledge graph (KG) triples. A KG triple may be represented in (subject, relation, object)-triple format. In some embodiments, the extracted knowledge can be in the form of n-nary extractions, represented in (argi, relation, arg2, . . . , argn)-extraction format. The acquired knowledge (i.e., the knowledge graph) can be used to improve or fix existing procedures (implemented, e.g., as pipelines), such as drug development, biomaterial synthesis, and the like.
[0042] FIG. 1 illustrates a method 100 of improving an existing process for a target task using one or more machine learning models, according to an embodiment of the present disclosure. The method 100 includes an initialization pipeline 110 (also referred to as the training pipeline), and an inference pipeline 140.
[0043] The initialization pipeline 110 includes a machine-learning model at training time (the left column). The inputs 112 to the initialization pipeline 110 include a collection of literature 114 relevant for the target task (e.g., books, blogs, scientific papers, etc.). The inputtext of the collection of literature 114 might be in a large variety of formats. In some embodiments, a pre-processing module 116 may be used to pre-process the input text into a common format. The pre-processing module 116 is optional. The pre-processed and / or unprocessed input text is passed in parallel to the information extractor module 118 and to a triple distillation module 120.
[0044] The information extractor module 118 is configured to execute an information extraction algorithm. In a preferred embodiment, the information extraction algorithm is an open information extraction algorithm. However, any algorithm that takes text as an input and output triples with the text facts may be used. The output triples from the information extractor module 118, together with the original text (or the pre-processed text), are passed to the triple distillation module 120.
[0045] The triple distillation module 120 takes the extracted triples produced by the information extractor module 118 and the original text as input, and filters them with respect to the relative importance for the target task. The triple distillation module 120 outputs the knowledge graph (KG) triples that that are considered relevant for the target task according to their relative importance. The result is a first distilled knowledge graph (KG) 122. The triple distillation module 120 can be considered as an explainability module, as it is capable of highlighting the relevant tokens in the input text, which, if changed, would flip the classification outcome (i.e., it can act as a counter-factual explainer). The triple distillation module 120 will be explained in greater detail below, in connection with FIG. 2. The first distillated knowledge graph (KG) 122 can be used to train a knowledge base completion module 130. The knowledge base completion module 130 performs the reasoning over the facts (the distilled KG 122) and produces a complete knowledge graph (KG) 132. The knowledge base completion module 130 is optional. For example, if the first distilled knowledge graph (KG) 122 is already complete or nearly complete, the knowledge base completion module 130 may not be needed.
[0046] An exemplary algorithm for training the knowledge base completion module 130 may include the following steps: for epoch in N EPOCHS: for triples in data:# Triple (Washington, capital_of, USA)True_pred = model(triple) corrupted triple = (change randomly any [head, rel, tail]) # Triple (Washington, capital of, Canada)False_pred = model(corrupted triple)Loss = compute_loss(True_pred, False_pred, triple)Grad = compute_gradients(model, loss) update(model, grad).
[0047] In the inference pipeline 140 (the right column), the pre-processing module 116, the information extractor module 118, and the triple distillation module 120 of the initialization pipeline 110 are shared with the inference pipeline 140. A text 144 describing a current process (e.g., an existing procedure that has not been unrefined) for the target task is provided as input 142. The current process will be optimized through the inference pipeline 140. The text 144 is optionally pre-processed by the pre-processing module 116, so it can be formatted for the later modules.
[0048] The pre-processed (or un-processed) text is passed to the information extractor module 118. The information extractor module 118 produces a set of triples. The set of triples, together with the processed (or un-processed) text, are then fed into the triple distillation module 120. The triple distillation module 120 produces a second distilled knowledge graph (KG) 146, which includes only triples that are relevant for the target task.
[0049] The second distilled knowledge graph (KG) 146, together with the complete knowledge graph (KG) 132 (or the first distilled knowledge graph 122 if the optional knowledge base completion module 130 is not used), are the inputs to a knowledge graph differentiator 150. The knowledge graph differentiator 150 compares the second distilled knowledge graph (KG) 146 that describes the current process introduced by the user, against the complete knowledge graph (KG) 132 that is produced by the initialization pipeline 110 based on the collection of literature 114. The knowledge graph differentiator 150 outputs a process-refined knowledge graph (KG) 152.
[0050] The process-refined knowledge graph 152 includes triples that indicate steps that are missing in the current process and / or steps that are potentially incorrect. Thus, the triples in process-refined knowledge graph (KG) 152 represent relevant knowledge (facts) that is gleaned from the literature, which can improve the current process. A user can use the relevant knowledge to modify and improve the current process (e.g., by adding the missing steps and / or correcting the incorrect steps).
[0051] A knowledge-graph-to-text conversion module 154 can convert the triples in the process-refined knowledge graph (KG) 152 into text, which can be better understood by users.
[0052] The knowledge-graph-to-text conversion module 154 is optional. The output 156 of the inference pipeline 140 is a refined process for the target task. For example, the refined process can include the missing steps and / or correct the incorrect steps.
[0053] Each of the modules illustrated in FIG. 1 will be described in more detail below. Pre-processing module
[0054] The pre-processing module 116 is configured to apply a set of predefined operations to prepare the data for the further modules. Exemplary operations include text formation algorithms, name entity recognition algorithms, coreference resolution algorithms, meta-data processors, and the like. As explained above, the pre-processing module 116 is optional.
[0055] Named entity recognition (NER) is a natural language processing (NLP) method that extracts information from text. NER involves detecting and categorizing important information in text known as named entities. Named entities refer to the key subjects of a piece of text, such as names, locations, companies, events and products, as well as themes, topics, times, monetary values and percentages. Coreference resolution is the task of finding all expressions that refer to the same entity in a text.Information extractor module
[0056] The information extractor module 118 takes text as input, and outputs a set of triples with facts found in the text. The triples are represented in (subject, relation, object)-triple format. For example, consider the following input sentence: “CD8 T cells, which play a crucial role in immunity to infection and cancer, are T lymphocytes.” The information extractor module 118 can extract, for example, the following triples from this input sentence:• (CD8 T cells; play role in; immunity to cancer)• (CD8 T cells; play role in; immunity to infection)• (CD8 T cells; are; T lymphocytes)
[0057] The information extractor module 118 can execute a variety of information extraction algorithms, including both open and closed information extraction algorithms. MillE is an example of an algorithm that the information extractor module 118 may execute. See, e.g., Bhushan Kotnis et al., “MILIE: Modular & Iterative Multilingual Open Information Extraction,” In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1 : Long Papers) (2022) (the entire contents of which are hereby incorporated by reference herein). Aspects of the present disclosure, however, are not limited to open or closed information extraction. Aspects of the present disclosure work in any settings where text is converted into either triples or n-ary extractions (e.g., (argi, relation, arg2, . . . , argn)-extractions).
[0058] A simple open information extraction algorithm may include the following steps: split the input text into sentences; tag the words (tokens) in each sentence with their part of speech (noun, pronoun, verb, adjective, etc.); for each sentence, identify the verb; and make one triple per sentence with subject (e.g., anything to the left of the verb), predicate (the verb), and object (e.g., anything to the right of the verb).Triple distillation module
[0059] FIG. 2 illustrates a triple distillation module and a method for generating a distilled knowledge graph (KG) according to an embodiment of the present disclosure. The triple distillation module 120 takes two inputs 202 and 204. The first input 202 is the set of triples produced by the information extractor module 118. The second input 204 is the original text, which can be either the raw text or the pre-processed text from the pre-processing module 116, as the pre-processing module 116 is optional (as explained above). If the pre-processing module 116 is employed, the second input 204 uses the pre-processed text from the pre-processing module 116; otherwise the second input 204 uses the raw text.
[0060] The triple distillation module 120 includes a text masker 210. The text masker 210 takes both the first input 202 and the second input 204. For each triple in the first input 202 (e.g., in a (head, relation, tail)-triple format), the text masker 210 produces a modified version of the original text (referred to as masked text), in which the piece of text related to the triple is removed or masked.
[0061] An exemplary algorithm for the text masker 210 may use fuzzy-matching, and may include the following steps: for each triple, identify the corresponding sentence (this information may be provided by the information extractor); for each component of the triple (subject, predicate, object), perform fuzzy-matching to identify where in the sentence this component is located; failing that (e.g., it cannot be identified where in the sentence the component is located), segment the component into words and perform exact fuzzy-matching on the wordlevel; and replace the fuzzy-matched strings with “XXX”.
[0062] The triple distillation module 120 further includes a text scorer 220. The text scorer 220 takes a text as input and outputs a score that indicates how relevant the text is with respect to the target task. For example, the text scorer 220 can be a bidirectional encoder representations from transformers (BERT) model that classifies texts between target task and non-target task. The text scorer 220a generates a respective first score for the masked text corresponding to each triple. The respective first score indicates how relevant the masked text is to the target task. For example, if a given triple is more relevant to the target task, the masked text corresponding to the given triple would be less relevant to the target task since the text related to the given triple has been removed or masked from the original text. Accordingly, the masked text corresponding to the given triple would have a lower score.
[0063] Referring to FIG. 2, the test scorer 220b (which is shared with the text scorer 220a) takes the original text from the second input 204, and outputs a second score that indicates how relevant the original text is with respect to the target task.
[0064] The triple distillation module 120 further includes a triple importance block 230. The triple importance block 230 compares each first score of the masked text and the second score of the original text, and outputs an importance score. For example, the second score of the original text may be defined as sr, and the first scores may be defined as sm= {sx, s2, ... , sn], where n is the number of triples from the first input 202. The importance scorescan then be computed as: sm ~sr ~sm-Thus, a lower first score smwould result in a higher importance score (e.g., if a given triple is more relevant to the target task, the masked text corresponding to the given triple would have a lower first score, and the given triple would have a higher importance score).
[0065] The triple distillation module 120 further includes a triple selector 240. The importance scoresproduced by the triple importance block 230, together with the set of triples from the first input 202 (produced by the information extractor module 118), are input into the triple selector 240. The triple selector 240 is configured to optimize and learn a set of triples to keep. For example, the triple selector 240 may start by randomly initializing a weight vector w = {w1(w2, ... , wn), where n is the number of triples. The triple selector 240 optimizes the weights by minimizing the following loss function: / V 1 \ V w \ log > - • s + a - ,5l _j l + e-w) -i l + e~wJ
[0066] where a is a hyper-parameter that needs to be tuned. (The reference value for a is around 0.4.)
[0067] The optimization algorithm, via the feedback loop 270 back to the text masker 210, is run until a stop criterion is satisfied. At the decision block 250, if the stop criterion is not satisfied, the optimization algorithm continues; if the stop criterion is satisfied, the optimization algorithm ends. Examples of stop criteria include whether a predetermined number of iterations has run, or whether the difference between values of the loss function of successive runs is less than a predetermined threshold. At each iteration, the set of triples to keep is selected based on the set of weights w = {w1(w2, ... , wn}. For example, if the weightof a respective triple is positive, the respective triple is kept; if the weight is zero or negative, the respective triple is removed. The current set of triples to keep is sent to the text masker 210, and a new iteration starts. When the stop criterion is satisfied, a final set of triples with positive weights is kept. The output 260 of the triple distillation module 120 is the final set of triples.
[0068] The triple distillation module 120 can also be considered as an explainability module, because it is capable of highlighting the relevant tokens in the input text, which, if changed, would flip the classification outcome (i.e., it can act as a counter-factual explainer).Knowledge base completion module
[0069] Referring to FIG. 1, the knowledge base completion module 130 is configured to learn a relational model that can complete the distilled knowledge graph (KG) 122, which is the set of relevant triples generated by the triple distillation module 120. Embodiments of the present disclosure are agnostic with respect to the knowledge base completion algorithms. There is a vast number of suitable algorithms, such as DistMult. See, e.g., Bishan Yang et al, “Embedding Entities and Relations for Learning and Inference in Knowledge Bases,” ICLR 2015 (2015) (the entire contents of which are hereby incorporated by reference herein). See also Alberto Garcia-Duran et al., “KBLRN : End-to-End Learning of Knowledge Base Representations with Latent, Relational, and Numerical Features,” arXiv: 1709.04676 (2017) (the entire contents of which are hereby incorporated by reference herein). The output of the knowledge base completion module 130 is the complete knowledge graph (KG) 132.Knowledge graph differentiator
[0070] Referring to FIG. 1, the knowledge graph differentiator 150 is configured to compare the second distilled knowledge graph (KG) 146 produced from the text 144 describing a current process provided by a user, with the complete knowledge graph (KG) 132 produced from the literature 114 (or the first distilled knowledge graph 122 if the knowledge base completion module 130 is not executed), and compute the differences. The result is the process-refined knowledge graph (KG) 152. For example, the knowledge graph differentiator 150 can execute a graph matching algorithm. Triples that are present in both the complete knowledge graph (KG) 132 and the second distilled knowledge graph (KG) 146 can be removed from the second distilled knowledge graph (KG) 146. Accordingly, the process-refined knowledge graph (KG) 152 includes triples that indicate steps that are missing in the current process, and / or steps in the current process that are potentially incorrect. The article by Danai Koutra et al., “Algorithms for Graph Similarity and Subgraph Matching,” (2011) (the content of which is incorporated by reference herein) provides a survey of possible algorithms that can be used for the knowledge graph differentiator 150.Knowledge-graph-to-text conversion module
[0071] Referring to FIG. 1, the knowledge-graph-to-text conversion module 154 is optional. This module is configured to convert the process-refined knowledge graph (KG) 152 into a text format, so that it can be better understood by users. In an embodiment, the knowledge-graph-to-text conversion module 154 can include a trained prompt-based language model that generates text out of a set of triples.
[0072] Some exemplary algorithms that the knowledge-graph-to-text conversion module 154 can use are provided at https: / / paperswithcode.com / task / kg-to-text and https: / / aclanthology.org / N19-1238.pdf. An exemplary algorithm may include the following steps: for each triple, make one sentence by concatenating the subject, predicate, object (with spaces in between) into one string; and join all sentences into the final text (adding punctuation at the end of the sentence if not already in the object).EXAMPLES
[0073] The method and system for constructing task relevant knowledge graphs according to embodiments of the present disclosure can be applied to various tasks and situations. Some examples are discussed below.Example 1
[0074] Embodiments of the present disclosure can be applied to targeted information extraction for robust drug recommendation with resistance to machine-induced errors. For example, relevant information about chemical compounds can be extracted from libraries of textbooks and publications. In the initialization pipeline 110 discussed above with reference to FIG. 1, the input 112 can include libraries of textbooks and publications (e.g., scientific papers). It can also include doctors’ reports, hospital logs, and the like. The complete knowledge graph (KG) 132 can include triples that contain relevant information about patients, diseases, drugs, and the like.
[0075] In the inference pipeline 140, the distilled knowledge graph (KG) 146 can contain information about using a particular drug to treat a particular patient, as well as how to treat the patient. The open nature (e.g., explicit or explainable nature) of the extractions allows for a wide variety of recommendations, such as suggesting a specific chemical for directly treating the patient. For example, one triple could be “Drug A helped patient B with disease C ” A second triple could be “Patient B was also allergic to XXX.” So a doctor may try that very drug A on a similar patient that is also allergic to XXX. Because the distilled extractions contain only relevant extractions, the resulting knowledge graph will include only of the triples that are actually relevant, thus omitting triples that do not contain useful information.Example 2
[0076] Embodiments of the present disclosure can be applied to material informatics. For example, relevant information about properties of materials can be extracted from textdocuments such as scientific articles, lab reports or log files, and the like. This can reduce the time, cost, and errors in the wet-lab of material design. The input 112 to the initialization pipeline 110 can include research papers, scientific reports, and log files describing the behavior of materials and tester feedback, such as the melting point. A machine learning model implemented according to aspects of the present disclosure can extract triples that contain relevant information about the synthesis process of materials (e.g., biomaterials).
[0077] The output 156 in the inference pipeline 140 can provide relevant information (e.g., in the form of ranked triples about chemical procedures) enabling users to enhance or fix their materials synthesis process. For example, an automatically extracted piece of information can be that rubber X fails for reason Y, and another extraction can suggest a particular method to fix that failure.Example 3
[0078] Embodiments of the present disclosure can be applied to inventory of items. For example, relevant information can be extracted from written logs or spoken dialogs about the stored items in a facility (e.g., warehouse). The input 112 to the initialization pipeline 110 can include facility reports, logs, and the like. A machine learning model implemented according to aspects of the present disclosure extracts triples from natural language text data and ranks the triples by their relevance for the items in the facility. The triples that are not relevant for the items are filtered out. The output is a knowledge graph that contains only relevant information about the items in the facility.
[0079] The triples in the constructed knowledge graph can contain information about the physical positions of the items in the facility. The knowledge graph can also include information about the positions of autonomous robots that move items (e.g., an autonomous robot for moving an item from point A to point B). The knowledge graph can also contain information about where certain items should be moved (e.g., within the facility) and how to move the items (e.g., with which robot). For example, based on the relevant information in the knowledge graph, an event can be triggered that sends an autonomous robot to move a certain item from point A to point B.Example 4
[0080] Embodiments of the present disclosure can be applied to detection of suspects from textual messages. For example, extracting and ranking information by relevance can be important in sensitive domains. The knowledge graph extracted using the method and system according to embodiments of the present disclosure can help improve and optimize legal procedures. The input can include email text messages, police reports, court protocols, witness testimonies, and the like. A machine learning model implemented according to aspects of thepresent disclosure receives the textual data, and extracts OIE triples and then creates a knowledge graph by selecting only the relevant triples (e.g., using open information extraction, or OIE). The output can be a ranked list of relevant triples.
[0081] For example, the relevant information extracted from text can be used for filing of legal actions and police investigations against suspects. The resulting knowledge graph can contain information about potential suspects and the crimes they may have committed. Because such information can be very sensitive, when sensitive information is extracted from the input text, it can trigger the situation in which data is written on separate part of the disc due to security reasons.
[0082] FIG. 3 illustrates a processing system 300 configured according to an embodiment of the present disclosure. The processing system 300 can include one or more processors 302, memory 304, one or more input / output devices 306, one or more sensors 308, one or more user interfaces 310, and one or more actuators 312. Processing system 300 can be representative of each computing system disclosed herein.
[0083] Processors 302 can include one or more distinct processors, each having one or more cores. Each of the distinct processors can have the same or different structure. Processors 302 can include one or more central processing units (CPUs), one or more graphics processing units (GPUs), circuitry (e.g., application specific integrated circuits (ASICs)), digital signal processors (DSPs), and the like. Processors 302 can be mounted to a common substrate or to multiple different substrates.
[0084] Processors 302 are configured to perform a certain function, method, or operation (e.g., are configured to provide for performance of a function, method, or operation) at least when one of the one or more of the distinct processors is capable of performing operations embodying the function, method, or operation. Processors 302 can perform operations embodying the function, method, or operation by, for example, executing code (e.g., interpreting scripts) stored on memory 304 and / or trafficking data through one or more ASICs. Processors 302, and thus processing system 300, can be configured to perform, automatically, any and all functions, methods, and operations disclosed herein. Therefore, processing system 300 can be configured to implement any of (e.g., all of) the modules, protocols, devices, mechanisms, systems, and methods described herein.
[0085] For example, when the present disclosure states that a method or module performs task “X” (or that task “X” is performed), such a statement should be understood to disclose that processing system 300 can be configured to perform task “X”. Processing system 300 is configured to perform a function, method, or operation at least when processors 302 are configured to do the same.
[0086] Memory 304 can include volatile memory, non-volatile memory, and any other medium capable of storing data. Each of the volatile memory, non-volatile memory, and any other type of memory can include multiple different memory devices, located at multiple distinct locations and each having a different structure. Memory 304 can include remotely hosted (e.g., cloud) storage.
[0087] Examples of memory 304 include a non-transitory computer-readable media such as RAM, ROM, flash memory, EEPROM, any kind of optical storage disk such as a DVD, a Blu- Ray® disc, magnetic storage, holographic storage, a HDD, a SSD, any medium that can be used to store program code in the form of instructions or data structures, and the like. Any and all of the methods, functions, and operations described herein can be fully embodied in the form of tangible and / or non-transitory machine-readable code (e.g., interpretable scripts) saved in memory 304.
[0088] Input-output devices 306 can include any component for trafficking data such as ports, antennas (i.e., transceivers), printed conductive paths, and the like. Input-output devices 306 can enable wired communication via USB®, DisplayPort®, HDMI®, Ethernet, and the like. Inputoutput devices 306 can enable electronic, optical, magnetic, and holographic, communication with suitable memory 306. Input-output devices 306 can enable wireless communication via WiFi®, Bluetooth®, cellular (e.g., LTE®, CDMA®, GSM®, WiMax®, NFC®), GPS, and the like. Inputoutput devices 306 can include wired and / or wireless communication pathways.
[0089] Sensors 308 can capture physical measurements of environment and report the same to processors 302. User interface 310 can include displays, physical buttons, speakers, microphones, keyboards, and the like. Actuators 312 can enable processors 302 to control mechanical forces.
[0090] Processing system 300 can be distributed. For example, some components of processing system 300 can reside in a remote hosted network service (e.g., a cloud computing environment) while other components of processing system 300 can reside in a local computing system. Processing system 300 can have a modular design where certain modules include a plurality of the features / functions shown in FIG. 3. For example, VO modules can include volatile memory and one or more processors. As another example, individual processor modules can include read-only-memory and / or local caches.
[0091] While embodiments of the invention have been illustrated and described in detail in the drawings and foregoing description, such illustration and description are to be considered illustrative or exemplary and not restrictive. It will be understood that changes and modifications may be made by those of ordinary skill within the scope of embodiments of the present invention. In particular, the present invention covers further embodiments with any combinationof features from different embodiments described above and below. Additionally, statements made herein characterizing the invention or disclosure refer to an embodiment of the invention or disclosure and not necessarily all embodiments.
[0092] The terms used in the claims should be construed to have the broadest reasonable interpretation consistent with the foregoing description. For example, the use of the article “a” or “the” in introducing an element should not be interpreted as being exclusive of a plurality of elements. Likewise, the recitation of “or” should be interpreted as being inclusive, such that the recitation of “A or B” is not exclusive of “A and B,” unless it is clear from the context or the foregoing description that only one of A and B is intended. Further, the recitation of “at least one of A, B and C” should be interpreted as one or more of a group of elements consisting of A, B and C, and should not be interpreted as requiring at least one of each of the listed elements A, B and C, regardless of whether A, B and C are related as categories or otherwise. Moreover, the recitation of “A, B and / or C” or “at least one of A, B or C” should be interpreted as including any singular entity from the listed elements, e.g., A, any subset from the listed elements, e.g., A and B, or the entire list of elements A, B and C.
Claims
CLAIMSWhat is claimed is:
1. A computer-implemented method for generating task-relevant knowledge graphs from natural language text data, the method comprising: performing triple distillation to generate a first distilled knowledge graph (KG) based on a first set of raw text and a first set of extractions, performing triple distillation comprising: iteratively performing the following steps until a stop criteria is satisfied: mask the first set of raw text according to the first set of extractions to generate masked text such that each piece of text in the first set of raw text corresponding to the first set of extractions is masked or removed; score the masked text to generate masked-text scores, each of the masked- text scores indicating how related corresponding text of the mask text is for a predefined task; score the first set of raw text to generate raw-text scores, each of the rawtext scores indicating how related corresponding text of the first set of raw text is for the predefined task; compute importance scores for the first set of extractions based on the raw-text scores and the masked-text scores; select a subset of the first set of extractions to subsequently use as the first set of extractions based on the computed importance scores; evaluate the stop criteria; and based on determining that the stop criteria is satisfied, outputting the first set of extractions as the set of extractions for the first distilled KG, wherein the natural language text data comprises the first set of raw text, and wherein the first set of extractions comprise triples or n-ary extractions extracted from the first set of raw text.
2. The computer-implemented method as claimed in claim 1, wherein the first set of raw text comprises unrefined process description for the predefined task, wherein the natural language text data further comprises a second set of raw text comprising a collection of text documents, wherein a second set of extractions comprise triples or n-ary extraction extracted from the second set of raw text, and wherein the method further comprises: performing triple distillation to generate a second distilled knowledge graph (KG) based on the second set of raw text and the second set of extractions; andgenerating a process-refined knowledge graph (KG) by comparing the first subset of extractions corresponding to the first distilled KG with the second subset of extractions corresponding to the second distilled KG, the process-refined KG comprising extractions that indicate steps that are missing in the unrefined process or steps in the unrefined process that are incorrect.
3. The computer-implemented method as claimed in claim 2, the method further comprising: prior to performing triple distillation to generate the second distilled KG, extracting the second set of extractions from the second set of raw text by converting the second set of raw text to the triples of the n-ary extractions.
4. The computer-implemented method as claimed in claim 2 or 3, further comprising, before generating the process-refined knowledge graph, executing a knowledge base completion algorithm on the second distilled KG.
5. The computer-implemented method as claimed in any of claims 2-4, wherein before executing the information extractor algorithm on the collection of text documents, each text document of the plurality of text documents is labeled with a class.
6. The computer-implemented method as claimed in any of claims 2-5, further comprising executing a knowledge-graph-to-text algorithm on the process-refined KG to convert the process-refined KG to text.
7. The computer-implemented method as claimed in any of claims 1-6, wherein generating the importance scores comprises, for each of the respective masked-text scores, computing a difference between a respective one of the raw-text scores and the respective masked-text score.
8. The computer-implemented method as claimed in any of claims 1-7, wherein, during triple distillation, selecting the subset of the first set of extractions is performed by an extractor selector model, the extractor selector model being iteratively trained based on the importance scores.
9. The computer-implemented method as claimed in claim 8, wherein the extractor selector model is trained by optimizing a set of weights to minimize a loss function, the loss function relating to the set of weights and the importance scores, each respective weight corresponding to a respective extraction of the first set of extractions, wherein the extractor selector model isconfigured to remove one or more extractions from the first set of extractions to update the first set of extractions, based on the set of weights after optimization.
10. The computer-implemented method as claimed in claim 9, wherein the extractor selector model is configured to remove one or more extractions that have zero or negative weights from the first set of extractions.
11. The computer-implemented method as claimed in any of claims 1-10, the method further comprising: prior to performing triple distillation, extracting the first set of extractions from the first set of raw text by converting the first set of raw text to the triples of the n-ary extractions.
12. The computer-implemented method of any of claims 1-11, further comprising, before executing the information extractor algorithm, pre-processing the input natural language text data by performing at least one of text formation, name entity recognition, coreference resolution, or meta-data processing.
13. The computer-implemented method of any of claims 1-12, wherein the predefined task comprises one of drug development, material synthesis, inventory of items, or detection of suspects from textual messages.
14. A computer system comprising one or more hardware processors which, alone or in combination, are configured to provide for execution of the following steps: performing triple distillation to generate a first distilled knowledge graph (KG) based on a first set of raw text and a first set of extractions, performing triple distillation comprising: iteratively performing the following steps until a stop criteria is satisfied: mask the first set of raw text according to the first set of extractions to generate masked text such that each piece of text in the first set of raw text corresponding to the first set of extractions is masked or removed; score the masked text to generate masked-text scores, each of the masked- text scores indicating how related corresponding text of the mask text is for a predefined task; score the first set of raw text to generate raw-text scores, each of the rawtext scores indicating how related corresponding text of the first set of raw text is for the predefined task; compute importance scores for the first set of extractions based on the raw-text scores and the masked-text scores;select a subset of the first set of extractions to subsequently use as the first set of extractions based on the computed importance scores; evaluate the stop criteria; and based on determining that the stop criteria is satisfied, outputting the first set of extractions as the set of extractions for the first distilled KG, wherein the natural language text data comprises the first set of raw text, and wherein the first set of extractions comprise triples or n-ary extractions extracted from the first set of raw text.
15. A tangible, non-transitory computer-readable medium having instructions thereon which, upon being executed by one or more hardware processors, alone or in combination, provide for execution of the following steps: performing triple distillation to generate a first distilled knowledge graph (KG) based on a first set of raw text and a first set of extractions, performing triple distillation comprising: iteratively performing the following steps until a stop criteria is satisfied: mask the first set of raw text according to the first set of extractions to generate masked text such that each piece of text in the first set of raw text corresponding to the first set of extractions is masked or removed; score the masked text to generate masked-text scores, each of the masked- text scores indicating how related corresponding text of the mask text is for a predefined task; score the first set of raw text to generate raw-text scores, each of the rawtext scores indicating how related corresponding text of the first set of raw text is for the predefined task; compute importance scores for the first set of extractions based on the raw-text scores and the masked-text scores; select a subset of the first set of extractions to subsequently use as the first set of extractions based on the computed importance scores; evaluate the stop criteria; and based on determining that the stop criteria is satisfied, outputting the first set of extractions as the set of extractions for the first distilled KG, wherein the natural language text data comprises the first set of raw text, and wherein the first set of extractions comprise triples or n-ary extractions extracted from the first set of raw text.
Citation Information
Patent Citations
Aquarium system and methods
US62634606P0
Systems and methods for generating and using knowledge graphs
US20200090053A1
System for extracting semantic triples for building a knowledge base
US20200160194A1
Component-Inventory-Based Robot Fleet Management in Value Chain Networks
US20230102048A1
