Vakavic nodejs API caller.
For complete information please refer to Vakavic
npm install vakavic --save
First of all you should login to Vakavic account and obtain your API_KEY
const vakavic = require('vakavic');
let _vakavic = new vakavic({
api_token : 'YOUR_API_TOKEN'
})
let text = "Your Text to summarize";
// sentence count is set to 5
_vakavic
.summarizeText(text)
.then(response => {
console.log(response);
})
.catch(err => {
throw new Error(err);
});
// sentece count can be set manually : for example here we took 2
_vakavic
.summarizeText(text, 2)
.then(response => {
console.log(response);
})
.catch(err => {
throw new Error(err);
});
This method uses to classify api call of text
you have to make a module inside vakavic account and get your unique module key
const vakavic = require('vakavic');
let _vakavic = new vakavic({
api_token : 'YOUR_API_TOKEN'
})
let text = "Your Text to classify";
let module_key = "YOUR_MODULE_KEY";
_vakavic
.classify(module_key, text)
.then(response => {
console.log(response);
})
.catch(err => {
throw new Error(err);
});
const vakavic = require('vakavic');
let _vakavic = new vakavic({
api_token : 'YOUR_API_TOKEN'
})
let text = "Your Text to classify";
let module_key = "YOUR_MODULE_KEY";
_vakavic
.getClassifications(module_key, text)
.then(response => {
console.log(response);
})
.catch(err => {
throw new Error(err);
});
const vakavic = require('vakavic');
let _vakavic = new vakavic({
api_token : 'YOUR_API_TOKEN'
})
let textArray = [
"Your first Text to classify",
"Your second Text to classify"
];
let module_key = "YOUR_MODULE_KEY";
_vakavic
.batchClassifications(module_key, textArray)
.then(response => {
console.log(response);
})
.catch(err => {
throw new Error(err);
});