All URIs are relative to https://api.farsava.ir/v1
Method | HTTP request | Description |
---|---|---|
getLanguageModelById | GET /speech/languagemodels/{languageModelId} | GET /speech/languagemodels/{languageModelId} |
getLanguageModelList | GET /speech/languagemodels | GET /speech/languagemodels |
trainLanguageModel | POST /speech/languagemodels | POST /speech/languagemodels |
LanguageModelResult getLanguageModelById(languageModelId)
GET /speech/languagemodels/{languageModelId}
Retrieving the status of a language model with specified languageModelId. A language model is ready to use when its status is trained. ***
import FarsavaJsClient from 'farsava-js-client';
let defaultClient = FarsavaJsClient.ApiClient.instance;
// Configure Bearer (JWT) access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new FarsavaJsClient.LanguageModelApi();
let languageModelId = "languageModelId_example"; // String | Id of the language model.
apiInstance.getLanguageModelById(languageModelId, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
languageModelId | String | Id of the language model. |
- Content-Type: Not defined
- Accept: application/json
[LanguageModelResult] getLanguageModelList()
GET /speech/languagemodels
Returns list of user available language models. Each user can access general language models plus their own custom trained language models. ***
import FarsavaJsClient from 'farsava-js-client';
let defaultClient = FarsavaJsClient.ApiClient.instance;
// Configure Bearer (JWT) access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new FarsavaJsClient.LanguageModelApi();
apiInstance.getLanguageModelList((error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
LanguageModelResult trainLanguageModel(languageModelTrainRequestBody)
POST /speech/languagemodels
Train a custom language model using pharases provided by user. Returning a languageModelId for accessing the language model later and using this custom language model to transcribe audios. Using custom language models will boost accuracy for specific keywords/phrases and can be used for a domain-specific speech recognition. ***
import FarsavaJsClient from 'farsava-js-client';
let defaultClient = FarsavaJsClient.ApiClient.instance;
// Configure Bearer (JWT) access token for authorization: bearerAuth
let bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"
let apiInstance = new FarsavaJsClient.LanguageModelApi();
let languageModelTrainRequestBody = new FarsavaJsClient.LanguageModelTrainRequestBody(); // LanguageModelTrainRequestBody | A json object including a name and a corpora. Corpora is a array of text data to train a custom model. This text data can be keywords/phrases. All values in the array must be a string. Name is an arbitary string you set for the custom language model name.
apiInstance.trainLanguageModel(languageModelTrainRequestBody, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
languageModelTrainRequestBody | LanguageModelTrainRequestBody | A json object including a name and a corpora. Corpora is a array of text data to train a custom model. This text data can be keywords/phrases. All values in the array must be a string. Name is an arbitary string you set for the custom language model name. |
- Content-Type: application/json
- Accept: application/json