I am trying to train my model in IBM Watson NLU. I have to classify emails into 2 labels. The instance has been created and I am passing the correct Model ID too.

 model_id = model['model_id']
 model_to_view = nlu.get_classifications_model(model_id=model_id).get_result()
    
 print("Information about the created NLU Classifications model:")
 print(json.dumps(model_to_view, indent=2))

The training status shows as 'started' initially, but after that it shows the below mentioned error:

Information about the created NLU Classifications model:
{
  "name": "MyClassificationsModel1",
  "user_metadata": null,
  "language": "en",
  "description": null,
  "model_version": "1.0.1",
  "version": "1.0.1",
  "workspace_id": null,
  "version_description": null,
  "status": "error",
  "notices": [
    {
      "message": "Training data validation failed: Too few examples for label class. Minimum of 5 required"
    }
  ],
"model_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
"features": [
    "classifications"
  ],
  "created": "2022-04-28T12:03:23Z",
  "last_trained": "2022-04-28T12:03:23Z",
  "last_deployed": null
}
1

There are 1 best solutions below

0
On

Your training data needs to provide 5 samples for each classification label. See

https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-classifications#classification-training-data-requirements

for classifications training data requirements. If you have 2 labels, there should be a minimum of 10 (5 each) samples.