IP Library › Granted Patent US 12,265,792
Granted Patent B2
US 12,265,792 · App. 17/526,824 · Granted Apr 1, 2025

Generating commonsense context for text using knowledge graphs

Inventors: Rachit Bansal (New Delhi, IN); Milan Aggarwal (Delhi, IN); Sumit Bhatia (New Delhi, IN); Jivat Neet Kaur (Delhi, IN); Balaji Krishnamurthy (Nodia, IN)
Assignee: Adobe Inc.
G06F40/295G06F16/3329G06N20/00
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,265,792
App. No.
17/526,824
Filed
Nov 15, 2021
Granted
Apr 1, 2025
Kind
B2
Art Unit
2655
USPC
704/9
Abstract

Methods and systems are provided for facilitating generation and utilization of a commonsense contextualizing machine learning (ML) model, in accordance with embodiments described herein. In embodiments, a commonsense contextual ML model is trained by fine-tuning a pre-trained language model using a set of training path-sentence pairs. Each training path-sentence pair includes a commonsense path, identified via a commonsense knowledge graph, and a natural language sentence identified as contextually related to the commonsense path. The trained commonsense contextualizing ML model can then be used to generate a commonsense inference path for a text input. Such a commonsense inference path can include a sequence of entities and relations that provide commonsense context to the text input. Thereafter, the commonsense inference path can be provided to a natural language processing system for use in performing a natural language processing task.

Claims (41)

1. A computer-implemented method comprising:

generating a commonsense path derived using a commonsense knowledge graph, the commonsense path including a sequence comprising entities and relations;

generating a training path-sentence pair including the commonsense path from the commonsense knowledge graph and a natural language sentence identified as contextually-related to the commonsense path based on at least one entity or relation associated with the commonsense path, wherein the natural language sentence is identified as contextually-related to the commonsense path using a query including an entity and a relation from the commonsense path generated via a query template to query a set of natural language sentences and obtain a subset of natural language sentences determined to be relevant to the query and using a model that derives semantically meaningful sentence embeddings to identify the natural language sentence, from the subset of natural language sentences, as within a threshold of similarity to the commonsense path;

using the training path-sentence pair to train a commonsense contextualizing machine learning model comprising a pre-trained language model;

using the commonsense contextualizing machine learning model to generate a commonsense inference path for an input text provided to the commonsense contextualizing machine learning model, the commonsense inference path including a sequence comprising entities and relations that provide commonsense context to the input text, the commonsense inference path generated by concatenating a set of path tokens, wherein each path token represents an entity or a relation at a corresponding time-step associated with the commonsense contextualizing machine learning model; and

providing, to a natural language processing system, the input text and the commonsense inference path to augment the input text for use in performing a natural language processing task using at least the commonsense inference path.

2. The computer-implemented method of claim 1 , wherein the commonsense path is identified from the commonsense knowledge graph based on an extraction of a set of multi-hop paths.

3. The computer-implemented method of claim 2 , wherein the length of each path of the set of multi-hop paths is within a predetermined range of hops.

4. The computer-implemented method of claim 1 , further comprising obtaining a set of natural language sentences, extracted from an electronic source of sentences, for use in generating a set of training path-sentence pairs including the training path-sentence pair.

5. The computer-implemented method of claim 1 , wherein a set of query templates are used to generate a set of queries for querying the set of natural language sentences.

6. The computer-implemented method of claim 1 , wherein the natural language sentence is identified as contextually-related to the commonsense path by:

accessing a set of query templates;

using the set of query templates to generate a set of queries based on the commonsense path; and

query an index having the set of natural language sentences to identify the natural language sentence as matching the query of the set of queries.

7. The computer-implemented method of claim 1 , wherein the training path-sentence pair is used to train the commonsense contextualizing machine learning model by:

inputting the training sentence into the pre-trained language model; and

using an output commonsense inference path from the pre-trained model to compare to the commonsense path of the training path-sentence pair to fine tune the commonsense contextualizing machine learning model.

8. The computer-implemented method of claim 1 , wherein training the commonsense contextualizing machine learning model includes performing masking of an entity in the natural language sentence, the entity also being included in the commonsense path.

9. One or more non-transitory computer-readable storage media having a plurality of executable instructions embodied thereon, which, when executed by one or more processors, cause the one or more processors to perform operations comprising:

obtaining an input text;

inputting the input text into a commonsense contextualizing machine learning model trained based on a set of path-sentence pairs, wherein each path-sentence pair includes a commonsense path identified via a commonsense knowledge graph and a natural language sentence identified as contextually-related to the commonsense path using a query generated to query a set of natural language sentences and obtain a subset of natural language sentences and using a model that derives semantically meaningful sentence embeddings to identify the natural language sentence, from the subset of natural language sentences, as within a threshold of similarity to the commonsense path;

