Skip to content

Commit 83799a6

Browse files
committed
Proofreading v4 Documents: Edited remaining documents
1 parent 6e4f4f0 commit 83799a6

11 files changed

+83
-66
lines changed

docs/v4/console-connector.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
## Installation
44

5-
You can install @nlpjs/console-connector:
5+
You can install the console connector @nlpjs/console-connector using:
66

77
```bash
88
npm install @nlpjs/console-connector
99
```
1010

1111
## Example of use inside NLP.js
1212

13-
This is a little bit special component. It allows to manage scenarios where the main interface way is the console. You can find an example of use on **`examples/02-qna-classic`**.
13+
This is a little bit special component.
14+
It allows you to manage scenarios where the main interface is the console. You can find an example of use on **`examples/02-qna-classic`**.
1415

1516
## Example of use of the package
1617

@@ -26,7 +27,7 @@ connector.say('Say something!');
2627

2728
## Example of use with @nlpjs/basic
2829

29-
You must have a file _corpus.json_ in the folder of the source code:
30+
You must have a file _corpus.json_ in the source code folder:
3031

3132
```javascript
3233
const { dockStart } = require('@nlpjs/basic');

docs/v4/emoji.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
## Introduction
44

5-
@nlpjs/emoji is the package that brings the function _removeEmojis_ that replace emojis with their text equivalents.
5+
@nlpjs/emoji is the package that adds the function _removeEmojis_ which replaces emojis with their text equivalents.
66

77
## Installing
88

9-
_removeEmojis_ is a function of the package _@nlpjs/emoji_, that you can install via NPM:
9+
_removeEmojis_ is a function in the package _@nlpjs/emoji_, which you can install via NPM:
1010

1111
```bash
1212
npm install @nlpjs/emoji

docs/v4/language-support.md

+14-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ BERT Support means that the tokenizer and stemmer are supported through a BERT A
77

88
Microsoft Builtins mean that the Builtin Entity extraction is supported directly in javascript, while the ones supported by Duckling requires the deployment of a Duckling instance.
99

