Fine-tuning RoBERTa with LoRA for highly accurate intent prediction from customer queries.
← Back to ProjectsThis project addresses the challenge of automatically categorizing high-volume customer support queries in the banking sector. Using the Banking77 dataset, which contains over 13,000 queries across 77 unique intent categories, we implemented and compared two distinct approaches to text classification.
Manually triaging thousands of customer queries is slow, expensive, and prone to human error. An accurate intent classification system allows for instant routing to the correct department, automated self-service responses, and improved customer satisfaction scores.
The Banking77 dataset is a fine-grained intent detection dataset specifically for the banking domain. It contains 13,083 customer service queries labeled with one of 77 intents, such as "activate_card", "balance_not_updated_after_bank_transfer", or "wrong_amount_of_cash_received".
Figure 1: Distribution of intent labels in the Banking77 dataset, showing the frequency of queries across all 77 categories.
We adopted a comparative research design to evaluate the performance gain provided by modern LLM fine-tuning techniques over traditional architectures.
For the baseline model, we used TF-IDF (Term Frequency-Inverse Document Frequency) vectorization to transform text into numerical features. For the RoBERTa model, we utilized the RoBERTa tokenizer to convert raw text into input IDs and attention masks compatible with the transformer architecture.
roberta-base from Hugging Face.
Figure 2: Text length distribution by intent category, highlighting the variability in customer query lengths across different intents.
The comparison revealed a significant performance gap between the traditional MLP approach and the fine-tuned RoBERTa model.
contactless_not_working (96.10% F1 vs 72.72% for MLP).
Figure 3: Word clouds showing the most frequent terms across key banking intent categories, illustrating the semantic themes the models must distinguish.
Based on the findings of this project, we provide the following recommendations for implementing automated intent classification in a production environment.
For production banking applications where accuracy is critical, RoBERTa-LoRA should be favored over simpler MLP architectures. The semantic understanding provided by transformers is essential for handling the complexity of financial queries.
The complete implementation, including data loading, model training, and performance evaluation, is available in the embedded notebook below. This workflow demonstrates the practical use of the Hugging Face ecosystem for advanced NLP tasks.
Loading notebook... This may take a moment.