Skip to content

Commit

Permalink
Merge pull request #264 from chughts/convintents
Browse files Browse the repository at this point in the history
Conversation Intents and Examples
  • Loading branch information
chughts authored Mar 9, 2017
2 parents b9f5a78 + f46b03d commit 19193ad
Show file tree
Hide file tree
Showing 8 changed files with 588 additions and 152 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ Node-RED Watson Nodes for IBM Bluemix

<a href="https://cla-assistant.io/watson-developer-cloud/node-red-node-watson"><img src="https://cla-assistant.io/readme/badge/watson-developer-cloud/node-red-node-watson" alt="CLA assistant" /></a>

### New in version 0.5.1
- Implement methods to manage for Intent and Example Input for Intent, in
Conversation workspace Manager node.
- Deprecated Alchemy Nodes.
- Removed Conversation experimental node.
- Removed Discovery experimental node.
- Removed Tone Analyzer beta node.
- Removed Relationship Extraction node.
- Removed the V1 Visual Recognition node.

### New in version 0.5.0
- New node for Natural Language Understanding
- watson-developer-cloud dependency forces node engine >= 4.5
Expand Down
9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-node-watson",
"version": "0.5.0",
"version": "0.5.1",
"description": "A collection of Node-RED nodes for IBM Watson services",
"dependencies": {
"alchemy-api": "^1.3.0",
Expand All @@ -11,7 +11,7 @@
"temp": "^0.8.3",
"qs": "6.x",
"image-type": "^2.0.2",
"watson-developer-cloud": "^2.22.1",
"watson-developer-cloud": "^2.25.1",
"kuromoji": "^0.0.5",
"is-docx": "^0.0.3"
},
Expand All @@ -34,10 +34,8 @@
"nodes": {
"watson-conversation-v1":"services/conversation/v1.js",
"watson-conversation-workspace-manager-v1":"services/conversation/v1-workspace-manager.js",
"watson-conversation-v1-experimental":"services/conversation/v1-exp.js",
"watson-discovery-v1":"services/discovery/v1.js",
"watson-discovery-v1-query-builder":"services/discovery/v1-query-builder.js",
"watson-discovery-v1-experimental":"services/discovery/v1-exp.js",
"watson-document-conversion-v1": "services/document_conversion/v1.js",
"watson-concept-insights-v2": "services/concept_insights/v2.js",
"alchemy-date-extraction": "services/alchemy_date_extraction/v1.js",
Expand All @@ -54,16 +52,13 @@
"alchemy-news-v1": "services/alchemy_data_news/v1.js",
"watson-personality-insights-v1": "services/personality_insights/v1.js",
"watson-personality-insights-v3": "services/personality_insights/v3.js",
"watson-relationship-extraction-v1": "services/relationship_extraction/v1.js",
"watson-retrieve-and-rank-v1": "services/retrieve_and_rank/v1.js",
"watson-speech-to-text-v1": "services/speech_to_text/v1.js",
"watson-speech-to-text-corpus-builder-v1": "services/speech_to_text/v1-corpus-builder.js",
"watson-text-to-speech-v1": "services/text_to_speech/v1.js",
"watson-text-to-speech-corpus-builder-v1": "services/text_to_speech/v1-corpus-builder.js",
"watson-tone-analyzer-v3": "services/tone_analyzer/v3.js",
"watson-tradeoff-analytics-v1": "services/tradeoff_analytics/v1.js",
"watson-tone-analyzer-v3-beta": "services/tone_analyzer/v3-beta.js",
"watson-visual-recognition-v1": "services/visual_recognition/v1.js",
"watson-visual-recognition-v3": "services/visual_recognition/v3.js",
"watson-similarity-search-v3": "services/similarity_search/v3.js",
"alchemy-vision-v1": "services/alchemy_vision/v1.js"
Expand Down
52 changes: 30 additions & 22 deletions services/alchemy_data_news/v1.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'enriched.url.author','enriched.url.taxonomy.taxonomy_.label','enriched.url.taxonomy.taxonomy_.score', 'enriched.url.concepts'];

