GraphQ IR: Unifying the Semantic Parsing of Graph Query Languages with One Intermediate Representation

30702

Authors

nan

Abstract

AbstractSubject to the huge semantic gap between natural and formal languages, neural semantic parsing is typically bottlenecked by its complexity of dealing with both input semantics and output syntax. Recent works have proposed several forms of supplementary supervision but none is generalized across multiple formal languages. This paper proposes a unified intermediate representation for graph query languages, named GraphQ IR. It has a natural-language-like expression that bridges the semantic gap and formally defined syntax that maintains the graph structure. Therefore, a neural semantic parser can more precisely convert user queries into GraphQ IR, which can be later losslessly compiled into various downstream graph query languages. Extensive experiments on several benchmarks including KQA Pro, Overnight, GrailQA, and MetaQA-Cypher under the standard i.i.d., out-of-distribution, and low-resource settings validate GraphQ IR’s superiority over the previous state-of-the-arts with a maximum 11% accuracy improvement.

Keywords

nan

Full Content

Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 5848 - 5865 December 7-11, 2022 ©2022 Association for Computational Linguistics GraphQ IR: Unifying the Semantic Parsing of Graph Query Languages with One Intermediate Representation Lunyiu Nie1, Shulin Cao1, Jiaxin Shi2, Jiuding Sun1, Qi Tian2, Lei Hou1, Juanzi Li1, Jidong Zhai1 1 Department of Computer Science and Technology, Tsinghua University 2 Huawei Cloud Computing Technologies Co., Ltd. {nlx20, caosl19, sjd22}@mails.tsinghua.edu.cn, shijx12@gmail.com, tian.qi1@huawei.com, {houlei,lijuanzi,zhaijidong}@tsinghua.edu.cn Abstract Subject to the huge semantic gap between nat- ural and formal languages, neural semantic parsing is typically bottlenecked by its com- plexity of dealing with both input semantics and output syntax. Recent works have pro- posed several forms of supplementary super- vision but none is generalized across multiple formal languages. This paper proposes a uni- fied intermediate representation (IR) for graph query languages, named GraphQ IR. It has a natural-language-like expression that bridges the semantic gap and formally defined syntax that maintains the graph structure. Therefore, a neural semantic parser can more precisely con- vert user queries into GraphQ IR, which can be later losslessly compiled into various down- stream graph query languages. Extensive exper- iments on several benchmarks including KQA PRO, OVERNIGHT, GRAILQA and METAQA- Cypher under standard i.i.d., out-of-distribution and low-resource settings validate GraphQ IR’s superiority over the previous state-of-the-arts with a maximum 11% accuracy improvement. 1 Introduction By mapping natural language utterances to log- ical forms, the task of semantic parsing has been widely explored in various applications, including database query (Yu et al., 2018; Talmor and Be- rant, 2018) and general-purpose code generation (Yin and Neubig, 2017; Campagna et al., 2019; Nan et al., 2020). Although the methodology has evolved from earlier statistical approaches (Zettle- moyer and Collins, 2005; Kwiatkowski et al., 2010) to present Seq2Seq paradigm (Zhong et al., 2017; Damonte and Monti, 2021), the semantic gap be- tween natural language and logical forms still lies as the major challenge for semantic parsing. As shown in Figure 1, in graph query languages (e.g., SPARQL, Cypher, Lambda-DCS, and newly emerged KoPL, etc.), graph nodes, edges and their respective properties constitute the key semantics of the logical forms (Pérez et al., 2009), which are very different from the expression of natural lan- guage utterances. Such discrepancy significantly hinders the learning of neural semantic parsers and therefore increases the demand for labeled data (Yin et al., 2022). However, due to the laborious efforts and language-specific expertise required in annotation, such demand cannot always be satisfied and thus becomes the bottleneck (Li et al., 2020b; Herzig et al., 2021). To overcome these challenges, many works adopt complementary forms of supervision, such as the schema of database (Hwang et al., 2019), results of the execution (Clarke et al., 2010; Wang et al., 2018, 2021), and grammar-constrained decoding algorithms (Krishnamurthy et al., 2017; Shin et al., 2021; Baranowski and Hochgeschwender, 2021). Although effective, the additional resources that these methods rely on are not necessarily available in practice. By normalizing the expression (Be- rant and …

Content truncated to 500 words

Labeled Text

AbstractSubject to the huge semantic gap between natural and formal languages, neural semantic parsing is typically bottlenecked by its complexity of dealing with both input semantics and output syntax. Recent works have proposed several forms of supplementary supervision but none is generalized across multiple formal languages. This paper proposes a unified intermediate representation for graph query languages, named GraphQ IR. It has a natural-language-like expression that bridges the semantic gap and formally defined syntax that maintains the graph structure. Therefore, a neural semantic parser can more precisely convert user queries into GraphQ IR, which can be later losslessly compiled into various downstream graph query languages. Extensive experiments on several benchmarks including KQA Pro, Overnight, GrailQA, and MetaQA-Cypher under the standard i.i.d., out-of-distribution, and low-resource settings validate GraphQ IR’s superiority over the previous state-of-the-arts with a maximum 11% accuracy improvement.

Publication Details

Paper ID:
30702
Year:
2022
Publication:
TIPSTER
Publication Type:
conf
DOI:
nan