Skip to content

Commit

Permalink
Adds changes to Tracker Tutorials (#444)
Browse files Browse the repository at this point in the history
  • Loading branch information
pema-s authored Mar 23, 2022
1 parent 5bc0c8e commit 9065719
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 102 deletions.
48 changes: 48 additions & 0 deletions docs/best-practices/best-practices-trackers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
id: best-practices-trackers
title: Trackers Best Practice
sidebar_label: Trackers Best Practice
slug: /best-practices/best-practices-trackers/
---

---
:::note In Beta Phase
This feature is in the Beta phase. If you have any questions, ideas or suggestions please reach out to us at [email protected].
:::

Some of the best practices to keep in mind while creating the Trackers vocabulary are given below:

## Using Keywords

**Dos** <br/>
Densely pack the vocabulary with keywords. Each keyword should add meaning to the sentence.
For example, using “subscription fees” is a good practice because both the words “subscription” and “fees” contain keywords.

**Don’ts** <br/>
Do not preface a keyword with words that don’t add meaning.
For example, using “Could you please kindly inform me about your subscription fees?” is not a good vocabulary item because the first part of the sentence conveys very little information. Only the last two words in the sentence contain useful information, which is “subscription fees”.


## Sentence Structure

**Dos** <br/>
Structure the sentences in a simple way avoiding words that do not add to the meaning.
For example, “I can’t afford this” is a simple sentence where all the four words contribute to the meaning.

**Don’ts**<br/>
Do not use complex sentence structures that do not add meaning such as “I think”, “I feel”, etc.
For example, “I am thinking that I can’t afford this”. Here, the words “I am thinking that ” do not contribute to the meaning of this sentence since “I can’t afford this” is the key meaning of this sentence.

## One meaning per vocabulary phrase

**Dos**<br/>
Each phrase in the vocabulary should convey only one meaning.
For example,
“I used to like chocolate” and “I don’t like chocolate anymore” are conveying two different meanings and are constructed as different phrases.

**Don’ts**<br/>
Do not use two different meanings or thoughts in a single phrase.
For example,
“I used to like chocolate, but I don’t anymore”. This vocabulary phrase is combining two meanings into one sentence and is not a good practice.


64 changes: 29 additions & 35 deletions docs/tutorials/trackers/consuming-trackers-async-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ slug: /tutorials/trackers/consuming-trackers-async-api/
This feature is in the Beta phase. If you have any questions, ideas or suggestions please reach out to us at [email protected].
:::

To use Trackers with Async API, follow the steps given below:
This tutorial covers step-by-step information on how to use Trackers with Async API. We have used the example of the [Async Audio URL API](/docs/management-api/trackers/create-tracker#async-audio-url-api) here. However, you can follow the same steps with other Async APIs as well.

### Step 1: Create a Tracker
---

The first step is to create a Tracker with a set of phrases and keywords using Async APIs.
The first step is to create a Tracker vocabulary with a set of phrases and keywords that you wish to track and pass the same in the Async API payload.

:::tip
If you want to create multiple trackers in bulk, use [Trackers Management API for bulk creation](/docs/management-api/trackers/create-tracker#create-trackers-in-bulk). The Trackers Management API handles Trackers at your account level and is recommended for usecases where where you want to use multiple Trackers.
:::
- Before creating the Trackers, go through the [Best Practices](/docs/best-practices/best-practices-trackers/) document to learn about the dos and don'ts of the Tracker vocabulary creation.

:::tip Best Practises
Before creating the Trackers, go through the [Best Practices](#best-practices) section to learn about how to create Trackers.
- If you want to create multiple trackers, use [Trackers Management API for bulk creation](/docs/management-api/trackers/create-tracker#create-trackers-in-bulk). The Trackers Management API handles all the Trackers you have created at your account level and makes it easy to maintain them.
:::

Given below is an example of an [Async Audio URL API](/docs/management-api/trackers/create-tracker#async-audio-url-api):
#### Authentication

Before using the API, ensure that you have your Authentication Token (`AUTH_TOKEN`) handy. To learn about how to get your auth token, see the step-by-step instructions on the [Authentication](/docs/developer-tools/authentication) page.

#### API Endpoint

Expand All @@ -34,11 +34,12 @@ POST https://api.symbl.ai/v1/process/audio/url
```

#### Request Body
```json

```shell
{
"url": "<PUBLIC_AUDIO_FILE_URL>",
"confidenceThreshold": 0.6,
"timezoneOffset": 0,
"url": "<PUBLIC_AUDIO_FILE_URL>", # The URL must be publicly accessible.
"confidenceThreshold": 0.6, # Minimum confidence score to consider an insight - action items, follow-ups, topics, and questions as valid.
"timezoneOffset": 0, # Specifies the actual timezoneOffset used for detecting the time/date-related entities.
"trackers": [
{
"name": "Promotion Mention",
Expand All @@ -55,16 +56,16 @@ POST https://api.symbl.ai/v1/process/audio/url

#### Response

This creates a Tracker and returns the following response. Note that every Tracker has a unique `id`.
This creates a Tracker and returns the following response. Note the conversation ID for the next step.

```json
```shell
{
"conversationId": "5815170693595136",
"jobId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"
"conversationId": "5815170693595136", # This is the unique identifier of the conversation. Use this to topics, action items, etc.
"jobId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d" # Use the Job ID to know the status of the job.
}
```
:::note
To create Trackers with Async APIs, see detailed documentation in the links given below.
See detailed documentation in the links given below:
- [Create Trackers- Async Audio File API](/docs/management-api/trackers/create-tracker#async-audio-file-api)
- [Create Trackers- Async Audio URL API](/docs/management-api/trackers/create-tracker#async-audio-url-api)
- [Create Trackers- Async Video File API](/docs/management-api/trackers/create-tracker#async-video-file-api)
Expand All @@ -81,7 +82,9 @@ After creating the Tracker, you can:
### Step 2: Get the detected messages containing Trackers
---

Using the `conversation_id` you get from Step 1, you can `GET` the Trackers for the conversation.
Using the `conversation_id` you got from Step 1, make a `GET` request to the Trackers API endpoint given below:

#### API Endpoint

```shell
GET "https://api.symbl.ai/v1/conversations/{{conversation_id}}/trackers-detected"
Expand All @@ -91,7 +94,7 @@ GET "https://api.symbl.ai/v1/conversations/{{conversation_id}}/trackers-detected
```json
[
{
"id": "4527907378937856",
"id": "4527907378937856", // this is the ID of the Tracker
"name": "Promotion Mention",
"matches": [
{
Expand All @@ -112,12 +115,13 @@ GET "https://api.symbl.ai/v1/conversations/{{conversation_id}}/trackers-detected
]
```

### Detecting Trackers with Async API
### Get Trackers by ID

You can also use the Async API to detect Trackers by sending a list of Tracker IDs of previously created trackers (from the Management API). The Trackers will be searched in the submitted Async API request containing the conversation.
You can also use the Async API to get Trackers by sending a list of Tracker IDs of previously created trackers. The Trackers will be searched in the submitted Async API request containing the conversation.

#### Example
In the example given below, we will send the following trackers IDs in the Async API request assuming they were already created:
In the example given below, we will send the following trackers IDs in the Async API request body:

```shell
"trackers": [
{
Expand All @@ -128,7 +132,8 @@ In the example given below, we will send the following trackers IDs in the Async
},
```
#### Full Request Sample
Given below is an example of an Async Text API call sent with Tracker IDs:
Given below is an example of an Async Text API request body containing Tracker IDs:
```shell
curl --location --request POST 'https://api.symbl.ai/v1/process/text' \
Expand All @@ -148,7 +153,7 @@ curl --location --request POST 'https://api.symbl.ai/v1/process/text' \
],
"detectEntities": true,
"messages": [],
"trackers": [
"trackers": [
{
"id": "5123033831841280"
},
Expand All @@ -163,17 +168,6 @@ The old endpoint for fetching Trackers (given below) is deprecated and not recom
`GET https://api.symbl.ai/v1/conversations/{conversationId}/trackers`
:::
### Best Practices
Following are the best practices to be followed while creating Trackers:
Dos' and Don'ts | Example |
---------- | ------- |
Densely pack your vocabulary with information | "What’s the price?" |
Don't preface your information with lots of words that don’t convey meaning | "I was wondering if you could tell me about your pricing structure". |
Use simple sentences or phrases | Short sentence: "I want to understand your product". Phrase: "understand your product" |
Avoid using complex sentence structure | "I want to make sure that I have a full understanding of your product".
## Read more
---
Expand Down Expand Up @@ -207,4 +201,4 @@ Avoid using complex sentence structure | "I want to make sure that I have a full
<br/>
</div>
<br/>
<br/>
21 changes: 7 additions & 14 deletions docs/tutorials/trackers/consuming-trackers-streaming-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ Additionally, you can pass the parameter `enableAllTrackers` in the `config` obj
:::

:::tip Best Practises
Before creating the Trackers, go through the [Best Practices](#best-practices) section to learn about how to create Trackers.
Before creating the Trackers, go through the [Best Practices](/docs/best-practices/best-practices-trackers/) document to learn about the dos and don'ts of the Tracker vocabulary creation.
:::

#### Authentication

Before using the API, ensure that you have your Authentication Token (`AUTH_TOKEN`) handy. To learn about how to get your auth token, see the step-by-step instructions on the [Authentication](/docs/developer-tools/authentication) page.

### Sample Request

```js
const connection = await sdk.startRealtimeRequest({
id,
Expand Down Expand Up @@ -151,19 +157,6 @@ Field Name | Description
`messageRefs.text` | The text body of the message. |
`messageRefs.offset`| The closest match of the text in the message. Offset of -1 means that an exact match for that specific vocabulary wasn’t found and this was the similar match. An offset greater than 0 indicates an exact match for the tracker in the payload of the message.
### Best Practices
Following are the best practices to be followed while creating Trackers:
Dos' and Don'ts | Example |
---------- | ------- |
Densely pack your vocabulary with information | "What’s the price?" |
Don't preface your information with lots of words that don’t convey meaning | "I was wondering if you could tell me about your pricing structure". |
Use simple sentences or phrases | Short sentence: "I want to understand your product". Phrase: "understand your product" |
Avoid using complex sentence structure | "I want to make sure that I have a full understanding of your product".
## Read more
---
<div class="row">
Expand Down
42 changes: 20 additions & 22 deletions docs/tutorials/trackers/consuming-trackers.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: consuming-trackers-management-api
title: How to Create and Use Trackers- Trackers Management API
sidebar_label: Creating and using Trackers- Trackers Management API
title: Consuming Trackers with Trackers Management API
sidebar_label: Consuming Trackers with Trackers Management API
slug: /tutorials/trackers/consuming-trackers-management-api/
---

Expand All @@ -11,7 +11,7 @@ This feature is in the Beta phase. If you have any questions, ideas or suggestio
:::


Trackers can be consumed via the Management API, which takes the onus of maintaining these entities from the developer and shifts it to Symbl’s backend. The Management API provides an easy-to-consume REST interface for managing these entities.
Trackers can be consumed via the Management API, which takes the onus of maintaining these entities from you and shifts it to Symbl’s backend. The Management API provides an easy-to-consume REST interface for managing these entities.

All Trackers created using Management API are saved and can be reused for other operations such as PUT, UPDATE and DELETE.
To read about the capabilities of the Management API, see the [Management API](/docs/management-api/introduction) page.
Expand All @@ -24,10 +24,20 @@ You can also create, view, edit and delete Trackers via the Trackers Management
- **Trackers limitation**: You can create up to 500 trackers per account.
:::

:::tip
Before creating the Trackers, go through the [Best Practices](/docs/best-practices/best-practices-trackers/) document to learn about the dos and don'ts of the Tracker vocabulary creation.
:::

### Step 1: Create Trackers
---

Create Trackers by sending a `POST` request to the Trackers Management API endpoint given below:
Create Trackers by sending a `POST` request to the Trackers Management API endpoint:

#### Authentication

Before using the API, ensure that you have your Authentication Token (`AUTH_TOKEN`) handy. To learn about how to get your auth token, see the step-by-step instructions on the [Authentication](/docs/developer-tools/authentication) page.

#### API Endpoint

```shell
POST "https://api.symbl.ai/v1/manage/tracker"
Expand All @@ -41,10 +51,6 @@ You can only pass the following punctuations in trackers vocabulary:
Using any other punctuation mark such as `?`, `,`, `!`, `:` is not allowed.
:::

:::tip Best Practises
Before creating the Trackers, go through the [Best Practices](#best-practices) section to learn about how to create Trackers.
:::

You can define the phrases and keywords in the **vocabulary** of the request body as shown below:

```json
Expand Down Expand Up @@ -80,6 +86,8 @@ When you send a recorded audio, video or text using [Async API](http://localhost

Given below is an example of a POST request to Async Audio API for processing an audio recording with `enableAllTrackers` set to `true`. By default this is set to `false`.

#### API Endpoint

```shell
POST "https://api.symbl.ai/v1/process/audio?enableAllTrackers=true"
```
Expand All @@ -95,7 +103,7 @@ As a query-param | Async Audio File API, Async Video File API.
In Request Body | Async Audio URL API, Async Video URL API, Async Text API.
:::

On successful processing by the above mentioned API, you will get the `conversationId` and the `jobId` as shown below:
On successful processing of the job, you will get the `conversationId` and the `jobId` as shown below:

#### Response
```json
Expand All @@ -113,7 +121,9 @@ Ensure that you wait for the job to complete before proceeding to Step 3.
### Step 3: Get detected messages containing Trackers
---

Using the `conversationId` from Step 2, you can `GET` the Trackers for the conversation.
Using the `conversationId` from Step 2, you can `GET` the detected Trackers using the following endpoint:

#### API Endpoint

```shell
GET "https://api.symbl.ai/v1/conversations/{{conversation_id}}/trackers-detected"
Expand Down Expand Up @@ -167,18 +177,6 @@ The old endpoint for fetching Trackers (given below) is deprecated and not recom
`GET https://api.symbl.ai/v1/conversations/{conversationId}/trackers`
:::

### Best Practices

Following are the best practices to be followed while creating Trackers:

Dos' and Don'ts | Example |
---------- | ------- |
Densely pack your vocabulary with information | "What’s the price?" |
Don't preface your information with lots of words that don’t convey meaning | "I was wondering if you could tell me about your pricing structure". |
Use simple sentences or phrases | Short sentence: "I want to understand your product". Phrase: "understand your product" |
Avoid using complex sentence structure | "I want to make sure that I have a full understanding of your product".


## Read more
---
<div class="row">
Expand Down
26 changes: 10 additions & 16 deletions docs/tutorials/trackers/creating-trackers-async-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,27 @@ slug: /tutorials/trackers/create-trackers-async-api/
This feature is in the Beta phase. If you have any questions, ideas or suggestions please reach out to us at [email protected].
:::

Symbl provides a diverse set of Async APIs based on Audio/Video or Textual content. For more details on Async APIs refer to the documentation [here](/docs/async-api/introduction).
Symbl provides a set of Async APIs based on audio, video or text content. For more details on Async APIs refer to the documentation [here](/docs/async-api/introduction).

The Trackers once ingested via the request, will then try to detect these in the Conversation. Once the job is complete, you can fetch the Trackers from the Conversation API through the `/trackers` endpoint described below.

:::info Creating Trackers with Management API
While you can create Trackers with Async or Streaming APIs, it is recommended that you create Trackers using Management API because Trackers created with Management APIs are saved and can be reused while the same is not possible with Async or Streaming APIs.
:::


### Async Audio File API
The Tracker entities should be passed in as a **query parameter** in the Async Audio API’s URL like shown below
The Tracker entities should be passed as a **query parameter** in the Async Audio API’s URL as shown below.

:::tip
- Before creating the Trackers, go through the [Best Practices](/docs/best-practices/best-practices-trackers/) document to learn about the dos and don'ts of the Tracker vocabulary creation.

:::tip Best Practises
Before creating the Trackers, go through the [Best Practices](#best-practices) section to learn about how to create Trackers.
- If you want to create multiple trackers, use [Trackers Management API for bulk creation](/docs/management-api/trackers/create-tracker#create-trackers-in-bulk). The Trackers Management API handles all the Trackers you have created at your account level and makes it easy to maintain them.
:::

#### Authentication

Before using the API, ensure that you have your Authentication Token (`AUTH_TOKEN`) handy. To learn about how to get your auth token, see the step-by-step instructions on the [Authentication](/docs/developer-tools/authentication) page.

### API Endpoint

```json
Expand Down Expand Up @@ -238,17 +243,6 @@ Notice that the trackers member follows the same structure as the Trackers secti
}
```

### Best Practices

Following are the best practices to be followed while creating Trackers:

Dos' and Don'ts | Example |
---------- | ------- |
Densely pack your vocabulary with information | "What’s the price?" |
Don't preface your information with lots of words that don’t convey meaning | "I was wondering if you could tell me about your pricing structure". |
Use simple sentences or phrases | Short sentence: "I want to understand your product". Phrase: "understand your product" |
Avoid using complex sentence structure | "I want to make sure that I have a full understanding of your product".

## Read more
---
<div class="row">
Expand Down
Loading

0 comments on commit 9065719

Please sign in to comment.