openfaas / workshop

Learn Serverless for Kubernetes with OpenFaaS
https://www.openfaas.com
MIT License
960 stars 312 forks source link

Lab 4 | Error when no text present #91

Closed divandauth closed 5 years ago

divandauth commented 5 years ago

During our workshop a couple of us had the following issue:

When calling the function after making all the changes in lab 4, it fails when there is no text present.

Perhaps you can add a note to remind users to always have text present when calling the sentimentanalysis function.

rgee0 commented 5 years ago

Could you point me where you are finding an instruction to send no text to sentimentanalysis? I've found this in Lab 4:

The Sentiment Analysis function will tell you the subjectivity and polarity (positivity rating) of any sentence. The result of the function is formatted in JSON as per the example below:

$ echo -n "California is great, it's always sunny there." | faas-cli invoke sentimentanalysis
{"polarity": 0.8, "sentence_count": 1, "subjectivity": 0.75}

Is the suggestion that we need to be explicit about the sentence being non-zero in length?

rgee0 commented 5 years ago

Derek close: inactive