Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
.gitignore
Function.csproj
FunctionHandler.cs
README.md
sentiment.model

README.md

get_sentiment_mlnet

This is an OpenFaaS function that uses ML.NET to analyze the sentiment of a supplied list of phrases. It requires the included sentiment.model file to be included as part of the function build. The sentiment model file was generated using my sample sentiment analysis application that is available here. You can use this application with different training data to generate an updated sentiment.model file, rebuild and redeploy the function.

This is a sample request for sentiment analysis on two phrases.

{
    "Phrases":[
        "This is good.",
        "This is horrible."
    ]
}

The response would look like this.

{
    "Phrases": [
        {
            "Phrase": "This is good.",
            "Sentiment": "Positive"
        },
        {
            "Phrase": "This is horrible.",
            "Sentiment": "Negative"
        }
    ]
}