mirror of
https://github.com/openfaas/faas.git
synced 2025-06-08 16:26:47 +00:00
AlpineFunction additional Dockerfiles Fix Coffe, node nonroot user and change workdir DnCore nonroot and updated to 2.1, new README Fix golang user and watchdog Java user and watchdog fix Watchdog and user for node image Fix python user and watchdog Fix R username and watchdog Captainsintent user and fwatchdog ChangeColorIntent change username, fwatchdog and directory CHelloWorld remove tmp, disabled lock, fwatchdog and user DockerHubStats user, fwatchdog and dependencies Change figlet to use base alpine image Improve figlet ARM Set base image GIF-Maker MarkDownRender change base image NodeInfo change base image PhantomJS user and fwatchdog Resize Image SentimentAnalysis user and watchdog WebhookStach change root image Replace user faas with app Upgrade alpine to latest version Revert vendor folders Upgrade alpine:3.9
SentimentAnalysis
Python function provides a rating on sentiment positive/negative (polarity -1.0-1.0) and subjectivity to provided to each of the sentences sent in via the TextBlob project.
Example:
Run in the function:
# curl -s http://localhost:8080/system/functions --data-binary \
'{
"service": "sentimentanalysis",
"image": "functions/sentimentanalysis",
"envProcess": "python ./handler.py",
"network": "func_functions"
}'
Now test the function:
# curl http://localhost:8080/function/sentimentanalysis -d "Personally I like functions to do one thing and only one thing well, it makes them more readable."
Polarity: 0.166666666667 Subjectivity: 0.6
# curl http://localhost:8080/function/sentimentanalysis -d "Functions are great and proven to be awesome"
Polarity: 0.9 Subjectivity: 0.875
# curl http://localhost:8080/function/sentimentanalysis -d "The hotel was clean, but the area was terrible"; echo
Polarity: -0.316666666667 Subjectivity: 0.85