Coder Social home page Coder Social logo

nlp.js-app's People

Contributors

axarrafols avatar dependabot[bot] avatar eric-lara avatar ericaltran avatar ericzon avatar lezsakdomi avatar maximebeaudoin avatar vilherda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nlp.js-app's Issues

Whoops. Can't update intents anymore without getting an error

Describe the bug
You can't update an intent without changing its name, else you get an error.

To Reproduce
Steps to reproduce the behavior:

  1. Go to any intent that already exists
  2. Add an utterance or remove one, do any update (other than changing the intent name)
  3. Click "Update"
  4. You get 400 Bad Request with the body of the response being "Intent name already used"

Expected behavior
If you don't change the name of the intent, please make sure you check OTHER intents to have the same name (don't take the one being updated into account)

Just saying this makes master absolutely broken. The only bypass I found is to rename the intent twice (once for the update, once for bringing it back where it was before).

"Exported" model performs differently in custom frontend

Describe the bug
I use the nlp.js-app because it is a good interface to add entities, intents and slots. It's much easier than training it via the source code.

I add a manager.save() line in the server\trainers\nlpjs-process.js file so it exports the model as a model.nlp file when I train the model in the app. It's a stupid solution but the app doesn't allow exporting except in a .csv file that is totally incomplete.

Anyway, I want to use the model in my own chatbot application. For the frontend I am using vue-bot-ui
The user input is basically just fed into manager.process but upon boot the manager is of course trained with the exported model.

Please see the exact same conversation both in the app and then in my web application:
nlp

The slot filling doesn't work in my application. What you can see from the logs is that when I input "UPS" after the tracking number, you won't find the tracking number entity in the entities array. It won't remember the filled slot:

{ message: '723747234' }
{
  utterance: '723747234',
  locale: 'en',
  languageGuessed: false,
  localeIso2: 'en',
  language: 'English',
  domain: 'EN',
  classifications: [
    { label: 'parcel.damaged', value: 1 },
    { label: 'helpcenter-redirect', value: 0 },
    { label: 'integration-error', value: 0 },
    { label: 'None', value: 0 }
  ],
  intent: 'parcel.damaged',
  score: 1,
  entities: [
    {
      start: 0,
      end: 9,
      accuracy: 1,
      sourceText: '723747234',
      utteranceText: '723747234',
      entity: 'tracking number'
    }
  ],
  sourceEntities: [
...
    }
  ],
  sentiment: {
    score: 0,
    comparative: 0,
    vote: 'neutral',
    numWords: 1,
    numHits: 0,
    type: 'senticon',
    language: 'en'
  },
  actions: [],
  srcAnswer: 'Which carrier did you use?',
  answer: 'Which carrier did you use?',
  slotFill: {
    localeIso2: 'en',
    intent: 'parcel.damaged',
    entities: [ [Object] ],
    answer: 'We will claim {{slots.tracking.sourceText}} as damaged at the carrier.',
    srcAnswer: 'We will claim {{slots.tracking.sourceText}} as damaged at the carrier.',
    currentSlot: 'carrier'
  }
}
POST /chatbot/conversations/e0a7ff81-366d-4686-8f09-8dff19c593ed 200 87.092 ms - 28
{ message: 'UPS' }
{
  utterance: 'UPS',
  locale: 'en',
  languageGuessed: false,
  localeIso2: 'en',
  language: 'English',
  domain: 'EN',
  classifications: [
    { label: 'parcel.damaged', value: 1 },
    { label: 'helpcenter-redirect', value: 0 },
    { label: 'integration-error', value: 0 },
    { label: 'None', value: 0 }
  ],
  intent: 'parcel.damaged',
  score: 1,
  entities: [
    {
      start: 0,
      end: 2,
      len: 3,
      levenshtein: 0,
      accuracy: 1,
      option: 'UPS',
      sourceText: 'UPS',
      entity: 'carrier',
      utteranceText: 'UPS'
    }
  ],
  sourceEntities: [],
  sentiment: {
    score: 0.344,
    comparative: 0.344,
    vote: 'positive',
    numWords: 1,
    numHits: 1,
    type: 'senticon',
    language: 'en'
  },
...
}

To Reproduce
Steps to reproduce the behavior:

  1. Use the nlp-js.app to train a model
  2. add a manager.save() line in the server\trainers\nlpjs-process.js fie to export the model
  3. Train a manager with that model in a nlp-js application somewhere else
  4. See different behaviours on the screenshot above

