3.6.1 • Published 2 years ago

jovo-nlu-nlpjs v3.6.1

Weekly downloads
60
License
Apache-2.0
Repository
-
Last release
2 years ago

NLP.js NLU Integration

To view this page on the Jovo website, visit https://v3.jovo.tech/marketplace/jovo-nlu-nlpjs

Learn how to use the open source NLP.js library as natural language understanding (NLU) integration with the Jovo Framework.

About NLP.js

NLP.js is an open source natural language understanding (NLU) library with features like entity extraction, sentiment analysis, and language detection.

Being open source, you can host NLP.js on your own servers without any external API calls.

Getting Started with NLP.js and Jovo

You can use the Jovo NLP.js integration for projects where you receive raw text input that needs to be translated into structured meaning to work with the Jovo intent structure. Patforms like the Jovo Core Platform (e.g. in conjunction with the Jovo Web Client), Facebook Messenger, and Google Business Messages are some examples where this would work.

Smaller NLP.js language models are fast to train and can even be used on serverless infrastructure like AWS Lambda without having to use any additional server infrastructure. We recommend taking a close look at the execution times though, as larger models can take quite some time to build.

To get started, download the package:

$ npm install --save jovo-nlu-nlpjs

As mentioned above, NLP.js works with platforms that provide raw text input. You can add the integration to the platform using the use method.

The below example uses the Jovo Core Platform as an example:

// @language=javascript

// src/app.js

const { NlpjsNlu } = require('jovo-nlu-nlpjs');

corePlatform.use(new NlpjsNlu());

app.use(corePlatform);

// @language=typescript

// src/app.ts

import { NlpjsNlu } from 'jovo-nlu-nlpjs';

corePlatform.use(new NlpjsNlu());

app.use(corePlatform);

Configuration

Languages

You can add languages to your integration like this:

// @language=javascript

// src/app.js

const { NlpjsNlu } = require('jovo-nlu-nlpjs');

const nlpjsNlu = new NlpjsNlu({
  languages: ['de', 'en'],
});

// @language=typescript

// src/app.ts

import { NlpjsNlu } from 'jovo-nlu-nlpjs';

const nlpjsNlu = new NlpjsNlu({
  languages: ['de', 'en'],
});

You can add languages by installing their NLP.js packages:

$ npm install --save @nlpjs/lang-de

Callback

You can add a callback function to train your model:

// @language=javascript

// src/app.js

const { NlpjsNlu } = require('jovo-nlu-nlpjs');

const nlpjsNlu = new NlpjsNlu({
  setupModelCallback: async (handleRequest, nlp) => {
    // Do stuff
  },
});

// @language=typescript

// src/app.ts

import { NlpjsNlu } from 'jovo-nlu-nlpjs';

const nlpjsNlu = new NlpjsNlu({
  setupModelCallback: async (handleRequest, nlp) => {
    // Do stuff
  },
});

Jovo Model

You can use the Jovo Model to turn the language model files in your models folder into an NLP.js model. Learn more about the NLP.js Jovo Model integration here.

Here is an example how to extend the Jovo Model with a custom input type for NLP.js.

3.6.1

2 years ago

3.6.0

2 years ago

3.5.1

3 years ago

3.5.0

3 years ago

3.4.1

3 years ago

3.4.0

3 years ago

3.3.1

3 years ago

3.3.0

3 years ago

3.2.2

3 years ago

3.2.1

3 years ago

3.2.0

4 years ago

3.1.5

4 years ago

3.1.4

4 years ago

3.1.3

4 years ago

3.1.2

4 years ago

3.1.0

4 years ago

3.0.19-alpha.0

4 years ago

3.0.18-alpha.0

4 years ago

3.0.16-alpha.0

4 years ago

3.0.15-alpha.0

4 years ago

3.0.14-alpha.0

4 years ago

3.0.13-alpha.0

4 years ago

3.0.12-alpha.0

4 years ago

3.0.11-alpha.0

4 years ago

3.0.10-alpha.0

4 years ago

3.0.9-alpha.0

4 years ago

3.0.8-alpha.0

4 years ago

3.0.7-alpha.0

4 years ago

3.0.6-alpha.0

4 years ago

3.0.4-alpha.0

4 years ago

3.0.5-alpha.0

4 years ago

3.0.3-alpha.0

4 years ago

3.0.2-alpha.0

4 years ago

3.0.1-alpha.0

4 years ago