UNPKG

node-red-contrib-viseo-ms-language

Version:

VISEO Bot Maker - Microsoft Cognitive Services Language

93 lines (86 loc) 4.14 kB
<script type="text/javascript"> RED.nodes.registerType('ms-text-analytics',{ category: '💬_language', color: '#8accff', defaults: { name: { value: undefined }, input: { value: undefined, required: false }, output: { value: undefined, required: false }, enpoint: { value: undefined, required: false }, key: { value: undefined, required: true, type: 'ms-config'}, api: { value: "keyPhrases" }, inputType: { value: "msg" }, endpointType: { value: "str" } }, inputs: 1, outputs: 1, icon: "azure.png", align: "left", paletteLabel: 'Text Analytics', label: function() { return this.name || "Text Analytics"; }, oneditprepare: function() { $("#node-input-input").typedInput({ default: 'msg', types: ['msg','global','json'], typeField: $("#node-input-inputType") }); $("#node-input-output").typedInput({ default: 'msg', types: ['msg'], type: 'msg' }); $("#node-input-endpoint").typedInput({ default: 'msg', types: ['str','msg','global'], typeField: $("#node-input-endpointType") }); } }); </script> <script type="text/x-red" data-template-name="ms-text-analytics"> <div class="form-row"> <label for="node-input-name"><i class="icon-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> <br> <b>API settings </b> <div class="form-row"> <br> <label for="node-input-key"><i class="fa fa-lock"></i> Key</label> <input type="text" id="node-input-key"> </div> <div class="form-row"> <label for="node-input-endpoint"><i class="fa fa-lock"></i> Endpoint</label> <input type="text" id="node-input-endpoint" style="width: 70%" placeholder="https://westeurope.api.cognitive.microsoft.com/text/analytics/v2.0"/> <input type="hidden" id="node-input-endpointType"> </div> <div class="form-row"> <label for="node-input-input"><i class="fa fa-sign-in"></i> Input</label> <input type="text" id="node-input-input" style="width: 70%" placeholder="payload"/> <input type="hidden" id="node-input-inputType"> </div> <div class="form-row"> <label for="node-input-output"><i class="fa fa-sign-out"></i> Output</label> <input type="text" id="node-input-output" style="width: 70%" placeholder="payload"/> </div> <br> <b>API parameters </b> <div class="form-row"> <br> <label for="node-input-api"><i class="fa fa-tasks"></i> API</label> <select id="node-input-api" style="width:70%;"> <option value="languages">Detect Language</option> <option value="entities">Entities</option> <option value="keyPhrases">Key Phrases</option> <option value="sentiment">Sentiment</option> </select> </div> </script> <script type="text/x-red" data-help-name="ms-text-analytics"> <p>Uses the Microsoft Cognitive Services Language API to get informations on a text. </p> <h3>Details</h3> <p>Properties</p> <dl class="message-properties"> <dt>Key <span class="property-type">config</span></dt> <dd>credentials for the Content Moderator API</dd> <dt>Endpoint <span class="property-type">string</span></dt> <dd>endpoint specified with the key in Azure Portal</dd> <dt>Input <span class="property-type">string</span></dt> <dd>where to get the input text</dd> <dt>Output <span class="property-type">string</span></dt> <dd>where to store the results</dd> </dl> <h3>References</h3> <ul> <li><a href="https://westus.dev.cognitive.microsoft.com/docs/services/TextAnalytics.V2.0/">Microsoft Text Analytics</a> - reference</li> <li><a href="https://github.com/NGRP/node-red-contrib-viseo/">VISEO BotMaker</a> - the nodes github repository</li> </ul> </script>