Skip to content

Commit 693cc8c

Browse files
committed
Almost done for the first ever version
1 parent ed936ee commit 693cc8c

13 files changed

+82
-11
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Julien LEICHER
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
rasa-tinyui
1+
tracy
22
===
33

44
A simple and easy to use trainer to generate RASA needed files.
55

6+
Inspired by [Chatito](https://rodrigopivi.github.io/Chatito/) and [Rasa NLU Trainer](https://rasahq.github.io/rasa-nlu-trainer/).
7+
8+
![Screenshot](docs/intent.png)
9+
10+
## How does that work?
11+
12+
Start a project with an **agent**. Create **skills** with multiple **intents** and affect them to your agent. Use **entities** to ease the training process by multiplying your training data sets. That's not magic, it just use intent slots to check if entity values should be used and generates every possible permutations.
13+
14+
*TODO: more documentation on how it works...*
15+
616
## Development
717

818
Run `npm install` to install packages and `npm start` to start the webpack dev server.

TODO.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
TODO
22
===
33

4-
- [ ] Deletion of skill, slots and entities
4+
- [ ] Send training data to Rasa NLU as HTTP Server
5+
- [ ] Cover Rasa Core stuff
6+
- [ ] Some minor refactoring
7+
- [ ] Import / Export of skills and/or agents
8+
- [ ] Production build

docs/intent.png

30.5 KB
Loading

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "rasa-tinyui",
3-
"version": "0.1.0",
2+
"name": "tracy",
3+
"version": "1.0.0",
44
"description": "Tiny interface to generate stuff for rasa",
55
"main": "index.js",
66
"scripts": {
@@ -10,6 +10,8 @@
1010
"test": "echo \"Error: no test specified\" && exit 1"
1111
},
1212
"author": "Julien LEICHER",
13+
"repository": "https://github.com/YuukanOO/tracy",
14+
"homepage": "https://yuukanoo.github.io/tracy/",
1315
"license": "MIT",
1416
"devDependencies": {
1517
"babel-core": "^6.26.0",

src/components/Topbar.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="topbar">
33
<div class="topbar__wrapper">
4-
<router-link class="topbar__link" to="/">rasa-tinyui <span class="topbar__version">{{version}}</span></router-link>
4+
<router-link class="topbar__link" to="/">tracy <span class="topbar__version">{{version}}</span></router-link>
55
<div>
66
<router-link class="topbar__link" :to="{ name: 'agents' }">agents</router-link>
77
<router-link class="topbar__link" :to="{ name: 'skills' }">skills</router-link>

src/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
66

7-
<title>rasa-tinyui</title>
7+
<title>tracy</title>
88
</head>
99
<body>
1010
<div id="root">Loading...</div>

src/pages/Agents.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</list-item>
1919

2020
<blankslate v-if="agents.length === 0" title="No agent yet!">
21-
Looks like you do not have any agent yet! Go ahead and create one!
21+
Agents represents an assistant. Attach skills to it and retrieve Rasa NLU training data. Go ahead and create your first agent!
2222
</blankslate>
2323

2424
<form>

src/pages/Entities.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</list-item>
1919

2020
<blankslate v-if="entities.length === 0" title="No entity yet!">
21-
Looks like you do not have any entity yet! Go ahead and create one!
21+
Entities hold values used to duplicates you sample data and make training easier! Go ahead and create one!
2222
</blankslate>
2323

2424
<form>

src/pages/Skill.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</list-item>
2323
</c-table>
2424
<blankslate title="No intent yet" v-if="skill.intents.length === 0">
25-
Add intents to your skill!
25+
Add intents to your skill to make it useful!
2626
</blankslate>
2727
</c-section>
2828

src/pages/Skills.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</list-item>
1919

2020
<blankslate v-if="skills.length === 0" title="No skill yet!">
21-
Looks like you do not have any skill yet! Go ahead and create one!
21+
Skills hold together multiple intents within a same bounded context. Go ahead and create your first skill!
2222
</blankslate>
2323

2424
<form>

src/store/agents.js

+34
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,19 @@ const mutations = {
113113
});
114114
},
115115
deleteEntity(state, id) {
116+
getters.skills(state).forEach((s) => {
117+
s.intents.forEach((int) => {
118+
Object.values(int.slots).forEach((sl) => {
119+
if (sl.entity == id) { // eslint-disable-line
120+
const slot = getters.slot(state)(s.id)(int.id)(sl.id);
121+
122+
if (slot) {
123+
slot.entity = '';
124+
}
125+
}
126+
});
127+
});
128+
});
116129
Vue.delete(state.entities, id);
117130
},
118131
setEntity(state, {
@@ -145,6 +158,13 @@ const mutations = {
145158
}
146159
},
147160
deleteSkill(state, id) {
161+
getters.agents(state).forEach((agent) => {
162+
for (let i = agent.skills.length - 1; i >= 0; i -= 1) {
163+
if (agent.skills[i] === id) {
164+
agent.skills.splice(i, 1);
165+
}
166+
}
167+
});
148168
Vue.delete(state.skills, id);
149169
},
150170
addIntent(state, { name, description, skillID }) {
@@ -205,6 +225,15 @@ const mutations = {
205225
const intent = getters.intent(state)(skillID)(intentID);
206226

207227
if (intent) {
228+
// Delete in training samples
229+
intent.training.forEach((sample) => {
230+
for (let i = sample.slots.length - 1; i >= 0; i -= 1) {
231+
if (sample.slots[i].slot === id) {
232+
sample.slots.splice(i, 1);
233+
}
234+
}
235+
});
236+
208237
Vue.delete(intent.slots, id);
209238
}
210239
},
@@ -357,6 +386,11 @@ export const actions = {
357386

358387
intent.training.forEach((sample) => {
359388
const text = sample.text.replace('\n', '');
389+
390+
if (!text) {
391+
return;
392+
}
393+
360394
const slotValues = {};
361395
const synonyms = {};
362396

webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = {
99
app: './src/boot.js',
1010
},
1111
output: {
12-
path: path.resolve(__dirname, './dist'),
12+
path: path.resolve(__dirname, './docs'),
1313
filename: '[name].[hash].js',
1414
publicPath: '',
1515
},

0 commit comments

Comments
 (0)