Skip to content
Last Dictionary

semantic parsing

nounAlso: text-to-SQL, NL2SQL, natural language interface to databases, NLIDB

In plain wordsTranslating a sentence into a precise, machine-executable form — such as a database query or a logical formula — so that a computer can act on what was asked.

  1. The task of mapping natural-language utterances to formal meaning representations that can be executed or reasoned over: logical forms, lambda-calculus expressions, database queries (text-to-SQL), API calls or programs. Early systems for querying databases used hand-built grammars; machine-learned semantic parsers were trained on utterances paired with logical forms or, more weakly, only with the results of executing them. Neural sequence-to-sequencesequence-to-sequence model, n.: A model that turns one sequence into another, such as a French sentence into English or speech into text, by first reading the whole input and then writing the output step by step. parsers and then LLMs turned it into a form of code generationcode generation, n.: Having an AI write computer code from a description in plain language, from finishing a single line as you type to building whole programs., and text-to-SQL benchmarks test generalization to database schemas unseen in training. Correctness is judged by exact match of the representation or, more robustly, by whether executing it returns the right answer. Modern function callingfunction calling, n.: A feature of AI model services that lets the model reply with a neatly formatted request to run one of a program's functions, rather than with ordinary text; the program, not the model, then runs it. is a descendant: the model parses a request into a structured call.

    Our text-to-SQL layer is semantic parsing in practice: questions become queries against the warehouse schema.

Origin

Natural-language database interfaces such as William Woods's LUNAR (demonstrated 1971) were early semantic parsers. John Zelle and Raymond Mooney (1996) learned parsers from examples on the GeoQuery dataset, and Luke Zettlemoyer and Michael Collins (2005) learned mappings to lambda-calculus forms; the WikiSQL (2017) and Spider (2018) datasets popularized text-to-SQL.

Related

See also
  • syntactic parsingsyntactic parsing, n.: Working out the grammatical structure of a sentence — which words group together and which word modifies which — usually drawn as a tree.
  • code generationcode generation, n.: Having an AI write computer code from a description in plain language, from finishing a single line as you type to building whole programs.
  • function callingfunction calling, n.: A feature of AI model services that lets the model reply with a neatly formatted request to run one of a program's functions, rather than with ordinary text; the program, not the model, then runs it.
  • question answeringquestion answering, n.: Systems that reply to people's questions with the right answer, whether by finding it in a passage they are given, searching a database or the web, or drawing on what they already know.
  • first-order logicfirst-order logic, n.: A precise formal language for statements about objects and their relations, using 'for all' and 'there exists', such as 'every person has a mother'. It is the standard logic of mathematics and of classic AI.
  • program synthesisprogram synthesis, n.: Getting a computer to write a program automatically from a description of what the program should do — a logical specification, a few input–output examples or a request in plain language.

Sources

  1. Zelle, J. M. & Mooney, R. J. (1996). Learning to Parse Database Queries Using Inductive Logic Programming. AAAI 1996.
  2. Yu, T. et al. (2018). Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Task. EMNLP 2018.

Mentioned in

frameframe, n.: In classic AI, a ready-made template for a familiar kind of thing or event, such as a kitchen or a job interview, with blanks to fill in and sensible default values., question answeringquestion answering, n.: Systems that reply to people's questions with the right answer, whether by finding it in a passage they are given, searching a database or the web, or drawing on what they already know., autoformalizationautoformalization, n.: Using AI to translate ordinary mathematics written for people — definitions, theorem statements, proofs — into a strict formal language that a proof-checking program can verify., conceptual dependencyconceptual dependency, n.: A 1970s theory for representing the meaning of sentences with a small set of basic actions, so that 'John gave Mary a book' and 'Mary got a book from John' come out the same., syntactic parsingsyntactic parsing, n.: Working out the grammatical structure of a sentence — which words group together and which word modifies which — usually drawn as a tree.