obtaining, as output from the commonsense contextualizing model, a commonsense inference path including a set of entities and relations providing commonsense context relevant to the input text, the commonsense inference path generated by concatenating a set of path tokens, wherein each path token represents an entity or a relation at a corresponding time-step associated with the commonsense contextualizing model; and

providing the input text with the commonsense inference path to augment the input text to a natural language processing system for performing a natural language processing task using the commonsense inference path.

10. The media of claim 9 , wherein the commonsense contextualizing machine learning model is trained using a pre-trained natural language model.

11. The media of claim 10 , wherein the commonsense contextualizing machine learning model outputs a set of diverse commonsense inference paths.

12. The media of claim 11 , wherein the set of diverse commonsense inference paths is generated based on sampling a predetermined number of most probable tokens at a first level associated with the commonsense contextualizing machine learning model and selecting a most probable path forward for each of the predetermined number of most probable tokens at the first level.

13. The media of claim 9 , wherein the natural language processing system uses at least the commonsense inference path to perform the natural language processing task.

14. The media of claim 13 , wherein the natural language processing task comprises at least one of a conversational bot task, a dialogue agent task, an information retrieval task, or a question answering task.

15. The media of claim 9 , wherein the natural language sentence is identified as contextually-related to the commonsense path by:

accessing a set of query templates;

using the set of query templates to generate a set of queries based on the commonsense path; and

querying an index having the set of natural language sentences to identify the natural language sentence as matching the query of the set of queries.

16. A system comprising:

a processor device; and

a memory device, coupled with the processor device, the processor device to perform actions comprising:

training a commonsense contextual machine learning (ML) model by fine tuning a pre-trained language model based on a set of training path-sentence pairs, wherein each training path-sentence pair includes a commonsense path, identified via a commonsense knowledge graph and a natural language sentence identified as contextually-related to the commonsense path, wherein the natural language sentence is identified as contextually-related to the commonsense path based on a query, generated using a query template, to search a set of natural language sentences to identify a subset of natural language sentences and using a model that derives semantically meaningful sentence embeddings to identify the natural language sentence, from the subset of natural language sentences, as within a threshold of similarity to the commonsense path;

using the commonsense contextualizing ML model to generate a commonsense inference path for a text input into the commonsense contextualizing ML model, the commonsense inference path including a sequence comprising entities and relations that provide commonsense context to the text input, the commonsense inference path generated by concatenating a set of path tokens, wherein each path token represents an entity or a relation at a corresponding time-step associated with the commonsense contextualizing ML model; and

providing the text input with the commonsense inference path to augment the text input to a natural language processing system for use in performing a natural language processing task using the text and the commonsense inference path.

17. The system of claim 16 , wherein the natural language processing task comprises at least one of a conversational bot task, a dialogue agent task, an information retrieval task, or a question answering task.

18. The system of claim 17 , wherein the sequence included in the commonsense inference path includes a portion selected from the text input and a portion not included within the text input.