Expected behavior
The exported model should show the same result on my own application as much on the app

nlp-js version 3.10.2 used for both applications (nlp-js.app & my own)

CERT_HAS_EXPIRED

Summary

I cloned the repo, and I'm trying to run npm install as per instructions

dave@Davids-MacBook-Pro nlp.js-app % npm install
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://axags.artifactoryonline.com/axags/api/npm/virtual-bcn-node/z-schema/-/z-schema-3.24.1.tgz failed, reason: certificate has expired
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dave/.npm/_logs/2021-03-23T15_27_24_011Z-debug.log

so no dependencies are installed, and the app cannot run.

A bot per agent

The idea is to have a Microsoft Bot Framework v4 chatbot for each agent, internally mantained, and with an NLP manager that is feeded when an agent is trained successfully.

cross origin blocked request (CORS) running on remote host

I'm trying to run the app wild on a remote server, using a different port than 3000 (3010).
That's because I'd like to run it by pm2 then reverse proxy it under Apache. So I'm configuring a different environment, because of 3000 port already configured by another app:

./.env

NODE_ENV=production
MONGO_URL=mongodb://localhost:27017/nlpjs
LOG_LEVEL=info
PORT=3010

./client/.env

SETTINGS_URL=http://10.11.2.80:3010
API_URL=http://10.11.2.80:3010
PUBLIC_PATH_PREFIX=

After I ran npm start, I can reach the web interface but it feels bad, missing APIs.
Reading browser's console I found four calls to http://localhost:3000/swagger2.json blocked by CORS rule.
In real life that JSON file can be found at http://10.11.2.80:3010/swagger2.json
Looks like something is hardcoded somehow.

Steps to reproduce the behavior:

  1. clone this repo
  2. edit .env files according remote host
  3. npm install then npm start inside project root
  4. Open your remote host webpage and browser's console.

I've expected that editing the environment was helpful to run things remotely.

  • OS: Centos7
  • Browser: latest firefox
  • Version: master
  • Node: v12.9.1
  • NPM: 6.11.2

entity: verify if regex entered in frontend is correct or not

Describe the bug
validate entered regexp for regexp-entity because train is crashing if not

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'entity edit' dialog
  2. enter "[a-zA-Z|]+[ ]*\d+"
  3. Click on 'update'
  4. train
  5. train is running for ever and stack trace

Expected behavior
error message that regexp is wrong
or always create valid rexexp from regex-string, if regex string is correct

example email
valid = /\b(\w[-.\w]*\w@\w[-.\w]\w.\w{2,3})\b/gi
invalid = \w[-._\w]
\w@\w[-._\w]*\w.\w{2,3})

example above: car plate number
invalid = [a-zA-Z|]+[ ]\d+
valid = /\b([a-zA-Z|]+[ ]
\d+)\b/gi

Screenshots
this is error in log:
Debug: internal, implementation, error
SyntaxError: Invalid flags supplied to RegExp constructor '[a-zA-Z|]+[ ]*\d+'
at new RegExp ()
at Function.str2regex (/Users/Lolo/git/nlp.js-app/node_modules/node-nlp/lib/ner/regex-named-entity.js:113:12)
at RegexNamedEntity.addStrRegex (/Users/Lolo/git/nlp.js-app/node_modules/node-nlp/lib/ner/regex-named-entity.js:60:50)
at NlpManager.addRegexEntity (/Users/Lolo/git/nlp.js-app/node_modules/node-nlp/lib/nlp/nlp-manager.js:145:14)
at data.entities.forEach.entity (/Users/Lolo/git/nlp.js-app/server/trainers/nlpjs-trainer.js:50:17)
at Array.forEach ()
at NlpjsTrainer.addEntities (/Users/Lolo/git/nlp.js-app/server/trainers/nlpjs-trainer.js:32:19)
at NlpjsTrainer.train (/Users/Lolo/git/nlp.js-app/server/trainers/nlpjs-trainer.js:120:10)
at App.train (/Users/Lolo/git/nlp.js-app/server/app.js:128:37)
at train (/Users/Lolo/git/nlp.js-app/server/feats/agent/agent.controllers.js:279:25)
at
at process._tickCallback (internal/process/next_tick.js:188:7)

