-
Notifications
You must be signed in to change notification settings - Fork 11
/
voice2json_training.html
120 lines (112 loc) · 5.73 KB
/
voice2json_training.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!--
Copyright 2020, Bart Butenaers & Johannes Kropf
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/javascript">
RED.nodes.registerType('voice2json-training',{
category: 'Voice2Json',
color: '#ff758d',
defaults: {
name: {value:""},
voice2JsonConfig: {value:"", type: "voice2json-config"},
inputField: {value:"payload", required:true},
outputField: {value:"payload", required:true},
loadedProfile: {value:""}
},
inputs:1,
outputs:1,
icon: "font-awesome/fa-refresh",
label: function() {
return this.name || "Voice2Json training";
},
oneditprepare: function() {
var node = this;
// Show the inputField value in a typedinput element (dropdown with only 'msg')
var inputValue = $("#node-input-inputField").val() || '';
$("#node-input-typed-inputField").typedInput({types:['msg']});
$("#node-input-typed-inputField").typedInput('type',node.inputType);
$("#node-input-typed-inputField").typedInput('value',inputValue);
// Show the outputField value in a typedinput element (dropdown with only 'msg')
var outputValue = $("#node-input-outputField").val() || '';
$("#node-input-typed-outputField").typedInput({types:['msg']});
$("#node-input-typed-outputField").typedInput('type','msg');
$("#node-input-typed-outputField").typedInput('value',outputValue);
},
oneditsave: function() {
var node = this;
// Copy the inputField value from the typedinput element to the inputField element
var inputValue = $("#node-input-typed-inputField").typedInput('value');
$("#node-input-inputField").val(inputValue);
// Store also the input type
node.inputType = $("#node-input-typed-inputField").typedInput('type');
// Copy the outputField value from the typedinput element to the outputField element
var outputValue = $("#node-input-typed-outputField").typedInput('value');
$("#node-input-outputField").val(outputValue);
},
oneditcancel: function() {
var node = this;
}
});
</script>
<script type="text/x-red" data-template-name="voice2json-training">
<div class="form-row">
<label for="node-input-voice2JsonConfig"><i class="fa fa-cog"></i> Voice2Json</label>
<!-- Node-Red will replace this input element by a drop-down (with available voice2Json configurations) -->
<input type="text" id="node-input-voice2JsonConfig">
</div>
<div class="form-row">
<label for="node-input-typed-inputField"><i class="fa fa-sign-in"></i> Input field</label>
<input id="node-input-typed-inputField" type="text" style="width: 70%">
<input id="node-input-inputField" type="hidden">
</div>
<div class="form-row">
<label for="node-input-typed-outputField"><i class="fa fa-sign-out"></i> Output field</label>
<input id="node-input-typed-outputField" type="text" style="width: 70%">
<input id="node-input-outputField" type="hidden">
</div>
<!--<br>
<div class="form-row">
<p>load the sentences.ini from the selected profile:</p>
<button id="node-input-loadSentences"><i class="fa fa-exchange"></i> Load </button>
</div>
<div class="form-row">
<p id="node-loadedProfile">no sentences.ini loaded yet</p>
</div>
<div class="form-row">
<button id="node-expand-aceDiv" class="editor-button editor-button-small" style="margin-top: 4px;">
<i class="fa fa-expand"></i>
</button>
<div id="aceDiv" style="width: 100%; height: 450px; min-height:350px;"></div>
</div>-->
<br>
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>
<script type="text/x-red" data-help-name="voice2json-training">
<p><strong>A node that can trigger the training process for a voice2json
language profile</strong><br/></p>
<p><strong>Usage:</strong><br/>
The node will start the training process for the choosen voice2json configuration when it receives
a <strong>"train"</strong> command in the configured input property of the input <code>msg</code>
object. After the training is completed (or failed), it will send a log of the training results in the configured output property
of the output <code>msg</code> object.
</p>
<p><strong>Configuration:</strong><br/>
You can configure the input and output properties of the <code>msg</code> object that the
node listens on and emits messages on. You need to choose a voice2json configuration that the node will
use.<br/></p>
<p><strong>Further Documentation:</strong><br/>
You can find more detailed usage information in the
<a href="https://github.com/johanneskropf/node-red-contrib-voice2json/blob/master/README.md">readme
</a>.</p>
</script>