-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfekextractor.html
420 lines (351 loc) · 16.1 KB
/
fekextractor.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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Page title -->
<title>NER & Metadata Extraction | Greek Government Gazette</title>
<!-- Vendor styles -->
<link rel="stylesheet" href="vendor/fontawesome/css/font-awesome.css" />
<link rel="stylesheet" href="vendor/metisMenu/dist/metisMenu.css" />
<link rel="stylesheet" href="vendor/animate.css/animate.css" />
<link rel="stylesheet" href="vendor/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="vendor/datatables.net-bs/css/dataTables.bootstrap.min.css" />
<!-- App styles -->
<link rel="stylesheet" href="fonts/pe-icon-7-stroke/css/pe-icon-7-stroke.css" />
<link rel="stylesheet" href="fonts/pe-icon-7-stroke/css/helper.css" />
<link rel="stylesheet" href="styles/style.css">
<link rel="stylesheet" href="styles/datatables_custom.css">
</head>
<body class="fixed-navbar fixed-sidebar">
<!-- Simple splash screen-->
<div class="splash"> <div class="color-line"></div><div class="splash-title"><h1>NER & Metadata Extraction from the Greek Government Gazette | Version 2.0 </p><div class="spinner"> <div class="rect1"></div> <div class="rect2"></div> <div class="rect3"></div> <div class="rect4"></div> <div class="rect5"></div> </div> </div> </div>
<!--[if lt IE 7]>
<p class="alert alert-danger">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!-- Header -->
<div id="header">
<div class="color-line">
</div>
<div id="logo" class="light-version">
<span>
Extractor APP
</span>
</div>
<nav role="navigation">
<div class="header-link hide-menu"><i class="fa fa-bars"></i></div>
<div class="small-logo">
<span class="text-primary">Extractor APP</span>
</div>
<form role="search" class="navbar-form-custom" method="post" action="#">
<div class="form-group">
<input type="text" placeholder="Search something special" class="form-control" name="search">
</div>
</form>
<div class="mobile-menu">
<button type="button" class="navbar-toggle mobile-menu-toggle" data-toggle="collapse" data-target="#mobile-collapse">
<i class="fa fa-chevron-down"></i>
</button>
<div class="collapse mobile-navbar" id="mobile-collapse">
<ul class="nav navbar-nav">
<li>
<a class="" href="login.html">Login</a>
</li>
<li>
<a class="" href="login.html">Logout</a>
</li>
<li>
<a class="" href="profile.html">Profile</a>
</li>
</ul>
</div>
</div>
<div class="navbar-right">
<ul class="nav navbar-nav no-borders">
<li class="dropdown">
<a class="dropdown-toggle" href="#" data-toggle="dropdown">
<i class="pe-7s-speaker"></i>
</a>
<ul class="dropdown-menu hdropdown notification animated flipInX">
<li>
<a>
<span class="label label-success">NEW</span> csv added
</a>
</li>
<li>
<a>
<span class="label label-warning">WAR</span> FEK detected
</a>
</li>
<li>
<a>
<span class="label label-danger">ERR</span> 3 errors found
</a>
</li>
<li class="summary"><a href="#">See all notifications</a></li>
</ul>
</li>
<li>
<a href="#" id="sidebar" class="right-sidebar-toggle">
<i class="pe-7s-upload pe-7s-news-paper"></i>
</a>
</li>
<li class="dropdown">
<a href="#">
<i class="pe-7s-upload pe-rotate-90"></i>
</a>
</li>
</ul>
</div>
</nav>
</div>
<!-- Navigation -->
<aside id="menu">
<div id="navigation">
<div class="profile-picture">
<a href="index.html">
<img src="images/profile.png" class="img-circle m-b" alt="logo">
</a>
<div class="stats-label text-color">
<span class="font-extra-bold font-uppercase">ΕΛΛΑΚ</span>
<div id="sparkline1" class="small-chart m-t-sm"></div>
<div>
<h4 class="font-extra-bold m-b-xs">
104,200
</h4>
<small class="text-muted">Greek Government Gazette exctractions</small>
</div>
</div>
</div>
<ul class="nav" id="side-menu">
<li>
<a href="#"> <span class="nav-label">Extractor</span> <span class="label label-success pull-right">v.2</span> </a>
</li>
<li>
<a href="#"> <span class="nav-label">Analytics</span><span class="label label-warning pull-right">NEW</span> </a>
</li>
</ul>
</div>
</aside>
<!-- Main Wrapper -->
<div id="wrapper">
<div class="content animate-panel">
<div class="row">
<div class="col-lg-12">
<div class="hpanel">
<div class="panel-heading">
<div class="panel-tools">
<a class="showhide"><i class="fa fa-chevron-up"></i></a>
</div>
Please load a csv file
<input type="file" id="the-csv-file-field">
<div id="predictionFilterDiv" class="pull-right "></div>
<div> </div>
</div>
<div class="panel-body">
<table id="example1" class="table table-striped table-bordered table-hover" width="100%">
<thead>
<tr>
<th name='ArticleNo' scope="col">ArticleNo</th>
<th name='RawParagraph' scope="col">RawParagraph</th>
<th name='Prediction' scope="col" width="15%">Prediction</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Right sidebar -->
<div id="right-sidebar" class="animated fadeInRight">
<div class="p-m">
<button id="sidebar-close" class="right-sidebar-toggle sidebar-button btn btn-default m-b-md"><i class="pe pe-7s-close"></i>
</button>
<div>
<span class="font-bold no-margins"> Analytics </span>
<br>
<small> number of entities extracted</small>
</div>
<div class="row m-t-sm m-b-sm">
<div class="col-lg-6">
<h3 class="no-margins font-extra-bold text-success">300,102</h3>
<div class="font-bold">98% <i class="fa fa-level-up text-success"></i></div>
</div>
<div class="col-lg-6">
<h3 class="no-margins font-extra-bold text-success">280,200</h3>
<div class="font-bold">98% <i class="fa fa-level-up text-success"></i></div>
</div>
</div>
<div class="progress m-t-xs full progress-small">
<div style="width: 25%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="25" role="progressbar"
class=" progress-bar progress-bar-success">
<span class="sr-only">35% Complete (success)</span>
</div>
</div>
</div>
<div class="p-m bg-light border-bottom border-top">
<span class="font-bold no-margins"> Organizations </span>
<br>
<small> positions and responsibilities</small>
<div class="m-t-md">
<div class="social-talk">
<div class="media social-profile clearfix">
<a class="pull-left">
<img src="images/profile.png" alt="profile-picture">
</a>
<div class="media-body">
<span class="font-bold">Ministry of Education</span>
<small class="text-muted">21.03.2015</small>
<div class="social-content small">
responsibilities
</div>
</div>
</div>
</div>
</div>
</div>
<div class="p-m">
<span class="font-bold no-margins"> Extractions in last week </span>
<div class="m-t-xs">
<div class="row">
<div class="col-xs-6">
<small>Today</small>
<h4 class="m-t-xs">170 <i class="fa fa-level-up text-success"></i></h4>
</div>
<div class="col-xs-6">
<small>Last week</small>
<h4 class="m-t-xs">580 <i class="fa fa-level-up text-success"></i></h4>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<small>Today</small>
<h4 class="m-t-xs">620 <i class="fa fa-level-up text-success"></i></h4>
</div>
<div class="col-xs-6">
<small>Last week</small>
<h4 class="m-t-xs">140 <i class="fa fa-level-up text-success"></i></h4>
</div>
</div>
</div>
<small> Lorem Ipsum is simply dummy text of the printing simply all dummy text.
Many desktop publishing packages and web page editors.
</small>
</div>
</div>
<!-- Footer-->
<footer class="footer">
<span class="pull-right">
Example text
</span>
Company 2015-2020
</footer>
</div>
<!-- Vendor scripts -->
<script src="vendor/jquery/dist/jquery.min.js"></script>
<script src="vendor/jquery-ui/jquery-ui.min.js"></script>
<script src="vendor/jquery-csv/jquery.csv.js"></script>
<script src="vendor/slimScroll/jquery.slimscroll.min.js"></script>
<script src="vendor/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="vendor/metisMenu/dist/metisMenu.min.js"></script>
<script src="vendor/iCheck/icheck.min.js"></script>
<script src="vendor/sparkline/index.js"></script>
<!-- DataTables -->
<script src="vendor/datatables/media/js/jquery.dataTables.min.js"></script>
<script src="vendor/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<!-- DataTables buttons scripts -->
<script src="vendor/pdfmake/build/pdfmake.min.js"></script>
<script src="vendor/pdfmake/build/vfs_fonts.js"></script>
<script src="vendor/datatables.net-buttons/js/buttons.html5.min.js"></script>
<script src="vendor/datatables.net-buttons/js/buttons.print.min.js"></script>
<script src="vendor/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
<script src="vendor/datatables.net-buttons-bs/js/buttons.bootstrap.min.js"></script>
<!-- App scripts -->
<script src="scripts/home.js"></script>
<script src="scripts/datatables.js"></script>
<script>
const colorMap = new Map([['Org', '#d9edf7'], ['RespA', '#fcf8e3'], ['Irrelevant', '#fff'] , ['Positions','#dff0d8']])
const predMapCycle = new Map([['Org', 'RespA'], ['RespA', 'Irrelevant'], ['Irrelevant', 'Positions'] , ['Positions','Org']])
$(function () {
// Initialize Example 1
$('#example1').dataTable( {
dom: "<'row'<'col-sm-4'l><'col-sm-4 text-center'B><'col-sm-4'f>>tp",
"lengthMenu": [ [10, 25, 50, -1], [10, 25, 50, "All"] ],
"paging": false,
columns: [
{ "data": "ArticleNo" },
{ "data": "RawParagraph" , "className": "rowtext" },
{ "data": "Prediction","className": "rowprediction" },
],
buttons: [
{extend: 'copy',className: 'btn-sm' },
{extend: 'csv',title: 'ExampleFile', className: 'btn-sm' , fieldSeparator:'|'},
{extend: 'print',className: 'btn-sm'}
],
rowCallback: function(row, data, index){
const prediction = data["Prediction"]
if (prediction!=='' && prediction!== undefined && colorMap.has(prediction)) {
const bgcolor = colorMap.get(prediction)
$('td', row).css('background-color', bgcolor);
}
}, //rowCallback
initComplete: function () {
var container = $("#predictionFilterDiv")
container.hide();
} //initComplete
}); // $('#example1').dataTable( {
var table = $('#example1').DataTable();
$('#example1').on('contextmenu', 'td', function(e) {
e.preventDefault();
const cell_clicked = table.cell(this).data();
const row_clicked = $(this).closest('tr');
const currentPred = table.row(row_clicked).data()["Prediction"];
if (currentPred!=='' && currentPred!== undefined && colorMap.has(currentPred)) {
const newPred = predMapCycle.get(currentPred);
console.log('API row values : ', table.row(row_clicked).data());
var cell = table.cell( table.row(row_clicked) , 2 );
cell.data( newPred ).draw();
}
}); //table.on('dblclick', 'tbody tr',
$('#example1').on('click', 'td', function(e) {
const cell_clicked = table.cell(this);
const row_clicked = $(this).closest('tr');
if (cell_clicked.index().column!==1) return;
const sel = window.getSelection();
if (sel==null || sel=='undefined' || sel.length<1) return;
sel.modify('extend','backward','word');
const wrd1 = sel.toString();
sel.modify('extend','forward','word');
const wrd2 = sel.toString();
const word = wrd1+wrd2;
const currentPred = table.row(row_clicked).data()["Prediction"];
const currentArticle = table.row(row_clicked).data()["ArticleNo"];
const cell_clicked_data = cell_clicked.data();
const splitted = cell_clicked_data.split(word);
const left_part = splitted[0] ;
const right_part = word + splitted[1];
table.row.add( {
"ArticleNo":currentArticle+ "a",
"RawParagraph":right_part,
"Prediction":currentPred,
} ).draw();
cell_clicked.data(left_part).draw();
//move added row to desired index (here the row we clicked on)
const row_index = table.row(row_clicked).index();
const row_count = table.data().length-1;
const insertedRow = table.row(row_count).data();
let tempRow;
for (var i=row_count;i>row_index;i--) {
tempRow = table.row(i-1).data();
table.row(i).data(tempRow);
table.row(i-1).data(insertedRow);
}
//refresh the current page
table.draw();
}); //table.on('dblclick', 'tbody tr',
});
</script>
</body>
</html>