IP Library Granted Patent US 12,353,408
Granted Patent B2
US 12,353,408 · App. 17/631,576 · Granted Jul 8, 2025

Semantic parsing of natural language query

Inventors: Yan Gao (Redmond, WA); Lei Fang (Redmond, WA); Dongmei Zhang (Beijing, CN); Yan Xiao (Redmond, WA); Jian-Guang Lou (Redmond, WA); Maria del Mar Gines Marin (Kirkland, WA)
Assignee: Microsoft Technology Licensing, LLC
G06F16/24522G06F16/243
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,353,408
App. No.
17/631,576
Granted
Jul 8, 2025
Kind
B2
Abstract

According to implementations of the subject matter described herein, a solution for semantic parsing of the natural language query is provided. In this solution, a first natural language query for a first data table is received, where the first natural language query comprises words. A first set of knowledge representations associated with the first data table are obtained and the first set of knowledge representations describe, in a structured manner, knowledge required for understanding a natural language query for the first data table. The first natural language query is converted into a first sequence of symbols. A first computer-executable query corresponding to the first natural language query is generated. According to this solution, various kinds of knowledge representations from different fields can be represented into universal structured knowledge representations, such that the knowledge representations are used to assist in understanding semantics of natural language queries and generating corresponding computer-executable queries.

Claims (41)

1. A computer-implemented method, comprising:

receiving, at a semantic parsing unit, a first natural language query for a first data table having data in a first field of knowledge, the first natural language query comprising a plurality of words;

obtaining, via the semantic parsing unit, a first set of knowledge representations extracted from the first data table, the first set of knowledge representations describing, in a structured manner, knowledge required for understanding a natural language query for the first data table in the first field of knowledge, wherein the first set of knowledge representations includes a first knowledge type describing an entity in the first data table and at least one word in the entity, and semantic information related to the at least one word, a second knowledge type describing an attribute of entity data, and a third knowledge type describing an act related to the entity;

converting, via the semantic parsing unit, the first natural language query into a first sequence of symbols that are universal for multiple data tables corresponding to multiple different fields of knowledge and include semantic information for symbols by replacing, based on the first set of knowledge representations, the plurality of words of the first natural language query with respective symbols in a predetermined symbol table;

parsing the first sequence of symbols via the semantic parsing unit comprised of a semantic parsing model trained on multiple examples of natural language queries and corresponding knowledge representations expressed as the symbols that are universal and corresponding computer executable queries from different fields of knowledge; and

generating a first computer-executable query corresponding to the first natural language query without having to retrain the semantic parsing model for different fields of knowledge.

2. The method of claim 1 , wherein the first set of knowledge representations indicates a data column in the first data table related to the knowledge representation, and

wherein at least one word in the first natural language query is replaced with a different word based on a respective symbol in response to matching a respective knowledge representation.

3. The method of claim 2 , wherein:

the first knowledge type describes an entity or a column name of a data column in the first data table,

the second knowledge type describes an attribute of a data column in the first data table, and

the third knowledge type describes an act related to a data column in the first data table.

4. The method of claim 3 , wherein the predetermined symbol table comprises a first predetermined symbol corresponding to the first knowledge type and a symbol attribute type, and wherein the replacing the plurality of words with respective symbols in a predetermined symbol table comprises:

in response to determining that a first word of the plurality of words matches a column name of a data column in the first data table or matches the at least one word indicated by the first knowledge representation, replacing the first word with the first predetermined symbol.

5. The method of claim 3 , wherein the predetermined symbol table comprises a second predetermined symbol corresponding to the second knowledge type, and wherein the replacing the plurality of words with respective symbols in a predetermined symbol table comprises:

in response to determining that a second word of the plurality of words matches the at least one word indicated by the second knowledge representation, replacing the second word with the second predetermined symbol.

6. The method of claim 3 , wherein the predetermined symbol table comprises a third predetermined symbol corresponding to the third knowledge type, and wherein the replacing the plurality of words with respective symbols in a predetermined symbol table comprises:

in response to determining that a third word of the plurality of words matches the at least one word indicated by the third knowledge representation, replacing the third word with the third predetermined symbol.

7. The method of claim 1 , wherein the replacing the plurality of words with respective symbols in a predetermined symbol table comprises:

in response to determining that a fourth word of the plurality of symbols matches a fourth predetermined symbol in the predetermined symbol table, replacing the fourth word with the fourth predetermined symbol.

8. The method of claim 1 , wherein the generating a first computer-executable query comprises:

