blob: 019f3a55715ede31537d483005f0170b96469cda [file] [log] [blame]
Marc Kupietz83305222016-04-28 09:57:22 +02001<!DOCTYPE html>
2<html>
3 <head>
Marc Kupietz58270662017-12-04 12:10:06 +01004 <title>DeReKo-Word-Vector-Distances: <%= $word %></title>
Marc Kupietz80bd7b92017-07-04 16:25:54 +02005 <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
Marc Kupietz58270662017-12-04 12:10:06 +01006 <link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Condensed" rel="stylesheet">
Marc Kupietz80bd7b92017-07-04 16:25:54 +02007 <script src="http://code.jquery.com/jquery-latest.min.js"></script>
Marc Kupietz58270662017-12-04 12:10:06 +01008 <script src = "https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
9 <script src = "https://cdn.datatables.net/fixedcolumns/3.2.3/js/dataTables.fixedColumns.min.js"></script>
10 <script src = "https://cdn.datatables.net/plug-ins/1.10.16/sorting/scientific.js"></script>
11 <link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
Marc Kupietz80bd7b92017-07-04 16:25:54 +020012 <script
Marc Kupietze6a7a732018-01-12 09:21:08 +010013 src="http://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
14 integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
15 crossorigin="anonymous"></script>
Marc Kupietz80bd7b92017-07-04 16:25:54 +020016 <script>
Marc Kupietz58270662017-12-04 12:10:06 +010017 var urlParams = new URLSearchParams(window.location.search);
Marc Kupietzb3a2e4f2017-12-08 17:25:53 +010018 var currentWords = urlParams.get("word");
19 var CIIsearchWords = (currentWords.includes(" ") ? '('+currentWords.replace(/ +/g, " oder ")+')' : currentWords);
Marc Kupietz66bfd952017-12-11 09:59:45 +010020 var collocatorTable = null;
Marc Kupietza6e08f02017-12-01 22:06:21 +010021
Marc Kupietz4abcd682017-11-28 20:51:08 +010022 $('#firstable').hide();
Marc Kupietz58270662017-12-04 12:10:06 +010023 $(document).ready(function() {
Marc Kupietz694610d2017-11-25 18:30:03 +010024
Marc Kupietze6a7a732018-01-12 09:21:08 +010025 $("input").bind("keydown", function(event) {
26 // track enter key
27 var keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode));
28 if (keycode == 13) { // keycode for enter key
29 // force the 'Enter Key' to implicitly click the Update button
30 document.getElementById('SEARCH').click();
31 return false;
32 } else {
33 return true;
34 }});
Marc Kupietzdab9f222017-11-29 14:22:59 +010035
Marc Kupietze6a7a732018-01-12 09:21:08 +010036 $( "#tabs" ).on( "tabsactivate", function( event, ui ) {
37 if (localStorage) localStorage['tab'] = ui.newTab.index();
38 });
39
40 $(function(){
41 $("#SEARCH").click(function() {
42 window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
Marc Kupietz58270662017-12-04 12:10:06 +010043 });
Marc Kupietze6a7a732018-01-12 09:21:08 +010044 });
Marc Kupietz0af83e32017-11-27 09:31:37 +010045
Marc Kupietze6a7a732018-01-12 09:21:08 +010046 function changeCharColor(txt, heat, word) {
47 var newText = "";
48 for (var i=0, l=txt.length; i<l; i++) {
49 newText += (i == 5 ? txt.charAt(i) : '<a href="http://korap.ids-mannheim.de/kalamar/?ql=cosmas2&q=' +
50 CIIsearchWords + ' /' + (i > 5? '%2B' : '-') + 'w' +
51 Math.abs(i-5) + ':' + Math.abs(i-5) + ' ' + word +
52 '" target="korap"><span style="background-color:' +
53 getHeatColor(heat[i]/maxHeat)+'">'+txt.charAt(i)+'</span></a>');
Marc Kupietzb6c615d2017-12-02 10:38:20 +010054 }
Marc Kupietze6a7a732018-01-12 09:21:08 +010055 return newText;
56 }
Marc Kupietzb6c615d2017-12-02 10:38:20 +010057
Marc Kupietze6a7a732018-01-12 09:21:08 +010058 function getHeatColor(value) {
59 var hue=((1-value)*120).toString(10);
60 return ["hsl(",hue,",90%,70%)"].join("");
61 }
62
63 function bitvec2window(n, heat, word) {
64 var str = n.toString(2).padStart(10, "0")
65 .replace(/^([0-9]{5})/, '$1x')
66 .replace(/0/g, '·')
67 .replace(/1/g, '+');
68 return changeCharColor(str, heat, word);
69 }
70
71 % use Mojo::ByteStream 'b';
72 var paraResults = <%= b(Mojo::JSON::to_json($lists)) %>;
73 var urlprefix = new URLSearchParams(window.location.search);
74 if (paraResults.length > 0 && paraResults[0] != null) {
75 var nvecs = [],
76 nwords = [],
77 nranks = [],
78 nmarked = [];
79 for(var i = 0; i < paraResults.length; i++) {
80 nwords = nwords.concat(paraResults[i].map(function(a){return a.word;}));
81 nvecs = nvecs.concat(paraResults[i].map(function(a){return a.vector;}));
82 nranks = nranks.concat(paraResults[i].map(function(a){return a.rank;}));
83 nmarked = nmarked.concat(paraResults[i].map(function(a){return a.marked;}));
Marc Kupietz0d4c0ca2017-12-04 09:18:56 +010084 }
Marc Kupietze6a7a732018-01-12 09:21:08 +010085 showMap({target: " "+urlParams.get('word')+" ", mergedEnd: 0, words: nwords, vecs: nvecs, ranks: nranks, marked: nmarked} );
86 var t = $('#firsttable').DataTable({
87 data: paraResults[0],
88 "sScrollY": "780px",
89 "bScrollCollapse": true,
90 "bPaginate": false,
91 "bJQueryUI": true,
92 "dom": '<"top">rt<"bottom"flp><"clear">',
93 "columns": [
94 { "data": "rank", type: "allnumeric" },
95 { "data": "dist", render: function ( data, type, row ) {return data.toFixed(3) }},
96 { "data": "word", render: function ( data, type, row ) {urlprefix.set("word", data); return '<a href="?' + urlprefix + '">' + data + '</a>' }}
97 ],
98 "columnDefs": [
99 { className: "dt-right", "targets": [0,1] },
100 { "searchable": false,
101 "orderable": false,
102 "targets": 0
103 },
104 { "orderSequence": [ "desc" ], "targets": [ 1 ] },
105 { "orderSequence": [ "asc", "desc" ], "targets": [ 2 ] },
106 ],
107 "oLanguage": {
108 "sSearch": "Filter: "
109 },
110 "order": [[ 1, 'desc' ]],
111 } );
Marc Kupietz0d4c0ca2017-12-04 09:18:56 +0100112
Marc Kupietze6a7a732018-01-12 09:21:08 +0100113 t.on( 'order.dt search.dt', function () {
114 t.column(0, {order:'applied'}).nodes().each( function (cell, i) {
115 cell.innerHTML = i+1;
116 } );
117 } ).draw();
118
119 $( "#first" ).clone().prependTo( "#tabs-2" );
120
121 }
122
123
124 var collocatorData = <%= b(Mojo::JSON::to_json($collocators)) %>;
125 var maxHeat; // = Math.max.apply(Math,collocatorData.map(function(o){return o.cprob;}))
126
127 if (collocatorData != null) {
128 maxHeat = Math.max.apply(Math,collocatorData.map(function(o){return Math.max.apply(Math,o.heat);}))
129 collocatorTable = $('#secondtable').DataTable({
130 data: collocatorData,
131 "sScrollY": "780px",
132 "bScrollCollapse": true,
133 "bPaginate": false,
134 "bJQueryUI": true,
135 "dom": '<"top">rt<"bottom"flp><"clear">',
136 "columns": [
137 { "data": "rank", type: "allnumeric" },
138 { "data": "pos", width: "7%", sClass: "dt-center mono compact", render: function ( data, type, row ) {return bitvec2window(data, row.heat, row.word) }},
139 { "data": "max", render: function ( data, type, row ) {return data.toFixed(3) }},
140 { "data": "average", render: function ( data, type, row ) {return data.toFixed(3) }},
141 { "data": "prob", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } },
142 { "data": "cprob", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } },
143 { "data": "overall", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } },
144 { "data": "word", sClass: "collocator" },
145 { "data": "rank", type: "allnumeric" }
146 ],
147 "columnDefs": [
148 { className: "dt-right", "targets": [0,2,3,4,5,6] },
149 { className: "dt-center", "targets": [ 1] },
150 { "searchable": false,
151 "orderable": false,
152 "targets": [0, 8]
153 },
154 { "type": "scientific", targets: [2,3,4,5,6] },
155 { "orderSequence": [ "desc" ], "targets": [ 2, 3, 4, 5, 6 ] },
156 { "orderSequence": [ "asc", "desc" ], "targets": [ 1, 7 ] },
157 { "targets": [8], "visible": false }
158 ],
159 "oLanguage": {
160 "sSearch": "Filter: "
161 },
162 "order": [[ 4, 'desc' ]],
163 } );
164 $.ajaxSetup({
165 type: 'POST',
166 timeout: 30000,
167 error: function(xhr) {
168 $('#display_error')
169 .html('Error: ' + xhr.status + ' ' + xhr.statusText);
170 }
Marc Kupietz78b434a2018-01-12 22:33:32 +0100171 });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100172
Marc Kupietz78b434a2018-01-12 22:33:32 +0100173 classicCollocatorTable = $('#classicoloctable').DataTable({
174 ajax: {
175 method: "POST",
176 url: '/derekovecs/getClassicCollocators',
177 dataType: 'json',
178 dataSrc: "",
179 timeout: 30000,
180 data: function ( d ) {
181 return JSON.stringify(paraResults[0][0].rank);
182 }
183 },
Marc Kupietzad783722018-01-13 17:45:21 +0100184 "initComplete":function(settings, json){
185 $("td.collocator").click(function(){
186 queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords);
187 });
188 },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100189 "sScrollY": "780px",
190 "bScrollCollapse": true,
191 "bPaginate": false,
192 "bJQueryUI": true,
193 "dom": '<"top">rt<"bottom"flp><"clear">',
194 "columns": [
195 // { "data": "pos", width: "7%", sClass: "dt-center mono compact", render: function ( data, type, row ) {return bitvec2window(data, row.heat, row.word) }},
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100196 { "data": "llr", render: function ( data, type, row ) {return data.toFixed(1) }},
197 { "data": "lfmd", render: function ( data, type, row ) {return data.toFixed(2) }},
198// { "data": "fpmi", type: "scientific", render: function ( data, type, row ) {return data.toExponential(2) } },
199 { "data": "npmi", type: "scientific", render: function ( data, type, row ) {return data.toExponential(2) } },
200 { "data": "llfmd", render: function ( data, type, row ) {return data.toFixed(2) }},
201 { "data": "rlfmd", render: function ( data, type, row ) {return data.toFixed(2) }},
202 { "data": "lnpmi", type: "scientific", render: function ( data, type, row ) {return data.toExponential(2) } },
203 { "data": "rnpmi", type: "scientific", render: function ( data, type, row ) {return data.toExponential(2) } },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100204 { "data": "word", sClass: "collocator" }
205 ],
206 "columnDefs": [
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100207 { className: "dt-right", "targets": [0,1,2,3,4,5,6] },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100208 { "searchable": false,
209 "orderable": false,
210 "targets": []
211 },
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100212 { "type": "scientific", targets: [2,3,4,5,6] },
213 { "orderSequence": [ "desc" ], "targets": [ 0, 1, 2, 3,4,5,6 ] },
214 { "orderSequence": [ "asc", "desc" ], "targets": [ 7 ] },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100215 ],
216 "oLanguage": {
217 "sSearch": "Filter: "
218 },
219 "order": [[ 1, 'desc' ]],
220 });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100221
Marc Kupietzad783722018-01-13 17:45:21 +0100222 $("td.collocator").click(function(){
223 queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords);
224 });
225
Marc Kupietze6a7a732018-01-12 09:21:08 +0100226 collocatorTable.on( 'order.dt search.dt', function () {
227 collocatorTable.column(0, {order:'applied'}).nodes().each( function (cell, i) {
228 cell.innerHTML = i+1;
229 } );
Marc Kupietz78b434a2018-01-12 22:33:32 +0100230 }).draw();
231 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100232
Marc Kupietz78b434a2018-01-12 22:33:32 +0100233 if (localStorage && !window.location.hash) { // let's not crash if some user has IE7
234 var index = parseInt(localStorage['tab']||'0');
235 $("#tabs").tabs({ active: index });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100236 }
237 $("#tabs").css("visibility", "visible"); // now we can show the tabs
Marc Kupietz58270662017-12-04 12:10:06 +0100238 });
239
240 $(function(){
Marc Kupietze6a7a732018-01-12 09:21:08 +0100241 $("#dropdownoptions").dialog({
242 title: "Options",
243 autoOpen: false,
244 modal: false,
245 draggable: false,
246 height: "auto",
247 width: "auto",
248 resizable: false,
249 buttons: {
250 "Cancel": function() {
251 $( this ).dialog( "close" );
252 },
253 "Apply": function() {
254 window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
255 }
256 }
257 });
Marc Kupietz58270662017-12-04 12:10:06 +0100258 });
259
260 $(function(){
Marc Kupietze6a7a732018-01-12 09:21:08 +0100261 $("#showoptions").click(function(){
262 $("#dropdownoptions").dialog("open");
263 var target = $(this);
264 $("#dropdownoptions").dialog("widget").position({
265 my: 'left bottom',
266 at: 'left bottom',
267 of: target
Marc Kupietz58270662017-12-04 12:10:06 +0100268 });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100269 });
Marc Kupietz58270662017-12-04 12:10:06 +0100270 });
Marc Kupietz4abcd682017-11-28 20:51:08 +0100271
272 $( function() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100273 $( "#no_iterations" ).spinner({
274 spin: function( event, ui ) {
275 if ( ui.value < 1000 ) {
276 $( this ).spinner( "value", 1000 );
277 return false;
278 } else if ( ui.value > 10000 ) {
279 $( this ).spinner( "value", 10000 );
280 return false;
281 }
282 }
283 });
Marc Kupietz58270662017-12-04 12:10:06 +0100284 } );
Marc Kupietz4abcd682017-11-28 20:51:08 +0100285
Marc Kupietz58270662017-12-04 12:10:06 +0100286 $( function() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100287 $( "#neighbours" ).spinner({
288 spin: function( event, ui ) {
289 if ( ui.value < 0 ) {
290 $( this ).spinner( "value", 0 );
291 return false;
292 } else if ( ui.value > 200 ) {
293 $( this ).spinner( "value", 200 );
294 return false;
295 }
296 }
297 });
Marc Kupietz58270662017-12-04 12:10:06 +0100298 } );
Marc Kupietz4abcd682017-11-28 20:51:08 +0100299
Marc Kupietz58270662017-12-04 12:10:06 +0100300 $( function() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100301 $( "#cutoff" ).spinner({
302 spin: function( event, ui ) {
303 if ( ui.value < 100000 ) {
304 $( this ).spinner( "value", 100000 );
305 return false;
306 } else if ( ui.value > 2000000 ) {
307 $( this ).spinner( "value", 2000000 );
308 return false;
309 }
310 }
311 });
Marc Kupietz58270662017-12-04 12:10:06 +0100312 } );
313
314 $( function() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100315 $( "#tabs" ).tabs().addClass('tabs-min');
Marc Kupietz58270662017-12-04 12:10:06 +0100316 } );
317
318 $( function() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100319 $( ".controlgroup-vertical" ).controlgroup({
320 "direction": "vertical"
321 });
Marc Kupietz58270662017-12-04 12:10:06 +0100322 } );
323
324 $(function() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100325 $( document ).tooltip({
326 content: function() {
327 return $(this).attr('title');
328 }}
329 )
Marc Kupietz58270662017-12-04 12:10:06 +0100330 })
Marc Kupietz694610d2017-11-25 18:30:03 +0100331
Marc Kupietz83305222016-04-28 09:57:22 +0200332 </script>
Marc Kupietz58270662017-12-04 12:10:06 +0100333 <script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script>
334 <script src="/derekovecs/js/tsne.js"></script>
335 <script src="/derekovecs/js/som.js"></script>
336 <script src="/derekovecs/js/labeler.js"></script>
Marc Kupietz83305222016-04-28 09:57:22 +0200337 <style>
338 body, input {
Marc Kupietz58270662017-12-04 12:10:06 +0100339 font-family: Lato, sans-serif;
340 font-size: 11pt;
Marc Kupietz83305222016-04-28 09:57:22 +0200341 }
Marc Kupietz30ca4342017-11-22 21:21:20 +0100342
Marc Kupietze6a7a732018-01-12 09:21:08 +0100343 .info {
344 font-size: 8pt;
345 margin-top: 4px;
346 /* position: absolute;
347 bottom: 0;
348 left: 0;
349 right: 0; */
350 }
351
Marc Kupietz58270662017-12-04 12:10:06 +0100352 h1, h2, h3 {
353 margin: 5px 10px 0 0;
354 color: rgb(246,168,0);
355 font-family: "Univers LT Std 47 Cn Lt", "Univers LT Std 67 Cn Lt", "Roboto Condensed", "Univers LT Std 67 Cn Bold", "UniversLTStd-BoldCn", "Times", 'League Gothic', Impact, sans-serif;
356 font-weight: bold;
357 line-height: 1.35;
358 letter-spacing: normal;
359 text-transform: uppercase;
360 text-shadow: none;
361 word-wrap: break-word;
362 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100363
364
Marc Kupietz58270662017-12-04 12:10:06 +0100365 showoptions, #SEARCH {
366 margin-left: 10px;
367 margin-right: 10px;
368 }
Marc Kupietz6dbadd12017-11-29 16:43:33 +0100369
Marc Kupietz58270662017-12-04 12:10:06 +0100370 .tabs-left-vertical .ui-tabs-nav {
371 position: absolute;
372 width: 21em;
373 transform: translate(-100%,0%) rotate(-90deg);
374 transform-origin: 100% 0%;
375 }
Marc Kupietz4fcda0c2017-11-29 09:00:31 +0100376
Marc Kupietz58270662017-12-04 12:10:06 +0100377 .tabs-left-vertical .ui-tabs-nav li {
378 float: right;
379 }
Marc Kupietz4fcda0c2017-11-29 09:00:31 +0100380
Marc Kupietz58270662017-12-04 12:10:06 +0100381 .tabs-left-vertical .ui-tabs-panel {
382 padding-left: 3.5em;
383 }
Marc Kupietzdab9f222017-11-29 14:22:59 +0100384
Marc Kupietz58270662017-12-04 12:10:06 +0100385 .tabs-left-vertical .ui-tabs-panel {
386 height: 20em;
387 }
Marc Kupietz4fcda0c2017-11-29 09:00:31 +0100388
Marc Kupietz58270662017-12-04 12:10:06 +0100389 .mono {
Marc Kupietzc8221182017-12-08 17:26:19 +0100390 font-family: "DejaVu Sans Mono", Inconsolata, SourceCodePro, "Courier New", Courier, monospace;
Marc Kupietz58270662017-12-04 12:10:06 +0100391 }
Marc Kupietz30ca4342017-11-22 21:21:20 +0100392
Marc Kupietz58270662017-12-04 12:10:06 +0100393 .ui-tooltip-content {
Marc Kupietz4116b432017-12-06 14:15:32 +0100394 font-size: 10pt;
Marc Kupietz58270662017-12-04 12:10:06 +0100395 color: #222222;
396 }
Marc Kupietzf4b49392016-04-28 10:49:56 +0200397
Marc Kupietz58270662017-12-04 12:10:06 +0100398 svg > .ui-tooltip-content {
399 font-size: 8pt;
400 color: #222222;
401 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100402
Marc Kupietz58270662017-12-04 12:10:06 +0100403 a.merged {
404 color: green;
405 fill: green;
406 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100407
Marc Kupietz58270662017-12-04 12:10:06 +0100408 #first a {
409 text-decoration: none;
410 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100411
Marc Kupietz58270662017-12-04 12:10:06 +0100412 a.marked, #first a.marked {
413 text-decoration: underline;
414 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100415
Marc Kupietz58270662017-12-04 12:10:06 +0100416 a.target {
417 color: red;
418 fill: red;
419 }
Marc Kupietz694610d2017-11-25 18:30:03 +0100420
Marc Kupietz58270662017-12-04 12:10:06 +0100421 table.display {
422 width: 40% important!;
423 margin: 1; /* <- works for me this way ****/
424 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100425
Marc Kupietz58270662017-12-04 12:10:06 +0100426 table.dataTable thead th, table.dataTable thead td, table.dataTable tbody td {
427 padding: 2px 2px;
428 // border-bottom: 1px solid #111;
429 }
Marc Kupietz4abcd682017-11-28 20:51:08 +0100430
Marc Kupietz8f75b1f2017-12-06 09:42:13 +0100431 td.collocator {
432 cursor: pointer;
433 }
434
Marc Kupietz58270662017-12-04 12:10:06 +0100435 #collocators {
436 margin-bottom: 15px;
437 }
Marc Kupietz4abcd682017-11-28 20:51:08 +0100438
Marc Kupietz58270662017-12-04 12:10:06 +0100439 #header {
440 width: 100%;
441 // border: 1px solid red;
442 overflow: hidden; /* will contain if #first is longer than #second */
443 }
Marc Kupietz81bf39c2017-11-29 17:04:35 +0100444
Marc Kupietz58270662017-12-04 12:10:06 +0100445 #topwrapper {
446 width: 100%;
447 // border: 1px solid red;
448 overflow: hidden; /* will contain if #first is longer than #second */
449 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100450
Marc Kupietz58270662017-12-04 12:10:06 +0100451 #wrapper {
452 // border: 1px solid red;
453 overflow: hidden; /* will contain if #first is longer than #second */
454 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100455
Marc Kupietz58270662017-12-04 12:10:06 +0100456 #pagetitle {
457 max-width: 460px;
458 margin-right: 20px;
459 float: left;
460 overflow: hidden; /* if you don't want #second to wrap below #first */
461 // border: 1px solid green;
462 }
Marc Kupietz4abcd682017-11-28 20:51:08 +0100463
Marc Kupietz58270662017-12-04 12:10:06 +0100464 #options {
465 float: left;
466 width: 800px;
467 margin: 10px;
468 overflow: hidden; /* if you don't want #second to wrap below #first */
469 }
Marc Kupietz81bf39c2017-11-29 17:04:35 +0100470
Marc Kupietz58270662017-12-04 12:10:06 +0100471 #word {
472 width: 50%;
473 }
Marc Kupietz81bf39c2017-11-29 17:04:35 +0100474
Marc Kupietz58270662017-12-04 12:10:06 +0100475 #first {
476 margin-right: 20px;
477 float: left;
478 overflow: hidden; /* if you don't want #second to wrap below #first */
479 // border: 1px solid green;
480 }
481 #tabs {
482 margin-right: 20px;
483 overflow: hidden; /* if you don't want #second to wrap below #first */
484 }
Marc Kupietzdf3d4b52017-11-29 16:57:27 +0100485
Marc Kupietz58270662017-12-04 12:10:06 +0100486 .tabs-min {
487 background: transparent;
488 border: none;
489 }
Marc Kupietzdf3d4b52017-11-29 16:57:27 +0100490
Marc Kupietz58270662017-12-04 12:10:06 +0100491 .tabs-min .ui-widget-header {
492 background: transparent;
493 border: none;
494 border-bottom: 1px solid #c0c0c0;
495 -moz-border-radius: 0px;
496 -webkit-border-radius: 0px;
497 border-radius: 0px;
498 }
Marc Kupietzdf3d4b52017-11-29 16:57:27 +0100499
Marc Kupietz58270662017-12-04 12:10:06 +0100500 .tabs-min .ui-tabs-nav .ui-state-default {
501 background: transparent;
502 border: none;
503 }
Marc Kupietzdf3d4b52017-11-29 16:57:27 +0100504
Marc Kupietz58270662017-12-04 12:10:06 +0100505 .tabs-min .ui-tabs-nav .ui-state-active {
506 background: transparent url(derekovecs/img/uiTabsArrow.png) no-repeat bottom center;
507 border: none;
508 }
Marc Kupietzdf3d4b52017-11-29 16:57:27 +0100509
Marc Kupietz58270662017-12-04 12:10:06 +0100510 .tabs-min .ui-tabs-nav .ui-state-default a {
511 color: #c0c0c0;
512 }
Marc Kupietzdf3d4b52017-11-29 16:57:27 +0100513
Marc Kupietz58270662017-12-04 12:10:06 +0100514 .tabs-min .ui-tabs-nav .ui-state-active a {
515 color: rgb(246,168,0);
516 }
Marc Kupietzdf3d4b52017-11-29 16:57:27 +0100517
Marc Kupietz58270662017-12-04 12:10:06 +0100518 #embed {
519 max-width: 802px;
520 border: 1px solid #333;
521 }
Marc Kupietz4abcd682017-11-28 20:51:08 +0100522
Marc Kupietz58270662017-12-04 12:10:06 +0100523 #second {
524 min-width: 800px;
525 // border: 1px solid #333;
526 overflow: hidden; /* if you don't want #second to wrap below #first */
527 }
528 #som2 svg {
529 border: 1px solid #333;
530 }
Marc Kupietz83305222016-04-28 09:57:22 +0200531
Marc Kupietz58270662017-12-04 12:10:06 +0100532 #cost {
533 font-size: 8pt;
534 color: #222222;
535 margin-top: 4px;
536 margin-bottom: 12px;
537 }
Marc Kupietz83305222016-04-28 09:57:22 +0200538
Marc Kupietz58270662017-12-04 12:10:06 +0100539 #sominfo1, #sominfo {
540 font-size: 8pt;
541 color: #222222;
542 margin-top: 0px;
543 }
Marc Kupietz83305222016-04-28 09:57:22 +0200544
Marc Kupietz58270662017-12-04 12:10:06 +0100545 #somcolor1, #somcolor2, #somcolor3 {
546 display: inline-block;
547 height: 10px;
548 width: 10px;
549 }
Marc Kupietz83305222016-04-28 09:57:22 +0200550
Marc Kupietz58270662017-12-04 12:10:06 +0100551 #third {
552 border: 1px solid #333;
553 }
Marc Kupietz83305222016-04-28 09:57:22 +0200554
555 </style>
556 <script>
557
558 var opt = {epsilon: <%= $epsilon %>, perplexity: <%= $perplexity %>},
Marc Kupietz58270662017-12-04 12:10:06 +0100559 mapWidth = 800, // width map
560 mapHeight = 800,
561 jitterRadius = 7;
Marc Kupietz83305222016-04-28 09:57:22 +0200562
563 var T = new tsnejs.tSNE(opt); // create a tSNE instance
564
565 var Y;
566
567 var data;
568 var labeler;
569
570 function applyJitter() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100571 svg.selectAll('.tsnet')
572 .data(labels)
573 .transition()
574 .duration(50)
575 .attr("transform", function(d, i) {
576 T.Y[i][0] = (d.x - mapWidth/2 - tx)/ss/20;
577 T.Y[i][1] = (d.y - mapHeight/2 - ty)/ss/20;
578 return "translate(" +
579 (d.x) + "," +
580 (d.y) + ")";
581 });
Marc Kupietz83305222016-04-28 09:57:22 +0200582 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100583
Marc Kupietz83305222016-04-28 09:57:22 +0200584 function updateEmbedding() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100585 var Y = T.getSolution();
586 svg.selectAll('.tsnet')
587 .data(data.words)
588 .attr("transform", function(d, i) {
589 return "translate(" +
590 ((Y[i][0]*20*ss + tx) + mapWidth/2) + "," +
591 ((Y[i][1]*20*ss + ty) + mapHeight/2) + ")"; });
Marc Kupietz83305222016-04-28 09:57:22 +0200592 }
593
594 var svg;
595 var labels = [];
596 var anchor_array = [];
597 var text;
598
599 function drawEmbedding() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100600 var urlprefix = new URLSearchParams(window.location.search);
601 urlprefix.delete("word");
602 urlprefix.append("word","");
Marc Kupietz8f9c86a2017-12-04 17:17:13 +0100603
Marc Kupietze6a7a732018-01-12 09:21:08 +0100604 $("#embed").empty();
605 var div = d3.select("#embed");
Marc Kupietz34c08172017-11-29 17:08:47 +0100606
Marc Kupietze6a7a732018-01-12 09:21:08 +0100607 // get min and max in each column of Y
608 var Y = T.Y;
Marc Kupietz34c08172017-11-29 17:08:47 +0100609
Marc Kupietze6a7a732018-01-12 09:21:08 +0100610 svg = div.append("svg") // svg is global
611 .attr("width", mapWidth)
612 .attr("height", mapHeight);
Marc Kupietz34c08172017-11-29 17:08:47 +0100613
Marc Kupietze6a7a732018-01-12 09:21:08 +0100614 var g = svg.selectAll(".b")
615 .data(data.words)
616 .enter().append("g")
617 .attr("class", "tsnet");
Marc Kupietz34c08172017-11-29 17:08:47 +0100618
Marc Kupietze6a7a732018-01-12 09:21:08 +0100619 g.append("a")
620 .attr("xlink:href", function(word) {
621 return "?"+urlprefix+word; })
622 .attr("class", function(d, i) {
623 var res="";
624 if(data.marked[i]) {
625 res="marked ";
626 }
627 if(data.target.indexOf(" "+d+" ") >= 0) {
628 return res+"target";
629 } else if(data.ranks[i] < data.mergedEnd) {
630 return res+"merged";
631 } else {
632 return res;
633 }
634 })
635 .attr("title", function(d, i) {
636 if(data.mergedEnd > 0) {
637 if(data.ranks[i] >= data.mergedEnd) {
638 return "rank: "+i +" "+"freq. rank: "+(data.ranks[i]).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
639 } else {
640 return "rank: "+i +" "+"freq. rank: "+data.ranks[i].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + " (merged vocab)";
641 }
642 } else {
643 return "rank: "+i +" "+"freq. rank: "+data.ranks[i].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
644 }
645 })
646 .append("text")
647 .attr("text-anchor", "top")
648 .attr("font-size", 12)
649 .text(function(d) { return d; });
Marc Kupietz34c08172017-11-29 17:08:47 +0100650
Marc Kupietze6a7a732018-01-12 09:21:08 +0100651 var zoomListener = d3.behavior.zoom()
652 .scaleExtent([0.1, 10])
653 .center([0,0])
654 .on("zoom", zoomHandler);
655 zoomListener(svg);
Marc Kupietz83305222016-04-28 09:57:22 +0200656 }
657
658 var tx=0, ty=0;
659 var ss=1;
660 var iter_id=-1;
661
662 function zoomHandler() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100663 tx = d3.event.translate[0];
664 ty = d3.event.translate[1];
665 ss = d3.event.scale;
666 updateEmbedding();
Marc Kupietz83305222016-04-28 09:57:22 +0200667 }
668
669 var stepnum = 0;
670
671 function stopStep() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100672 clearInterval(iter_id);
673 text = svg.selectAll("text");
Marc Kupietz34c08172017-11-29 17:08:47 +0100674
Marc Kupietze6a7a732018-01-12 09:21:08 +0100675 // jitter function needs different data and co-ordinate representation
676 labels = d3.range(data.words.length).map(function(i) {
677 var x = (T.Y[i][0]*20*ss + tx) + mapWidth/2;
678 var y = (T.Y[i][1]*20*ss + ty) + mapHeight/2;
679 anchor_array.push({x: x, y: y, r: jitterRadius});
680 return {
681 x: x,
682 y: y,
683 name: data.words[i]
684 };
685 });
Marc Kupietz34c08172017-11-29 17:08:47 +0100686
Marc Kupietze6a7a732018-01-12 09:21:08 +0100687 // get the actual label bounding boxes for the jitter function
688 var index = 0;
689 text.each(function() {
690 labels[index].width = this.getBBox().width;
691 labels[index].height = this.getBBox().height;
692 index += 1;
693 });
Marc Kupietz83305222016-04-28 09:57:22 +0200694
Marc Kupietz34c08172017-11-29 17:08:47 +0100695
Marc Kupietze6a7a732018-01-12 09:21:08 +0100696 // setTimeout(updateEmbedding, 1);
697 // setTimeout(
698 labeler = d3.labeler()
699 .label(labels)
700 .anchor(anchor_array)
701 .width(mapWidth)
702 .height(mapHeight)
703 .update(applyJitter);
704 // .start(1000);
Marc Kupietz83305222016-04-28 09:57:22 +0200705
Marc Kupietze6a7a732018-01-12 09:21:08 +0100706 iter_id = setInterval(jitterStep, 1);
Marc Kupietz83305222016-04-28 09:57:22 +0200707 }
708
709 var jitter_i=0;
710
711 function jitterStep() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100712 if(jitter_i++ > 100) {
713 clearInterval(iter_id);
714 } else {
715 labeler.start2(10);
716 applyJitter();
717 }
Marc Kupietz83305222016-04-28 09:57:22 +0200718 }
719
720 var last_cost=1000;
721
722 function step() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100723 var i = T.iter;
Marc Kupietz34c08172017-11-29 17:08:47 +0100724
Marc Kupietze6a7a732018-01-12 09:21:08 +0100725 if(i > <%= $no_iterations %>) {
726 stopStep();
727 } else {
728 var cost = Math.round(T.step() * 100000) / 100000; // do a few steps
729 $("#cost").html("tsne iteration " + i + ", cost: " + cost.toFixed(5));
730 if(i % 250 == 0 && cost >= last_cost) {
731 stopStep();
Marc Kupietz58270662017-12-04 12:10:06 +0100732 } else {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100733 last_cost = cost;
734 updateEmbedding();
Marc Kupietz58270662017-12-04 12:10:06 +0100735 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100736 }
Marc Kupietz83305222016-04-28 09:57:22 +0200737 }
738
739 function showMap(j) {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100740 data=j;
741 T.iter=0;
742 iter_id = -1;
743 last_cost=1000;
744 T.initDataRaw(data.vecs); // init embedding
745 drawEmbedding(); // draw initial embedding
Marc Kupietz78114532017-11-29 17:00:16 +0100746
Marc Kupietze6a7a732018-01-12 09:21:08 +0100747 if(iter_id >= 0) {
748 clearInterval(iter_id);
749 }
750 //T.debugGrad();
751 iter_id = setInterval(step, 1);
752 if(true) { // (<%= $show_som %>) {
753 makeSOM(j, <%= $no_iterations %>);
754 }
Marc Kupietz83305222016-04-28 09:57:22 +0200755 }
Marc Kupietz39179ab2017-07-04 16:28:06 +0200756 var queryword;
757
Marc Kupietz66bfd952017-12-11 09:59:45 +0100758 function showCollocatorSOM() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100759 if (collocatorTable) {
760 var ctableData = collocatorTable.rows().data();
761 var nwords = [],
762 nranks = [];
763 for (var i=0; i < ctableData.length && i < 100; i++) {
764 nranks.push(ctableData[i].rank);
765 nwords.push(ctableData[i].word);
Marc Kupietz66bfd952017-12-11 09:59:45 +0100766 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100767 $.post('/derekovecs/getVecsByRanks',
768 JSON.stringify(nranks),
769 function(data, status){
770 showMap({target: " "+urlParams.get('word')+" ", mergedEnd: 0, words: nwords, vecs: data, ranks: nranks, marked: Array(100).fill(false)} );
771 }, 'json');
772 }
Marc Kupietz66bfd952017-12-11 09:59:45 +0100773 }
774
Marc Kupietz39179ab2017-07-04 16:28:06 +0200775 function onload() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100776 queryword = document.getElementById('word');
Marc Kupietz39179ab2017-07-04 16:28:06 +0200777 }
778
779 function queryKorAP() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100780 window.open('http://korap.ids-mannheim.de/kalamar/?q='+queryword.value, 'KorAP');
Marc Kupietz39179ab2017-07-04 16:28:06 +0200781 }
Marc Kupietz4dc270c2017-11-24 10:17:12 +0100782
783 function queryKorAPCII(query) {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100784 window.open('http://korap.ids-mannheim.de/kalamar/?ql=cosmas2&q='+query, 'KorAP');
Marc Kupietz4dc270c2017-11-24 10:17:12 +0100785 }
Marc Kupietz83305222016-04-28 09:57:22 +0200786 </script>
787 </head>
Marc Kupietz39179ab2017-07-04 16:28:06 +0200788 <body onload="onload()">
Marc Kupietz58270662017-12-04 12:10:06 +0100789 <div id="header">
790 <div id="pagetitle">
791 <h1>DeReKo-Vectors</h1>
Marc Kupietz4fcda0c2017-11-29 09:00:31 +0100792 </div>
Marc Kupietz58270662017-12-04 12:10:06 +0100793 <div id="options" class="widget">
794 <form id="queryform">
795 <input id="word" type="text" name="word" placeholder="Word(s) to be searched" value="<%= $word %>"
796 title="When looking for multiple words use spaces as separators to search around the average vector and | as separator to get the neighbours for each word."/>
797 <input id="SEARCH" type="button" value="SEARCH">
798 <input type="button" id="showoptions" name="showoptions" value="Options" />
799 </form>
800 <div id="dropdownoptions" style="display: none">
801 <form id="optionsform">
802 <div class="controlgroup-vertical">
803 <label for="cutoff">cut-off</label>
804 <input id="cutoff" type="text" name="cutoff" size="10" value="<%= $cutoff %>" title="Only consider the most frequent x word forms.">
805 <label for="dedupe">dedupe</label>
806 <input id="dedupe" type="checkbox" name="dedupe" value="1" <%= ($dedupe ? "checked" : "") %> title="radically filter out any near-duplicates">
807 % if($mergedEnd > 0) {
808 <label for="sbf">backw.</label>
809 <input id="sbf" type="checkbox" name="sbf" value="1" <%= ($searchBaseVocabFirst ? "checked" : "") %> title="If checkecked base vocabulary will be searched first. Otherwise merged vocabulray will be searched first.">
810 % }
811 <label for="neighbours">max. neighbours:</label>
812 <input id="neighbours" size="4" name="n" value="<%= $no_nbs %>">
813 <label for="no_iterations">max. iterations</label>
814 <input id="no_iterations" name="N" size="4" value="<%= $no_iterations %>">
815 <!-- <label for="dosom">SOM</label>
816 <input id="dosom" type="checkbox" name="som" value="1" <%= ($show_som ? "checked" : "") %>> -->
817 % if($collocators) {
818 <label for="sortby">window/sort</label>
819 <select id="sortby" name="sort">
820 <option value="0" <%= ($sort!=1 && $sort!=2? "selected":"") %>>auto focus</option>
821 <!-- <option value="1" <%= ($sort==1? "selected":"") %>>any single position</option>
822 <option value="2" <%= ($sort==2? "selected":"") %>>whole window</option> -->
823 </select>
824 % }
825 <input type="button" value="→ KorAP" onclick="queryKorAP();" title="query word with KorAP"/>
826 </div>
827 </form>
828 </div>
829 </div>
830 </div>
831 <div id="topwrapper">
832 <div style="visibility: hidden;" id="tabs">
833 <ul>
834 <li><a href="#tabs-1">Semantics (TSNE-map)</a></li>
835 <li><a href="#tabs-2">Semantics (SOM)</a></li>
836 <li><a href="#tabs-3">Syntagmatic (collocators)</a></li>
837 </ul>
838 <div id="tabs-1">
839 % if($lists && (@$lists) > 0 && (@$lists)[0]) {
840 <div id="wrapper">
841 <div id="first" style="width: 320px">
842 <table class="display compact nowrap" id="firsttable">
843 <thead>
844 <tr>
845 <th align="right">#</th><th align="right">cos</th><th align="left">similars</th>
846 </tr>
847 </thead>
848 <tbody>
849 <tr>
850 <td align="right">
851 </td>
852 <td align="right">
853 </td>
854 <td></td>
855 </tr>
856 </tbody>
857 </table>
858 </div>
859 <script>
860 </script>
861 <div id="second">
862 <div id="embed">
863 </div>
864 <div id="cost">
865 </div>
866 </div>
867 </div>
868 % } elsif($word !~ /^\s*$/) {
869 <div id="wrapper">
870 <div id="not-found-dialog" title="Not found">
871 <p>ERROR: "<%= $word %>" not found in vocabluary.</p>
872 <p>If you are sure you have spelled the word as intended, you can try to increase the cutoff parameter in the options menu.</p>
873 </div>
874 <script>
875 $( function() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100876 $( "#not-found-dialog" ).dialog({
877 autoOpen: true,
878 modal: true,
879 draggable: false,
880 height: "auto",
881 width: "auto",
882 resizable: false,
883 buttons: {
884 "OK": function() {
885 $( this ).dialog( "close" );
886 },
887 "Apply": function() {
888 window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
889 }
890 }
891 });
Marc Kupietz58270662017-12-04 12:10:06 +0100892 });
893 </script>
894 </div>
Marc Kupietze6a7a732018-01-12 09:21:08 +0100895 % }
Marc Kupietz58270662017-12-04 12:10:06 +0100896 </div>
897 <div id="tabs-2">
Marc Kupietz66bfd952017-12-11 09:59:45 +0100898 <div id="som2" style="width: 800;">
Marc Kupietz58270662017-12-04 12:10:06 +0100899 </div>
900 <div id="sominfo1"><span id="somcolor1"> </span> <span id="somword1"> </span> <span id="somcolor2"> </span> <span id="somword2"> </span> <span id="somcolor3"> </span></div>
901 <div id="sominfo">SOM iteration <span id="iterations">0</span></div>
902 </div>
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100903 <div id="tabs-3" style="width:1500px">
904 <div style="width: 55%; float: left;" id="secondt">
Marc Kupietze6a7a732018-01-12 09:21:08 +0100905 <table class="display compact nowrap" id="secondtable">
Marc Kupietz58270662017-12-04 12:10:06 +0100906 <thead>
907 <tr>
908 % if($collocators) {
909 <th>#</th>
Marc Kupietz4116b432017-12-06 14:15:32 +0100910 <th align="center" title="Activation of the respective collocator in the columns around the target normalized by its maximum (red). Columns selected by the auto-focus funtion (which window of all possible column-combinations maximizes ⊥(a/c)?) are marked with +. Click on the column postions to lauch a KorAP query with target word and collocator in the respective position.">w'</th>
911 <th align="right" title="Maximum activation of the collocator anywhere in the output layer.">max(a)</th>
912 <th title="Average raw activation of the collocator in the columns selected by auto-focus." align="right">⟨a⟩</th>
913 <th title="Sum of activations over the selected colunns normalized by the total activation sum of the selected columns." align="right">Σa/Σw'</th>
914 <th title="Co-norm of the column-normalized activations over the colunns selected by the auto-focus." align="right">⊥(a/c)</th>
Marc Kupietz58270662017-12-04 12:10:06 +0100915 <th title="Sum of the activations over the whole window normalized by the total window sum (no auto-focus)." align="right">Σa/Σw</th>
916 <th align="left">collocator</th>
917 % }
918 </tr>
919 </thead>
920 <tbody>
921 <tr>
922 <td align="right">
923 </td>
924 <td align="right">
925 </td>
926 <td align="right">
927 </td>
928 <td align="right">
929 </td>
930 <td align="right">
931 </td>
932 <td align="right">
933 </td>
Marc Kupietz58270662017-12-04 12:10:06 +0100934 </tr>
935 </tbody>
936 </table>
Marc Kupietz66bfd952017-12-11 09:59:45 +0100937 </div>
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100938 <div style="margin-left:20px; float:right; width: 650px">
Marc Kupietze6a7a732018-01-12 09:21:08 +0100939 <table class="display compact nowrap" id="classicoloctable">
940 <thead>
941 <tr>
942 <th>llr</th>
943 <th title="log-frequency biased mutual dependency">lfmd</th>
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100944 <!-- <th title="frequency biased pointwise mutual information">fpmi</th>-->
Marc Kupietz78b434a2018-01-12 22:33:32 +0100945 <th title="normalized pointwise mutual information">npmi</th>
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100946 <th title="log-frequency biased mutual dependency - left neighbour only">l-lfmd</th>
947 <th title="log-frequency biased mutual dependency - right neighbour only">r-lfmd</th>
948 <th title="normalized pointwise mutual information - left neighbour only">l-npmi</th>
949 <th title="normalized pointwise mutual information - right neighbour only">r-npmi</th>
Marc Kupietze6a7a732018-01-12 09:21:08 +0100950 <th>collocator</th>
951 </tr>
952 </thead>
953 <tbody>
954 <tr>
955 <td align="right">
956 </td>
957 <td align="right">
958 </td>
959 <td align="right">
960 </td>
961 <td align="right">
962 </td>
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100963 <td align="right">
964 </td>
965 <td align="right">
966 </td>
967 <td align="right">
968 </td>
969 <td align="right">
970 </td>
Marc Kupietze6a7a732018-01-12 09:21:08 +0100971 </tr>
972 </tbody>
973 </table>
974 </div>
975 <div style="clear:both" ></div>
Marc Kupietz66bfd952017-12-11 09:59:45 +0100976 <div style="float: right; overflow: hidden" id="extra"><button onClick="showCollocatorSOM()"> </button></div>
Marc Kupietz66bfd952017-12-11 09:59:45 +0100977 </div>
Marc Kupietz58270662017-12-04 12:10:06 +0100978 </div>
979 </div> <!-- topwrapper -->
980 <div style="clear: both;"></div>
981 </div>
Marc Kupietzebea4702018-01-12 09:16:09 +0100982 % if($training_args && (@$lists)[0]) {
983 <div class="info">
984 % if($training_args =~ /-type\s*3/) {
985 Calculations are based on a word embedding model trained with an extension of <a href="https://github.com/wlin12/wang2vec/">wang2vec</a> using the following parameters: <%= $training_args %>
986 % } else {
987 Calculations are based on a word embedding model trained with <a href="https://code.google.com/p/word2vec/">word2vec</a> using the following parameters: <%= $training_args %>
988 % }
989 </div>
Marc Kupietz83305222016-04-28 09:57:22 +0200990 % }
Marc Kupietz58270662017-12-04 12:10:06 +0100991 </body>
Marc Kupietz83305222016-04-28 09:57:22 +0200992</html>