Vulavula Converse
Vulavula Converse is our platform for conversational AI
Features
Converse have a couple of features which includes:
-
NLU: Converse supports Natural Language Understanding (NLU) through Intent Classification and Named Entity Recognition (NER).
-
Multilingual Few-shot Intent Classification: Our platform enables few-shot learning for intent classification across multiple languages.
-
Generative Chat with RAG (Coming Soon): Stay tuned for upcoming features that will enable generative chat using Retrieval-Augmented Generation (RAG) techniques.
Entity Recognition
POST
https://vulavula-services.lelapa.ai/api/v1/entity_recognition/process.
The Named Entity Recognition (NER) endpoint analyzes the provided text and identifies named entities such as persons, locations, and more. Each request can handle up to 2,000 tokens, with 180 tokens recommended for optimal performance.
BODY PARAMS
encoded_text string required.
This parameter represents the text input that will be analyzed for named entities. It is required for the endpoint to function properly. The encoded_text
should be provided as a string and contains the text to be processed by the Named Entity Recognition (NER) model. The text may include any language and should ideally be encoded in a format suitable for NER processing, ensuring accurate entity detection.
HEADERS
X-CLIENT-TOKEN string required.
Represents the authentication token required for accessing the API. This header ensures that only authorized clients can make requests to the endpoint.
EXAMPLES
- Python SDK
- Python HTTP
- Curl
pdm add vulavula
from vulavula import VulavulaClient
client = VulavulaClient("<INSERT_TOKEN>")
entity_result = client.get_entities({'encoded_text': 'President Ramaphosa gaan loop by Emfuleni Municipality.'})
print("Entity Recognition Output:", entity_result)
# Endpoint URL
url = 'https://vulavula-services.lelapa.ai/api/v1/entity_recognition/process'
# Headers
headers = {
'Content-Type': 'application/json',
'X-CLIENT-TOKEN': '<INSERT_TOKEN>' # Replace '<INSERT_TOKEN>' with your actual client token
}
# Request body
data = {
"encoded_text": "President Ramaphosa gaan loop by Emfuleni Municipality"
}
# Sending POST request
response = requests.post(url, headers=headers, json=data)
# Printing response
print(response.json())
curl --request POST \
--url https://vulavula-services.lelapa.ai/api/v1/entity_recognition/process \
--header 'Content-Type: application/json' \
--header 'User-Agent: curl/7.68.0' \
--header 'X-Client-Token: <INSERT_TOKEN>' \
--data '{"encoded_text": "President Ramaphosa gaan loop by Emfuleni Municipality"}'
RESPONSES
🟢 200 OK
[
{
"entity": "person",
"word": "Ramaphosa",
"start": 10,
"end": 19
},
{
"entity": "location",
"word": "Emfuleni Municipality",
"start": 33,
"end": 54
}
]
RESPONSE BODY PARAMS
Object |
---|
entity string required. Specifies the type of the recognized entity (e.g., person, location). |
word string required. Contains the text representing the recognized entity. |
start number required. Indicates the starting index of the recognized entity in the input text. |
end number required. Indicates the ending index of the recognized entity in the input text. |
🔴 400 Bad Request
🟠 401 Unauthorized
🔴 500 Internal Server Error
Multilingual Few-shot Intent Classification
POST
https://vulavula-services.lelapa.ai/api/v1/classify.
Allows users to classify inputs into specified intents with minimal training data across multiple languages.
Below is how the endpoint works:
BODY PARAMS
examples array of objects required.
Supply a minimum of two examples for each intent along with their corresponding intent classifications. Each example should include the intent it represents. Each Object has two keys.
intent
: Specifies the name of the intent for which the example input is provided.example
: Contains the example input text.
inputs array of strings required.
An array of input texts that need to be classified into intents. These input texts are the ones for which the intent classification will be performed. For example: ["greeting", "goodbye", "happy", "sad", "none"]
HEADERS
X-CLIENT-TOKEN string required.
Represents the authentication token required for accessing the API. This header ensures that only authorized clients can make requests to the endpoint.
EXAMPLES
- Python SDK
- Python HTTP
- Curl
- Typescript
pdm add vulavula
from vulavula import VulavulaClient
client = VulavulaClient("<INSERT_TOKEN>")
classification_data = {
"examples": [
{"intent": "greeting", "example": "Hello!"},
{"intent": "greeting", "example": "Hi there!"},
{"intent": "greeting", "example": "Habari yako?"}, #how are you?
{"intent": "goodbye", "example": "Goodbye!"},
{"intent": "goodbye", "example": "See you later!"},
{"intent": "goodbye", "example": "Kwaheri"}, #bye
{"intent": "goodbye", "example": "Tutaonana baadaye"}, #see you later
],
"inputs": [
"Hey, how are you?",
"I must be going now."
]
}
classification_results = client.classify(classification_data)
print("Classification Results:", classification_results)
# Endpoint URL
url = 'https://vulavula-services.lelapa.ai/api/v1/classify'
# Headers
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-Client-Token': '<INSERT_TOKEN>' # Replace '<INSERT_TOKEN>' with your actual client token
}
# Request body
data = {
"examples": [
{"intent": "greeting", "example": "Hello!"},
{"intent": "greeting", "example": "Hi there!"},
{"intent": "goodbye", "example": "Goodbye!"},
{"intent": "goodbye", "example": "See you later!"}
],
"inputs": [
"Hey, how are you?",
"I must be going now."
]
}
# Sending POST request
response = requests.post(url, headers=headers, json=data)
# Printing response
print(response.json())
curl --request POST \
--url https://vulavula-services.lelapa.ai/api/v1/classify \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'User-Agent: insomnia/8.6.1' \
--header 'X-CLIENT-TOKEN: <INSERT_TOKEN>' \
--data '{
"examples": [
{"intent": "greeting", "example": "Hello!"},
{"intent": "greeting", "example": "Hi there!"},
{"intent": "goodbye", "example": "Goodbye!"},
{"intent": "goodbye", "example": "See you later!"}
],
"inputs": [
"Hey, how are you?",
"I must be going now."
]
}'
import axios, { AxiosRequestConfig } from 'axios';
// Endpoint URL
const url: string = 'https://vulavula-services.lelapa.ai/api/v1/classify';
// Request body
const data = {
examples: [
{ intent: 'greeting', example: 'Hello!' },
{ intent: 'greeting', example: 'Hi there!' },
{ intent: 'goodbye', example: 'Goodbye!' },
{ intent: 'goodbye', example: 'See you later!' }
],
inputs: [
'Hey, how are you?',
'I must be going now.'
]
};
// Headers
const headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-Client-Token': '<INSERT_TOKEN>' // Replace '<INSERT_TOKEN>' with your actual client token
};
// Axios request configuration
const config: AxiosRequestConfig = {
headers: headers
};
// Sending POST request
axios.post(url, data, config)
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});
RESPONSES
🟢 200 OK
The endpoint returns a JSON object containing the possible intents along with their corresponding scores or probabilities. For example:
[
{
"probabilities": [
{
"intent": "goodbye",
"score": 0.25613666
},
{
"intent": "greeting",
"score": 0.74386334
}
]
},
{
"probabilities": [
{
"intent": "goodbye",
"score": 0.6334656
},
{
"intent": "greeting",
"score": 0.36653438
}
]
}
]
RESPONSE BODY PARAMS
Object |
---|
probabilities array of objects required. An array containing objects representing the probabilities of different intents for the input text. |
intent string required. A string indicating the name of the intent. |
score number required. A number representing the probability or confidence score of the corresponding intent. Higher scores indicate a higher likelihood that the input text belongs to that intent category. |
🔴 400 Bad Request
🟠 401 Unauthorized
🔴 500 Internal Server Error
You can also checkout our Getting Started.