blob: 15c75c9c0edf8ab44a4152f8e217eba22ddab9d1 [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: {
Marc Kupietz8893dec2018-01-24 09:52:02 +0100175 method: "GET",
Marc Kupietz78b434a2018-01-12 22:33:32 +0100176 url: '/derekovecs/getClassicCollocators',
177 dataType: 'json',
178 dataSrc: "",
179 timeout: 30000,
Marc Kupietz8893dec2018-01-24 09:52:02 +0100180 data: { w: paraResults[0][0].rank }
Marc Kupietz78b434a2018-01-12 22:33:32 +0100181 },
Marc Kupietzad783722018-01-13 17:45:21 +0100182 "initComplete":function(settings, json){
183 $("td.collocator").click(function(){
184 queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords);
185 });
186 },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100187 "sScrollY": "780px",
188 "bScrollCollapse": true,
189 "bPaginate": false,
190 "bJQueryUI": true,
191 "dom": '<"top">rt<"bottom"flp><"clear">',
192 "columns": [
193 // { "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 +0100194 { "data": "llr", render: function ( data, type, row ) {return data.toFixed(1) }},
195 { "data": "lfmd", render: function ( data, type, row ) {return data.toFixed(2) }},
196// { "data": "fpmi", type: "scientific", render: function ( data, type, row ) {return data.toExponential(2) } },
197 { "data": "npmi", type: "scientific", render: function ( data, type, row ) {return data.toExponential(2) } },
198 { "data": "llfmd", render: function ( data, type, row ) {return data.toFixed(2) }},
199 { "data": "rlfmd", render: function ( data, type, row ) {return data.toFixed(2) }},
200 { "data": "lnpmi", type: "scientific", render: function ( data, type, row ) {return data.toExponential(2) } },
201 { "data": "rnpmi", type: "scientific", render: function ( data, type, row ) {return data.toExponential(2) } },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100202 { "data": "word", sClass: "collocator" }
203 ],
204 "columnDefs": [
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100205 { className: "dt-right", "targets": [0,1,2,3,4,5,6] },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100206 { "searchable": false,
207 "orderable": false,
208 "targets": []
209 },
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100210 { "type": "scientific", targets: [2,3,4,5,6] },
211 { "orderSequence": [ "desc" ], "targets": [ 0, 1, 2, 3,4,5,6 ] },
212 { "orderSequence": [ "asc", "desc" ], "targets": [ 7 ] },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100213 ],
214 "oLanguage": {
215 "sSearch": "Filter: "
216 },
217 "order": [[ 1, 'desc' ]],
218 });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100219
Marc Kupietzad783722018-01-13 17:45:21 +0100220 $("td.collocator").click(function(){
221 queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords);
222 });
223
Marc Kupietze6a7a732018-01-12 09:21:08 +0100224 collocatorTable.on( 'order.dt search.dt', function () {
225 collocatorTable.column(0, {order:'applied'}).nodes().each( function (cell, i) {
226 cell.innerHTML = i+1;
227 } );
Marc Kupietz78b434a2018-01-12 22:33:32 +0100228 }).draw();
229 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100230
Marc Kupietz78b434a2018-01-12 22:33:32 +0100231 if (localStorage && !window.location.hash) { // let's not crash if some user has IE7
232 var index = parseInt(localStorage['tab']||'0');
233 $("#tabs").tabs({ active: index });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100234 }
235 $("#tabs").css("visibility", "visible"); // now we can show the tabs
Marc Kupietz58270662017-12-04 12:10:06 +0100236 });
237
238 $(function(){
Marc Kupietze6a7a732018-01-12 09:21:08 +0100239 $("#dropdownoptions").dialog({
240 title: "Options",
241 autoOpen: false,
242 modal: false,
243 draggable: false,
244 height: "auto",
245 width: "auto",
246 resizable: false,
247 buttons: {
248 "Cancel": function() {
249 $( this ).dialog( "close" );
250 },
251 "Apply": function() {
252 window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
253 }
254 }
255 });
Marc Kupietz58270662017-12-04 12:10:06 +0100256 });
257
258 $(function(){
Marc Kupietze6a7a732018-01-12 09:21:08 +0100259 $("#showoptions").click(function(){
260 $("#dropdownoptions").dialog("open");
261 var target = $(this);
262 $("#dropdownoptions").dialog("widget").position({
263 my: 'left bottom',
264 at: 'left bottom',
265 of: target
Marc Kupietz58270662017-12-04 12:10:06 +0100266 });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100267 });
Marc Kupietz58270662017-12-04 12:10:06 +0100268 });
Marc Kupietz4abcd682017-11-28 20:51:08 +0100269
270 $( function() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100271 $( "#no_iterations" ).spinner({
272 spin: function( event, ui ) {
273 if ( ui.value < 1000 ) {
274 $( this ).spinner( "value", 1000 );
275 return false;
276 } else if ( ui.value > 10000 ) {
277 $( this ).spinner( "value", 10000 );
278 return false;
279 }
280 }
281 });
Marc Kupietz58270662017-12-04 12:10:06 +0100282 } );
Marc Kupietz4abcd682017-11-28 20:51:08 +0100283
Marc Kupietz58270662017-12-04 12:10:06 +0100284 $( function() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100285 $( "#neighbours" ).spinner({
286 spin: function( event, ui ) {
287 if ( ui.value < 0 ) {
288 $( this ).spinner( "value", 0 );
289 return false;
290 } else if ( ui.value > 200 ) {
291 $( this ).spinner( "value", 200 );
292 return false;
293 }
294 }
295 });
Marc Kupietz58270662017-12-04 12:10:06 +0100296 } );
Marc Kupietz4abcd682017-11-28 20:51:08 +0100297
Marc Kupietz58270662017-12-04 12:10:06 +0100298 $( function() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100299 $( "#cutoff" ).spinner({
300 spin: function( event, ui ) {
301 if ( ui.value < 100000 ) {
302 $( this ).spinner( "value", 100000 );
303 return false;
304 } else if ( ui.value > 2000000 ) {
305 $( this ).spinner( "value", 2000000 );
306 return false;
307 }
308 }
309 });
Marc Kupietz58270662017-12-04 12:10:06 +0100310 } );
311
312 $( function() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100313 $( "#tabs" ).tabs().addClass('tabs-min');
Marc Kupietz58270662017-12-04 12:10:06 +0100314 } );
315
316 $( function() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100317 $( ".controlgroup-vertical" ).controlgroup({
318 "direction": "vertical"
319 });
Marc Kupietz58270662017-12-04 12:10:06 +0100320 } );
321
322 $(function() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100323 $( document ).tooltip({
324 content: function() {
325 return $(this).attr('title');
326 }}
327 )
Marc Kupietz58270662017-12-04 12:10:06 +0100328 })
Marc Kupietz694610d2017-11-25 18:30:03 +0100329
Marc Kupietz83305222016-04-28 09:57:22 +0200330 </script>
Marc Kupietz58270662017-12-04 12:10:06 +0100331 <script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script>
332 <script src="/derekovecs/js/tsne.js"></script>
333 <script src="/derekovecs/js/som.js"></script>
334 <script src="/derekovecs/js/labeler.js"></script>
Marc Kupietz83305222016-04-28 09:57:22 +0200335 <style>
336 body, input {
Marc Kupietz58270662017-12-04 12:10:06 +0100337 font-family: Lato, sans-serif;
338 font-size: 11pt;
Marc Kupietz83305222016-04-28 09:57:22 +0200339 }
Marc Kupietz30ca4342017-11-22 21:21:20 +0100340
Marc Kupietze6a7a732018-01-12 09:21:08 +0100341 .info {
342 font-size: 8pt;
343 margin-top: 4px;
344 /* position: absolute;
345 bottom: 0;
346 left: 0;
347 right: 0; */
348 }
349
Marc Kupietz58270662017-12-04 12:10:06 +0100350 h1, h2, h3 {
351 margin: 5px 10px 0 0;
352 color: rgb(246,168,0);
353 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;
354 font-weight: bold;
355 line-height: 1.35;
356 letter-spacing: normal;
357 text-transform: uppercase;
358 text-shadow: none;
359 word-wrap: break-word;
360 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100361
362
Marc Kupietz58270662017-12-04 12:10:06 +0100363 showoptions, #SEARCH {
364 margin-left: 10px;
365 margin-right: 10px;
366 }
Marc Kupietz6dbadd12017-11-29 16:43:33 +0100367
Marc Kupietz58270662017-12-04 12:10:06 +0100368 .tabs-left-vertical .ui-tabs-nav {
369 position: absolute;
370 width: 21em;
371 transform: translate(-100%,0%) rotate(-90deg);
372 transform-origin: 100% 0%;
373 }
Marc Kupietz4fcda0c2017-11-29 09:00:31 +0100374
Marc Kupietz58270662017-12-04 12:10:06 +0100375 .tabs-left-vertical .ui-tabs-nav li {
376 float: right;
377 }
Marc Kupietz4fcda0c2017-11-29 09:00:31 +0100378
Marc Kupietz58270662017-12-04 12:10:06 +0100379 .tabs-left-vertical .ui-tabs-panel {
380 padding-left: 3.5em;
381 }
Marc Kupietzdab9f222017-11-29 14:22:59 +0100382
Marc Kupietz58270662017-12-04 12:10:06 +0100383 .tabs-left-vertical .ui-tabs-panel {
384 height: 20em;
385 }
Marc Kupietz4fcda0c2017-11-29 09:00:31 +0100386
Marc Kupietz58270662017-12-04 12:10:06 +0100387 .mono {
Marc Kupietzc8221182017-12-08 17:26:19 +0100388 font-family: "DejaVu Sans Mono", Inconsolata, SourceCodePro, "Courier New", Courier, monospace;
Marc Kupietz58270662017-12-04 12:10:06 +0100389 }
Marc Kupietz30ca4342017-11-22 21:21:20 +0100390
Marc Kupietz58270662017-12-04 12:10:06 +0100391 .ui-tooltip-content {
Marc Kupietz4116b432017-12-06 14:15:32 +0100392 font-size: 10pt;
Marc Kupietz58270662017-12-04 12:10:06 +0100393 color: #222222;
394 }
Marc Kupietzf4b49392016-04-28 10:49:56 +0200395
Marc Kupietz58270662017-12-04 12:10:06 +0100396 svg > .ui-tooltip-content {
397 font-size: 8pt;
398 color: #222222;
399 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100400
Marc Kupietz58270662017-12-04 12:10:06 +0100401 a.merged {
402 color: green;
403 fill: green;
404 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100405
Marc Kupietz58270662017-12-04 12:10:06 +0100406 #first a {
407 text-decoration: none;
408 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100409
Marc Kupietz58270662017-12-04 12:10:06 +0100410 a.marked, #first a.marked {
411 text-decoration: underline;
412 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100413
Marc Kupietz58270662017-12-04 12:10:06 +0100414 a.target {
415 color: red;
416 fill: red;
417 }
Marc Kupietz694610d2017-11-25 18:30:03 +0100418
Marc Kupietz58270662017-12-04 12:10:06 +0100419 table.display {
420 width: 40% important!;
421 margin: 1; /* <- works for me this way ****/
422 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100423
Marc Kupietz58270662017-12-04 12:10:06 +0100424 table.dataTable thead th, table.dataTable thead td, table.dataTable tbody td {
425 padding: 2px 2px;
426 // border-bottom: 1px solid #111;
427 }
Marc Kupietz4abcd682017-11-28 20:51:08 +0100428
Marc Kupietz8f75b1f2017-12-06 09:42:13 +0100429 td.collocator {
430 cursor: pointer;
431 }
432
Marc Kupietz58270662017-12-04 12:10:06 +0100433 #collocators {
434 margin-bottom: 15px;
435 }
Marc Kupietz4abcd682017-11-28 20:51:08 +0100436
Marc Kupietz58270662017-12-04 12:10:06 +0100437 #header {
438 width: 100%;
439 // border: 1px solid red;
440 overflow: hidden; /* will contain if #first is longer than #second */
441 }
Marc Kupietz81bf39c2017-11-29 17:04:35 +0100442
Marc Kupietz58270662017-12-04 12:10:06 +0100443 #topwrapper {
444 width: 100%;
445 // border: 1px solid red;
446 overflow: hidden; /* will contain if #first is longer than #second */
447 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100448
Marc Kupietz58270662017-12-04 12:10:06 +0100449 #wrapper {
450 // border: 1px solid red;
451 overflow: hidden; /* will contain if #first is longer than #second */
452 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100453
Marc Kupietz58270662017-12-04 12:10:06 +0100454 #pagetitle {
455 max-width: 460px;
456 margin-right: 20px;
457 float: left;
458 overflow: hidden; /* if you don't want #second to wrap below #first */
459 // border: 1px solid green;
460 }
Marc Kupietz4abcd682017-11-28 20:51:08 +0100461
Marc Kupietz58270662017-12-04 12:10:06 +0100462 #options {
463 float: left;
464 width: 800px;
465 margin: 10px;
466 overflow: hidden; /* if you don't want #second to wrap below #first */
467 }
Marc Kupietz81bf39c2017-11-29 17:04:35 +0100468
Marc Kupietz58270662017-12-04 12:10:06 +0100469 #word {
470 width: 50%;
471 }
Marc Kupietz81bf39c2017-11-29 17:04:35 +0100472
Marc Kupietz58270662017-12-04 12:10:06 +0100473 #first {
474 margin-right: 20px;
475 float: left;
476 overflow: hidden; /* if you don't want #second to wrap below #first */
477 // border: 1px solid green;
478 }
479 #tabs {
480 margin-right: 20px;
481 overflow: hidden; /* if you don't want #second to wrap below #first */
482 }
Marc Kupietzdf3d4b52017-11-29 16:57:27 +0100483
Marc Kupietz58270662017-12-04 12:10:06 +0100484 .tabs-min {
485 background: transparent;
486 border: none;
487 }
Marc Kupietzdf3d4b52017-11-29 16:57:27 +0100488
Marc Kupietz58270662017-12-04 12:10:06 +0100489 .tabs-min .ui-widget-header {
490 background: transparent;
491 border: none;
492 border-bottom: 1px solid #c0c0c0;
493 -moz-border-radius: 0px;
494 -webkit-border-radius: 0px;
495 border-radius: 0px;
496 }
Marc Kupietzdf3d4b52017-11-29 16:57:27 +0100497
Marc Kupietz58270662017-12-04 12:10:06 +0100498 .tabs-min .ui-tabs-nav .ui-state-default {
499 background: transparent;
500 border: none;
501 }
Marc Kupietzdf3d4b52017-11-29 16:57:27 +0100502
Marc Kupietz58270662017-12-04 12:10:06 +0100503 .tabs-min .ui-tabs-nav .ui-state-active {
504 background: transparent url(derekovecs/img/uiTabsArrow.png) no-repeat bottom center;
505 border: none;
506 }
Marc Kupietzdf3d4b52017-11-29 16:57:27 +0100507
Marc Kupietz58270662017-12-04 12:10:06 +0100508 .tabs-min .ui-tabs-nav .ui-state-default a {
509 color: #c0c0c0;
510 }
Marc Kupietzdf3d4b52017-11-29 16:57:27 +0100511
Marc Kupietz58270662017-12-04 12:10:06 +0100512 .tabs-min .ui-tabs-nav .ui-state-active a {
513 color: rgb(246,168,0);
514 }
Marc Kupietzdf3d4b52017-11-29 16:57:27 +0100515
Marc Kupietz58270662017-12-04 12:10:06 +0100516 #embed {
517 max-width: 802px;
518 border: 1px solid #333;
519 }
Marc Kupietz4abcd682017-11-28 20:51:08 +0100520
Marc Kupietz58270662017-12-04 12:10:06 +0100521 #second {
522 min-width: 800px;
523 // border: 1px solid #333;
524 overflow: hidden; /* if you don't want #second to wrap below #first */
525 }
526 #som2 svg {
527 border: 1px solid #333;
528 }
Marc Kupietz83305222016-04-28 09:57:22 +0200529
Marc Kupietz58270662017-12-04 12:10:06 +0100530 #cost {
531 font-size: 8pt;
532 color: #222222;
533 margin-top: 4px;
534 margin-bottom: 12px;
535 }
Marc Kupietz83305222016-04-28 09:57:22 +0200536
Marc Kupietz58270662017-12-04 12:10:06 +0100537 #sominfo1, #sominfo {
538 font-size: 8pt;
539 color: #222222;
540 margin-top: 0px;
541 }
Marc Kupietz83305222016-04-28 09:57:22 +0200542
Marc Kupietz58270662017-12-04 12:10:06 +0100543 #somcolor1, #somcolor2, #somcolor3 {
544 display: inline-block;
545 height: 10px;
546 width: 10px;
547 }
Marc Kupietz83305222016-04-28 09:57:22 +0200548
Marc Kupietz58270662017-12-04 12:10:06 +0100549 #third {
550 border: 1px solid #333;
551 }
Marc Kupietz83305222016-04-28 09:57:22 +0200552
553 </style>
554 <script>
555
556 var opt = {epsilon: <%= $epsilon %>, perplexity: <%= $perplexity %>},
Marc Kupietz58270662017-12-04 12:10:06 +0100557 mapWidth = 800, // width map
558 mapHeight = 800,
559 jitterRadius = 7;
Marc Kupietz83305222016-04-28 09:57:22 +0200560
561 var T = new tsnejs.tSNE(opt); // create a tSNE instance
562
563 var Y;
564
565 var data;
566 var labeler;
567
568 function applyJitter() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100569 svg.selectAll('.tsnet')
570 .data(labels)
571 .transition()
572 .duration(50)
573 .attr("transform", function(d, i) {
574 T.Y[i][0] = (d.x - mapWidth/2 - tx)/ss/20;
575 T.Y[i][1] = (d.y - mapHeight/2 - ty)/ss/20;
576 return "translate(" +
577 (d.x) + "," +
578 (d.y) + ")";
579 });
Marc Kupietz83305222016-04-28 09:57:22 +0200580 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100581
Marc Kupietz83305222016-04-28 09:57:22 +0200582 function updateEmbedding() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100583 var Y = T.getSolution();
584 svg.selectAll('.tsnet')
585 .data(data.words)
586 .attr("transform", function(d, i) {
587 return "translate(" +
588 ((Y[i][0]*20*ss + tx) + mapWidth/2) + "," +
589 ((Y[i][1]*20*ss + ty) + mapHeight/2) + ")"; });
Marc Kupietz83305222016-04-28 09:57:22 +0200590 }
591
592 var svg;
593 var labels = [];
594 var anchor_array = [];
595 var text;
596
597 function drawEmbedding() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100598 var urlprefix = new URLSearchParams(window.location.search);
599 urlprefix.delete("word");
600 urlprefix.append("word","");
Marc Kupietz8f9c86a2017-12-04 17:17:13 +0100601
Marc Kupietze6a7a732018-01-12 09:21:08 +0100602 $("#embed").empty();
603 var div = d3.select("#embed");
Marc Kupietz34c08172017-11-29 17:08:47 +0100604
Marc Kupietze6a7a732018-01-12 09:21:08 +0100605 // get min and max in each column of Y
606 var Y = T.Y;
Marc Kupietz34c08172017-11-29 17:08:47 +0100607
Marc Kupietze6a7a732018-01-12 09:21:08 +0100608 svg = div.append("svg") // svg is global
609 .attr("width", mapWidth)
610 .attr("height", mapHeight);
Marc Kupietz34c08172017-11-29 17:08:47 +0100611
Marc Kupietze6a7a732018-01-12 09:21:08 +0100612 var g = svg.selectAll(".b")
613 .data(data.words)
614 .enter().append("g")
615 .attr("class", "tsnet");
Marc Kupietz34c08172017-11-29 17:08:47 +0100616
Marc Kupietze6a7a732018-01-12 09:21:08 +0100617 g.append("a")
618 .attr("xlink:href", function(word) {
619 return "?"+urlprefix+word; })
620 .attr("class", function(d, i) {
621 var res="";
622 if(data.marked[i]) {
623 res="marked ";
624 }
625 if(data.target.indexOf(" "+d+" ") >= 0) {
626 return res+"target";
627 } else if(data.ranks[i] < data.mergedEnd) {
628 return res+"merged";
629 } else {
630 return res;
631 }
632 })
633 .attr("title", function(d, i) {
634 if(data.mergedEnd > 0) {
635 if(data.ranks[i] >= data.mergedEnd) {
636 return "rank: "+i +" "+"freq. rank: "+(data.ranks[i]).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
637 } else {
638 return "rank: "+i +" "+"freq. rank: "+data.ranks[i].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + " (merged vocab)";
639 }
640 } else {
641 return "rank: "+i +" "+"freq. rank: "+data.ranks[i].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
642 }
643 })
644 .append("text")
645 .attr("text-anchor", "top")
646 .attr("font-size", 12)
647 .text(function(d) { return d; });
Marc Kupietz34c08172017-11-29 17:08:47 +0100648
Marc Kupietze6a7a732018-01-12 09:21:08 +0100649 var zoomListener = d3.behavior.zoom()
650 .scaleExtent([0.1, 10])
651 .center([0,0])
652 .on("zoom", zoomHandler);
653 zoomListener(svg);
Marc Kupietz83305222016-04-28 09:57:22 +0200654 }
655
656 var tx=0, ty=0;
657 var ss=1;
658 var iter_id=-1;
659
660 function zoomHandler() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100661 tx = d3.event.translate[0];
662 ty = d3.event.translate[1];
663 ss = d3.event.scale;
664 updateEmbedding();
Marc Kupietz83305222016-04-28 09:57:22 +0200665 }
666
667 var stepnum = 0;
668
669 function stopStep() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100670 clearInterval(iter_id);
671 text = svg.selectAll("text");
Marc Kupietz34c08172017-11-29 17:08:47 +0100672
Marc Kupietze6a7a732018-01-12 09:21:08 +0100673 // jitter function needs different data and co-ordinate representation
674 labels = d3.range(data.words.length).map(function(i) {
675 var x = (T.Y[i][0]*20*ss + tx) + mapWidth/2;
676 var y = (T.Y[i][1]*20*ss + ty) + mapHeight/2;
677 anchor_array.push({x: x, y: y, r: jitterRadius});
678 return {
679 x: x,
680 y: y,
681 name: data.words[i]
682 };
683 });
Marc Kupietz34c08172017-11-29 17:08:47 +0100684
Marc Kupietze6a7a732018-01-12 09:21:08 +0100685 // get the actual label bounding boxes for the jitter function
686 var index = 0;
687 text.each(function() {
688 labels[index].width = this.getBBox().width;
689 labels[index].height = this.getBBox().height;
690 index += 1;
691 });
Marc Kupietz83305222016-04-28 09:57:22 +0200692
Marc Kupietz34c08172017-11-29 17:08:47 +0100693
Marc Kupietze6a7a732018-01-12 09:21:08 +0100694 // setTimeout(updateEmbedding, 1);
695 // setTimeout(
696 labeler = d3.labeler()
697 .label(labels)
698 .anchor(anchor_array)
699 .width(mapWidth)
700 .height(mapHeight)
701 .update(applyJitter);
702 // .start(1000);
Marc Kupietz83305222016-04-28 09:57:22 +0200703
Marc Kupietze6a7a732018-01-12 09:21:08 +0100704 iter_id = setInterval(jitterStep, 1);
Marc Kupietz83305222016-04-28 09:57:22 +0200705 }
706
707 var jitter_i=0;
708
709 function jitterStep() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100710 if(jitter_i++ > 100) {
711 clearInterval(iter_id);
712 } else {
713 labeler.start2(10);
714 applyJitter();
715 }
Marc Kupietz83305222016-04-28 09:57:22 +0200716 }
717
718 var last_cost=1000;
719
720 function step() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100721 var i = T.iter;
Marc Kupietz34c08172017-11-29 17:08:47 +0100722
Marc Kupietze6a7a732018-01-12 09:21:08 +0100723 if(i > <%= $no_iterations %>) {
724 stopStep();
725 } else {
726 var cost = Math.round(T.step() * 100000) / 100000; // do a few steps
727 $("#cost").html("tsne iteration " + i + ", cost: " + cost.toFixed(5));
728 if(i % 250 == 0 && cost >= last_cost) {
729 stopStep();
Marc Kupietz58270662017-12-04 12:10:06 +0100730 } else {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100731 last_cost = cost;
732 updateEmbedding();
Marc Kupietz58270662017-12-04 12:10:06 +0100733 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100734 }
Marc Kupietz83305222016-04-28 09:57:22 +0200735 }
736
737 function showMap(j) {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100738 data=j;
739 T.iter=0;
740 iter_id = -1;
741 last_cost=1000;
742 T.initDataRaw(data.vecs); // init embedding
743 drawEmbedding(); // draw initial embedding
Marc Kupietz78114532017-11-29 17:00:16 +0100744
Marc Kupietze6a7a732018-01-12 09:21:08 +0100745 if(iter_id >= 0) {
746 clearInterval(iter_id);
747 }
748 //T.debugGrad();
749 iter_id = setInterval(step, 1);
750 if(true) { // (<%= $show_som %>) {
751 makeSOM(j, <%= $no_iterations %>);
752 }
Marc Kupietz83305222016-04-28 09:57:22 +0200753 }
Marc Kupietz39179ab2017-07-04 16:28:06 +0200754 var queryword;
755
Marc Kupietz66bfd952017-12-11 09:59:45 +0100756 function showCollocatorSOM() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100757 if (collocatorTable) {
758 var ctableData = collocatorTable.rows().data();
759 var nwords = [],
760 nranks = [];
761 for (var i=0; i < ctableData.length && i < 100; i++) {
762 nranks.push(ctableData[i].rank);
763 nwords.push(ctableData[i].word);
Marc Kupietz66bfd952017-12-11 09:59:45 +0100764 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100765 $.post('/derekovecs/getVecsByRanks',
766 JSON.stringify(nranks),
767 function(data, status){
768 showMap({target: " "+urlParams.get('word')+" ", mergedEnd: 0, words: nwords, vecs: data, ranks: nranks, marked: Array(100).fill(false)} );
769 }, 'json');
770 }
Marc Kupietz66bfd952017-12-11 09:59:45 +0100771 }
772
Marc Kupietz39179ab2017-07-04 16:28:06 +0200773 function onload() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100774 queryword = document.getElementById('word');
Marc Kupietz39179ab2017-07-04 16:28:06 +0200775 }
776
777 function queryKorAP() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100778 window.open('http://korap.ids-mannheim.de/kalamar/?q='+queryword.value, 'KorAP');
Marc Kupietz39179ab2017-07-04 16:28:06 +0200779 }
Marc Kupietz4dc270c2017-11-24 10:17:12 +0100780
781 function queryKorAPCII(query) {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100782 window.open('http://korap.ids-mannheim.de/kalamar/?ql=cosmas2&q='+query, 'KorAP');
Marc Kupietz4dc270c2017-11-24 10:17:12 +0100783 }
Marc Kupietz83305222016-04-28 09:57:22 +0200784 </script>
785 </head>
Marc Kupietz39179ab2017-07-04 16:28:06 +0200786 <body onload="onload()">
Marc Kupietz58270662017-12-04 12:10:06 +0100787 <div id="header">
788 <div id="pagetitle">
789 <h1>DeReKo-Vectors</h1>
Marc Kupietz4fcda0c2017-11-29 09:00:31 +0100790 </div>
Marc Kupietz58270662017-12-04 12:10:06 +0100791 <div id="options" class="widget">
792 <form id="queryform">
793 <input id="word" type="text" name="word" placeholder="Word(s) to be searched" value="<%= $word %>"
794 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."/>
795 <input id="SEARCH" type="button" value="SEARCH">
796 <input type="button" id="showoptions" name="showoptions" value="Options" />
797 </form>
798 <div id="dropdownoptions" style="display: none">
799 <form id="optionsform">
800 <div class="controlgroup-vertical">
801 <label for="cutoff">cut-off</label>
802 <input id="cutoff" type="text" name="cutoff" size="10" value="<%= $cutoff %>" title="Only consider the most frequent x word forms.">
803 <label for="dedupe">dedupe</label>
804 <input id="dedupe" type="checkbox" name="dedupe" value="1" <%= ($dedupe ? "checked" : "") %> title="radically filter out any near-duplicates">
805 % if($mergedEnd > 0) {
806 <label for="sbf">backw.</label>
807 <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.">
808 % }
809 <label for="neighbours">max. neighbours:</label>
810 <input id="neighbours" size="4" name="n" value="<%= $no_nbs %>">
811 <label for="no_iterations">max. iterations</label>
812 <input id="no_iterations" name="N" size="4" value="<%= $no_iterations %>">
813 <!-- <label for="dosom">SOM</label>
814 <input id="dosom" type="checkbox" name="som" value="1" <%= ($show_som ? "checked" : "") %>> -->
815 % if($collocators) {
816 <label for="sortby">window/sort</label>
817 <select id="sortby" name="sort">
818 <option value="0" <%= ($sort!=1 && $sort!=2? "selected":"") %>>auto focus</option>
819 <!-- <option value="1" <%= ($sort==1? "selected":"") %>>any single position</option>
820 <option value="2" <%= ($sort==2? "selected":"") %>>whole window</option> -->
821 </select>
822 % }
823 <input type="button" value="→ KorAP" onclick="queryKorAP();" title="query word with KorAP"/>
824 </div>
825 </form>
826 </div>
827 </div>
828 </div>
829 <div id="topwrapper">
830 <div style="visibility: hidden;" id="tabs">
831 <ul>
832 <li><a href="#tabs-1">Semantics (TSNE-map)</a></li>
833 <li><a href="#tabs-2">Semantics (SOM)</a></li>
834 <li><a href="#tabs-3">Syntagmatic (collocators)</a></li>
835 </ul>
836 <div id="tabs-1">
837 % if($lists && (@$lists) > 0 && (@$lists)[0]) {
838 <div id="wrapper">
839 <div id="first" style="width: 320px">
840 <table class="display compact nowrap" id="firsttable">
841 <thead>
842 <tr>
843 <th align="right">#</th><th align="right">cos</th><th align="left">similars</th>
844 </tr>
845 </thead>
846 <tbody>
847 <tr>
848 <td align="right">
849 </td>
850 <td align="right">
851 </td>
852 <td></td>
853 </tr>
854 </tbody>
855 </table>
856 </div>
857 <script>
858 </script>
859 <div id="second">
860 <div id="embed">
861 </div>
862 <div id="cost">
863 </div>
864 </div>
865 </div>
866 % } elsif($word !~ /^\s*$/) {
867 <div id="wrapper">
868 <div id="not-found-dialog" title="Not found">
869 <p>ERROR: "<%= $word %>" not found in vocabluary.</p>
870 <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>
871 </div>
872 <script>
873 $( function() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100874 $( "#not-found-dialog" ).dialog({
875 autoOpen: true,
876 modal: true,
877 draggable: false,
878 height: "auto",
879 width: "auto",
880 resizable: false,
881 buttons: {
882 "OK": function() {
883 $( this ).dialog( "close" );
884 },
885 "Apply": function() {
886 window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
887 }
888 }
889 });
Marc Kupietz58270662017-12-04 12:10:06 +0100890 });
891 </script>
892 </div>
Marc Kupietze6a7a732018-01-12 09:21:08 +0100893 % }
Marc Kupietz58270662017-12-04 12:10:06 +0100894 </div>
895 <div id="tabs-2">
Marc Kupietz66bfd952017-12-11 09:59:45 +0100896 <div id="som2" style="width: 800;">
Marc Kupietz58270662017-12-04 12:10:06 +0100897 </div>
898 <div id="sominfo1"><span id="somcolor1"> </span> <span id="somword1"> </span> <span id="somcolor2"> </span> <span id="somword2"> </span> <span id="somcolor3"> </span></div>
899 <div id="sominfo">SOM iteration <span id="iterations">0</span></div>
900 </div>
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100901 <div id="tabs-3" style="width:1500px">
902 <div style="width: 55%; float: left;" id="secondt">
Marc Kupietze6a7a732018-01-12 09:21:08 +0100903 <table class="display compact nowrap" id="secondtable">
Marc Kupietz58270662017-12-04 12:10:06 +0100904 <thead>
905 <tr>
906 % if($collocators) {
907 <th>#</th>
Marc Kupietz4116b432017-12-06 14:15:32 +0100908 <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>
909 <th align="right" title="Maximum activation of the collocator anywhere in the output layer.">max(a)</th>
910 <th title="Average raw activation of the collocator in the columns selected by auto-focus." align="right">⟨a⟩</th>
911 <th title="Sum of activations over the selected colunns normalized by the total activation sum of the selected columns." align="right">Σa/Σw'</th>
912 <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 +0100913 <th title="Sum of the activations over the whole window normalized by the total window sum (no auto-focus)." align="right">Σa/Σw</th>
914 <th align="left">collocator</th>
915 % }
916 </tr>
917 </thead>
918 <tbody>
919 <tr>
920 <td align="right">
921 </td>
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>
Marc Kupietz58270662017-12-04 12:10:06 +0100932 </tr>
933 </tbody>
934 </table>
Marc Kupietz66bfd952017-12-11 09:59:45 +0100935 </div>
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100936 <div style="margin-left:20px; float:right; width: 650px">
Marc Kupietze6a7a732018-01-12 09:21:08 +0100937 <table class="display compact nowrap" id="classicoloctable">
938 <thead>
939 <tr>
940 <th>llr</th>
941 <th title="log-frequency biased mutual dependency">lfmd</th>
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100942 <!-- <th title="frequency biased pointwise mutual information">fpmi</th>-->
Marc Kupietz78b434a2018-01-12 22:33:32 +0100943 <th title="normalized pointwise mutual information">npmi</th>
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100944 <th title="log-frequency biased mutual dependency - left neighbour only">l-lfmd</th>
945 <th title="log-frequency biased mutual dependency - right neighbour only">r-lfmd</th>
946 <th title="normalized pointwise mutual information - left neighbour only">l-npmi</th>
947 <th title="normalized pointwise mutual information - right neighbour only">r-npmi</th>
Marc Kupietze6a7a732018-01-12 09:21:08 +0100948 <th>collocator</th>
949 </tr>
950 </thead>
951 <tbody>
952 <tr>
953 <td align="right">
954 </td>
955 <td align="right">
956 </td>
957 <td align="right">
958 </td>
959 <td align="right">
960 </td>
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100961 <td align="right">
962 </td>
963 <td align="right">
964 </td>
965 <td align="right">
966 </td>
967 <td align="right">
968 </td>
Marc Kupietze6a7a732018-01-12 09:21:08 +0100969 </tr>
970 </tbody>
971 </table>
972 </div>
973 <div style="clear:both" ></div>
Marc Kupietz66bfd952017-12-11 09:59:45 +0100974 <div style="float: right; overflow: hidden" id="extra"><button onClick="showCollocatorSOM()"> </button></div>
Marc Kupietz66bfd952017-12-11 09:59:45 +0100975 </div>
Marc Kupietz58270662017-12-04 12:10:06 +0100976 </div>
977 </div> <!-- topwrapper -->
978 <div style="clear: both;"></div>
979 </div>
Marc Kupietzebea4702018-01-12 09:16:09 +0100980 % if($training_args && (@$lists)[0]) {
981 <div class="info">
982 % if($training_args =~ /-type\s*3/) {
983 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 %>
984 % } else {
985 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 %>
986 % }
987 </div>
Marc Kupietz83305222016-04-28 09:57:22 +0200988 % }
Marc Kupietz58270662017-12-04 12:10:06 +0100989 </body>
Marc Kupietz83305222016-04-28 09:57:22 +0200990</html>