Conversational AI

Bookstore Chatbot with Rasa

A multilingual conversational AI assistant for an e-bookstore, providing personalized recommendations and order tracking

February 2022
Natural Language Processing
E-commerce
Automating customer service for an e-bookstore with conversational AI

Project Overview

Bookstore E-commerce Interface

E-bookstore interface with integrated chatbot assistant

This project addresses the growing need for automated customer service in e-commerce, specifically for an online bookstore. Traditional FAQ lists and static search functions provide limited user experience compared to the natural interaction possible with a conversational interface.

Our solution combines Rasa, an open-source conversational AI framework, with spaCy for natural language understanding to create a chatbot that can help users find books, place orders, check order status, and get personalized recommendations in both German and English.

Microservice-based architecture with containerized components

System Architecture

System Architecture Diagram

Complete system architecture showing chatbot, frontend, and backend integration

Chatbot Components

  • Rasa Core: Dialogue management engine
  • Rasa NLU: Intent classification & entity extraction
  • spaCy NLP: Custom entity recognition model
  • Language Detection: Multilingual support
  • Sentiment Analysis: User mood understanding

E-Bookstore Stack

  • Frontend: Vue.js with chatbot widget
  • Backend: Node.js REST API
  • Database: MongoDB for books & orders
  • API Documentation: Swagger
  • Reverse Proxy: NGINX
Smart features powered by NLP and integration with the e-commerce platform

Chatbot Capabilities

Book Information

Provides summaries, reviews, and ratings for books in the catalog. Can answer questions about specific authors, genres, and book details.

Order Management

Places orders, checks order status, and provides delivery estimates. Integrates with the e-commerce backend via REST API calls.

Recommendations

Suggests books based on user preferences, search history, and filters. Understands complex queries like price ranges and genre combinations.

Custom natural language processing pipeline for bookstore domain

NLP Implementation

Custom Entity Recognition

To handle book-specific entities like GENRE, WORK_OF_ART, and PRICE, we created and annotated a custom training dataset. The dataset includes e-bookstore specific queries and book reviews from German news sources. The Prodigy annotation tool was used to label entities within examples.

NLU Pipeline Components

  • Language Detection: Based on spaCy fastlang to support multilingual conversations
  • Sentiment Analysis: VADER-based component to understand user emotions
  • Intent Classification: Trained to recognize 10+ domain-specific intents
  • Entity Recognition: Custom spaCy model for book-related entities
Performance metrics for the NLU model and chatbot

Evaluation Results

Intent Classification Performance

The intent classification model showed strong performance in recognizing user intents, with only minor confusion between similar intents like "ask_about_delivery" and "ask_for_order_number". Overall accuracy was above 90% for the primary intents.

User inputDetected intentSentimentLanguage
Ich möchte gerne ein Buch bestellen.order: 0.723neutral: 0.649de: 0.998
Das ist genau was ich gesucht habe, vielen Dank =)mood_great: 0.994positive: 0.403de: 0.993
Bitte Bücher unter 15€ anzeigen.filter: 0.999neutral: 1.0de: 0.996
Project Details
Date
February 2022
Category
Conversational AI / E-commerce
Technologies
Rasa
NLP
Python
Vue.js
Docker
JavaScript
MongoDB
NginX
Swagger
SpaCy
Prodigy
Transformers
BERT
Key Achievements
  • Multilingual chatbot supporting German and English
  • Integration with e-commerce API for order status and tracking
  • Custom NLP pipeline with sentiment analysis
  • Microservice architecture with Docker containerization
  • Entity extraction for book genres, prices, and titles