@intres/azure-text-analytics
Version:
Node-red nodes for Microsoft Azure Text Analytics
100 lines (89 loc) • 4.76 kB
HTML
<script type="text/javascript">
RED.nodes.registerType('sentiment',{
category: 'Azure Text Analytics',
color: '#008AD7',
defaults: {
name: { value: '' },
showStats: { value: 'no', required: true },
loggingOptOut: { value: 'no', required: true },
opinionMining: { value: 'no', required: true },
stringIndexType: { value: 'textElement_v8', required: true },
modelVersion: { value: '' },
},
credentials: {
key: { type: 'password' },
region: { type: 'text' }
},
inputs: 1,
outputs: 1,
label: function() {
if (this.name) return this.name;
return 'sentiment';
},
icon: 'font-awesome/fa-exchange',
});
</script>
<script type="text/html" data-template-name="sentiment">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name </label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div id="node-input-div-showStats" class="form-row">
<label for="node-input-showStats"><i class="fa fa-tag"></i> Show stats </label>
<select name="node-input-showStats" id="node-input-showStats">
<option value="yes"> Yes </option>
<option value="no"> No </option>
</select>
</div>
<div id="node-input-div-loggingOptOut" class="form-row">
<label for="node-input-loggingOptOut"><i class="fa fa-tag"></i> Logging OptOut </label>
<select name="node-input-loggingOptOut" id="node-input-loggingOptOut">
<option value="yes"> Yes </option>
<option value="no"> No </option>
</select>
</div>
<div id="node-input-div-opinionMining" class="form-row">
<label for="node-input-opinionMining"><i class="fa fa-tag"></i> Opinion Mining </label>
<select name="node-input-opinionMining" id="node-input-opinionMining">
<option value="yes"> Yes </option>
<option value="no"> No </option>
</select>
</div>
<div id="node-input-div-stringIndexType" class="form-row">
<label for="node-input-stringIndexType"><i class="fa fa-tag"></i> String index type </label>
<select name="node-input-stringIndexType" id="node-input-stringIndexType">
<option value="textElement_v8"> textElement_v8 </option>
<option value="unicodeCodePoint"> unicodeCodePoint </option>
<option value="utf16CodeUnit"> utf16CodeUnit </option>
</select>
</div>
<div id="node-input-div-modelVersion" class="form-row">
<label for="node-input-modelVersion"><i class="fa fa-tag"></i> Model version </label>
<input type="text" id="node-input-modelVersion" placeholder="Optional parameter to specify the version of the AI model">
</div>
<div class="form-row">
<label for="node-input-key"><i class="fa fa-tag"></i> Key </label>
<input type="password" id="node-input-key" placeholder="Your beautiful key">
</div>
<div class="form-row">
<label for="node-input-region"><i class="fa fa-tag"></i> Region </label>
<input type="text" id="node-input-region" placeholder="Region">
</div>
</script>
<script type="text/html" data-help-name="sentiment">
<h3>Outputs</h3>
<dl class="message-properties">
<dt> msg.payload
<span class="property-type"> Array </span>
</dt>
<dd>
An array of objects. There are three valid fields for the object: <code> id </code>, <code> text </code> and <code> language </code>(optional).<br/>
For more information, please refer to <a href="https://westus.dev.cognitive.microsoft.com/docs/services/TextAnalytics-v3-2-Preview-2/operations/KeyPhrases"> Official document </a>.
</dd>
</dl>
<p> showStats is an optional input to specify if the response should contain request and document level statistics. The default is false.</p>
<p> loggingOptOut is an optional input to specify if you opt-out of having your text input logged for troubleshooting. The default is false.</p>
<p> modelVersion is an optional input to specify the version of the AI model. The default value is "latest".</p>
<p> opinionMining is an optional input to specify if the response should contain opinion mining (aspect-based sentiment analysis) results or not. The default is false. </p>
<p> stringIndexType is an optional input to specify which method should be used to interpret string offsets. The default is 'textElement_v8'. For more information, please refer to <a href="https://aka.ms/text-analytics-offsets"> analytics-offsets section </a> </p>
</script>