Desktop (please complete the following information):

  • OS: Mac
  • Browser chrome
  • Version (master, alpha version)

Additional context
Add any other context about the problem here.

display error if train process crashes

Describe the bug
due to error in regexp the training was crashing ... in the frontend, the state is still "training" and never changes the state

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'entity regexp'
  2. enter wrong regexp
  3. update
  4. train
  5. See error in console

Expected behavior
show error message or status change in training status box (top right corner). I know this should never happen, but during alpha, beta or future test stages it would be good to have it.

Screenshots
described above

Desktop (please complete the following information):

  • OS: mac
  • Browser chrome
  • Version 70.x

Additional context
also checkout issue
#15

WebChat

Implement a React WebChat connected to the Direct Line API, so for each agent, I will have a frontend piece that I can introduce in my web to chat with my chatbot.
Also, a way to configure colors / names / avatars /...

Errors in installation on Windows Subsystem for Linux

Describe the bug
A clear and concise description of what the bug is.

Following the same steps for installation that were described in issue #85, I get an error on the npm start command and it fails to complete the installation... here is the command and response I received...

$ npm start

> [email protected] start /mnt/c/Users/Steve/nlpjsapp/nlp.js-app
> node .

[2021-05-18 02:54:19.455 +0000] INFO  (1790 on Scotti-Flex): log level: debug
(node:1790) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1790) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
(node:1790) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
(node:1790) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency
(node:1790) UnhandledPromiseRejectionWarning: MongooseTimeoutError: Server selection timed out after 30000 ms
    at new MongooseTimeoutError (/mnt/c/Users/Steve/nlpjsapp/nlp.js-app/node_modules/mongoose/lib/error/timeout.js:22:11)
    at NativeConnection.Connection.openUri (/mnt/c/Users/Steve/nlpjsapp/nlp.js-app/node_modules/mongoose/lib/connection.js:763:19)
    at Mongoose.connect (/mnt/c/Users/Steve/nlpjsapp/nlp.js-app/node_modules/mongoose/lib/index.js:332:15)
    at /mnt/c/Users/Steve/nlpjsapp/nlp.js-app/server/core/database.js:52:13
    at new Promise (<anonymous>)
    at Database.connect (/mnt/c/Users/Steve/nlpjsapp/nlp.js-app/server/core/database.js:51:10)
    at startDatabase (/mnt/c/Users/Steve/nlpjsapp/nlp.js-app/server/boot/start-database.js:42:22)
    at start (/mnt/c/Users/Steve/nlpjsapp/nlp.js-app/server/index.js:129:8)
    at Object.<anonymous> (/mnt/c/Users/Steve/nlpjsapp/nlp.js-app/server/index.js:133:1)
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Function.Module._load (internal/modules/cjs/loader.js:774:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47
(node:1790) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1790) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:1790) UnhandledPromiseRejectionWarning: Error: Connection error
    at NativeConnection.<anonymous> (/mnt/c/Users/Steve/nlpjsapp/nlp.js-app/server/core/database.js:54:32)
    at NativeConnection.emit (events.js:376:20)
    at /mnt/c/Users/Steve/nlpjsapp/nlp.js-app/node_modules/mongoose/lib/connection.js:772:37
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
(node:1790) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

To Reproduce
Follow steps for installation described in issue #85

Expected behavior
I thought that I would be able to see the app user interface when I opened a browser with url localhost:3000

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10 running Windows Subsystem for Linux 2 (Linux 5.4.72-microsoft-standard-WSL2 x86_64)
  • Linux distribution: Ubuntu 20.04.2 LTS

Additional context
Add any other context about the problem here.

A more unviersal API

I have been using NLP.js for a while and I want to move to a more organized setup such as with this app to speed up some of the work. The issue is I want some sort of API which I can use to easily send requests and get responses in JS to the server hosting the app. I saw some API related things with the code but I don't quite understand how to use it for what i'm trying. (Using a bot in a Discord server to link to this)

Export everything

Is your feature request related to a problem? Please describe.
So far it is only possible to export as csv, and even there, not everything is covered.

Describe the solution you'd like
It would be great to fully export all intents, entities, slots, etc. so it can be implemented as a corpus or .nlp model in custom chat bots.

After all, it does have the save/export methods

Is there any way to do something similar with the mongodb database? It stores everything, which is good, but how can I take that and train it to my own custom chat bot?

