In [*]: loading

Skip to content
All projects

NLP

AI-Powered Customer Support Ticket Classification and Sentiment Analysis

Hawa Doumbe Traore

Updated 7 Nov 2026

Abstract

This project develops an AI system that classifies customer support requests into seven categories and analyzes customer sentiment. Using 210 tickets, the models achieved 88.10% accuracy in category classification and improved sentiment analysis accuracy from 61.90% to 88.10%, incorporating human validation.

  • Python
  • Scikit-learn
  • Pandas
  • NumPy
  • Natural Language Processing (NLP)
  • Machine Learning
  • Google Colab

1. Problem

Customer support teams receive large volumes of requests containing problems, questions, and feedback. Processing these messages manually can be time-consuming and make it difficult to quickly identify the topic of each request and the sentiment expressed by the customer.

The objective of this project is to develop an artificial intelligence system that automatically classifies support tickets into different categories and identifies their sentiment as positive, negative, or neutral. This approach aims to simplify request analysis and support customer service agents.

2. Data

The project uses a dataset containing 210 customer support tickets, distributed across 7 categories, with 30 tickets per category.

The sentiment distribution is:

  • Neutral: 85 tickets
  • Positive: 70 tickets
  • Negative: 55 tickets

The dataset was divided into two subsets:

  • Training set: 168 tickets (80%)
  • Test set: 42 tickets (20%)

The text messages serve as the system's input data, while the categories and sentiment labels are used for supervised learning and model evaluation.

3. Method

The project relies on Natural Language Processing (NLP) and Machine Learning techniques to analyze customer messages.

The methodology consists of the following steps:

  1. Preparation and organization of customer support tickets.
  2. Splitting the dataset into training and testing sets.
  3. Developing classification models to identify request categories and customer sentiment.
  4. Evaluating model performance using accuracy.
  5. Developing an interface where users can enter a support ticket and receive an automated analysis.

A second version of the sentiment analysis model was developed to improve its performance. Human validation is also incorporated into the approach, allowing support agents to review the system's predictions.

4. Results

The results demonstrate that the system can classify customer support requests and identify the sentiment expressed in customer messages.

The main performance results are:

  • Ticket category classification: 88.10% accuracy.
  • Sentiment analysis – Version 1: 61.90% accuracy.
  • Sentiment analysis – Version 2: 88.10% accuracy.

The second sentiment analysis model achieved an improvement of 26.20 percentage points compared with the first version.

An interactive interface also allows users to enter a support ticket and display its analysis. These results demonstrate the potential of NLP and Machine Learning in supporting customer service teams.

Table 1. Main results.
Metric Value
Number of tickets 210
Training samples 168
Test samples 42
Category classification accuracy 88.10%
Sentiment accuracy (V1) 61.90%
Sentiment accuracy (V2) 88.10%
Overview of a 210-ticket customer support dataset covering 7 categories and 3 sentiment classes.
Figure 1. The project uses a custom dataset of 210 customer support tickets. Each entry contains the ticket text, its reference category, and an annotated sentiment label. The dataset includes 7 categories with 30 tickets each and 3 sentiment classes.
Diagram showing how customer ticket texts are converted into numerical vectors using TF-IDF.
Figure 2. After preprocessing, TF-IDF converts tickets into numerical vectors by weighting words according to their frequency and importance for classification.
Screenshot showing predicted ticket categories, confidence scores.
Figure 3. The model automatically classifies tickets into seven categories and displays a confidence score for each prediction. It achieves 88.10% accuracy on the test set.
Illustration of the function that automatically assigns ticket priorities using predefined rules.
Figure 4. A rule-based function automatically assigns priority levels to customer support tickets. It uses classification and sentiment analysis results to facilitate ticket management and identify requests requiring special attention.
Screenshot showing multiple customer tickets analyzed simultaneously with predicted categories, sentiments, and priority levels.
Figure 5. Batch analysis enables multiple customer support tickets to be processed simultaneously. For each ticket, the system predicts its category, sentiment, and priority level, demonstrating automated management of requests with different urgency levels.
Screenshot of the interactive interface displaying a ticket's predicted category, sentiment, and priority.
Figure 6. The interactive interface allows users to enter a customer support ticket and run an automatic analysis. The system displays prediction results, including the category, detected sentiment, and priority level, making requests easier to understand and manage.

5. Limitations and future work

Despite the encouraging results, the project has several limitations. The dataset contains only 210 tickets, which is relatively small compared with the diversity of real-world customer support requests. Performance may also vary depending on message quality, wording, and the data used for training.

Future improvements could include:

  • Using a larger and more diverse dataset.
  • Exploring more advanced NLP models, particularly Transformer-based architectures.
  • Evaluating performance with additional metrics such as precision, recall, and F1-score.
  • Improving the interface and integrating the system into a customer support platform.
  • Strengthening human validation to reduce classification errors.

6. References

  1. Google. (n.d.). Google Colaboratory FAQ. Google Research. https://research.google.com/colaboratory/faq.html

  2. Holzinger, A. (2016). Interactive machine learning for health informatics: When do we need the human-in-the-loop? Brain Informatics, 3, 119–131. https://doi.org/10.1007/s40708-016-0042-6

  3. Jurafsky, D., & Martin, J. H. (2026). Speech and language processing: An introduction to natural language processing, computational linguistics, and speech recognition with language models (3rd ed., online manuscript). Stanford University. https://web.stanford.edu/~jurafsky/slp3/

  4. Liu, B. (2012). Sentiment analysis and opinion mining. Morgan & Claypool Publishers. https://doi.org/10.2200/S00416ED1V01Y201204HLT016

  5. Liu, B., & Zhang, L. (2012). A survey of opinion mining and sentiment analysis. In C. C. Aggarwal & C. Zhai (Eds.), Mining text data (pp. 415–463). Springer. https://doi.org/10.1007/978-1-4614-3223-4_13

  6. Matplotlib Development Team. (n.d.). Matplotlib documentation. https://matplotlib.org/stable/

  7. NumPy Developers. (n.d.). NumPy documentation. https://numpy.org/doc/stable/

  8. pandas Development Team. (n.d.). pandas documentation. https://pandas.pydata.org/docs/

  9. Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., & Duchesnay, É. (2011). Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12, 2825–2830. https://jmlr.org/papers/v12/pedregosa11a.html

  10. Python Software Foundation. (n.d.). Python 3 documentation. https://docs.python.org/3/

  11. Sebastiani, F. (2002). Machine learning in automated text categorization. ACM Computing Surveys, 34(1), 1–47. https://doi.org/10.1145/505282.505283

Cite

@misc{traore2026ai,
  author       = {Traore, Hawa Doumbe},
  title        = {{AI-Powered Customer Support Ticket Classification and Sentiment Analysis}},
  year         = {2026},
  howpublished = {\url{https://hawadtraore.alwaysdata.net/en/projects/ai-customer-support-sentiment-analyzer}},
  note         = {Case study},
  url          = {https://colab.research.google.com/drive/1Fm42H3lxT6jOdUg6PJLUc6GLWNuniksg}
}