Master's Thesis

Retrieval-Augmented Generation for Addressing Consumer Complaints

David Azevedo Escobar de Lima2025

Key information

Authors:

David Azevedo Escobar de Lima (David Azevedo Escobar de Lima)

Supervisors:

Pedro Alexandre Simões dos Santos (Pedro Alexandre Simões dos Santos); João Miguel De Sousa de Assis Dias

Published in

July 21, 2025

Abstract

Consumers in Portugal often encounter challenges when seeking resolutions to their complaints, as information regarding consumer rights may be inaccessible or hard to understand. In this work, we focus on this gap, introducing a system that responds to consumer complaints with legally grounded, understandable explanations based on Portuguese consumer law. To achieve this, a Retrieval-Augmented Generation architecture was implemented, combining information retrieval with natural language generation. The system consists of two main components: a Retriever and a Generator. The Retriever was built by fine-tuning Albertina, a BERT-family model for European Portuguese, to identify the most semantically relevant legal segments for a given complaint. To support this, a new dataset was created, consisting of Portuguese consumer complaints paired with legislative excerpts, an essential contribution given the absence of existing resources of this kind. The Generator component then produces a response using the retrieved legal information, presenting it in a simplified and user-friendly manner. The system was evaluated through both quantitative and qualitative methods. The Retriever showed significant gains in accuracy compared to a traditional BM25 baseline, demonstrating improved ability to match complaints with relevant legal content. To assess the Generator's effectiveness, a user study was conducted in which participants compared full system responses to a baseline consisting only of retrieved legal segments. In this evaluation, 78.67% of participants preferred the generated responses, indicating the potential of the RAG architecture to provide clearer and more helpful legal guidance to consumers.

Publication details

Authors in the community:

Supervisors of this institution:

Fields of Science and Technology (FOS)

electrical-engineering-electronic-engineering-information-engineering - Electrical engineering, electronic engineering, information engineering

Publication language (ISO code)

eng - English

Rights type:

Embargo lifted

Date available:

June 19, 2026

Institution name

Instituto Superior Técnico