This repository has been archived by the owner on Dec 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
/
index.html
294 lines (261 loc) · 11.6 KB
/
index.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="favicon.ico">
<title>Apache Joshua Machine Translation Demonstration</title>
<!-- Bootstrap core CSS -->
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
/* Move down content because we have a fixed navbar that is 50px tall */
body {
background-image: url("apache_joshua_logo_faded.png");
background-repeat: no-repeat;
background-position: -300px -300px;
}
.oov {
color: red;
font-weight: bold;
text-decoration: underline;
}
.navbar-brand {
font-weight: bold;
}
</style>
</head>
<body>
<nav class="navbar navbar-static-top">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#">
Apache Joshua Machine Translation Demonstration
</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<!-- <form class="navbar-form navbar-right"> -->
<!-- <div class="form-group"> -->
<!-- <input type="text" placeholder="Email" class="form-control"> -->
<!-- </div> -->
<!-- <div class="form-group"> -->
<!-- <input type="password" placeholder="Password" class="form-control"> -->
<!-- </div> -->
<!-- <button type="submit" class="btn btn-success">Sign in</button> -->
<!-- </form> -->
</div><!--/.navbar-collapse -->
</div>
</nav>
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="container">
<div>
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#translate">Translate</a></li>
<li><a data-toggle="tab" href="#rules">Rules</a></li>
<li><a data-toggle="tab" href="#params">Parameters</a></li>
<li><a data-toggle="tab" href="#instructions">Instructions</a></li>
</ul>
</div>
<div class="tab-content">
<div id="translate" class="tab-pane fade in active">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Input</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-lg-12">
<fieldset class="form-group">
<textarea class="form-control" id="sourceTxt" rows="5" placeholder="Enter sentences one per line and type Ctrl-return or ⌘-return to submit" autofocus="autofocus"></textarea>
</fieldset>
</div>
<!-- <div class="col-lg-1"> -->
<!-- <button class="btn btn-primary" type="submit" onclick="translate_default()">Translate</button> -->
<!-- </div> -->
</div>
<div class="row">
<div class="col-lg-8">
<form class="form-inline">
<div class="form-group">
Add New Phrase:
<input type="text" class="form-control" placeholder="source side" id="addPhrase_source" size=20 />
<input type="text" class="form-control" placeholder="target side" id="addPhrase_target" size=20 />
<button type="button" class="btn btn-primary" id="add_rule">Add</button>
</div>
</form>
<!-- <input type="text" class="form-control" placeholder="Enter text to paraphrase" -->
<!-- id="sourceTxt" autofocus="autofocus" size=100 /> -->
</div>
</div>
</div>
<div class="panel-heading">
<h3 class="panel-title">Output</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-lg-8" id="output">
</div>
</div>
</div>
</div>
</div>
<!--
<select id="ppdb_size">
<option value="S">S</option>
<option value="M">M</option>
<option value="L">L</option>
<option value="XL" selected="selected">XL</option>
<option value="XXL">XXL</option>
<option value="XXXL">XXXL</option>
</select>
<select id="ppdb_type">
<option value="all" selected="selected">All</option>
<option value="lex">Lexical</option>
<option value="phrasal">Phrasal</option>
<option value="syntactic">Syntactic</option>
</select>
-->
<div id="rules" class="tab-pane fade">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Rules</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-8 col-xs-12">
<table class="table table-striped table-condensed" id="ruletable">
<thead>
<tr>
<th width="5%"></th>
<th>Source</th>
<th>Target</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="params" class="tab-pane fade">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Parameters</h3>
</div>
<div id="params" class="panel-body">
<div class="panel-body">
<div class="col-md-6">
<div class="input-group">
<span class="input-group-addon" id="label-host">Host</span>
<input type="text" class="form-control" value="127.0.0.1" size="40" id="server_host"
aria-describedby="label-host" />
<span class="input-group-addon" id="label-port">Port</span>
<input type="text" class="form-control" value="" size="5" id="server_port"
aria-describedby="label-port" />
</div>
<br/>
<h5>Feature weights</h5>
<div id="feature_weights">
<div class="input-group">
<span class="input-group-addon" id="label-lm_0">lm_0</span>
<input type="text" class="form-control weights" value="1.0" size="4" id="lm_0"
aria-describedby="label-lm_0" />
</div>
<div class="input-group">
<span class="input-group-addon" id="label-WordPenalty">WordPenalty</span>
<input type="text" class="form-control weights" value="1.0" size="4" id="WordPenalty"
aria-describedby="label-WordPenalty" />
</div>
<div class="input-group">
<span class="input-group-addon" id="label-PhrasePenalty">PhrasePenalty</span>
<input type="text" class="form-control weights" value="1.0" size="4" id="PhrasePenalty"
aria-describedby="label-PhrasePenalty" />
</div>
<div class="input-group">
<span class="input-group-addon" id="label-OOVPenalty">OOVPenalty</span>
<input type="text" class="form-control weights" value="1.0" size="4" id="OOVPenalty"
aria-describedby="label-OOVPenalty" />
</div>
<!-- WordPenalty, OOVPenalty, PhrasePenalty, GoogleNgramSim, AGigaSim -->
</div>
</div>
</div>
</div>
</div>
</div>
<div id="instructions" class="tab-pane fade">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Instructions</h3>
</div>
<div class="panel-body">
<div class="col-md-10 col-xs-12">
<div class="panel panel-info">
<div class="panel-heading">Adding rules</div>
<div class="panel-body">
<p>
To enter a rule, type its source and target sides in the boxes above.
For example, you might enter:
</p>
<div class="well well-sm">
source="ne peux pas" target="can't"
</div>
<p>
Then click "Add Rule" to have the rule added.
The rule will appear in the list above, and any data in the input box on the first tab will be retranslated.
</p>
<p>
For more advanced usage, you can add hierarchical rules.
These are rules with a variable inside them.
The variable serves as a substitution point for the source and target sides.
For example:
</p>
<div class="well well-sm">
source="ne X pas" target="do not X"
</div>
<p>
X here will be replaced with another phrase pair that you have entered.
If you have another entry for "veux" and "want", for example, the decoder can use these two rules to translate the source phrase "do not want".
</p>
<p>
Up to two variables are permitted: X and Y.
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<hr/>
<!-- <footer> -->
<!-- <p>© Johns Hopkins University</p> -->
<!-- </footer> -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="bootstrap/js/jquery-2.2.0.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="demo.js" type="text/javascript"></script>
</body>
</html>