19. The system of claim 16 , wherein the commonsense contextualizing ML model outputs a set of diverse commonsense inference paths that are provided to the natural language processing system for use in performing the natural language processing task.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 15, 2021
From: BANSAL, RACHIT; AGGARWAL, MILAN; BHATIA, SUMIT; KAUR, JIVAT NEET; KRISHNAMURTHY, BALAJI
To: ADOBE INC.
Reel/Frame 058116/0755 →
Continuity (1)
Related Publication 20230153534A1 · May 18, 2023
References Cited (35)
US 7519529B1 · Horvitz · 2009 [cited by examiner]
US 11210590B2 · Boxwell · 2021 [cited by examiner]
US 11526678B2 · Perez · 2022 [cited by examiner]
US 20040260694A1 · Chaudhuri · 2004 [cited by examiner]
US 20070203863A1 · Gupta · 2007 [cited by examiner]
US 20190065576A1 · Peng · 2019 [cited by examiner]
US 20210117509A1 · Aditya · 2021 [cited by examiner]
US 20210191988A1 · Galitsky · 2021 [cited by examiner]
US 20220230625A1 · Zhu · 2022 [cited by examiner]
US 20220335219A1 · Sengupta · 2022 [cited by examiner]
Dognin et al. “DualTKB: A Dual Learning Bridge between Text and Knowledge Base”. arXiv:2010.14660v1 [cs.CL] Oct. 27, 2020 (Year: 2020). [cited by examiner]
Chris van den Berg. 2017. “Super Fast String Matching in Python”. web.archive.org/web/20171102084304/https://bergvca.github.io/2017/10/14/super-fast-string-matching.html (Year: 2017). [cited by examiner]
Jagvaral et al. “Path-based reasonin approach for knowledge graph completion using CNN-biLSTM with attention mechanism”. Expert Systems with Applications 142, (2020), 112960 (Year: 2020). [cited by examiner]
Ji et al. “Language Generation with Multi-Hop Reasoning on Commonsense Knowledge Graph”. arXiv:2009.11692v1 [cs.CL] Sep. 24, 2020 (Year: 2020). [cited by examiner]
Bansal, R., et al., “CoSe-Co: Sentence Conditioned Generative CommonSense Contextualizer for Language Models,” Automated Knowledge Base Construction, pp. 17 (2021). [cited by applicant]
Bao, J., et al., “Constraint-based question answering with knowledge graph,” In Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: Technical Papers, pp. 2503-2514 (2016). [cited by applicant]
Bhagavatula, C., et al., “Abductive commonsense reasoning,” arXiv preprint arXiv:1908.05739, pp. 15 (Aug. 15, 2019). [cited by applicant]
Bosselut, A., et al., “Comet: Commonsense transformers for automatic knowledge graph construction,” arXiv preprint arXiv:1906.05317, Accepted to ACL 2019, pp. 18 (Jun. 14, 2019). [cited by applicant]
Bosselut, A., et al., “Dynamic neuro-symbolic knowledge graph construction for zero-shot commonsense question answering,” The Eleventh Symposium on Educational Advances in Artificial Intelligence, EAAI 2021, Virtual Eve… [cited by applicant]
Feng, Y., et al., “Scalable multi-hop relational reasoning for knowledge-aware question answering,” In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), Anthology ID: 2020.e… [cited by applicant]
Huang, L., et al., “Cosmos QA: Machine reading comprehension with contextual commonsense reasoning,” In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Jo… [cited by applicant]
Lin, B.Y., et al., “KagNet: Knowledge-aware graph networks for commonsense reasoning,” In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference… [cited by applicant]
Lv, S., et al., “Graph-based reasoning over heterogeneous external knowledge for commonsense question answering,” Proceedings of the AAAI Conference on Artificial Intelligence, vol. 34, No. 05, pp. 8449-8456 (Apr. 2020). [cited by applicant]
Mitra, A., et al., “Exploring ways to incorporate additional knowledge to improve natural language commonsense question answering,” arXiv preprint arXiv:1909.08855, pp. 8 (Sep. 19, 2019). [cited by applicant]
Niven, T., and Kao, H.-Y., “Probing neural network comprehension of natural language arguments,” In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, Anthology ID: P19-1459, pp. 46… [cited by applicant]
Ren, H., and Leskovec,J., “Beta embeddings for multi-hop logical reasoning in knowledge graphs,” Advances in Neural Information Processing Systems, vol. 33, retrieved from Internet URL https://proceedings.neurips.cc/pap… [cited by applicant]
Ren, H., et al., “Query2box: Reasoning over knowledge graphs in vector space using box embeddings,” In International Conference on Learning Representations, pp. 17 (2020). [cited by applicant]
Sap, M., et al., “Atomic: An atlas of machine commonsense for if-then reasoning,” In Proceedings of the AAAI Conference on Artificial Intelligence, vol. 33, pp. 3027-3035 (2019). [cited by applicant]
Speer, R., et al., “Conceptnet 5.5: An open multilingual graph of general knowledge,” In Proceedings of the AAAI Conference on Artificial Intelligence, vol. 31, pp. 4444-4451 (2017). [cited by applicant]
Sun, H., et al., “Open domain question answering using early fusion of knowledge bases and text,” In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 4231-4242 (2018). [cited by applicant]
Wang, P., et al., “Connecting the dots: A knowledgeable path generator for commonsense question answering,” Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings, EMNLP 2020, p… [cited by applicant]
Wang, X., et al., “Improving natural language inference using external knowledge in the science questions domain,” Proceedings of the AAAI Conference on Artificial Intelligence, vol. 33, No. 01, pp. 7208-7215 (Jul. 2019… [cited by applicant]
Yasunaga, M., et al., “Qa-gnn: Reasoning with language models and knowledge graphs for question answering,” In Proceedings of the 18th Meeting of the North American Association for Computational Linguistics (NAACL), pp.… [cited by applicant]
Zellers, R., et al., “Swag: A large-scale adversarial dataset for grounded commonsense inference,” In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 93-104 (2018). [cited by applicant]
Zhou, P., et al., “RICA: Evaluating robust inference capabilities based on commonsense axioms,” arXivpreprint arXiv:2005.00782, Accepted in EMNLP 2021 main conference, pp. 14 (Sep. 23, 2020). [cited by applicant]
Cited By (1)
US 12,591,602