something went wrong while being behind Apache reverse proxy

While loading the web interface I got a 404 error "something went wrong" because browser can't load /api/settings neither /api/agent resources.

Settings are missing and Agents can't be loaded because resorces are served at: /nlp/api/settings and /nlp/api/agent

File swagger2.json is correctly loaded from: /nlp/swagger2.json

Steps to reproduce the behavior:

  1. Configure ssl with self-signed certs
  2. Configure apache to reverse proxy /nlp/ url
ProxyRequests Off
ProxyPass /nlp/ http://localhost:3010/
ProxyPassReverse /nlp/ http://localhost:3010/
<Location /nlp/>
        ProxyPassReverse /
        ProxyHTMLEnable On
        ProxyHTMLURLMap http://localhost:3010/ /nlp/
        ProxyHTMLURLMap / /nlp/
        RequestHeader unset Accept-Encoding
</Location>
  1. Configure client/.env like this
# ENV to generate public
# npm run build
SETTINGS_URL=https://remote.host/nlp
API_URL=https://remote.host/nlp
PUBLIC_PATH_PREFIX=.
  1. Open web interface and browser console
  2. See error

Mixed Content: The page at 'https://remote.host/nlp/api' was loaded over HTTPS, but requested an insecure resource 'http://remote.host/api/settings'. This request has been blocked; the content must be served over HTTPS.

I expected the interface were looking for /nlp/api/settings and /nlp/api/agent resources, where resource really are. Looks like SETTINGS_URL and API_URL are ignored.

Hapi module deprecation

Running npm update you get various deprecation notifications about hapi and its dependencies. I paste the most representative:

npm WARN deprecated [email protected]: This module has moved and is now available at @hapi/hapi. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.

To Reproduce

  1. git clone this repository
  2. npm update the libraries
  3. read npm logging
  • OS: Xubuntu
  • Node v12.9.1
  • Npm v6.11.2

Empty default fallback answer

I tried to customize the global setting for default fallback answers in italian language but when I write unrecognised text in the chat demo, the answer is an empty baloon. Neither Agent's fallback responses are working.

Steps to reproduce the behavior:

  1. Go to settings, change language, add some global fallback answers. Save.
  2. Go to Agent's edit page, edit fallback answers with different strings. Save.
  3. Add a domain. Add an intent and re-train.
  4. write some random text in the demo chat pane: «sdafsofijaso»
  5. any of the strings is displayed as answer, only empty baloon

I expected to get one of the answers from Agent's fallback.
Then I would like to delete that answer and get the global answers.
If any of them is set, three dots «...» can be enough.

Screenshot_2019-11-07 Agent Provagent

  • OS: Xubuntu
  • Browser: firefox latest stable
  • Node: v12.9.1
  • Npm: 6.11.2

as administrator I would like to change domain while editing an intent

Summary

While I was editing an intent, I tried to change its domain but combo box looks like disabled in agent user inteface.

Simplest Example to Reproduce

  • Create two domains in your agent
  • Create a simple intent
  • Train the agent
  • Edit that intent

Expected Behavior

I expected I can change domain editing my intent, to move it away.

Current Behavior

Domain combo box is disabled, it's the only intent's parameter you can't edit.

Possible Solution

For routines reuse, maybe a solution is create a new intent in the new selected domain, then delete current intent.

Context

Can be useful when you decide there are too much intents in that domain and you want to split into two detailed domains.

Your Environment

Software Version
dost ?
node node v12.9.1
npm npm v6.14.2
Operating System Centos7

How connect node-nlp.js with nls.js-app

Hello,

First of all, thank you very much for all this and the node-nlp.js