10-
Languages not included in this list can be still supported, but without stemming, only tokenizing. That means less precission, but most of the times can be good enough, as an example you can use it for fantasy languages (at unit tests you'll find tests in klingon from Star Trek).
10+
Languages not included in this list can be still supported, but without stemming, only tokenizing. That means less precision, but most of the time this can be good enough. As an example you can use it for fantasy languages (during unit testing you'll find tests in klingon from Star Trek).
1111

1212
| Locale | Language | Native Support | BERT Support | Microsoft Builtins | Duckling Builtins | Sentiment |
1313
|--------|-----------------------|----------------|--------------|--------------------|-------------------|-----------|
@@ -38,7 +38,9 @@ Languages not included in this list can be still supported, but without stemming
3838
| cs | Czech | X | X | | | X |
3939
| da | Danish | X | X | | X | X |
4040
| nl | Dutch | X | X | | X | X |
41-
| en | [English](https://github.com/axa-group/nlp.js/blob/master/packages/lang-en/README.md) | X | X | X | X | X |
41+
42+
(https://github.com/axa-group/nlp.js/blob/master/packages/lang-en/README.md)
43+
| en | [English] | X | X | X | X | X |
4244
| et | Estonian | | X | | X | |
4345
| fi | Finnish | X | X | | X | X |
4446
| fr | French | X | X | X | X | X |
@@ -53,9 +55,13 @@ Languages not included in this list can be still supported, but without stemming
5355
| hu | Hungarian | X | X | | X | X |
5456
| is | Icelandic | | X | | X | |
5557
| io | Ido | | X | | | |
56-
| id | [Indonesian](https://github.com/axa-group/nlp.js/blob/master/packages/lang-id/README.md) | X | X | | X | X |
58+
59+
(https://github.com/axa-group/nlp.js/blob/master/packages/lang-id/README.md)
60+
| id | [Indonesian] | X | X | | X | X |
5761
| ga | Irish | X | X | | X | X |
58-
| it | [Italian](https://github.com/axa-group/nlp.js/blob/master/packages/lang-it/README.md) | X | X | | X | X |
62+
63+
(https://github.com/axa-group/nlp.js/blob/master/packages/lang-it/README.md)
64+
| it | [Italian] | X | X | | X | X |
5965
| ja | Japanese | X | X | X | X | |
6066
| jv | Javanese | | X | | | |
6167
| kn | Kannada | | X | | X | |
@@ -94,7 +100,9 @@ Languages not included in this list can be still supported, but without stemming
94100
| sk | Slovak | | X | | X | |
95101
| sl | Slovenian | X | X | | | X |
96102
| az | South Azerbaijani | | X | | | |
97-
| es | [Spanish](https://github.com/axa-group/nlp.js/blob/master/packages/lang-es/README.md) | X | X | X | X | X |
103+
104+
(https://github.com/axa-group/nlp.js/blob/master/packages/lang-es/README.md)
105+
| es | [Spanish] | X | X | X | X | X |
98106
| su | Sundanese | | X | | | |
99107
| sw | Swahili | | X | | X | |
100108
| sv | Swedish | X | X | | X | X |
@@ -270,7 +278,7 @@ Languages not included in this list can be still supported, but without stemming
270278

271279
## Example with several languages
272280

273-
Example with three languages, where one of the language is klingon, to show that NLP will work even with support of the language, because it will use tokenizer but not stemmers.
281+
This example uses three languages, where one of the languages is Klingon, to show that NLP will work even with language support, because it will use the tokenizer but not the stemmers.
274282

275283
```javascript
276284
const { NlpManager } = require('../packages/node-nlp/src');

docs/v4/logger.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# logger
22

33
## Introduction
4-
A logger can be registered to log what happen during the execution.
4+
A logger can be registered to log what happens during the execution.
55

66
## Default logger in @nlpjs/core
77
By default, a logger based on console is added to the NLP.js container
@@ -15,7 +15,7 @@ logger.info('This is an info message');
1515
```
1616

1717
## Default logger in @nlpjs/basic
18-
When using the basic package of NLP.js, a logger based on pino is added.
18+
When using the basic NLP.js package, a logger based on pino is added.
1919

2020
```javascript
2121
const { dockStart } = require('@nlpjs/basic');
@@ -31,7 +31,7 @@ const { dockStart } = require('@nlpjs/basic');
3131
```
3232

3333
## Adding your own logger to the container
34-
You can register your own logger to the container:
34+
You can register your own logger in the container:
3535

3636
```javascript
3737
const { dockStart } = require('@nlpjs/basic');

docs/v4/ner-quickstart.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# NER Quick Start
22

33
## Install the needed packages
4-
At the folder where is your node project, install the @nlpjs/basic, @nlpjs/express-api-server and @nlpjs/directline-connector packages.
4+
5+
In your node project folder, install the @nlpjs/basic, @nlpjs/express-api-server and @nlpjs/directline-connector packages.
56
```bash
67
npm i @nlpjs/basic @nlpjs/express-api-server @nlpjs/directline-connector
78
```
@@ -25,13 +26,13 @@ Create the file _conf.json_ with this content:
2526
}
2627
```
2728

28-
You'll telling the applicaition to use 4 plugins:
29+
You are telling the applicaition to use 4 plugins:
2930
- Basic: the basic plugins for an NLP backend, that includes evaluator, javascript compiler, logger, and NLP classes
30-
- LangEn: the plugin to use english language
31-
- ExpressApiServer: the plugin to have an API server done with express
31+
- LangEn: the plugin to use English language
32+
- ExpressApiServer: the plugin to have an Express API server
3233
- DirectlineConnector: the plugin that uses the ExpressApiServer to serve an API for the chatbot
3334

34-
Also this configure the ExpressApiServer to be exposed in the port 3000 and to serve the chatbot frontend (serveBot: true).
35+
Also this configures the ExpressApiServer to be exposed at port 3000 and to serve the chatbot frontend (serveBot: true).
3536
Finally, it tells the NLP to import the corpus defined in the file _corpus.json_.
3637

3738
## Create the corpus.json
@@ -77,13 +78,13 @@ Add the file _corpus.json_ with this content:
7778
```
7879

7980
This creates 2 intents: one to know the real name of a hero and other one to know where the hero lives.
80-
Also creates the entity to recognize thre heros: spiderman, ironman and thor, and also their synonyms.
81+
It also creates the entity to recognize the heros: spiderman, ironman and thor, and also their synonyms.
8182
There is a part in the json to tell the NLP to load some contextData that will be used to generate the answers:
8283
```json
8384
"contextData": "./heros.json",
8485
```
8586

86-
If you take a look at one answer, ```_data[entities.hero.option].city``` as an example, the content at the json _heros.json_ will be accesible at the context as data. Also, the entities are accesible at the property _entities_, so as the entity name is _hero_ you'll have the result from the NER for the entity _hero_ stored at _entities.hero_
87+
If you take a look at one answer, ```_data[entities.hero.option].city``` as an example, the content at the json _heros.json_ will be accessible in the context as data. Also, the entities are accessible in the property _entities_, so because the entity name is _hero_ you'll have the result from the NER for the entity _hero_ stored in _entities.hero_
8788

8889
## Create the heros.json
8990

@@ -120,7 +121,7 @@ const { dockStart } = require('@nlpjs/basic');
120121
})();
121122
```
122123

123-
This initializes the project and load all the jsons building the structure when you call _dockStart()_ and returns to you a dock for the containers.
124+
This initializes the project and loads all the jsons. It also builds the structure when you call _dockStart()_ and then it returns a dock for the containers.
124125
Then you can retrieve instances from the container, in this case we retrieve the _nlp_ instance to train it.
125126

126127
## Start the application
@@ -135,8 +136,8 @@ Then you can navigate to http://localhost:3000 to use it.
135136

136137
## Stored context
137138

138-
You'll see that you can ask for information of a hero, but also that if you're talking with the bot about a hero then you can omit the reference to the hero you're talking about.
139-
This context is stored per conversation, so different conversations have its own context variables.
139+
You'll see that you can ask for information about a hero, but also that if you're talking with the bot about a hero then you can omit the reference to the hero you're talking about.
140+
This context is stored per conversation, so different conversations have their own context variables.
140141

141142
<div align="center">
142143
<img src="https://github.com/axa-group/nlp.js/raw/master/screenshots/ner-demo.png" width="auto" height="auto"/>

docs/v4/neural.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ _NeuralNetwork_ is a class of the package _@nlpjs/neural_, that you can install
1414

1515
## Corpus Format
1616

17-
For training the classifier you need a corpus. The corpus format is an array of objects where each object contains an input and output, where the input is an object with the features and the output is an object with the intents:
17+
To train the classifier you need a corpus. The corpus format is an array of objects where each object contains an input and output, where the input is an object with the features and the output is an object for the intent:
1818

1919
```json
2020
[
@@ -47,7 +47,7 @@ For training the classifier you need a corpus. The corpus format is an array of
4747
"output": { "birthday": 1 }
4848
},
4949
{
50-
"input": { "when": 1, "were": 1, "you": 1, "borned": 1 },
50+
"input": { "when": 1, "were": 1, "you": 1, "born": 1 },
5151
"output": { "birthday": 1 }
5252
},
5353
{
@@ -59,9 +59,9 @@ For training the classifier you need a corpus. The corpus format is an array of
5959

6060
## Example of use
6161

62-
The file _corpus.json_ should contain the corpus shown in the Corpus Format section for this example.
63-
This will train this corpus and run the input equivalent to the sentence "when birthday".
64-
The result is each intent with the score for this intent.
62+
The file _corpus.json_ should contain the corpus shown in the Corpus Format section of this example.
63+
This will train the corpus and run the input equivalent to the sentence "when birthday".
64+
The result is a list of all intents with the score for each intent.
6565

6666
```javascript
6767
const { NeuralNetwork } = require('@nlpjs/neural');
@@ -94,11 +94,11 @@ console.log(net.run({ when: 1, birthday: 1 }));
9494
There are several options that you can customize:
9595
- _iterations_: maximum number of iterations (epochs) that the neural network can run. By default this is 20000.
9696
- _errorThresh_: minimum error threshold, if the loss is lower than this number, then the training ends. By default this is 0.00005.
97-
- _deltaErrorThresh_: minimum delta error threshold, this is, the difference between the current and the last errors. If the delta error threshold is lower than this number, then the training ends. By default this is 0.000001.
97+
- _deltaErrorThresh_: minimum delta error threshold, this is the difference between the current error and the last error. If the delta error threshold is lower than this number, then the training ends. By default this is 0.000001.
9898
- _learningRate_: learning rate for the neural network. By default this is 0.6.
9999
- _momentum_: momentum for the gradient descent optimization. By default this is 0.5.
100100
- _alpha_: Multiplicator or alpha factor for the ReLu activation function. By default this is 0.07.
101-
- _log_: If is *false* then no log happens, if is *true* then there is log in console. Also a function can be provided, and will receive two parameters: the status and the elapsed time of the last epoch. By default this is false.
101+
- _log_: If is *false* then no log happens, if is *true* then details are logged in console. You can also provide a function, and it will receive two parameters: the status and the elapsed time of the last epoch. By default this is false.
102102

103103
Example of how to provide parameters:
104104
```javascript

docs/v4/nlu.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can install @nlpjs/nlu:
1010

1111
## NluNeural
1212

13-
Class _NluNeural_ is an abstraction built on top of _NeuralNetwork_ that help to use it with a corpus.
13+
Class _NluNeural_ is an abstraction built on top of _NeuralNetwork_ that help in using _NeuralNetwork_ with a corpus.
1414
A language can be used as a plugin in order to use the correct tokenizer and stemmer for this language.
1515
In this example both versions, with language and without language, are used in order to compare the results.
1616

@@ -64,7 +64,7 @@ async function measure(useStemmer) {
6464
```
6565

6666
## DomainManager
67-
_DomainManager_ is the class that is an abstraction on top of _NluNeural_.
67+
_DomainManager_ is a class abstraction on top of _NluNeural_.
6868
It adds the concept of _domain_, so each intent belongs to one domain; that way we can have domains for _smalltalk_, _human resources_, _claims_, or whatever logical split of intents that we want to have.
6969
Each _DomainManager_ instance has only one language.
7070
It can be trained by domain or all together:
@@ -167,7 +167,7 @@ function addPersonalityDomain(manager) {
167167
## NluManager
168168
_NluManager_ is the abstraction over _DomainManager_: it contains one _DomainManager_ instance per each language that we want to use. It is also able to guess automatically the language of the sentence, so we can provide the locale of the sentence or omit it.
169169

170-
This is an example with two languages (english and spanish) with two domains each (personality and food).
170+
This is an example with two languages (English and Spanish) with two domains each (personality and food).
171171

172172
```javascript
173173
const { containerBootstrap } = require('@nlpjs/core');

0 commit comments

Comments
 (0)