Skip to content

Commit

Permalink
fix snips adapter ref #73
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigopivi committed Jun 24, 2019
1 parent 79e77e1 commit 7b85d6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 7 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,10 @@ In the previous example, all `@[date]` values will be tagged with the `snips/dat

Chatito supports Node.js `v8.11.2 LTS` or higher.

Install it globally:
```
npm i chatito -g
```
Or locally:
Install it with yarn or npm:
```
npm i chatito --save
````
```

Then create a definition file (e.g.: `trainClimateBot.chatito`) with your code.

Expand Down Expand Up @@ -122,5 +118,10 @@ npx chatito <pathToFileOrDirectory> --format=<format> --formatOptions=<formatOpt

[Overfitting](https://en.wikipedia.org/wiki/Overfitting) is a problem that can be prevented if we use Chatito correctly. The idea behind this tool, is to have an intersection between data augmentation and a probabilistic description of possible sentences combinations. It is not intended to generate deterministic datasets, you should avoid generating all possible combinations.

### Visual Studio Code support

There is a [syntax highlighting plugin](https://marketplace.visualstudio.com/items?itemName=nimfin.chatito) at the VS Code marketplace. Thanks to [Yuri Golobokov](https://github.com/nimf) for his [work on this](https://github.com/nimf/chatito-vscode).


### Author and maintainer
Rodrigo Pimentel
4 changes: 3 additions & 1 deletion src/adapters/snips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ export async function adapter(dsl: string, formatOptions?: any, importer?: gen.I
if (!training.entities[slotKey].data) {
training.entities[slotKey].data = [];
}
const slotSynonymsSet = synonymsForSlots[slotKey][synonymsValue];
const synonymsList = slotSynonymsSet.size ? Array.from(slotSynonymsSet) : [];
(training.entities[slotKey].data as any[]).push({
synonyms: [...synonymsForSlots[slotKey][synonymsValue]],
synonyms: synonymsList,
value: synonymsValue
});
});
Expand Down

0 comments on commit 7b85d6c

Please sign in to comment.