I'm a beginner in this and I'm setting up my own project since a week ago,
My question is about another question that was already closed (I don't know if I should have created a new ticket or use the previously created one even though it is closed)

#55 (comment)

Here you say that when a model in NLP.js-app is trained the model is injected into the bot.

My question is how to connect node-nlp.js to NLP.js-APP as you described

How should the injection into the bot be? Sharing a database?

On the other hand, I don't know if you can help me with this question,

Could I put in the same project of the bot, running with the NLP.js-APP in different port?

Thank you very much,

Card Editor

An adaptative card editor (a first version can be directly a json editor) where I can define cards by name, so the answer from the agent can be not only text, but also to send a card.

Dialog Editor

Include a Dialgo creator/editor, done with Microsoft pxt, so non-developers can develop a complex chatbot, and developers can use javascript directly but with snippets and code templates. This task is an epic, should be planned and splitted into tasks.

Direct Line API

Build the Direct Line API with hapi + joi, connected to the session/conversation APIs and to the Microsoft Bot Framework v4 chatbot.
That way every agent will have an API that can be used by a WebChat without having the Bot Channel Registration in azure.

How to use it in production

Sorry in advance if it's already explained, but I don't get how can I use this app after train the model.

Where is model file to use it with a existing app running with nlp.js?
Can I import a already trained model to work with it?
This app create an API to make request to it?

Dropdown menus need a double click in order to open

Describe the bug
When using any dropdown menu in the app, our team needs to click twice or even more to get the dropdown to open. I know it's minor but HELL does that get on our nerves!

To Reproduce
Steps to reproduce the behavior:

  1. Go to the app
  2. Click on a dropdown list (like the Agent dropdown)
  3. ???
  4. It closes, so you need to re-click it

Expected behavior
Click once, the dropdown opens

Screenshots

nlp-js-app-ghost-dropdown

Desktop:

  • OS: MacOS Mojave and Catalina
  • Browser Chrome
  • Version latest

Error: agent head missing at dev instance (Also on Heroku)

Describe the bug
The app is completely malfunctioning due to "Error: agent head missing" in development build. The URL directs to localhost:3000/missing-api, there is no functionality (cannot create agent, cannot browse domains, intents, entities, etc.) - screenshot 1.

Inspecting console events in frontend shows the connection to swagger2.json fails - screenshot 2.

The exact same issue happens using the one-click deployment on Heroku.

To Reproduce
Followed installation steps:

  1. Cloned git repo
  2. Installed dependencies using npm install
  3. .env in root and client as follows:

./.env

NODE_ENV=development
MONGO_URL=mongodb://localhost:27017/nlpjs
LOG_LEVEL=debug

./client/.env

# ENV to generate public
# npm run build
SETTINGS_URL=http://localhost:3000
API_URL=http://localhost:3000
PUBLIC_PATH_PREFIX=
  1. npm start at root

Screenshots
1.
image
2.
image

Additional context
Tested on Chrome, Firefox and Edge.

package.json file in root:

{
  "name": "nlpjs-ui",
  "version": "1.0.2",
  "description": "UI of NLP.js",
  "author": {
    "email": "[email protected]",
    "name": "Jesus Seijas"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/axa-group/nlp.js-app.git"
  },
  "bugs": {
    "url": "https://github.com/axa-group/nlp.js-app/issues"
  },
  "maintainers": [
    {
      "email": "[email protected]",
      "name": "Jesus Seijas"
    },
    {
      "email": "[email protected]",
      "name": "Eric Lara"
    }
  ],
  "license": "MIT",
  "scripts": {
    "analyze:clean": "rimraf stats.json",
    "preanalyze": "npm run analyze:clean",
    "analyze": "node ./internals/scripts/analyze.js",
    "extract-intl": "babel-node --presets latest,stage-0 -- ./internals/scripts/extract-intl.js",
    "postinstall": "npm run build:dll",
    "prebuild": "npm run build:clean",
    "build": "cross-env NODE_ENV=production webpack --config internals/webpack/webpack.prod.babel.js --color -p --progress",
    "build:clean": "npm run test:clean && rimraf ./build",
    "build:dll": "node ./internals/scripts/dependencies.js",
    "start": "cross-env NODE_ENV=development node server",
    "start:tunnel": "cross-env NODE_ENV=development ENABLE_TUNNEL=true node server",
    "start:production": "npm run test && npm run build && npm run start:prod",
    "start:prod": "cross-env NODE_ENV=production node server",
    "presetup": "npm i chalk shelljs",
    "setup": "node ./internals/scripts/setup.js",
    "postsetup": "npm run build:dll",
    "clean": "shjs ./internals/scripts/clean.js",
    "clean:all": "npm run analyze:clean && npm run test:clean && npm run build:clean",
    "generate": "plop --plopfile internals/generators/index.js",
    "lint": "npm run lint:js",
    "lint:eslint": "eslint --ignore-path .gitignore --ignore-pattern internals/scripts",
    "lint:js": "npm run lint:eslint -- . ",
    "lint:staged": "lint-staged",
    "pretest": "npm run test:clean && npm run lint",
    "test:clean": "rimraf ./coverage",
    "test": "cross-env NODE_ENV=test jest --coverage",
    "test:watch": "cross-env NODE_ENV=test jest --watchAll"
  },
  "lint-staged": {
    "*.js": "lint:eslint"
  },
  "pre-commit": "lint:staged",
  "babel": {
    "presets": [
      [
        "latest",
        {
          "es2015": {
            "modules": false
          }
        }
      ],
      "react",
      "stage-0"
    ],
    "env": {
      "production": {
        "only": [
          "app"
        ],
        "plugins": [
          "transform-react-remove-prop-types",
          "transform-react-constant-elements",
          "transform-react-inline-elements"
        ]
      },
      "test": {
        "plugins": [
          "transform-es2015-modules-commonjs",
          "dynamic-import-node"
        ]
      }
    }
  },
  "eslintConfig": {
    "parser": "babel-eslint",
    "extends": "airbnb",
    "env": {
      "browser": true,
      "node": true,
      "jest": true,
      "es6": true
    },
    "plugins": [
      "redux-saga",
      "react",
      "jsx-a11y"
    ],
    "parserOptions": {
      "ecmaVersion": 6,
      "sourceType": "module",
      "ecmaFeatures": {
        "jsx": true
      }
    },
    "rules": {
      "arrow-parens": [
        "error",
        "always"
      ],
      "arrow-body-style": [
        2,
        "as-needed"
      ],
      "comma-dangle": [
        2,
        "always-multiline"
      ],
      "import/imports-first": 0,
      "import/newline-after-import": 0,
      "import/no-dynamic-require": 0,
      "import/no-extraneous-dependencies": 0,
      "import/no-named-as-default": 0,
      "import/no-unresolved": 2,
      "import/prefer-default-export": 0,
      "indent": [
        2,
        2,
        {
          "SwitchCase": 1
        }
      ],
      "jsx-a11y/aria-props": 2,
      "jsx-a11y/heading-has-content": 0,
      "jsx-a11y/href-no-hash": 2,
      "jsx-a11y/label-has-for": 2,
      "jsx-a11y/mouse-events-have-key-events": 2,
      "jsx-a11y/role-has-required-aria-props": 2,
      "jsx-a11y/role-supports-aria-props": 2,
      "max-len": 0,
      "newline-per-chained-call": 0,
      "no-confusing-arrow": 0,
      "no-console": 1,
      "no-use-before-define": 0,
      "prefer-template": 2,
      "class-methods-use-this": 0,
      "react/forbid-prop-types": 0,
      "react/jsx-first-prop-new-line": [
        2,
        "multiline"
      ],
      "react/jsx-filename-extension": 0,
      "react/jsx-no-target-blank": 0,
      "react/require-extension": 0,
      "react/self-closing-comp": 0,
      "redux-saga/no-yield-in-race": 2,
      "redux-saga/yield-effects": 2,
      "require-yield": 0,
      "import/no-webpack-loader-syntax": 0
    },
    "settings": {
      "import/resolver": {
        "webpack": {
          "config": "./internals/webpack/webpack.prod.babel.js"
        }
      }
    }
  },
  "dllPlugin": {
    "path": "node_modules/react-boilerplate-dlls",
    "exclude": [
      "chalk",
      "compression",
      "cross-env",
      "express",
      "ip",
      "minimist",
      "sanitize.css"
    ],
    "include": [
      "core-js",
      "lodash",
      "eventsource-polyfill"
    ]
  },
  "jest": {
    "collectCoverageFrom": [
      "app/**/*.{js,jsx}",
      "!app/**/*.test.{js,jsx}",
      "!app/*/RbGenerated*/*.{js,jsx}",
      "!app/app.js",
      "!app/routes.js"
    ],
    "coverageThreshold": {
      "global": {
        "statements": 98,
        "branches": 91,
        "functions": 98,
        "lines": 98
      }
    },
    "moduleDirectories": [
      "node_modules",
      "app"
    ],
    "moduleNameMapper": {
      ".*\\.(css|less|styl|scss|sass)$": "<rootDir>/internals/mocks/cssModule.js",
      ".*\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/internals/mocks/image.js"
    },
    "setupTestFrameworkScriptFile": "<rootDir>/internals/testing/test-bundler.js",
    "testRegex": "tests/.*\\.test\\.js$"
  },
  "dependencies": {
    "babel-polyfill": "6.20.0",
    "chalk": "1.1.3",
    "compression": "1.7.3",
    "copy-webpack-plugin": "^3.0.0",
    "cross-env": "3.1.3",
    "dotenv-webpack": "^1.5.4",
    "escope": "^3.6.0",
    "eslint": "^5.16.0",
    "express": "4.16.4",
    "fontfaceobserver": "2.0.7",
    "hammerjs": "^2.0.8",
    "immutability-helper": "^2.7.0",
    "immutable": "3.8.1",
    "intl": "1.2.5",
    "invariant": "2.2.2",
    "ip": "1.1.4",
    "jquery": "^3.4.1",
    "jquery-ui": "^1.12.1",
    "lodash": "^4.17.14",
    "material-ui": "^0.20.0",
    "minimist": "^1.2.5",
    "react": "15.4.1",
    "react-accessible-accordion": "^2.4.2",
    "react-ace": "^5.9.0",
    "react-chips": "^0.6.3",
    "react-color": "^2.13.8",
    "react-dnd": "^2.6.0",
    "react-dnd-html5-backend": "^2.6.0",
    "react-dom": "15.4.1",
    "react-helmet": "3.2.2",
    "react-intl": "2.1.5",
    "react-linkify": "^0.2.2",
    "react-materialize": "1.0.11",
    "react-redux": "4.4.6",
    "react-router": "3.0.0",
    "react-router-redux": "4.0.6",
    "react-router-scroll": "0.4.1",
    "react-s-alert": "^1.3.2",
    "react-table": "^6.7.4",
    "react-tap-event-plugin": "2.0.1",
    "redux": "3.6.0",
    "redux-immutable": "3.0.8",
    "redux-saga": "0.14.0",
    "redux-seamless-immutable": "^0.4.0",
    "reselect": "2.5.4",
    "sanitize.css": "4.1.0",
    "seamless-immutable": "^7.1.3",
    "styled-components": "1.1.2",
    "swagger-client": "^3.4.4",
    "time-ago": "^0.2.1",
    "to-camel-case": "^1.0.0",
    "transit-immutable-js": "^0.7.0",
    "transit-js": "^0.8.846",
    "warning": "3.0.0",
    "webpack-cli": "^3.3.11",
    "whatwg-fetch": "2.0.1"
  },
  "devDependencies": {
    "babel-cli": "6.26.0",
    "babel-core": "6.21.0",
    "babel-eslint": "7.1.1",
    "babel-loader": "6.2.10",
    "babel-plugin-dynamic-import-node": "1.0.0",
    "babel-plugin-react-intl": "2.2.0",
    "babel-plugin-react-transform": "2.0.2",
    "babel-plugin-transform-es2015-modules-commonjs": "6.18.0",
    "babel-plugin-transform-react-constant-elements": "6.9.1",
    "babel-plugin-transform-react-inline-elements": "6.8.0",
    "babel-plugin-transform-react-remove-prop-types": "0.2.11",
    "babel-preset-latest": "6.16.0",
    "babel-preset-react": "6.16.0",
    "babel-preset-react-hmre": "1.1.1",
    "babel-preset-stage-0": "6.16.0",
    "cheerio": "0.22.0",
    "circular-dependency-plugin": "2.0.0",
    "css-loader": "0.26.1",
    "enzyme": "2.6.0",
    "eslint-config-airbnb": "13.0.0",
    "eslint-config-airbnb-base": "10.0.1",
    "eslint-import-resolver-webpack": "0.8.0",
    "eslint-plugin-import": "2.14.0",
    "eslint-plugin-jsx-a11y": "2.2.3",
    "eslint-plugin-react": "6.7.1",
    "eslint-plugin-redux-saga": "0.1.5",
    "eventsource-polyfill": "0.9.6",
    "exports-loader": "0.6.3",
    "file-loader": "0.9.0",
    "html-loader": "0.4.4",
    "html-webpack-plugin": "2.24.1",
    "image-webpack-loader": "^4.6.0",
    "imports-loader": "0.6.5",
    "jest-cli": "25.2.7",
    "lint-staged": "3.2.1",
    "node-plop": "0.25.0",
    "node-sass": "^4.13.1",
    "null-loader": "0.1.1",
    "offline-plugin": "5.0.5",
    "plop": "1.7.3",
    "pre-commit": "1.1.3",
    "react-addons-test-utils": "15.4.1",
    "resolve-url-loader": "^2.1.0",
    "rimraf": "2.5.4",
    "sass-loader": "^6.0.6",
    "shelljs": "0.7.5",
    "sinon": "2.0.0-pre",
    "style-loader": "0.13.1",
    "url-loader": "1.1.2",
    "webpack": "4.42.1",
    "webpack-dev-middleware": "3.7.2",
    "webpack-hot-middleware": "2.25.0"
  }
}

Unable to create agent

Describe the bug
I tried to launch the app from localhost. The backend and client app started successfully. When I try to create agent its loding and didn't give a response

To Reproduce
Steps to reproduce the behavior:

  1. Start the backend server
  2. Start the client app
  3. Try to create agent
  4. See error

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome
  • node 10.15

Additional context
Please help me to solve this issue

An error occurred: ServerLambdaFunction - Unzipped size must be smaller than 262144000 bytes

Describe the bug
The app is too large to deploy to AWS Lambda. In the example, the deploy size is 77.6MB. However when I deploy the app it is 122.3MB, which is too large for AWS Lambda. Therefore I get this error An error occurred: ServerLambdaFunction - Unzipped size must be smaller than 262144000 bytes

To Reproduce
Follow steps 1-4 here https://github.com/axa-group/nlp.js-app/blob/master/docs/serverless-aws.md

Expected behavior
The app deploys successfully

Desktop (please complete the following information):

  • OS: macOS Mojave
  • Browser: N/A
  • Version: N/A

Additional context
I have pushed the nlp.js-app repo up into a gitlab repository, which is what I'm deploying.

User nlpjs_user not found

Describe the bug
Attempting to run docker-compose up but the node app fails to start due to mongo credentials / user doesn't exist. Did I miss a step in the setup to create this user?

To Reproduce
Steps to reproduce the behavior:

  1. docker-compose up
  2. Watch start up and see node app does not start
    nlpjs_mongo | 2020-03-17T20:47:30.375+0000 I ACCESS [conn58] SASL SCRAM-SHA-1 authentication failed for nlpjs_user on nlpjs from client 172.19.0.4:44194 ; UserNotFound: Could not find user nlpjs_user@nlpjs

Expected behavior
The stack to start.

Screenshots
N/A

Import feature

While I found «export» link in the Agent page, presumably there's no way to import an exported CSV. I didn't found it.

Data import inside existing agent

as nlp.js-app trainer I would like to click a link named «import» to overwrite current agent's KB by CSV upload

Agent creation from scratch

as nlp.js-app trainer I would like to push a button named «+ import agent» to create a brand new agent and fill it with data from a CSV upload

Error 'context.getSourceCode(...).getLocFromIndex is not a function' running tests in client

Describe the bug
During npm test phase in client I got an error related with eslint, coming from sub-dependency eslint-plugin-prettier.

To Reproduce
Steps to reproduce the behavior:

  1. From new cloned repo, install dependencies
  2. Enter in /client and run: npm test
  3. See error

During npm test phase I got this error related with eslint:

[email protected] lint:eslint /Users/elara/mygit/nlp/nlp.js-app-eric/client
eslint --ignore-path .gitignore --ignore-pattern internals/scripts "."

context.getSourceCode(...).getLocFromIndex is not a function
TypeError: context.getSourceCode(...).getLocFromIndex is not a function
    at reportReplace (/Users/elara/mygit/nlp/nlp.js-app-eric/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js:85:41)
    at Program.differences.forEach.difference (/Users/elara/mygit/nlp/nlp.js-app-eric/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js:233:21)
    at Array.forEach (<anonymous>)

Expected behavior
It should start testing process of client side

Desktop (please complete the following information):

  • OS: [e.g. iOS]

Add login

Is your feature request related to a problem? Please describe.
Deploying app to public can be access by everyone

Describe the solution you'd like
Add login page to client and auth middleware to Hapi server

Describe alternatives you've considered
Set an auth redirect in your webserver

Include code integrations to the intents

I would like to know if it`s possible to include javascript code integrations into the intents before giving the response and incorporate that into the response for example: check the weather in the a site and come back with the weather results for the city and in the response respond with the weather results, how can this work with this tool?

Thanks for the work by the way it looks very similar to the Dialogflow by the way which is the best UI out there, very nice job.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.