converting, via the semantic parsing unit, the first sequence of symbols into a plurality of logic representations by applying a set of deductive rules to the first sequence of symbols, each logic representation corresponding to a predicted semantic meaning of the first natural language query;

selecting, via the semantic parsing model, from the plurality of logic representations, a logic representation that best matches true semantics of the first natural language query via the semantic parsing model; and

generating, via the semantic parsing model, the first computer-executable query based on the selected logic representation and by replacing at least one word in the first natural language query with a word corresponding to one of the first sequence of symbols.

9. The method of claim 8 , wherein the selecting a logic representation comprises:

selecting, from the plurality of logic representations, the logic representation using the semantic parsing model.

10. The method of claim 1 , wherein the generating a first computer-executable query comprises:

generating, using the trained semantic parsing model, the first computer-executable query based on the first sequence of symbols.

11. The method of claim 10 , further comprising:

obtaining a second natural language query for a second data table and a second computer-executable query corresponding to the second natural language query;

obtaining a second set of knowledge representations associated with the second data table, the second set of knowledge representations describing, in a structured manner, knowledge required for understanding a natural language query for the second data table;

converting the second natural language query into a second sequence of symbols by replacing, based on the second set of knowledge representations, a plurality of words in the second natural language query with respective symbols in the predetermined symbol table; and

generating, at least based on the second sequence of symbols and the second computer-executable query, training data for training the neural network.

12. A computing device, comprising: a processing unit; and a memory coupled to the processing unit and storing instructions which, when executed by the processing unit, cause the device to perform acts comprising: receiving, at a semantic parsing unit, a first natural language query for a first data table having data in a first field of knowledge, the first natural language query comprising a plurality of words; obtaining, via the semantic parsing unit, a first set of knowledge representations extracted from the first data table, the first set of knowledge representations describing, in a structured manner, knowledge required for understanding a natural language query for the first data table in the first field of knowledge, wherein the first set of knowledge representations includes a first knowledge type describing an entity in the first data table and at least one word in the entity, and semantic information related to the at least one word, a second knowledge type describing an attribute of entity data, and a third knowledge type describing an act related to the entity; converting, via the semantic parsing unit, the first natural language query into a first sequence of symbols that are universal for multiple data tables corresponding to multiple different fields of knowledge and include semantic information for symbols by replacing, based on the first set of knowledge representations, the plurality of words of the first natural language query with respective symbols in a predetermined symbol table; parsing the first sequence of symbols via the semantic parsing unit comprised of a semantic parsing model trained on multiple examples of natural language queries and corresponding knowledge representations expressed as the symbols that are universal and corresponding computer executable queries from different fields of knowledge; and generating a first computer-executable query corresponding to the first natural language query without having to retrain the semantic parsing model for different fields of knowledge.

13. The device of claim 12 , wherein the first set of knowledge representations indicates a data column in the first data table related to the knowledge representation, and

wherein at least one word in the first natural language query is replaced with a different word based on a respective symbol in response to matching a respective knowledge representation.

14. The device of claim 12 , wherein the generating a first computer-executable query comprises:

converting, via the semantic parsing unit, the first sequence of symbols into a plurality of logic representations by applying a set of deductive rules to the first sequence of symbols, each logic representation corresponding to a predicted semantic meaning of the first natural language query;

selecting, via the semantic parsing model, from the plurality of logic representations, a logic representation that best matches true semantics of the first natural language query via the semantic parsing model; and

generating, via the semantic parsing model, the first computer-executable query based on the selected logic representation and by replacing at least one word in the first natural language query with a word corresponding to one of the first sequence of symbols.

