2

When I follow "Getting started with the Natural Language Classifier service" guide line, I meet problem at Stage 2: Create and train a classifier:

$ curl -i -u "<username>":"<password>" \
-F training_data=@<path_to_file>/weather_data_train.csv \
-F training_metadata="{\"language\":\"en\",\"name\":\"TutorialClassifier\"}" \
"https://gateway.watsonplatform.net/natural-language-classifier/api/v1/classifiers"

It returns:

{
  "code" : 400,
  "error" : "Data too small",
  "description" : "The number of training entries received = 1, which is smaller
 than the required minimum of 5"
}

Any one could kindly help how to solve this problem. Thanks a lot~

Here is the guide line link: http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/nl-classifier/get_start.shtml#create

ralphearle
  • 1,696
  • 13
  • 18

2 Answers2

1

Just tried following the tutorial step by step and it works fine for me. I received the response "The classifier instance is in its training phase, not yet ready to accept classify requests" meaning that the training process started.

Please double check that you specified a correct path and that the content of the weather_data_train.csv file is correct: it should contain 50 lines.

I've used the following command (I executed the command within the same directory containing the .csv file):

$ curl -i -u "myusername":"mypwd" \
-F training_data=@./weather_data_train.csv \
-F training_metadata="{\"language\":\"en\",\"name\":\"TutorialClassifier\"}" \
"https://gateway.watsonplatform.net/natural-language-classifier/api/v1/classifiers"
Umberto Manganiello
  • 3,213
  • 9
  • 16
  • Hi Manganiello, thanks a lot. It is caused by the incorrect path. I missed character '@' after 'training_data='. It goes well after I correct it. – CatrillYuan Apr 13 '16 at 01:49
0

I just had the same problem. But I found out the importance is the @ before the path. Without that it will not work. training_data=@{path_to_file}

fsulser
  • 853
  • 2
  • 10
  • 34