Diverse Utterances Generation with GPT to Improve Task-Oriented Chatbots and APIs Integration
Vitor Gaboardi dos Santos, Boualem Benatallah, Auday Berro, Silvana Togneri MacMahon · 2024
Task-oriented chatbots enable users to make requests in natural language, such as booking flights or checking the weather. Given the richness of language, users may express the same request in many ways, making it essential to consider a diverse set of utterances when training chatbots to ensure its robustness. Additionally, APIs offer valuable information, and integrating chatbots with them improves access to external data, enabling contextual interactions and enhancing response relevance. However, developing and maintaining effective models for recognising API method calls from user requests remains challenging. Existing solutions often require substantial resources to integrate new APIs and create sufficiently diverse and semantically relevant training utterances. In this paper, we propose a novel approach using Large Language Models (LLMs) to create diverse utterances related to API methods. We also leverage the generated utterances to build a vector space to support natural language conversations with APIs or tools. We collect data from OpenAPI specifications and perform a multi-stage prompt pipeline using GPT to generate diverse utterances. Then, we leverage sentence embeddings to create a vector space representation of API methods. Experiments show that the proposed approach generates diverse and semantic relevant utterances, resulting in a robust representation of API methods.