https://github.com/ecrmnn/wit-keywords
Mass push values to keyword based entities on Wit.ai
https://github.com/ecrmnn/wit-keywords
concurrency entities massively-parallel nlp wit wit-api witai
Last synced: 5 days ago
JSON representation
Mass push values to keyword based entities on Wit.ai
- Host: GitHub
- URL: https://github.com/ecrmnn/wit-keywords
- Owner: ecrmnn
- License: mit
- Created: 2017-02-23T21:53:50.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-23T21:59:21.000Z (over 8 years ago)
- Last Synced: 2025-06-02T11:25:57.110Z (14 days ago)
- Topics: concurrency, entities, massively-parallel, nlp, wit, wit-api, witai
- Language: JavaScript
- Homepage: https://npmjs.com/wit-keywords
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# wit-keywords
> Mass push values to keyword based entities on Wit.ai[](https://travis-ci.org/ecrmnn/wit-keywords.svg?branch=master)
[](http://badge.fury.io/js/wit-keywords)
[](http://badge.fury.io/js/wit-keywords)
[](http://badge.fury.io/js/wit-keywords)### Installation
```bash
npm install wit-keywords --save
```### Usage
Push an array of actors to the actor entity
```javascript
const keywords = require('wit-keywords');new keywords(process.env.WIT_TOKEN)
.entity('actor')
.push([
'Leonardo DiCaprio',
'Steve Carell',
'Alec Baldwin',
'Micheal Cera'
])
.then(response => console.log(response))
.catch(err => console.log(err));//=> [{
//=> value: 'Leonardo DiCaprio',
//=> status: 'added'
//=> }, {}, {}, {}]
```Trigger a function ``after`` each pushed item
```javascript
const keywords = require('wit-keywords');new keywords(process.env.WIT_TOKEN)
.entity('actor')
.after(actor => {
// Do something
})
.push([
'Leonardo DiCaprio',
'Steve Carell',
'Alec Baldwin',
'Micheal Cera'
]);
```Trigger a function ``after`` each pushed item
```javascript
const keywords = require('wit-keywords');new keywords(process.env.WIT_TOKEN)
.entity('actor')
.after(actor => {
// Do something
})
.push([
'Leonardo DiCaprio',
'Steve Carell',
'Alec Baldwin',
'Micheal Cera'
]);
```Set custom number of parallel requests (``concurrency``)
```javascript
const keywords = require('wit-keywords');new keywords(process.env.WIT_TOKEN)
.concurrency(4) // Default = 3
.entity('actor')
.after(actor => {
// Do something
})
.push([
'Leonardo DiCaprio',
'Steve Carell',
'Alec Baldwin',
'Micheal Cera'
]);
```### License
MIT © [Daniel Eckermann](http://danieleckermann.com)