[CCSDK-28] populated the seed code for dgbuilder
[ccsdk/distribution.git] / dgbuilder / core_nodes / analysis / 72-sentiment.html
1 <!--
2   Copyright 2013 IBM Corp.
3
4   Licensed under the Apache License, Version 2.0 (the "License");
5   you may not use this file except in compliance with the License.
6   You may obtain a copy of the License at
7
8   http://www.apache.org/licenses/LICENSE-2.0
9
10   Unless required by applicable law or agreed to in writing, software
11   distributed under the License is distributed on an "AS IS" BASIS,
12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   See the License for the specific language governing permissions and
14   limitations under the License.
15 -->
16
17 <script type="text/x-red" data-template-name="sentiment">
18     <div class="form-row">
19         <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
20         <input type="text" id="node-input-name" placeholder="Name">
21     </div>
22 </script>
23
24 <script type="text/x-red" data-help-name="sentiment">
25     <p>Analyses the <b>msg.payload</b> and adds a <b>msg.sentiment</b> object that contains the resulting AFINN-111 sentiment score as <b>msg.sentiment.score</b>.</p>
26     <p>A score greater than zero is positive and less than zero is negative.</p>
27     <p>The score typically ranges from -5 to +5, but can go higher and lower.</p>
28     <p>An object of word score overrides can be supplied as <b>msg.overrides</b>.</p>
29     <p>See <a href="https://github.com/thisandagain/sentiment/blob/master/README.md" target="_new">the Sentiment docs here</a>.</p>
30 </script>
31
32 <script type="text/javascript">
33     RED.nodes.registerType('sentiment',{
34         category: 'analysis-function',
35         color:"#E6E0F8",
36         defaults: {
37             name: {value:""},
38         },
39         inputs:1,
40         outputs:1,
41         icon: "arrow-in.png",
42         label: function() {
43             return this.name||"sentiment";
44         },
45         labelStyle: function() {
46             return this.name?"node_label_italic":"";
47         }
48     });
49 </script>