RED.nodes.registerType('news',{
category: 'IBM_Watson',
category: 'Watson Deprecated',
color: '#FFFF80',
defaults: {
name: {value:""},
Expand All @@ -20,7 +20,7 @@
results: {value:[]},
max: {value:10,required: true},
mode: {value:"json",required: true},
},
},
inputs:1,
outputs:1,
icon: "news2.png",
Expand All @@ -32,11 +32,11 @@
var node = this;

$.getJSON('watson-news/vcap/',function(data) {

node.newss = data;
var last = $('#node-input-service').children().last();
var opts = [];

for (var i=0; i < data.length; i++) {
var selected = node.service === data[i].name;
opts.push(
Expand All @@ -45,7 +45,7 @@
'</option>'
);
}

if (opts.length === 0) {
node.service = "_ext_";
$('#node-input-service').find("option").filter(function() {
Expand All @@ -54,7 +54,7 @@
} else {
last.before(opts.join(""));
}

if (node.service === '_ext_') {
$("#external_news_service :input").attr('disabled',false);
} else {
Expand All @@ -67,7 +67,7 @@
}
$("#external_news_service :input").attr('disabled',true);
}

if (node.command === 'list') {
$("#node-input-classifier :input").attr('disabled',true);
} else {
Expand Down Expand Up @@ -107,11 +107,11 @@
if ($.inArray(val,node.results)<0) {
$('#node-input-results-list').append($("<option></option>")
.attr("value",val)
.text(val));
.text(val));
} else {
$('#node-input-results').append($("<option></option>")
.attr("value",val)
.text(val));
.text(val));
}
});

Expand All @@ -133,7 +133,7 @@
$("#node-input-results-list").val().forEach(function(val) {
$("#node-input-results").append($("<option></option>")
.attr("value",val)
.text(val));
.text(val));
$("#node-input-results-list option[value='"+val+"']").remove();
});
});
Expand All @@ -142,7 +142,7 @@
$("#node-input-results").val().forEach(function(val) {
$("#node-input-results-list").append($("<option></option>")
.attr("value",val)
.text(val));
.text(val));
$("#node-input-results option[value='"+val+"']").remove();
});
});
Expand Down Expand Up @@ -178,7 +178,7 @@
fields.forEach(function(val) {
select11.append($("<option></option>")
.attr("value",val)
.text(val));
.text(val));
});
var select12 = $("<select></select>",{class:"node-input-op",type:"text",style:"margin-left: 5px;width:120px;"}).appendTo(row2);
var option121 = $("<option></option>").text("Contains").val("cc").appendTo(select12);
Expand All @@ -195,9 +195,9 @@
$("#node-input-queries-container").append(row1);

if (query) {
select11.val(query.field);
select12.val(query.op);
input13.val(query.value);
select11.val(query.field);
select12.val(query.op);
input13.val(query.value);
}

