Applying Generative AI and pre-trained Transformer models to analyze customer service logs, uncovering insights in sentiment, issue patterns, and response quality to enhance customer interaction strategies.
This project analyzes customer service conversation logs from Fresh Fare Meal Kits using Generative AI (GenAI) and pre-trained NLP models from the Hugging Face Transformers library. The goal is to extract actionable insights from 20 real call logs, enabling data-driven improvements to customer interaction protocols.
The project was developed for the QuickServe Meals Analytics Team as part of a broader customer experience enhancement initiative.
- Apply Generative AI models (Google's FLAN-T5) to analyze text and conversation data
- Gain proficiency in utilizing pre-trained NLP models from the Transformers library
- Understand how generative AI models learn from data to generate new content
- Design and develop AI-driven solutions to solve complex problems in customer service
genai-customer-insights-nlp/
│
├── Call_Logs.csv # Raw dataset: 20 customer service call logs
├── gen_ai_customer_insights.ipynb # Main Jupyter Notebook (all 5 tasks)
├── requirements.txt # Python dependencies
└── README.md # Project documentation
| Property | Detail |
|---|---|
| File | Call_Logs.csv |
| Records | 20 customer service conversation logs |
| Structure | Single Logs column (unstructured text) |
| Date Range | April 3 – April 29, 2024 |
| Company | Fresh Fare Meal Kits |
Each log entry contains:
- Date and Time of the call
- Agent name and Client name
- Full dialogue from greeting to resolution
| Tool / Library | Purpose |
|---|---|
| Python 3.12 | Core programming language |
| pandas | Data loading and manipulation |
| Transformers | Pre-trained NLP models (Hugging Face) |
| google/flan-t5-base | Conversation summarization & reason extraction |
| MoritzLaurer/multilingual-MiniLMv2-L6-mnli-xnli | Zero-shot cancellation detection |
| matplotlib | Plotting and visualization |
| wordcloud | Word cloud generation |
Transform unstructured call logs into a structured DataFrame by extracting:
- Date, Time, Agent, Client, and Conversation columns
Use google/flan-t5-base to generate concise summaries of each customer conversation, capturing the main points discussed.
Apply zero-shot classification (MoritzLaurer/multilingual-MiniLMv2-L6-mnli-xnli) to flag conversations that contain cancellation requests — labelled as cancellation or other.
For flagged cancellation conversations, use FLAN-T5 to extract the underlying reasons customers are choosing to cancel their subscriptions.
Generate word clouds for both full conversations and their summaries to visually identify common themes and customer concerns.
- Python 3.12+
- Git
- VS Code (with Jupyter extension) or GitHub Codespaces
git clone https://github.com/your-username/genai-customer-insights-nlp.git
cd genai-customer-insights-nlp# Create virtual environment
python -m venv venv
# Activate (Linux/Mac/Codespaces)
source venv/bin/activatepip install --upgrade pip
pip install transformers torch sentencepiece pandas numpy matplotlib seaborn scikit-learn jupyter ipykernel notebook tqdm datasets wordcloudpython -m ipykernel install --user --name=venv --display-name "Python (venv)"pip freeze > requirements.txtOpen gen_ai_customer_insights.ipynb in VS Code or Jupyter and select the Python (venv) kernel.
- 5 out of 20 conversations involved subscription cancellation requests
- Primary cancellation reasons: delivery delays, poor ingredient quality, missing recipe cards
- Most frequent issues: missing ingredients, damaged items, late deliveries
- Word cloud analysis reveals high frequency of terms: delivery, cancel, ingredient, kit, issue
- Generative AI (GenAI) — How models like FLAN-T5 generate text from prompts
- Natural Language Processing (NLP) — Text classification, summarization, information extraction
- AI Applications — Real-world customer service analytics
- Transformers Library — Loading and using pre-trained models from Hugging Face
- Python Proficiency
- Basic Machine Learning Knowledge
- Google for the FLAN-T5 model
- MoritzLaurer for the multilingual zero-shot classification model
- Hugging Face for the Transformers library
- Fresh Fare Meal Kits / QuickServe Meals analytics team for the dataset and project brief
Built with ❤️ for the QuickServe Meals Analytics Team