15. A computer program product being tangibly stored in a computer storage medium and comprising machine-executable instructions which, when executed by a device, cause the device to perform acts comprising: receiving, at a semantic parsing unit, a first natural language query for a first data table having data in a first field of knowledge, the first natural language query comprising a plurality of words; obtaining, via the semantic parsing unit, a first set of knowledge representations extracted from the first data table, the first set of knowledge representations describing, in a structured manner, knowledge required for understanding a natural language query for the first data table in the first field of knowledge, wherein the first set of knowledge representations includes a first knowledge type describing an entity in the first data table and at least one word in the entity, and semantic information related to the at least one word, a second knowledge type describing an attribute of entity data, and a third knowledge type describing an act related to the entity; converting, via the semantic parsing unit, the first natural language query into a first sequence of symbols that are universal for multiple data tables corresponding to multiple different fields of knowledge and include semantic information for symbols by replacing, based on the first set of knowledge representations, the plurality of words of the first natural language query with respective symbols in a predetermined symbol table; parsing the first sequence of symbols via the semantic parsing unit comprised of a semantic parsing model trained on multiple examples of natural language queries and corresponding knowledge representations expressed as the symbols that are universal and corresponding computer executable queries from different fields of knowledge; and generating a first computer-executable query corresponding to the first natural language query without having to retrain the semantic parsing model for different fields of knowledge.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 31, 2022
From: GAO, YAN; FANG, LEI; XIAO, YAN; GINES MARIN, MARIA DEL MAR; LOU, JIAN-GUANG; ZHANG, DONGMEI
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 058827/0948 →
Priority Claims (1)
CN 201910930771 · Sep 29, 2019 · national
Continuity (1)
Related Publication 20220277005A1 · Sep 1, 2022
References Cited (26)
US 5794050A · Dahlgren et al. · 1998 [cited by applicant]
US 20040122661A1 · Hawkinson et al. · 2004 [cited by applicant]
US 20050043940A1 · Elder et al. · 2005 [cited by applicant]
US 20150081711A1 · Dixon et al. · 2015 [cited by applicant]
US 20170024465A1 · Yeh et al. · 2017 [cited by applicant]
US 20200356363A1 · Dewitt · 2020 [cited by examiner]
CN 109033063A · 2018 [cited by applicant]
KR 20160066236A · 2016 [cited by applicant]
WO 2018213530A2 · 2018 [cited by applicant]
WO WO2018208813A1 · 2018 [cited by examiner]
Agrawal, Rohit, “DBIQS—An Intelligent System for Querying and Mining Databases using NPL”, In Proceeding of International Conference on Information Systems and Computer Networks, Mar. 1, 2014, pp. 39-44. [cited by applicant]
Androutsopoulos, et al., “Natural Language Interfaces to Databases—An Introduction”, In Journal of Natural Language Engineering, vol. 1, Issue 1, Mar. 1995, 50 Pages. [cited by applicant]
Bouchou, Beatrice, “Using Transducers in Natural Language Database Query”, In Proceeding of Applications of Natural Language to Information Systems Proceedings International Conference NLDB, Jun. 17, 1999, 15 Pages. [cited by applicant]
Chen, et al., “English Sentence Structures and Entity-Relationship Diagrams”, In Journal of Information Sciences, vol. 29, Issue 2-3, May 1, 1983, pp. 127-149. [cited by applicant]
Chen, et al., “English, Chinese and ER Diagrams”, In Journal of Data & Knowledge Engineering, vol. 23, Issue 1, Jun. 1, 1997, pp. 5-16. [cited by applicant]
Kunze, et al., “Putting People's Common Sense into Knowledge Bases of Household Robots”, In Proceedings of Annual Conference on Artificial Intelligence, Sep. 21, 2010, 8 Pages. [cited by applicant]
Ma, et al., “Risk Prediction on Electronic Health Records with Prior Medical Knowledge”, In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, Jul. 19, 2018, pp. 1910-1919. [cited by applicant]
“International Search Report and Written Opinion Issued in PCT Application No. PCT/US20/038292”, Mailed Date : Sep. 29, 2020, 12 Pages. [cited by applicant]
Weissenborn, et al., “Dynamic Integration of Background Knowledge in Neural NLU Systems”, In Repository of arXiv:1706.02596v3, Jun. 8, 2017, 13 Pages. [cited by applicant]
Zhang, et al., “Prior Knowledge Integration for Neural Machine Translation using Posterior Regularization”, In Repository of arXiv:1811.01100v1, Nov. 2, 2018, 10 Pages. [cited by applicant]
Zhou, et al., “Commonsense Knowledge Aware Conversation Generation with Graph Attention”, In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, Jul. 13, 2018, pp. 4623-4629. [cited by applicant]
Office Action Received for Chinese Application No. 201910930771.3, mailed on Apr. 16, 2024, 16 pages. [cited by applicant]
Second Office Action Received for Chinese Application No. 201910930771.3, mailed on Dec. 2, 2024, 14 pages. [cited by applicant]
Examination Report Received for Indian Application No. 202217015877, mailed on Mar. 4, 2025, 06 Pages. [cited by applicant]
Gupta, et al., “IQS-intelligent querying system using natural language processing”, IEEE, International Conference on Electronics, Communication and Aerospace Technology, Apr. 2017, pp. 407-411. [cited by applicant]
Rejection Decision Received for Chinese Application No. 201910930771.3, mailed on Mar. 28, 2025, 13 Pages (English Translation Provided). [cited by applicant]