<commit_before>var express = require('express');
var cfenv = require('cfenv');
var app = express();
var result = [];

const fs = require('fs');
var NaturalLanguageClassifierV1 = require('watson-developer-cloud/natural-language-classifier/v1');

var natural_language_classifier = new NaturalLanguageClassifierV1({
  username: '<PASSWORD>bc-<PASSWORD>-<PASSWORD>-<PASSWORD>',
  password: '<PASSWORD>',
  version: 'v1'
});


app.get('/nlcDipol/:classifier_id/:texto', function (req, res) {
    var classifier_id = req.params.classifier_id;
    var texto = req.params.texto;

    natural_language_classifier.classify({
      text: texto,
      classifier_id: classifier_id },
      function(err, response) {
        if (err) {
          res.send(err);         
          console.log('error:', err);
        } else {

          var classes_0 = response.classes[0].class_name;
          var confidence_0 = response.classes[0].confidence;
          var classes_1 = response.classes[1].class_name;
          var confidence_1 = response.classes[1].confidence;
<commit_msg>Implementando uma lista de resultados forma antiga<commit_after>var express = require('express');
var cfenv = require('cfenv');
var app = express();
var result = [];

const fs = require('fs');
var NaturalLanguageClassifierV1 = require('watson-developer-cloud/natural-language-classifier/v1');

var natural_language_classifier = new NaturalLanguageClassifierV1({
  username: '0ec6f1bc-d977-428f-b2a4-4530df881f57',
  password: '<PASSWORD>',
  version: 'v1'
});


// O adequado seria desta Performance
// app.get('/nlcDipol/:classifier_id/:texto', function (req, res) {
//    var classifier_id = req.params.classifier_id;
//     var texto = req.params.texto;


app.get('/nlcDipol', function (req, res) {
    var classifier_id = req.param('classifier_id');
    var texto = req.param('texto');

    natural_language_classifier.classify({
      text: texto,
      classifier_id: classifier_id },
      function(err, response) {
        if (err) {
          res.send(err);         
          console.log('error:', err);
        } else {

          var classes_0 = response.classes[0].class_name;
          var confidence_0 = response.classes[0].confidence;
          var classes_1 = response.classes[1].class_name;
          var confidence_1 = response.classes[1].confidence;

{'fraction_non_alphanumeric': 0.13587655379339905, 'fraction_numerical': 0.018859837119588514, 'mean_word_length': 3.428842504743833, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5634885', 'n_tokens_mistral': 757, 'n_tokens_neox': 732, 'n_words': 145}