Customer Complaints Classification:
Craft a Simple Prompt

Welcome to the Customer Complaints Classification Tutorial! Imagine you’re a customer support analyst tasked with categorizing customer complaints to route them to the appropriate department. With GenAI Studio, you can sort these complaints efficiently, aiding data-driven decision-making.

Let’s get started! First, we’ll make sure you’re signed in with your Hugging Face access token ready, and then we’ll set up your project.

Get Set Up

Create a Project

Creating a new project is like preparing your workspace for this task.

Projects, playgrounds, and Snapshots
A project contains all the datasets, models, and experiments you use to solve a single problem. A problem can be something like classifying customer complaints or summarizing consumer feedback. The playground is where you interact with different LLMs using single prompts or an entire dataset. A snapshot is a recording in time. It contains a collection of elements that define the model generation, such as model, prompt, generation parameters, and model output.

Create a New Project: Go to your GenAI Studio home page and click Create a new project. Name Your Project: Call it Customer Complaints Tutorial and click Create. You’ll see it listed in your projects.

  1. Go to your GenAI Studio home page and select Create a new project.
  2. Name it Customer Complaints Tutorial and then select Create. You’ll see it listed in your projects.
  3. Select Customer Complaints Tutorial from the project list.

Choose a Base Model

Selecting a base model is the foundation for categorizing complaints.

  1. From the project’s Snapshots tab, select New Playground.
  2. Open the Select model drawer and then pick a base model from the list, such as meta-llama/Llama-2-7b-chat-hf.
    About the Llama-2-7b-chat-hf base model
    • Llama-2: This is the second version of the Llama model series.
    • 7b: The model has around 7 billion parameters.
    • chat: The model is specifically tuned for conversational tasks.
    • hf: Hugging Face platform.
  3. Select a Resource pool. Let’s choose the a100 resource pool of NVIDIA A100s. NVIDIA A100s are generally recommended for inference and fine-tuning However, if your resources are limited, you can use NVIDIA V100s or NVIDIA T4s.
  4. Select Load to load the model into the playground.

Provide Instructions

Now, let’s start by categorizing a single complaint.

  1. Type the following Instruction.

Instruction

You are a customer support expert in a financial sector. Your task is to classify customer complaints 
as related to a particular product from the following list. Don't include any explanation. 
Only respond with one product from the numbered list. 

Categories:
1. Credit reporting, credit repair services, or other personal consumer reports
2. Credit card or prepaid card
3. Credit card
4. Student loan
5. Debt collection
6. Checking or savings account
7. Credit reporting or other personal consumer reports
8. Vehicle loan or lease
9. Payday loan, title loan, or personal loan
10. Mortgage

Provide a Customer Complaint

  1. In Input, enter a real complaint text and prepare to categorize it.

Input

Complaint: I have not been living at the address which judgment was issued for the past year and I do not owe any money to these lawyers or landlord. I will like this removed from my credit report. Also I made final payment on my woman within account and close it. please research and clear my credit will be looking for apartment soon and this issue will not let me get the apartment I want. Thank you.
Answer:

Generate a Response

  1. Select Generate and review the output.

Set Model Generation Properties (Model Parameters)

Optimize your model’s responses by adjusting its settings.

  1. Select Manage model.
  2. In Model generation properties, set the following parameters:
    • Temperature: 0
    • Max Tokens: 64
    • Top K: 30
    • Top P: 1
  3. Select Load.

Re-generate the Response

  1. Select Generate.
  2. Review the re-generated output.

Continue to adjust the generation properties until you are satisfied with the output.

Save the Snapshot

  1. Save the snapshot and name it customer complaints snapshot1.
Saving Snapshot
Saving a snapshot is like taking a picture of your work so you can come back to it later. This way, you can easily see what you did before and try out new ideas without losing your original results. Plus, if you attach a dataset to your snapshot, you can work on many things at once, making your process more efficient and effective.

That’s great! You’ve just created a snapshot and saved it! But, there’s more to explore! In the next part, we’ll enhance our model’s capabilities by providing examples and linking a dataset containing various complaints.

By doing this, we’ll see how our model transforms responses into a structured dataset, complete with categorized complaints.


Recap

  • Craft a Simple Prompt: You learned how to create a basic prompt to engage with the model initially. This helps establish a foundation for more complex interactions.