Customer Complaints Classification:
Provide Examples and Link a Dataset

In this part of the tutorial, we explore how to enhance the model’s understanding and responses by using a dataset filled with examples. Initially, we worked with a single complaint. Now, by introducing a broader range of examples, the model can better grasp variations and details, leading to more precise categorizations.

Import a Pre-Loaded Hugging Face Dataset

Datasets are crucial for complex tasks or further refining (fine-tuning) your model.

  1. Go to the Datasets tab. This is where you can manage different datasets.
  2. Select New Dataset.
  3. In Dataset type, select the Hugging Face tab.
  4. Fill in the details:
    • Dataset name: determined-ai/customers-complaints
    • Description: Customer complaints pre-processed and classified into issue categories
    • Config name: Leave this field blank. This dataset does not have multiple configurations, or sub-parts. See Hugging Face Configurations for more details.
  5. Select Create Dataset.

Your dataset is now ready to be linked to your project!

Connecting your dataset to the model allows it to use the real data during the response generation.

  1. Go to the Snapshots tab and select your saved snapshot to open the playground.

  2. Open the dataset drawer, then in Load dataset, choose the determined-ai/customers-complaints dataset.

  3. Preview the dataset samples to understand the data structure, then select Load.

    The dataset feature columns like Product and Consumer_complaint_narrative are essential for your next steps.

Set Up Your Prompt

Provide clear instructions to the model on how to use the data:


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. 

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


Below are examples:

Complaint: {{Consumer_complaint_narrative}} 
Answer: {{Product}}


Complaint: {{Consumer_complaint_narrative}}

Expected Output


Generate and Review the Model’s Response

  1. Select Generate.
  2. Review the generated output and check how accurately the complaints are categorized.

By providing examples and linking a dataset, we can see the new output contains the original linked dataset with new columns including a column where the model has categorized the complaint.

Save Your Progress

After adjustments and testing:

  1. Select Save Snapshot.
  2. Select Save as New Snapshot and name it customer complaints snapshot2 to capture this state.
  3. Select Save.

Continuing to refine your model might involve crafting more complex prompts or conducting additional fine-tuning.


  • Provide Examples and Link a Dataset: By incorporating examples and connecting a dataset, you enabled the model to understand and process a broader range of data. This step is crucial for enhancing the model’s ability to categorize information accurately.