Reputation: 329
I want to change my index.html page to display my Node Red flow. How do I add the HTTPRequest->Template->HTTPResponse sequence to NLC flow?
The following Node Red flow displays in debug mode only. https://github.com/watson-developer-cloud/node-red-labs/blob/master/basic_examples/natural_language_classifier/nlc_flows.json
Also see for more general instructions: https://github.com/watson-developer-cloud/node-red-labs/tree/master/basic_examples/natural_language_classifier
Upvotes: 1
Views: 289
Reputation: 4737
You will need to change the output from the HTTP Request to return a json object. Once you do, then this template will display everything that the Watson NLC service outputs
<h1>Watson NLC Output</h1>
{{#payload}}
<div><span>Classifier ID : </span><span>{{classifier_id}}</span></div>
<div><span>Question : </span><span>{{text}}</span></div>
<div><span>Top Class : </span><span>{{top_class}}</span></div>
<div>
<h2>Classes</h2>
{{#classes}}
<div><span>{{class_name}} : </span><span>{{confidence}}</span></div>
{{/classes}}
</div>
{{/payload}}
Upvotes: 3