DIR: A Large-Scale Dialogue Rewrite Dataset for Cross-Domain Conversational Text-to-SQL
Abstract
:1. Introduction
- We collect a large-scale cross-domain dialogue rewriting dataset DIR for conversational text-to-SQL. We also provide the additional action category labels and the rewrite process tracking annotations for interpretation research.
- We evaluate the effectiveness of the two-stage framework with DIR.
- We provide in-depth analysis of the two-stage framework in conversational text-to-SQL.
2. Related Work
2.1. Conversational Text-to-SQL
2.2. Dialogue Rewrite
3. Dialogue Rewrite Task
- Bridging anaphora and their antecedents are linked via various lexico-semantic frames or encyclopedic relations.
- Definite noun phrase is a determined noun phrase whose head is a noun with definiteness.
- One anaphora is an anaphoric noun phrase headed by one.
- Demonstrative pronoun is a pronoun used to point to specific people or things.
- Possessive determiner is one of the words my, your, his, her, its, our, and their.
- Continuation is the subsequent utterance that omits previous query conditions.
- Substitution-explicit exists when the current utterance contains the same structure of querying as the previous utterance. The repeating parts are omitted in the current utterance, and substituting the different parts will restore the complete query. The substitution phrase is the query target and is explicit in this category.
- Substitution-implicit is where the substitution phrase is the query target and is implicit in this category.
- Substitution-schema is where the substitution phrase is the query condition.
- Substitution-operator is where the substitution phrase involves a mathematical operation.
4. Dataset
4.1. Annotation
4.2. Data Collection
4.2.1. Crowd Sourcing with Sampling Inspection
4.2.2. Keywords Recognizing
4.2.3. Review with Pre-Trained Model
4.3. Statistics
5. Dialogue Rewrite
5.1. Baseline
5.2. DIR as a Challenging Benchmark
6. Conversational Text-to-SQL
6.1. Two-Stage Framework
6.1.1. Metrics
6.1.2. Rewrite Stage Models
6.1.3. Understanding Stage Model
6.2. Efficient Rewrite Model is Necessary
6.3. Influence of Dialogue Formulation
7. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Androutsopoulos, I.; Ritchie, G.D.; Thanisch, P. Natural language interfaces to databases-an introduction. Nat. Lang. Eng. 1995, 1, 29–81. [Google Scholar] [CrossRef]
- Quan, J.; Xiong, D.; Webber, B.; Hu, C. GECOR: An End-to-End Generative Ellipsis and Co-reference Resolution Model for Task-Oriented Dialogue. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), Hong Kong, China, 3–7 November 2019; pp. 4539–4549. [Google Scholar]
- Chen, Z.; Chen, L.; Li, H.; Cao, R.; Ma, D.; Wu, M.; Yu, K. Decoupled Dialogue Modeling and Semantic Parsing for Multi-Turn Text-to-SQL. In Proceedings of the Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, Virtual, 1–6 August 2021; pp. 3063–3074. [Google Scholar]
- Yu, T.; Zhang, R.; Yasunaga, M.; Tan, Y.C.; Lin, X.V.; Li, S.; Heyang Er, I.L.; Pang, B.; Chen, T.; Ji, E.; et al. SParC: Cross-Domain Semantic Parsing in Context. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics; Association for Computational Linguistics, Florence, Italy, 28 July–2 August 2019. [Google Scholar]
- Yu, T.; Zhang, R.; Er, H.; Li, S.; Xue, E.; Pang, B.; Lin, X.V.; Tan, Y.C.; Shi, T.; Li, Z.; et al. CoSQL: A Conversational Text-to-SQL Challenge Towards Cross-Domain Natural Language Interfaces to Databases. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), Hong Kong, China, 3–7 November 2019; pp. 1962–1979. [Google Scholar]
- Scarselli, F.; Gori, M.; Tsoi, A.C.; Hagenbuchner, M.; Monfardini, G. The graph neural network model. IEEE Trans. Neural Netw. 2008, 20, 61–80. [Google Scholar] [CrossRef] [PubMed]
- Bogin, B.; Gardner, M.; Berant, J. Global reasoning over database structures for text-to-sql parsing. arXiv 2019, arXiv:1908.11214. [Google Scholar]
- Lin, X.V.; Socher, R.; Xiong, C. Bridging textual and tabular data for cross-domain text-to-sql semantic parsing. arXiv 2020, arXiv:2012.12627. [Google Scholar]
- Chen, Z.; Chen, L.; Zhao, Y.; Cao, R.; Xu, Z.; Zhu, S.; Yu, K. ShadowGNN: Graph projection neural network for text-to-SQL parser. arXiv 2021, arXiv:2104.04689. [Google Scholar]
- Hui, B.; Geng, R.; Wang, L.; Qin, B.; Li, Y.; Li, B.; Sun, J.; Li, Y. S2SQL: Injecting Syntax to Question-Schema Interaction Graph Encoder for Text-to-SQL Parsers. In Proceedings of the Findings of the Association for Computational Linguistics, ACL 2022, Dublin, Ireland, 22–27 May 2022; Association for Computational Linguistics: Stroudsburg, PA, USA, 2022; pp. 1254–1262. [Google Scholar]
- Wang, B.; Shin, R.; Liu, X.; Polozov, O.; Richardson, M. Rat-sql: Relation-aware schema encoding and linking for text-to-sql parsers. arXiv 2019, arXiv:1911.04942. [Google Scholar]
- Cao, R.; Chen, L.; Chen, Z.; Zhao, Y.; Zhu, S.; Yu, K. LGESQL: Line Graph Enhanced Text-to-SQL Model with Mixed Local and Non-Local Relations. arXiv 2021, arXiv:2106.01093. [Google Scholar]
- Krishnamurthy, J.; Dasigi, P.; Gardner, M. Neural Semantic Parsing with Type Constraints for Semi-Structured Tables. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, Association for Computational Linguistics, Copenhagen, Denmark, 7–11 September 2017; pp. 1516–1526. [Google Scholar]
- Yin, P.; Neubig, G. A Syntactic Neural Model for General-Purpose Code Generation. arXiv 2017, arXiv:1704.01696. [Google Scholar]
- Guo, J.; Zhan, Z.; Gao, Y.; Xiao, Y.; Lou, J.G.; Liu, T.; Zhang, D. Towards Complex Text-to-SQL in Cross-Domain Database with Intermediate Representation. arXiv 2019, arXiv:1905.0820. [Google Scholar]
- Scholak, T.; Schucher, N.; Bahdanau, D. PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Models. arXiv 2021, arXiv:2109.05093. [Google Scholar]
- Hui, B.; Geng, R.; Ren, Q.; Li, B.; Li, Y.; Sun, J.; Huang, F.; Si, L.; Zhu, P.; Zhu, X. Dynamic Hybrid Relation Network for Cross-Domain Context-Dependent Semantic Parsing. arXiv 2021, arXiv:2101.01686. [Google Scholar] [CrossRef]
- Li, Y.; Zhang, H.; Li, Y.; Wang, S.; Wu, W.; Zhang, Y. Pay More Attention to History: A Context Modeling Strategy for Conversational Text-to-SQL. arXiv 2021, arXiv:2112.08735. [Google Scholar]
- Shi, P.; Ng, P.; Wang, Z.; Zhu, H.; Li, A.H.; Wang, J.; dos Santos, C.N.; Xiang, B. Learning contextual representations for semantic parsing with generation-augmented pre-training. In Proceedings of the AAAI Conference on Artificial Intelligence, Virtual, 2–9 February 2021; Volume 35, pp. 13806–13814. [Google Scholar]
- Yu, T.; Zhang, R.; Polozov, O.; Meek, C.; Awadallah, A.H. SCoRE: Pre-Training for Context Representation in Conversational Semantic Parsing. In Proceedings of the International Conference on Learning Representations, Vienna, Austria, 4 May 2021. [Google Scholar]
- Zheng, Y.; Wang, H.; Dong, B.; Wang, X.; Li, C. HIE-SQL: History Information Enhanced Network for Context-Dependent Text-to-SQL Semantic Parsing. In Proceedings of the Findings of the Association for Computational Linguistics, ACL 2022, Dublin, Ireland, 22–27 May 2022; Association for Computational Linguistics: Stroudsburg, PA, USA, 2022; pp. 2997–3007. [Google Scholar] [CrossRef]
- Yu, T.; Wu, C.S.; Lin, X.V.; Wang, B.; Tan, Y.C.; Yang, X.; Radev, D.; Socher, R.; Xiong, C. Grappa: Grammar-augmented pre-training for table semantic parsing. arXiv 2020, arXiv:2009.13845. [Google Scholar]
- Cai, Z.; Li, X.; Hui, B.; Yang, M.; Li, B.; Li, B.; Cao, Z.; Li, W.; Huang, F.; Si, L.; et al. STAR: SQL Guided Pre-Training for Context-dependent Text-to-SQL Parsing. arXiv 2022, arXiv:2210.11888. [Google Scholar]
- Pan, Z.; Bai, K.; Wang, Y.; Zhou, L.; Liu, X. Improving open-domain dialogue systems via multi-turn incomplete utterance restoration. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), Dublin, Ireland, 22–27 May 2019; pp. 1824–1833. [Google Scholar]
- Su, H.; Shen, X.; Zhang, R.; Sun, F.; Hu, P.; Niu, C.; Zhou, J. Improving Multi-turn Dialogue Modelling with Utterance ReWriter. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, Florence, Italy, 28 July–2 August 2019; pp. 22–31. [Google Scholar]
- Elgohary, A.; Peskov, D.; Boyd-Graber, J. Can You Unpack That? Learning to Rewrite Questions-in-Context. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), Hong Kong, China, 3–7 November 2019; pp. 5920–5926. [Google Scholar]
- Regan, M.; Rastogi, P.; Gupta, A.; Mathias, L. A dataset for resolving referring expressions in spoken dialogue via contextual query rewrites (cqr). arXiv 2019, arXiv:1903.11783. [Google Scholar]
- Eric, M.; Manning, C.D. Key-value retrieval networks for task-oriented dialogue. arXiv 2017, arXiv:1705.05414. [Google Scholar]
- Han, T.; Liu, X.; Takanobu, R.; Lian, Y.; Huang, C.; Peng, W.; Huang, M. MultiWOZ-coref: A multi-domain task-oriented dataset enhanced with annotation corrections and co-reference annotation. arXiv 2020, arXiv:2010.05594. [Google Scholar]
- Liu, Q.; Chen, B.; Guo, J.; Lou, J.G.; Zhou, B.; Zhang, D. How far are we from effective context modeling? An exploratory study on semantic parsing in context. arXiv 2020, arXiv:2002.00652. [Google Scholar]
- Stainton, R.J. 80Semantic Ellipsis. In Words and Thoughts: Subsentences, Ellipsis, and the Philosophy of Language; Oxford University Press: Cambridge, MA, USA, 2006; Available online: https://academic.oup.com/book/0/chapter/314898219/chapter-ag-pdf/44494641/book_36193_section_314898219.ag.pdf (accessed on 15 June 2007). [CrossRef]
- Rastogi, P.; Gupta, A.; Chen, T.; Mathias, L. Scaling Multi-Domain Dialogue State Tracking via Query Reformulation. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics, Minneapolis, MN, USA, 2–7 June 2019; Association for Computational Linguistics: Stroudsburg, PA, USA, 2019. [Google Scholar]
- Sutskever, I.; Vinyals, O.; Le, Q.V. Sequence to sequence learning with neural networks. arXiv 2014, arXiv:1409.3215. [Google Scholar]
- Liu, Q.; Chen, B.; Lou, J.G.; Zhou, B.; Zhang, D. Incomplete Utterance Rewriting as Semantic Segmentation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), Virtual, 16–20 November 2020; pp. 2846–2857. [Google Scholar]
- Ronneberger, O.; Fischer, P.; Brox, T. U-net: Convolutional networks for biomedical image segmentation. In Proceedings of the International Conference on Medical Image Computing and Computer-Assisted Intervention, Munich, Germany, 5–9 October 2015; Springer: Cham, Switzerland, 2015; pp. 234–241. [Google Scholar]
- Sokolova, M.; Japkowicz, N.; Szpakowicz, S. Beyond accuracy, F-score and ROC: A family of discriminant measures for performance evaluation. In Proceedings of the Australasian Joint Conference on Artificial Intelligence, Hobart, Australia, 4–8 December 2006; Springer: Berlin/Heidelberg, Germany, 2006; pp. 1015–1021. [Google Scholar]
- Habash, N.; Sadat, F. Arabic preprocessing schemes for statistical machine translation. In Proceedings of the Human Language Technology Conference of the NAACL, Companion Volume: Short Papers, New York, NY, USA, 4–9 June 2006; pp. 49–52. [Google Scholar]
- Lin, C.Y. Rouge: A package for automatic evaluation of summaries. In Proceedings of the Text Summarization Branches Out, Barcelona, Spain, 4–10 July 2004; pp. 74–81. [Google Scholar]
- Zhang, R.; Yu, T.; Er, H.; Shim, S.; Xue, E.; Lin, X.V.; Shi, T.; Xiong, C.; Socher, R.; Radev, D. Editing-Based SQL Query Generation for Cross-Domain Context-Dependent Questions. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), Hong Kong, China, 3–7 November 2019; Association for Computational Linguistics: Stroudsburg, PA, USA, 2019; pp. 5338–5349. [Google Scholar] [CrossRef]
- Cai, Y.; Wan, X. IGSQL: Database Schema Interaction Graph Based Neural Model for Context-Dependent Text-to-SQL Generation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), Online, 16–20 November 2020; Association for Computational Linguistics: Stroudsburg, PA, USA, 2020; pp. 6903–6912. [Google Scholar] [CrossRef]
Utterance | Category |
---|---|
History: Show ids of all employees. | Semantically Complete |
Current: Show ids of all employees who have destroyed a document. | |
History: We went to see a concert last night. | Bridging Anaphora |
Current: The tickets were really expensive. | |
History: What school has the most number of students? | Definite Noun Phrases |
Current: How many teachers are in that school? | |
History: Show me the age of all pilots! | One Anaphora |
Current: what is the name of the oldest one? | |
History: List all the shop names. | Demonstrative Pronoun |
Current: Which shop has the least quantity of devices of those? | |
History: Show the name for all employees. | Possessive Determiner |
Current: What’s their age? | |
History: Show the name of all teachers. | Continuation |
Current: Who teach math? | |
History: Show the director for all movies. | Substitution-Explicit |
Current: How about the name? | |
History: Find all students born before 1998? | Substitution-Implicit |
Current: How about after? | |
History: What are the distinct last names of staff? | Substitution-Schema |
Current: Of customers? | |
History: Show me the number of invoices by country! | Substitution-Operator |
Current: What is the total invoice for each! |
Dataset | Num. Dom | S/U | ER | AR | ||
---|---|---|---|---|---|---|
TASK | 1 | 92.75 | 24.25 | - | 1.27 | 1.11 |
CQR | 3 | 62.17 | 47.34 | - | 2.18 | - |
MultiWOZ 2.3 | 7 | 20.16 | 4.75 | 1.23 | 0.96 | 1.18 |
DIR-SParC | 160 | 89.35 | 50.02 | 1.41 | 1.57 | 1.23 |
DIR-CoSQL | 160 | 49.39 | 24.16 | 1.29 | 1.57 | 1.14 |
DIR | 160 | 72.77 | 38.40 | 1.38 | 1.57 | 1.21 |
Methods | F-Score | BLEU | ROUGE | ||||
---|---|---|---|---|---|---|---|
1 | 2 | 4 | 1 | 2 | L | ||
Concat | 57.54 | 51.55 | 51.18 | 50.15 | 83.02 | 72.03 | 75.18 |
Seq2Seq | 23.11 | 69.38 | 61.27 | 52.35 | 57.06 | 43.02 | 55.06 |
RUN | 65.03 | 89.80 | 87.38 | 83.44 | 93.90 | 88.16 | 92.45 |
Models | SParC | CoSQL |
---|---|---|
CD-S2S [4] | 21.9 | 13.8 |
SyntaxSQL [4] | 18.5 | 15.1 |
EditSQL [39] | 47.2 | 39.9 |
IGSQL [40] | 50.7 | 44.1 |
RichContext [34] | 52.1 | 41.0 |
RSQL [17] | 54.1 | 46.8 |
Concat RAT-SQL | 47.46 | 25.81 |
Oracle RAT-SQL | 59.27 | 52.98 |
Models | BLEU-4 | ROUGE-L | F-Score | SParC | CoSQL | ||
---|---|---|---|---|---|---|---|
QEM | QEX | QEM | QEX | ||||
Concat RAT-SQL | 50.15 | 75.18 | 57.54 | 47.46 | 70.38 | 25.81 | 45.18 |
Seq2Seq RAT-SQL | 52.35 | 55.06 | 23.11 | 24.02 | 47.72 | 27.04 | 48.22 |
RUN RAT-SQL | 83.44 | 92.45 | 65.03 | 49.79 | 72.87 | 50.20 | 71.24 |
Oracle RAT-SQL | - | - | - | 59.27 | 81.01 | 52.98 | 74.82 |
Train Dataset | DIR-SParC | DIR-CoSQL | ||||
---|---|---|---|---|---|---|
BLEU-4 | ROUGE-L | EM | BLEU-4 | ROUGE-L | EM | |
DIR-SParC | 55.86 | 78.94 | 11.22 | 78.11 | 89.02 | 38.97 |
DIR-CoSQL | 39.29 | 67.91 | 0.01 | 83.58 | 91.39 | 73.96 |
DIR | 64.08 | 82.90 | 18.45 | 88.31 | 94.26 | 74.25 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Li, J.; Chen, Z.; Chen, L.; Zhu, Z.; Li, H.; Cao, R.; Yu, K. DIR: A Large-Scale Dialogue Rewrite Dataset for Cross-Domain Conversational Text-to-SQL. Appl. Sci. 2023, 13, 2262. https://doi.org/10.3390/app13042262
Li J, Chen Z, Chen L, Zhu Z, Li H, Cao R, Yu K. DIR: A Large-Scale Dialogue Rewrite Dataset for Cross-Domain Conversational Text-to-SQL. Applied Sciences. 2023; 13(4):2262. https://doi.org/10.3390/app13042262
Chicago/Turabian StyleLi, Jieyu, Zhi Chen, Lu Chen, Zichen Zhu, Hanqi Li, Ruisheng Cao, and Kai Yu. 2023. "DIR: A Large-Scale Dialogue Rewrite Dataset for Cross-Domain Conversational Text-to-SQL" Applied Sciences 13, no. 4: 2262. https://doi.org/10.3390/app13042262
APA StyleLi, J., Chen, Z., Chen, L., Zhu, Z., Li, H., Cao, R., & Yu, K. (2023). DIR: A Large-Scale Dialogue Rewrite Dataset for Cross-Domain Conversational Text-to-SQL. Applied Sciences, 13(4), 2262. https://doi.org/10.3390/app13042262