Connect with us

Gadgets

Node-RED Dashboard 2.0 smiles at sentiment analysis node

[ad_1]

Sentiment analysis? It’s a way of (objectively) gauging the emotions expressed in a piece of text – generally whether positive, negative or neutral. You might, for example, be automating the analysis of feedback forms or comments, or perhaps monitoring social media posts to see which way the wind is blowing, or measuring the effects of marketing campaigns… Generally, extract some insights from text-based content.

Node-RED? It’s an open source devtool – for wiring the Internet of Things – that can be used with Raspberry Pi devices and BeagleBone boards.

So, the example I’m highlighting, takes you though building a sentiment analysis system with Node-RED using Dashboard 2.0 “in a few easy steps”.


Basically, the user has a form field for pasting text content. When the form’s Submit button is pressed, it calculates the percentage based on the node’s score. And you see the result in a neat a circular progress bar and one of three different emojis based on the resulting percentage.

Obviously, the emojis used are very basic, but the sensitivity of the output could always be increased with a greater range of scoring…

Sentiment analysis

First of all, you need to actually install a Node-RED Dashboard 2.0 (instructions can be found here), then you need to create a group and drag a UI form widget to the canvas for the created group.

Next, simply add an element in the form widget – give it a name and label, select the type as multiline, and set the number of rows according to your need. Then there are a few config commands for form widget.

The next big step is to install a custom node that can the perform sentiment analysis. The guide uses node-red-node-sentiment, which is a Node-RED node that uses the AFINN-165 wordlists for sentiment analysis of words. Apparently, it returns a “sentiment object” containing a score, typically ranging from -5 to 5. You can see where this is going…

Then drag another change node to the canvas using a JSONata expression to calculate the percentage of the score, which will feed into the displayed result.

To display the result on Dashboard 2.0 it uses a Vuetify circular progress bar and emojis – you build a Vue component using FlowFuse’s UI template widget. Setting various attributes – such as size and rotate values – the final flow should look like the below:

 

Finally, it’s time to deploy the flow by clicking on the red deploy button. And then you can go to https://<your-instance-name>.flowfuse.cloud/dashboard

You can read the full step-by-step guide here.

FlowFuse

FlowFuse was founded in 2021 by Nick O’Leary, co-creator of Node-RED, to make Node-RED more accessible for enterprise use.

“FlowFuse seamlessly integrates into existing enterprise environments, offering an adaptable foundation for complex application development,” it writes.

See also: The Internet of Lego, powered by Raspberry Pi, Arduino and Node-RED

 

 

[ad_2]

Alun Williams

Source link