# Using other NLP engines

The eva NLP (NTT DATA proprietary Natural Language Processing engine) comes integrated as default.&#x20;

In this chapter, you'll learn how to connect the virtual agent to an external NLP engine (natural language processing).&#x20;

eva allows you to use different cognitive engines:

1. IBM Watson Assistant.
2. Google Dialogflow Essentials.
3. Microsoft Luis.

To use any of these, just follow the step by step below.&#x20;

In case you are using any of the externals NLP and want to move your virtual agent to the eva NLP, just select it on the NLP menu.

### IBM Watson Assistant

![Watson on eva](/files/UXtfzlDh6ELqfAKjsN2f)

Watson is a service package offered by IMB. Among them, there is a question-answering software that applies natural language processing, information retrieval, knowledge representation, automated reasoning and machine learning technologies to answer questions posed in natural language.

1\)   Go to <https://login.ibm.com/>

2\)   Log in with your IBMid

3\)   Click on "skills" in the upper left corner

4\)   Then click “create skill” to create a virtual agent on Watson

5\)   If you have existing skills, select one, then click on the menu in the upper right corner of the selected skill card.

![Watson skills](/files/G5UMhLne2VDqQr07pP4O)

6\)   Click on “view API details”&#x20;

7\)   If you are using a newer account, copy the links and codes after Assistant URL and Api Key insert them on eva. Remember to switch to the newer version in eva.

8\)   If you are using an older account, copy the links and codes after v1 Workspace URL, Username and Password and insert them on eva. Remember to switch to the older version in eva.

![APIs](/files/RLhWeye7REEz8u1rMnQ5)

### Google Dialogflow Essentials

![Dialog on eva](/files/OwTLhKGZpW15UJMkqWPr)

Dialogflow is a human-computer interaction framework that works on natural language.

1\)   Go to <https://dialogflow.com/>

2\)   Then click on “go to console”.

3\)   Click on settings on the upper left corner (the cogwheel icon - see image).

4\)   Click the link right after “Project ID”.

5\)   You will be taken to a page in the Google Cloud Platform.

6\)   Once in the Google Cloud Platform, click on the link below “e-mail”.

{% hint style="warning" %}
**Important:** Remember to charge your agent permission or else your intents won’t work
{% endhint %}

7\)   Go to IAM on the upper left corner of the menu (as shown in the image below).<br>

![IAM](/files/y30QbNmkbZnO8rjdfCVx)

8\)   Once there, click on the edit icon (pencil) on the right of the agent named as Dialogflow Integrations (see image below).<br>

![Agents list](/files/Fg7kh1g0pHdccrm7Njzi)

9\)   Now, select “Dialogflow” and then “Dialogflow API Admin” (as shown in the image below).<br>

![Permissions](/files/DG3WyUAikroljoXBPU8L)

10\)   Once you changed your agent permission, go to “service accounts” and then click on the menu on the right of the agent you want to use.

{% hint style="warning" %}
**Important:** If you don’t have a Service Account, click on “Create Service Account” and create one
{% endhint %}

![Agent selection](/files/C0ViRxUBqQS8p9NxMpKK)

11\)   Click on “create key” and select JSON.&#x20;

12\)   Save the JSON file on your computer.

{% hint style="info" %}
New option to configure Dialogflow multi region.
{% endhint %}

13\) (Optional) If you want to use a Dialogflow agent from a specific region, you need to modify the JSON file with a new parameter called Dialogflow\.region. This parameter must contain the official region identifier described in this table:

| Country grouping | Geographic location                                          | Region ID            |
| ---------------- | ------------------------------------------------------------ | -------------------- |
| Europe           | Belgium                                                      | europe-west1         |
| Europe           | London                                                       | europe-west2         |
| Asia-Pacific     | Sydney                                                       | australia-southeast1 |
| Asia-Pacific     | Tokyo                                                        | asia-northeast1      |
| Global           | Dialogflow delivery is global, data at rest is within the US | global               |

If this parameter does not exist when creating the bot in eva, the global region will continue to be used by default as it has been to date.

Example Dialogflow metadata JSON with “region” parameter:

```
{
  "type": "service_account",
  "project_id": "projectId",
  "private_key_id": "d8313783b67e14489ef0ea8b2fafd2b23c62c507",
  "private_key": "-----BEGIN PRIVATE KEY-----CRIPTED_KEY-----END PRIVATE KEY-----\n",
  "client_email": "email@ email.iam.gserviceaccount.com",
  "client_id": "1234",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/...",
  
  # NEW PARAMETER --------------------------------
  "region": "australia-southeast1"
  # NEW PARAMETER --------------------------------
}
```

14\. Upload this file when creating a Dialogflow virtual agent in eva to complete the integration.

### Microsoft Luis

![Luis on eva](/files/FQUGacJIe70fTjoO2kh7)

Language Understanding (LUIS) is a cloud-based API service that applies custom machine-learning intelligence to a user's conversational, natural language text to predict overall meaning, and pull out relevant, detailed information.

To integrate LUIS to eva, you have to have an active Azure account with created resources.

1\)   Go to luis.ai

2\)   Login with your Microsoft account.

3\)   Create an app or click on an existing one.

4\)   Click on “manage”.

![Endpoints on Azure](/files/pgJBhK3QhyBNapeo1MBR)

5\) Then click on “Azure Resources” at the left.<br>

![Azure resources](/files/Vwa0IivJheKh560JHizj)

6\)   Copy the example query, located on the bottom of the screen.

![](/files/B6Yd2vGGW6Gwuns8NwyN)

7\)   Then, click on authoring resource and copy the primary key.

![](/files/yXJ9hIeMxAuFXhTCW5xt)

8\)   Paste the Example Query on the URL prediction field and the primary key on the authoring key field.

![](/files/tsgwXbdMA0cUt091tOYG)

#### Using system entities in Luis

eva supports Luis version 2. When using the datetimeV2 system entity in Luis, you can use subcategories, such:

date

time

datetime

daterange

timerange

datetimerange

Those subcategories should be added after a dot (.).

So, if you are using the date subcategory, the entity name should be builtin.datetimeV2.date

Where builtin.datetimeV2 is the system entity name and date is the subcategory.

For further information, check <https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-datetimev2?tabs=1-3%2C2-1%2C3-1%2C4-1%2C5-1%2C6-1#subtypes-of-datetimev2>

### Microsoft QnA Maker <a href="#qna-maker" id="qna-maker"></a>

![QnA Maker on eva](/files/YMT4ynZTLkarIHVvsDxl)

QnA Maker is a cloud-based Natural Language Processing (NLP) service that creates a conversational layer over data. It can be used to find the most appropriate answer for any given natural language input.

1\)   Go to <https://www.qnamaker.ai/>

2\)   Login.

3\)   Click on "My Knowledge Bases".

4\)   \*If you already have knowledge bases, skip to the next page.

5\)   Click “create a knowledge base”.

6\)   You must have an active Azure account.&#x20;

7\)   Fill the required fields and click “create”.<br>

![Knowledge base creation](/files/kbh10cPazvtWidJfZBof)

8\) Select a knowledge base.

![Knowledge base selection](/files/vRDPYifgYUn5ECT6jXO8)

9\) Click on “settings”.

![Knowledge base settings](/files/yXLYcuE7FWSjtY8dPPiE)

10\)  Then go to “postman”, on the bottom of the page, and copy the code.

![Deployment details](/files/kipsy52SGq5OefMyZMiB)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.conversational-ai.syntphony.com/user-guide/_eva-3.4.1_1/using-eva/natural-language/using-other-nlp-engines.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
