Creating advertising content based on customer sentiment analysis using retrieval-augmented generation (RAG) models
Jafariandehkordi, Amirreza (2025)
Kandidaatintyö
Jafariandehkordi, Amirreza
2025
School of Engineering Science, Tietotekniikka
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi-fe2025050738183
https://urn.fi/URN:NBN:fi-fe2025050738183
Tiivistelmä
This paper presents an automated pipeline that converts large-scale customer reviews into personalized advertisement copy through the combination of transformer-based sentiment analysis with retrieval-augmented generation (RAG). First, Amazon review texts are pre-processed and used to fine-tune a BERT classifier that classifies each review as positive, neutral or negative, resulting in 83% overall accuracy along with F1 scores of 0.91 (positive) and 0.83 (negative). Rich product metadata are then embedded using a SentenceTransformer model and indexed using FAISS to support efficient approximate nearest-neighbour search. When a new review comes in, the system looks up the most semantically relevant product records, then generates a prompt that combines the detected sentiment, key review phrases and factual product information. A GPT-based generator converts this prompt into advertisement copy that highlights praised attributes, or transparently addresses flaws with better alternatives. Qualitative analysis indicates that the advertisements are close to the tone of the customers, are factually consistent, cover the wide range of products, and demonstrate the applicability of the model to dynamic e-commerce catalogues. The approach minimizes the labour involved to produce context-aware marketing messages, enables near real-time response to consumer opinion and presents the potential template for the creation of future sentiment-led, knowledge-based content in digital marketing.