Icon

01_​Sentiment_​Analysis_​Variable_​Input

Sentiment Analysis: JSON Input

This workflow showcases how the Container Input (Variable) and Container Output (JSON) nodes can be used to create a REST API for a workflow that can then be deployed as inference workflow to KNIME Edge. The workflow can be called via REST and classifies a review as positive or negative.

When deployed to KNIME Edge, a POST request with the following JSON body can be used for testing:

{
"content": "What a crappy flight, I hated it! It was the worst experience ever"
}

The response will be:

{
"Prediction (Document class) (Confidence)": 0.7526856112217033,
"Prediction (Sentiment)": "Negative"
}



REST API for Sentiment AnalysisThis workflow showcases how the Container Input (Variable) and Container Output(JSON) nodes can be used to create a REST API for a workflow that can then bedeployed as inference workflow to KNIME Edge. The workflow can be called via RESTand classifies a review as positive or negative.See the workflow description for example requests and responses. Prediction/Inferencing REST API REST Response Read Trained ML ModelExtract recomended label Create term vector of the test set with identicalfeature space of thetraining setAssigning text to predicted classesOutput prediction andconfidenceRead Document VectorInput one commentas String variableModel Reader Category To Class DocumentVector Applier Rule Engine ContainerOutput (JSON) Preprocessing Postprocessing Model Reader Gradient BoostedTrees Predictor Container Input(Variable) REST API for Sentiment AnalysisThis workflow showcases how the Container Input (Variable) and Container Output(JSON) nodes can be used to create a REST API for a workflow that can then bedeployed as inference workflow to KNIME Edge. The workflow can be called via RESTand classifies a review as positive or negative.See the workflow description for example requests and responses. Prediction/Inferencing REST API REST Response Read Trained ML ModelExtract recomended label Create term vector of the test set with identicalfeature space of thetraining setAssigning text to predicted classesOutput prediction andconfidenceRead Document VectorInput one commentas String variableModel Reader Category To Class DocumentVector Applier Rule Engine ContainerOutput (JSON) Preprocessing Postprocessing Model Reader Gradient BoostedTrees Predictor Container Input(Variable)

Nodes

Extensions

Links