node-nlp
Version:
Library for NLU (Natural Language Understanding) done in Node.js
4,215 lines (1,018 loc) • 48 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: NlpManager</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: NlpManager</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>NlpManager<span class="signature">(settings)</span><span class="type-signature"></span></h2>
<div class="class-description">Class for the NLP Manager.
The NLP manager is the one that is able to manage several classifiers,
to have multilanguage, and also is the responsible of the NER (Named Entity
Recognition).
Understanding NER:
You can have several entities defined, each one with multilanguage and
several texts for each option. Example
Entity Option English Spanish
FOOD Burguer Burguer, Hamburguer Hamburguesa
FOOD Salad Salad Ensalada
FOOD Pizza Pizza Pizza</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="NlpManager"><span class="type-signature"></span>new NlpManager<span class="signature">(settings)</span><span class="type-signature"></span></h4>
<div class="description">
Constructor of the class.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>settings</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Settings for the NLP Manager.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line51">line 51</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="addAnswer"><span class="type-signature"></span>addAnswer<span class="signature">(locale, intent, answer, condition)</span><span class="type-signature"></span></h4>
<div class="description">
Adds an answer for a locale and intent.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>locale</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Locale of the intent.</td>
</tr>
<tr>
<td class="name"><code>intent</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Intent name.</td>
</tr>
<tr>
<td class="name"><code>answer</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Text of the answer.</td>
</tr>
<tr>
<td class="name"><code>condition</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Condition to be evaluated.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line259">line 259</a>
</li></ul></dd>
</dl>
<h4 class="name" id="addDocument"><span class="type-signature"></span>addDocument<span class="signature">(srcLocale, utterance, intent)</span><span class="type-signature"></span></h4>
<div class="description">
Adds a new utterance associated to an intent for the given locale.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>srcLocale</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Locale of the language.</td>
</tr>
<tr>
<td class="name"><code>utterance</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Text of the utterance.</td>
</tr>
<tr>
<td class="name"><code>intent</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Intent name.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line211">line 211</a>
</li></ul></dd>
</dl>
<h4 class="name" id="addLanguage"><span class="type-signature"></span>addLanguage<span class="signature">(srcLocales)</span><span class="type-signature"></span></h4>
<div class="description">
Adds a language or several languages to the NLP Manager.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>srcLocales</code></td>
<td class="type">
<span class="param-type">Array.<String></span>
</td>
<td class="description last">Locales to be added.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line88">line 88</a>
</li></ul></dd>
</dl>
<h4 class="name" id="addNamedEntityText"><span class="type-signature"></span>addNamedEntityText<span class="signature">(entityName, optionName, languages, texts)</span><span class="type-signature"></span></h4>
<div class="description">
Add new texts for an option of an entity for the given languages.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>entityName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Name of the entity.</td>
</tr>
<tr>
<td class="name"><code>optionName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Name of the option.</td>
</tr>
<tr>
<td class="name"><code>languages</code></td>
<td class="type">
<span class="param-type">Array.<String></span>
</td>
<td class="description last">Languages for adding the texts.</td>
</tr>
<tr>
<td class="name"><code>texts</code></td>
<td class="type">
<span class="param-type">Array.<String></span>
</td>
<td class="description last">Texts to be added.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line121">line 121</a>
</li></ul></dd>
</dl>
<h4 class="name" id="addRegexEntity"><span class="type-signature"></span>addRegexEntity<span class="signature">(entityName, regex)</span><span class="type-signature"></span></h4>
<div class="description">
Adds a new regex named entity
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>entityName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Name of the entity.</td>
</tr>
<tr>
<td class="name"><code>regex</code></td>
<td class="type">
<span class="param-type">RegEx</span>
</td>
<td class="description last">Regular expression</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line135">line 135</a>
</li></ul></dd>
</dl>
<h4 class="name" id="addTrimEntity"><span class="type-signature"></span>addTrimEntity<span class="signature">(entityName)</span><span class="type-signature"> → {Object}</span></h4>
<div class="description">
Adds a new trim named entity.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>entityName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Name of the entity.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line150">line 150</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
New Trim Named Entity instance.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id="assignDomain"><span class="type-signature"></span>assignDomain<span class="signature">(intent, domain)</span><span class="type-signature"></span></h4>
<div class="description">
Assign an intent to a domain.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>intent</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Intent to be assigned.</td>
</tr>
<tr>
<td class="name"><code>domain</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Domain to include the intent.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line175">line 175</a>
</li></ul></dd>
</dl>
<h4 class="name" id="classify"><span class="type-signature"></span>classify<span class="signature">(srcLocale, srcUtterance)</span><span class="type-signature"></span></h4>
<div class="description">
Given an utterance and a locale, try to classify the utterance into one intent.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>srcLocale</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Locale of the text. If not provided,
the locale is guessed.</td>
</tr>
<tr>
<td class="name"><code>srcUtterance</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Text to be classified</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line303">line 303</a>
</li></ul></dd>
</dl>
<h4 class="name" id="clear"><span class="type-signature"></span>clear<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Clear the NLP Manger.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line504">line 504</a>
</li></ul></dd>
</dl>
<h4 class="name" id="export"><span class="type-signature"></span>export<span class="signature">(minified)</span><span class="type-signature"> → {String}</span></h4>
<div class="description">
Export NLP manager information as a string.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>minified</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="default">
false
</td>
<td class="description last">If true, the returned JSON will have no spacing or indentation.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line574">line 574</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
NLP manager information as a JSON string.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
<h4 class="name" id="extractEntities"><span class="type-signature">(async) </span>extractEntities<span class="signature">(srcLocale, srcUtterance, whitelist)</span><span class="type-signature"> → {Array.<Object>}</span></h4>
<div class="description">
Process to extract entities from an utterance.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>srcLocale</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Locale of the utterance, optional.</td>
</tr>
<tr>
<td class="name"><code>srcUtterance</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Text of the utterance.</td>
</tr>
<tr>
<td class="name"><code>whitelist</code></td>
<td class="type">
<span class="param-type">Array.<string></span>
</td>
<td class="description last">Optional whitelist of entity names.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line363">line 363</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Array of entities.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.<Object></span>
</dd>
</dl>
<h4 class="name" id="getDomains"><span class="type-signature"></span>getDomains<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Get an object with the intents of each domain.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line191">line 191</a>
</li></ul></dd>
</dl>
<h4 class="name" id="getIntentDomain"><span class="type-signature"></span>getIntentDomain<span class="signature">(intent)</span><span class="type-signature"> → {String}</span></h4>
<div class="description">
Returns the domain of a given intent.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>intent</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Intent name.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line184">line 184</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Domain of the intent.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
<h4 class="name" id="getSentiment"><span class="type-signature"></span>getSentiment<span class="signature">(srcLocale, srcUtterance)</span><span class="type-signature"></span></h4>
<div class="description">
Gets the sentiment of an utterance.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>srcLocale</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Locale of the text. If not provided, is guessed.</td>
</tr>
<tr>
<td class="name"><code>srcUtterance</code></td>
<td class="type">
<span class="param-type">Promise.String</span>
</td>
<td class="description last">Texto to analyze the sentiment.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line323">line 323</a>
</li></ul></dd>
</dl>
<h4 class="name" id="guessLanguage"><span class="type-signature"></span>guessLanguage<span class="signature">(utterance)</span><span class="type-signature"> → {String}</span></h4>
<div class="description">
Given a text, try to guess the language, over the languages used for the NLP.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>utterance</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Text to be guessed.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line109">line 109</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
ISO2 locale of the language, or undefined if not found.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
<h4 class="name" id="import"><span class="type-signature"></span>import<span class="signature">(data)</span><span class="type-signature"></span></h4>
<div class="description">
Load NLP manager information from a string.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">String</span>
|
<span class="param-type">Object</span>
</td>
<td class="description last">JSON string or object to load NLP manager information from.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line516">line 516</a>
</li></ul></dd>
</dl>
<h4 class="name" id="isEqualClassification"><span class="type-signature"></span>isEqualClassification<span class="signature">(classifications)</span><span class="type-signature"> → {boolean}</span></h4>
<div class="description">
Indicates if all the classifications has exactly 0.5 score.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>classifications</code></td>
<td class="type">
<span class="param-type">Array.<Object></span>
</td>
<td class="description last">Array of classifications.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line347">line 347</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
True if all classifications score is 0.5.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id="load"><span class="type-signature"></span>load<span class="signature">(srcFilename)</span><span class="type-signature"></span></h4>
<div class="description">
Load the NLP manager information from a file.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>srcFilename</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Filename for loading the NLP manager.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line639">line 639</a>
</li></ul></dd>
</dl>
<h4 class="name" id="loadExcel"><span class="type-signature"></span>loadExcel<span class="signature">(srcFileName)</span><span class="type-signature"></span></h4>
<div class="description">
Load the NLP manager information from an excel file.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>srcFileName</code></td>
<td class="type">
<span class="param-type">Sting</span>
</td>
<td class="description last">File name of the excel.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line649">line 649</a>
</li></ul></dd>
</dl>
<h4 class="name" id="process"><span class="type-signature">(async) </span>process<span class="signature">(srcLocale, srcUtterance, Promise)</span><span class="type-signature"></span></h4>
<div class="description">
Process an utterance for full classify and analyze. If the locale is
not provided, then it will be guessed.
Classify the utterance and extract entities from it, returning an
object with all the information available.
Also calculates the sentiment of the utterance, if possible.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>srcLocale</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Language locale of the utterance.</td>
</tr>
<tr>
<td class="name"><code>srcUtterance</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Text of the utterance.</td>
</tr>
<tr>
<td class="name"><code>Promise</code></td>
<td class="type">
<span class="param-type">Promise.Object</span>
</td>
<td class="description last">srcContext Context for finding answers.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line392">line 392</a>
</li></ul></dd>
</dl>
<h4 class="name" id="removeAnswer"><span class="type-signature"></span>removeAnswer<span class="signature">(locale, intent, answer, condition)</span><span class="type-signature"></span></h4>
<div class="description">
Remove and answer from a locale and intent.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>locale</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Locale of the intent.</td>
</tr>
<tr>
<td class="name"><code>intent</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Intent name.</td>
</tr>
<tr>
<td class="name"><code>answer</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Text of the answer.</td>
</tr>
<tr>
<td class="name"><code>condition</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Condition to be evaluated.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line270">line 270</a>
</li></ul></dd>
</dl>
<h4 class="name" id="removeDocument"><span class="type-signature"></span>removeDocument<span class="signature">(srcLocale, utterance, intent)</span><span class="type-signature"></span></h4>
<div class="description">
Removes an utterance associated to an intent for the given locale.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>srcLocale</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Locale of the language.</td>
</tr>
<tr>
<td class="name"><code>utterance</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Text of the utterance.</td>
</tr>
<tr>
<td class="name"><code>intent</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Intent name.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line237">line 237</a>
</li></ul></dd>
</dl>
<h4 class="name" id="removeNamedEntityText"><span class="type-signature"></span>removeNamedEntityText<span class="signature">(entityName, optionName, languages, texts)</span><span class="type-signature"></span></h4>
<div class="description">
Remove texts from an option of an entity for the given languages.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>entityName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Name of the entity.</td>
</tr>
<tr>
<td class="name"><code>optionName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Name of the option.</td>
</tr>
<tr>
<td class="name"><code>languages</code></td>
<td class="type">
<span class="param-type">Array.<String></span>
</td>
<td class="description last">Languages for adding the texts.</td>
</tr>
<tr>
<td class="name"><code>texts</code></td>
<td class="type">
<span class="param-type">Array.<String></span>
</td>
<td class="description last">Texts tobe added.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line161">line 161</a>
</li></ul></dd>
</dl>
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">(srcFileName)</span><span class="type-signature"></span></h4>
<div class="description">
Save the NLP manager information into a file.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>srcFileName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Filename for saving the NLP manager.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line630">line 630</a>
</li></ul></dd>
</dl>
<h4 class="name" id="train"><span class="type-signature">(async) </span>train<span class="signature">(locale)</span><span class="type-signature"></span></h4>
<div class="description">
Train the classifiers for the provided locales. If no locale is
provided, then retrain all the classifiers.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>locale</code></td>
<td class="type">
<span class="param-type">Array.<String></span>
</td>
<td class="description last">List of locales for being retrained.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="nlp_nlp-manager.js.html">nlp/nlp-manager.js</a>, <a href="nlp_nlp-manager.js.html#line279">line 279</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BinaryNeuralNetworkClassifier.html">BinaryNeuralNetworkClassifier</a></li><li><a href="Classifier.html">Classifier</a></li><li><a href="ConversationContext.html">ConversationContext</a></li><li><a href="DutchStemmer.html">DutchStemmer</a></li><li><a href="EnglishStemmer.html">EnglishStemmer</a></li><li><a href="EnumNamedEntity.html">EnumNamedEntity</a></li><li><a href="Evaluator.html">Evaluator</a></li><li><a href="HungarianStemmer.html">HungarianStemmer</a></li><li><a href="ItalianStemmer.html">ItalianStemmer</a></li><li><a href="Language.html">Language</a></li><li><a href="LogisticRegressionClassifier.html">LogisticRegressionClassifier</a></li><li><a href="Matrix.html">Matrix</a></li><li><a href="MemoryConversationContext.html">MemoryConversationContext</a></li><li><a href="NamedEntity.html">NamedEntity</a></li><li><a href="NerManager.html">NerManager</a></li><li><a href="NlgManager.html">NlgManager</a></li><li><a href="NlpClassifier.html">NlpClassifier</a></li><li><a href="NlpManager.html">NlpManager</a></li><li><a href="NorwegianStemmer.html">NorwegianStemmer</a></li><li><a href="PortugueseStemmer.html">PortugueseStemmer</a></li><li><a href="Recognizer.html">Recognizer</a></li><li><a href="RegexNamedEntity.html">RegexNamedEntity</a></li><li><a href="RomanianStemmer.html">RomanianStemmer</a></li><li><a href="RussianStemmer.html">RussianStemmer</a></li><li><a href="SentimentAnalyzer.html">SentimentAnalyzer</a></li><li><a href="SentimentManager.html">SentimentManager</a></li><li><a href="SimilarSearch.html">SimilarSearch</a></li><li><a href="SlotManager.html">SlotManager</a></li><li><a href="StemmerJa.html">StemmerJa</a></li><li><a href="SwedishStemmer.html">SwedishStemmer</a></li><li><a href="Tokenizer.html">Tokenizer</a></li><li><a href="TrimNamedEntity.html">TrimNamedEntity</a></li><li><a href="TurkishStemmer.html">TurkishStemmer</a></li><li><a href="Vector.html">Vector</a></li><li><a href="XTable.html">XTable</a></li></ul><h3>Global</h3><ul><li><a href="global.html#endsinArr">endsinArr</a></li><li><a href="global.html#prelude">prelude</a></li><li><a href="global.html#regions">regions</a></li><li><a href="global.html#stem">stem</a></li><li><a href="global.html#stopwords">stopwords</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat Oct 13 2018 19:14:51 GMT+0200 (CEST)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>