2
votes

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

2
are you sure you have the right path to the csv file? - Leo
Thanks Leo, It is truely caused by the incorrect path. - CatrillYuan
they could improve the error message, however :-) - Leo
Yeah, I agree, too. The error message is confused. I didn't realize I miss the '@' which cause the path problem. - CatrillYuan

2 Answers

1
votes

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"
0
votes

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}