button1.click(function() {
Expand Down Expand Up @@ -261,14 +261,14 @@
<input type="text" id="node-input-start" style="width: 110px;">
<label for="node-input-end" style="margin-left: 10px;"><i class="fa fa-calendar"></i> End</label>
<input type="text" id="node-input-end" style="width: 110px;">
</div>
</div>
<div class="form-row">
<label for="node-input-results-list"><i class="fa fa-check"></i> Outputs</label>
<select id="node-input-results-list" style="width: 25%;" size='4' multiple></select>
<a href="#" class="editor-button editor-button-small" id="node-input-add-result"margin- style="margin-left: 4px;"><i class="fa fa-toggle-right"></i> Add</a>
<a href="#" class="editor-button editor-button-small" id="node-input-remove-result" style="margin-bottom: 4px;">Remove <i class="fa fa-toggle-left"></i></a>
<select id="node-input-results" style="margin-left: 10px;width: 25%;" size='4' multiple></select>
</div>
</div>
<div class="form-row">
<label for="node-input-max"><i class="fa fa-list"></i> Max. Results</label>
<input type="text" id="node-input-max" style="width: 30px;">
Expand All @@ -279,7 +279,7 @@
<div class="form-row">
<label for="node-input-query"><i class="icon-tag"></i> Query</label>
<input type="text" id="node-input-query">
</div>
</div>
</div>
<div id="node_query_wizard">
<div class="form-row">
Expand All @@ -295,13 +295,21 @@
</script>

<script type="text/x-red" data-help-name="news">
<p><b>NB:</b> The Alchemy News service that this node
uses has been deprecated in favor Watson News in the
new Watson Discovery service. Once the service
has been switched off this node will no longer work.
The node will be removed from the palette in a
future release.
</p>
<br/>

<p>Watson Alchemy News provides you with access to a hyper-relevant, curated dataset of news and blogs that has been enriched with AI.</p>
<p>In order to use the service you need to provide a key. Start and end dates for the search must also be provided.
The rest of the fields are optional and default values will be used if none is specified. If the list of output
<p>In order to use the service you need to provide a key. Start and end dates for the search must also be provided.
The rest of the fields are optional and default values will be used if none is specified. If the list of output
fields is empty, only the number of found articles will be returned.</p>
<p>Configuration values will be taken from the input message if available. Start and end date, query, result fields and maximum number
<p>Configuration values will be taken from the input message if available. Start and end date, query, result fields and maximum number
of results should be placed in <b>msg.start</b>, <b>msg.end</b>, <b>msg.query</b>, <b>msg.result</b>, <b>msg.maximum</b> respectively.
More information on how to build the queries can be found at the <a href='https://www.ibm.com/watson/developercloud/dashboard/en/alchemyapi-dashboard.html'>
API Alchemy documentation</a>.</p>
</script>

10 changes: 9 additions & 1 deletion services/alchemy_date_extraction/v1.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
</script>

<script type="text/x-red" data-help-name="alchemy-date-extraction">
<p><b>NB:</b> The Alchemy Language service that this node
uses has been deprecated in favor of the
new Watson Natural Language Understanding service. Once the service
has been switched off this node will no longer work.
The node will be removed from the palette in a
future release.
</p>
<br/>
<p>Using the Date Extract node, you can use the Alchemy APIs to analyse external URLs, HTML files or text content.</p>
<p>For full details on the feature details, please see the <a href="http://www.ibm.com/watson/developercloud/alchemy-language/api/v1/#date_extraction">Alchemy API documentation</a></p>
<p>The content to be analysed should be passed in on <code>msg.payload</code>.</p>
Expand All @@ -47,7 +55,7 @@
<script type="text/javascript">
(function() {
RED.nodes.registerType('alchemy-date-extraction', {
category: 'IBM Watson',
category: 'Watson Deprecated',
defaults: {
name: {value: ""},
},
Expand Down
10 changes: 9 additions & 1 deletion services/alchemy_language/v1.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@
</script>

<script type="text/x-red" data-help-name="alchemy-feature-extract">
<p><b>NB:</b> The Alchemy Language service that this node
uses has been deprecated in favor of the
new Watson Natural Language Understanding service. Once the service
has been switched off this node will no longer work.
The node will be removed from the palette in a
future release.
</p>
<br/>
<p>Using the Feature Extract node, you can use the Alchemy APIs to analyse external URLs, HTML files or text content.</p>
<p>The following features are available for analysis:</p>
<ul>
Expand Down Expand Up @@ -162,7 +170,7 @@
<script type="text/javascript">
(function() {
RED.nodes.registerType('alchemy-feature-extract', {
category: 'IBM Watson',
category: 'Watson Deprecated',
defaults: {
name: {value: ""},
"page-image": {value: ""},
Expand Down
Loading

0 comments on commit 19193ad

Please sign in to comment.