blob: 32c8a07868671b0d85aa40e27518fe5109ed57f4 [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>
Marc Kupietza0ffb392018-01-25 08:53:43 +010011 <script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML'></script>
Marc Kupietz58270662017-12-04 12:10:06 +010012 <link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
Marc Kupietz4949d232018-03-19 16:43:18 +010013 <link rel="stylesheet" href="/derekovecs/css/derekovecs.css">
Marc Kupietz80bd7b92017-07-04 16:25:54 +020014 <script
Marc Kupietze6a7a732018-01-12 09:21:08 +010015 src="http://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
16 integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
17 crossorigin="anonymous"></script>
Marc Kupietz80bd7b92017-07-04 16:25:54 +020018 <script>
Marc Kupietza0ffb392018-01-25 08:53:43 +010019 MathJax.Hub.Config({
20 config: ["MMLorHTML.js"],
21 jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML", "output/PreviewHTML"],
22 extensions: ["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js", "fast-preview.js", "AssistiveMML.js", "a11y/accessibility-menu.js"],
23 TeX: {
24 extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
25 }
26 });
Marc Kupietz58270662017-12-04 12:10:06 +010027 var urlParams = new URLSearchParams(window.location.search);
Marc Kupietzb3a2e4f2017-12-08 17:25:53 +010028 var currentWords = urlParams.get("word");
Marc Kupietza0ffb392018-01-25 08:53:43 +010029 var CIIsearchWords = (currentWords && currentWords.includes(" ") ? '('+currentWords.replace(/ +/g, " oder ")+')' : currentWords);
Marc Kupietz66bfd952017-12-11 09:59:45 +010030 var collocatorTable = null;
Marc Kupietza6e08f02017-12-01 22:06:21 +010031
Marc Kupietz58270662017-12-04 12:10:06 +010032 $(document).ready(function() {
Marc Kupietz694610d2017-11-25 18:30:03 +010033
Marc Kupietza0ffb392018-01-25 08:53:43 +010034 $('#firstable').hide();
35 //Set up a callback to hear back when MathJax is done rendering the equations
36 // it finds
37 $('#ccd').load(
38 '@Url.Action("ActionResultMethod","ControllerName",{controller parameters})',
39 function () {
40 MathJax.Hub.Queue(
41 ["Typeset",MathJax.Hub,"ccd"],
42 function () {
43 $("#lfmd_tt").attr("title",$("#lfmd_ttt").html());
44 $("#npmi_tt").attr("title",$("#npmi_ttt").html());
45 }
46 );
47 });
48
49 //set things up so that we can shove raw html into what is shown in the tooltip;
50 // in this case, we will have already put into the title attribute the html that
51 // contains the MathJax rendered equations (via what we do in the callback).
52 $(function () {
53 $(document).tooltip({
54 content: function () {
55 return $(this).prop('title');
56 }
57 });
58 });
59
Marc Kupietze6a7a732018-01-12 09:21:08 +010060 $("input").bind("keydown", function(event) {
61 // track enter key
62 var keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode));
63 if (keycode == 13) { // keycode for enter key
64 // force the 'Enter Key' to implicitly click the Update button
65 document.getElementById('SEARCH').click();
66 return false;
67 } else {
68 return true;
69 }});
Marc Kupietzdab9f222017-11-29 14:22:59 +010070
Marc Kupietze871abd2018-01-25 16:18:27 +010071 var collocatorTable_activated = false;
Marc Kupietze6a7a732018-01-12 09:21:08 +010072 $( "#tabs" ).on( "tabsactivate", function( event, ui ) {
73 if (localStorage) localStorage['tab'] = ui.newTab.index();
Marc Kupietze871abd2018-01-25 16:18:27 +010074 if(ui.newTab.index() == 2 && !collocatorTable_activated) {
75 classicCollocatorTable.columns.adjust();
76 collocatorTable.columns.adjust();
77 collocatorTable_activated = true;
78 }
Marc Kupietze6a7a732018-01-12 09:21:08 +010079 });
80
81 $(function(){
82 $("#SEARCH").click(function() {
83 window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
Marc Kupietz58270662017-12-04 12:10:06 +010084 });
Marc Kupietze6a7a732018-01-12 09:21:08 +010085 });
Marc Kupietz0af83e32017-11-27 09:31:37 +010086
Marc Kupietze6a7a732018-01-12 09:21:08 +010087 function changeCharColor(txt, heat, word) {
88 var newText = "";
89 for (var i=0, l=txt.length; i<l; i++) {
90 newText += (i == 5 ? txt.charAt(i) : '<a href="http://korap.ids-mannheim.de/kalamar/?ql=cosmas2&q=' +
91 CIIsearchWords + ' /' + (i > 5? '%2B' : '-') + 'w' +
92 Math.abs(i-5) + ':' + Math.abs(i-5) + ' ' + word +
93 '" target="korap"><span style="background-color:' +
94 getHeatColor(heat[i]/maxHeat)+'">'+txt.charAt(i)+'</span></a>');
Marc Kupietzb6c615d2017-12-02 10:38:20 +010095 }
Marc Kupietze6a7a732018-01-12 09:21:08 +010096 return newText;
97 }
Marc Kupietzb6c615d2017-12-02 10:38:20 +010098
Marc Kupietze6a7a732018-01-12 09:21:08 +010099 function getHeatColor(value) {
100 var hue=((1-value)*120).toString(10);
101 return ["hsl(",hue,",90%,70%)"].join("");
102 }
103
104 function bitvec2window(n, heat, word) {
105 var str = n.toString(2).padStart(10, "0")
106 .replace(/^([0-9]{5})/, '$1x')
107 .replace(/0/g, '·')
108 .replace(/1/g, '+');
109 return changeCharColor(str, heat, word);
110 }
111
112 % use Mojo::ByteStream 'b';
113 var paraResults = <%= b(Mojo::JSON::to_json($lists)) %>;
114 var urlprefix = new URLSearchParams(window.location.search);
115 if (paraResults.length > 0 && paraResults[0] != null) {
116 var nvecs = [],
117 nwords = [],
118 nranks = [],
119 nmarked = [];
120 for(var i = 0; i < paraResults.length; i++) {
121 nwords = nwords.concat(paraResults[i].map(function(a){return a.word;}));
122 nvecs = nvecs.concat(paraResults[i].map(function(a){return a.vector;}));
123 nranks = nranks.concat(paraResults[i].map(function(a){return a.rank;}));
124 nmarked = nmarked.concat(paraResults[i].map(function(a){return a.marked;}));
Marc Kupietz0d4c0ca2017-12-04 09:18:56 +0100125 }
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100126 showMap({target: " "+urlParams.get('word')+" ", mergedEnd: <%= $mergedEnd %>, words: nwords, vecs: nvecs, ranks: nranks, marked: nmarked} );
Marc Kupietze6a7a732018-01-12 09:21:08 +0100127 var t = $('#firsttable').DataTable({
128 data: paraResults[0],
129 "sScrollY": "780px",
130 "bScrollCollapse": true,
131 "bPaginate": false,
132 "bJQueryUI": true,
133 "dom": '<"top">rt<"bottom"flp><"clear">',
Marc Kupietz384c9132018-03-19 16:45:24 +0100134 "initComplete":function(settings, json) {
135 $('td.paradigmator a').on('mousedown', function(e) {
136 return paradigmatorClick(e, paraResults[0][0].word, this.childNodes["0"].textContent);
137 });
138 },
Marc Kupietze6a7a732018-01-12 09:21:08 +0100139 "columns": [
140 { "data": "rank", type: "allnumeric" },
141 { "data": "dist", render: function ( data, type, row ) {return data.toFixed(3) }},
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100142 { "data": "word", class: "paradigmator", render: function ( data, type, row ) {
143 urlprefix.set("word", data); return '<a class="' + getMergedClass(row.rank) + '" href="?' + urlprefix + '">' + data + '</a>'
144 }}
Marc Kupietze6a7a732018-01-12 09:21:08 +0100145 ],
146 "columnDefs": [
147 { className: "dt-right", "targets": [0,1] },
148 { "searchable": false,
149 "orderable": false,
150 "targets": 0
151 },
152 { "orderSequence": [ "desc" ], "targets": [ 1 ] },
153 { "orderSequence": [ "asc", "desc" ], "targets": [ 2 ] },
154 ],
155 "oLanguage": {
156 "sSearch": "Filter: "
157 },
158 "order": [[ 1, 'desc' ]],
159 } );
Marc Kupietz0d4c0ca2017-12-04 09:18:56 +0100160
Marc Kupietze6a7a732018-01-12 09:21:08 +0100161 t.on( 'order.dt search.dt', function () {
162 t.column(0, {order:'applied'}).nodes().each( function (cell, i) {
163 cell.innerHTML = i+1;
164 } );
165 } ).draw();
166
167 $( "#first" ).clone().prependTo( "#tabs-2" );
168
169 }
170
171
172 var collocatorData = <%= b(Mojo::JSON::to_json($collocators)) %>;
173 var maxHeat; // = Math.max.apply(Math,collocatorData.map(function(o){return o.cprob;}))
174
175 if (collocatorData != null) {
176 maxHeat = Math.max.apply(Math,collocatorData.map(function(o){return Math.max.apply(Math,o.heat);}))
177 collocatorTable = $('#secondtable').DataTable({
178 data: collocatorData,
179 "sScrollY": "780px",
180 "bScrollCollapse": true,
181 "bPaginate": false,
182 "bJQueryUI": true,
183 "dom": '<"top">rt<"bottom"flp><"clear">',
184 "columns": [
185 { "data": "rank", type: "allnumeric" },
186 { "data": "pos", width: "7%", sClass: "dt-center mono compact", render: function ( data, type, row ) {return bitvec2window(data, row.heat, row.word) }},
187 { "data": "max", render: function ( data, type, row ) {return data.toFixed(3) }},
188 { "data": "average", render: function ( data, type, row ) {return data.toFixed(3) }},
189 { "data": "prob", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } },
190 { "data": "cprob", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } },
191 { "data": "overall", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } },
192 { "data": "word", sClass: "collocator" },
193 { "data": "rank", type: "allnumeric" }
194 ],
195 "columnDefs": [
196 { className: "dt-right", "targets": [0,2,3,4,5,6] },
197 { className: "dt-center", "targets": [ 1] },
198 { "searchable": false,
199 "orderable": false,
200 "targets": [0, 8]
201 },
202 { "type": "scientific", targets: [2,3,4,5,6] },
203 { "orderSequence": [ "desc" ], "targets": [ 2, 3, 4, 5, 6 ] },
204 { "orderSequence": [ "asc", "desc" ], "targets": [ 1, 7 ] },
205 { "targets": [8], "visible": false }
206 ],
207 "oLanguage": {
208 "sSearch": "Filter: "
209 },
210 "order": [[ 4, 'desc' ]],
211 } );
212 $.ajaxSetup({
213 type: 'POST',
214 timeout: 30000,
215 error: function(xhr) {
216 $('#display_error')
217 .html('Error: ' + xhr.status + ' ' + xhr.statusText);
218 }
Marc Kupietz78b434a2018-01-12 22:33:32 +0100219 });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100220
Marc Kupietz384c9132018-03-19 16:45:24 +0100221
222 if($('#sprofiles').length) {
223 similarProfileTable = $('#sprofiles').DataTable({
224 ajax: {
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100225 method: "GET",
Marc Kupietz384c9132018-03-19 16:45:24 +0100226 url: '/derekovecs/getSimilarProfiles',
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100227 dataType: 'json',
228 dataSrc: "",
229 timeout: 30000,
230 data: { w: paraResults[0][0].rank }
Marc Kupietz384c9132018-03-19 16:45:24 +0100231 },
232 "initComplete":function(settings, json){
233 $('td.paradigmator a').on('mousedown', function(e) {
234 if (e.which === 2) {
235 e.preventDefault();
236 queryKorAPalternatives(paraResults[0][0].word, this.childNodes["0"].textContent);
237 return false;
238 }
239 });
240 },
241 "sScrollY": "780px",
242 "bScrollCollapse": true,
243 "bPaginate": false,
244 "bJQueryUI": true,
245 "dom": '<"top">rt<"bottom"flp><"clear">',
246 "columns": [
247 { "data": "v", render: function ( data, type, row ) {return data.toFixed(3) }},
248 { "data": "w", sClass: "paradigmator", render: function ( data, type, row ) {urlprefix.set("word", data); return '<a href="?' + urlprefix + '">' + data + '</a>' } }
249 ],
250 "columnDefs": [
251 { className: "dt-right", "targets": [0] },
252 ],
253 "oLanguage": {
254 "sSearch": "Filter: "
255 },
256 "order": [[ 0, 'desc' ]],
257 });
258 }
259 // var filterQuot = /(^quot?=[A-Z])|(quot$)/g;
260 var filterQuot = /^quot/;
261 classicCollocatorTable = $('#classicoloctable').DataTable({
262 ajax: {
263 method: "GET",
264 url: '/derekovecs/getClassicCollocators',
265 dataType: 'json',
266 dataSrc: "",
267 timeout: 30000,
268 data: { w: paraResults[0][0].rank }
Marc Kupietz78b434a2018-01-12 22:33:32 +0100269 },
Marc Kupietzad783722018-01-13 17:45:21 +0100270 "initComplete":function(settings, json){
271 $("td.collocator").click(function(){
272 queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords);
273 });
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100274 classicCollocatorTable.columns(".detail").visible(false);
275 $("#ccd").css('width', '450px');
276 classicCollocatorTable.columns.adjust().draw();
Marc Kupietzad783722018-01-13 17:45:21 +0100277 },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100278 "sScrollY": "780px",
279 "bScrollCollapse": true,
280 "bPaginate": false,
281 "bJQueryUI": true,
282 "dom": '<"top">rt<"bottom"flp><"clear">',
283 "columns": [
284 // { "data": "pos", width: "7%", sClass: "dt-center mono compact", render: function ( data, type, row ) {return bitvec2window(data, row.heat, row.word) }},
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100285 { "data": "llr", render: function ( data, type, row ) {return data.toFixed(0) }},
286 { "data": "lfmd", render: function ( data, type, row ) {return data.toFixed(1) }},
Marc Kupietz1acb3172018-02-17 09:41:26 +0100287 // { "data": "fpmi", type: "scientific", render: function ( data, type, row ) {return data.toExponential(2) } },
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100288 { "data": "npmi", render: function ( data, type, row ) {return data.toFixed(2) }},
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100289 { "data": "llfmd", render: function ( data, type, row ) {return data.toFixed(1) }},
290 { "data": "rlfmd", render: function ( data, type, row ) {return data.toFixed(1) }},
291 { "data": "lnpmi", render: function ( data, type, row ) {return data.toFixed(2) }},
292 { "data": "rnpmi", render: function ( data, type, row ) {return data.toFixed(2) }},
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100293 { "data": "f" },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100294 { "data": "word", sClass: "collocator" }
295 ],
296 "columnDefs": [
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100297 { className: "dt-right", "targets": [0,1,2,3,4,5,6,7] },
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100298 { className: "dt-right detail", "targets": [3,4,5,6] },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100299 { "searchable": false,
300 "orderable": false,
301 "targets": []
302 },
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100303 { "orderSequence": [ "desc" ], "targets": [ 0, 1, 2,3,4,5,6,7 ] },
304 { "orderSequence": [ "asc", "desc" ], "targets": [ 8 ] },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100305 ],
306 "oLanguage": {
307 "sSearch": "Filter: "
308 },
309 "order": [[ 1, 'desc' ]],
310 });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100311
Marc Kupietz1acb3172018-02-17 09:41:26 +0100312
313 $('#show-details').change(function (e) {
314 var columns = classicCollocatorTable.columns(".detail");
315 if(this.checked) {
316 columns.visible(true);
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100317 $("#ccd").css('width', 'auto');
Marc Kupietz1acb3172018-02-17 09:41:26 +0100318 } else {
319 columns.visible(false);
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100320 $("#ccd").css('width', '450px');
Marc Kupietz1acb3172018-02-17 09:41:26 +0100321 }
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100322 classicCollocatorTable.columns.adjust().draw();
Marc Kupietz1acb3172018-02-17 09:41:26 +0100323 } );
324
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100325 $("td.collocator").click(function(){
326 queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords);
Marc Kupietzad783722018-01-13 17:45:21 +0100327 });
328
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100329 collocatorTable.on( 'order.dt search.dt', function () {
330 collocatorTable.column(0, {order:'applied'}).nodes().each( function (cell, i) {
331 cell.innerHTML = i+1;
332 } );
333 }).draw();
334 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100335
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100336 if (localStorage && !window.location.hash) { // let's not crash if some user has IE7
337 var index = parseInt(localStorage['tab']||'0');
338 $("#tabs").tabs({ active: index });
339 }
340 $("#tabs").css("visibility", "visible"); // now we can show the tabs
341 });
Marc Kupietz58270662017-12-04 12:10:06 +0100342
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100343 $(function(){
344 $("#dropdownoptions").dialog({
345 title: "Options",
346 autoOpen: false,
347 modal: false,
348 draggable: false,
349 height: "auto",
350 width: "auto",
351 resizable: false,
352 buttons: {
353 "Cancel": function() {
354 $( this ).dialog( "close" );
Marc Kupietze6a7a732018-01-12 09:21:08 +0100355 },
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100356 "Apply": function() {
357 window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
Marc Kupietze6a7a732018-01-12 09:21:08 +0100358 }
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100359 }
360 });
361 });
362
363 $(function(){
364 $("#showoptions").click(function(){
365 $("#dropdownoptions").dialog("open");
366 var target = $(this);
367 $("#dropdownoptions").dialog("widget").position({
368 my: 'left bottom',
369 at: 'left bottom',
370 of: target
Marc Kupietz58270662017-12-04 12:10:06 +0100371 });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100372 });
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100373 });
374
375 $( function() {
376 $( "#no_iterations" ).spinner({
377 spin: function( event, ui ) {
378 if ( ui.value < 1000 ) {
379 $( this ).spinner( "value", 1000 );
380 return false;
381 } else if ( ui.value > 10000 ) {
382 $( this ).spinner( "value", 10000 );
383 return false;
384 }
385 }
386 });
387 } );
388
389 $( function() {
390 $( "#neighbours" ).spinner({
391 spin: function( event, ui ) {
392 if ( ui.value < 0 ) {
393 $( this ).spinner( "value", 0 );
394 return false;
395 } else if ( ui.value > 200 ) {
396 $( this ).spinner( "value", 200 );
397 return false;
398 }
399 }
400 });
401 } );
402
403 $( function() {
404 $( "#cutoff" ).spinner({
405 spin: function( event, ui ) {
406 if ( ui.value < 100000 ) {
407 $( this ).spinner( "value", 100000 );
408 return false;
409 } else if ( ui.value > 2000000 ) {
410 $( this ).spinner( "value", 2000000 );
411 return false;
412 }
413 }
414 });
415 } );
416
417 $( function() {
418 $( "#tabs" ).tabs().addClass('tabs-min');
419 } );
420
421 $( function() {
422 $( ".controlgroup-vertical" ).controlgroup({
423 "direction": "vertical"
424 });
425 } );
426
427 $(function() {
428 $( document ).tooltip({
429 content: function() {
430 return $(this).attr('title');
431 }}
432 )
433 });
434
435 $(function () {
436 $(document).tooltip({
437 content: function () {
438 return $(this).prop('title');
439 },
440 show: null,
441 close: function (event, ui) {
442 ui.tooltip.hover(
443 function () {
444 $(this).stop(true).fadeTo(400, 1);
445 },
446 function () {
447 $(this).fadeOut("400", function () {
448 $(this).remove();
449 })
450 });
451 }
452 });
453 });
Marc Kupietz83305222016-04-28 09:57:22 +0200454 </script>
Marc Kupietz58270662017-12-04 12:10:06 +0100455 <script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script>
456 <script src="/derekovecs/js/tsne.js"></script>
457 <script src="/derekovecs/js/som.js"></script>
458 <script src="/derekovecs/js/labeler.js"></script>
Marc Kupietzcdd51302018-03-19 16:36:54 +0100459 <script src="/derekovecs/js/derekovcs.js"></script>
Marc Kupietz83305222016-04-28 09:57:22 +0200460 <script>
461
462 var opt = {epsilon: <%= $epsilon %>, perplexity: <%= $perplexity %>},
Marc Kupietz58270662017-12-04 12:10:06 +0100463 mapWidth = 800, // width map
464 mapHeight = 800,
465 jitterRadius = 7;
Marc Kupietz83305222016-04-28 09:57:22 +0200466
467 var T = new tsnejs.tSNE(opt); // create a tSNE instance
468
469 var Y;
470
471 var data;
472 var labeler;
473
474 function applyJitter() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100475 svg.selectAll('.tsnet')
476 .data(labels)
477 .transition()
478 .duration(50)
479 .attr("transform", function(d, i) {
480 T.Y[i][0] = (d.x - mapWidth/2 - tx)/ss/20;
481 T.Y[i][1] = (d.y - mapHeight/2 - ty)/ss/20;
482 return "translate(" +
Marc Kupietz384c9132018-03-19 16:45:24 +0100483 (d.x) + "," +
484 (d.y) + ")";
Marc Kupietze6a7a732018-01-12 09:21:08 +0100485 });
Marc Kupietz83305222016-04-28 09:57:22 +0200486 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100487
Marc Kupietz83305222016-04-28 09:57:22 +0200488 function updateEmbedding() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100489 var Y = T.getSolution();
490 svg.selectAll('.tsnet')
491 .data(data.words)
492 .attr("transform", function(d, i) {
493 return "translate(" +
Marc Kupietz384c9132018-03-19 16:45:24 +0100494 ((Y[i][0]*20*ss + tx) + mapWidth/2) + "," +
495 ((Y[i][1]*20*ss + ty) + mapHeight/2) + ")"; });
Marc Kupietz83305222016-04-28 09:57:22 +0200496 }
497
498 var svg;
499 var labels = [];
500 var anchor_array = [];
501 var text;
502
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100503 function getMergedClass(i) {
504 if(data.mergedEnd && i > data.mergedEnd) {
505 return " merged"
506 } else {
507 return "";
508 }
509 }
510
511 function getRankTooltip(i) {
512 if(data.mergedEnd) {
513 if(data.ranks[i] < data.mergedEnd) {
514 return "rank: "+i +" "+"freq. rank: "+(data.ranks[i]).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
515 } else {
516 return "rank: "+i +" "+"freq. rank: "+(data.ranks[i]-data.mergedEnd).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + " (merged vocab)";
517 }
518 } else {
519 return "rank: "+i +" "+"freq. rank: "+data.ranks[i].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
520 }
521 }
522
Marc Kupietz83305222016-04-28 09:57:22 +0200523 function drawEmbedding() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100524 var urlprefix = new URLSearchParams(window.location.search);
525 urlprefix.delete("word");
526 urlprefix.append("word","");
Marc Kupietz8f9c86a2017-12-04 17:17:13 +0100527
Marc Kupietze6a7a732018-01-12 09:21:08 +0100528 $("#embed").empty();
529 var div = d3.select("#embed");
Marc Kupietz34c08172017-11-29 17:08:47 +0100530
Marc Kupietze6a7a732018-01-12 09:21:08 +0100531 // get min and max in each column of Y
532 var Y = T.Y;
Marc Kupietz34c08172017-11-29 17:08:47 +0100533
Marc Kupietze6a7a732018-01-12 09:21:08 +0100534 svg = div.append("svg") // svg is global
535 .attr("width", mapWidth)
536 .attr("height", mapHeight);
Marc Kupietz34c08172017-11-29 17:08:47 +0100537
Marc Kupietze6a7a732018-01-12 09:21:08 +0100538 var g = svg.selectAll(".b")
539 .data(data.words)
540 .enter().append("g")
541 .attr("class", "tsnet");
Marc Kupietz34c08172017-11-29 17:08:47 +0100542
Marc Kupietze6a7a732018-01-12 09:21:08 +0100543 g.append("a")
544 .attr("xlink:href", function(word) {
545 return "?"+urlprefix+word; })
546 .attr("class", function(d, i) {
547 var res="";
548 if(data.marked[i]) {
549 res="marked ";
550 }
551 if(data.target.indexOf(" "+d+" ") >= 0) {
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100552 res += "target";
553 }
554 if(data.mergedEnd && data.ranks[i] >= data.mergedEnd) {
555 return res+" merged";
Marc Kupietze6a7a732018-01-12 09:21:08 +0100556 } else {
557 return res;
558 }
559 })
560 .attr("title", function(d, i) {
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100561 return getRankTooltip(i);
Marc Kupietze6a7a732018-01-12 09:21:08 +0100562 })
563 .append("text")
564 .attr("text-anchor", "top")
565 .attr("font-size", 12)
566 .text(function(d) { return d; });
Marc Kupietz34c08172017-11-29 17:08:47 +0100567
Marc Kupietz384c9132018-03-19 16:45:24 +0100568 g.append("svg:title")
569 .text(function(d, i) {
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100570 return getRankTooltip(i);
Marc Kupietz384c9132018-03-19 16:45:24 +0100571 });
572
Marc Kupietze6a7a732018-01-12 09:21:08 +0100573 var zoomListener = d3.behavior.zoom()
574 .scaleExtent([0.1, 10])
575 .center([0,0])
576 .on("zoom", zoomHandler);
577 zoomListener(svg);
Marc Kupietz83305222016-04-28 09:57:22 +0200578 }
579
580 var tx=0, ty=0;
581 var ss=1;
582 var iter_id=-1;
583
584 function zoomHandler() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100585 tx = d3.event.translate[0];
586 ty = d3.event.translate[1];
587 ss = d3.event.scale;
588 updateEmbedding();
Marc Kupietz83305222016-04-28 09:57:22 +0200589 }
590
591 var stepnum = 0;
592
593 function stopStep() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100594 clearInterval(iter_id);
595 text = svg.selectAll("text");
Marc Kupietz34c08172017-11-29 17:08:47 +0100596
Marc Kupietze6a7a732018-01-12 09:21:08 +0100597 // jitter function needs different data and co-ordinate representation
598 labels = d3.range(data.words.length).map(function(i) {
599 var x = (T.Y[i][0]*20*ss + tx) + mapWidth/2;
600 var y = (T.Y[i][1]*20*ss + ty) + mapHeight/2;
601 anchor_array.push({x: x, y: y, r: jitterRadius});
602 return {
603 x: x,
604 y: y,
605 name: data.words[i]
606 };
607 });
Marc Kupietz34c08172017-11-29 17:08:47 +0100608
Marc Kupietze6a7a732018-01-12 09:21:08 +0100609 // get the actual label bounding boxes for the jitter function
610 var index = 0;
611 text.each(function() {
612 labels[index].width = this.getBBox().width;
613 labels[index].height = this.getBBox().height;
614 index += 1;
615 });
Marc Kupietz83305222016-04-28 09:57:22 +0200616
Marc Kupietz34c08172017-11-29 17:08:47 +0100617
Marc Kupietze6a7a732018-01-12 09:21:08 +0100618 // setTimeout(updateEmbedding, 1);
619 // setTimeout(
620 labeler = d3.labeler()
621 .label(labels)
622 .anchor(anchor_array)
623 .width(mapWidth)
624 .height(mapHeight)
625 .update(applyJitter);
626 // .start(1000);
Marc Kupietz83305222016-04-28 09:57:22 +0200627
Marc Kupietze6a7a732018-01-12 09:21:08 +0100628 iter_id = setInterval(jitterStep, 1);
Marc Kupietz83305222016-04-28 09:57:22 +0200629 }
630
631 var jitter_i=0;
632
633 function jitterStep() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100634 if(jitter_i++ > 100) {
635 clearInterval(iter_id);
636 } else {
637 labeler.start2(10);
638 applyJitter();
639 }
Marc Kupietz83305222016-04-28 09:57:22 +0200640 }
641
642 var last_cost=1000;
643
644 function step() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100645 var i = T.iter;
Marc Kupietz34c08172017-11-29 17:08:47 +0100646
Marc Kupietze6a7a732018-01-12 09:21:08 +0100647 if(i > <%= $no_iterations %>) {
648 stopStep();
649 } else {
650 var cost = Math.round(T.step() * 100000) / 100000; // do a few steps
651 $("#cost").html("tsne iteration " + i + ", cost: " + cost.toFixed(5));
652 if(i % 250 == 0 && cost >= last_cost) {
653 stopStep();
Marc Kupietz58270662017-12-04 12:10:06 +0100654 } else {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100655 last_cost = cost;
656 updateEmbedding();
Marc Kupietz58270662017-12-04 12:10:06 +0100657 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100658 }
Marc Kupietz83305222016-04-28 09:57:22 +0200659 }
660
661 function showMap(j) {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100662 data=j;
663 T.iter=0;
664 iter_id = -1;
665 last_cost=1000;
666 T.initDataRaw(data.vecs); // init embedding
667 drawEmbedding(); // draw initial embedding
Marc Kupietz78114532017-11-29 17:00:16 +0100668
Marc Kupietze6a7a732018-01-12 09:21:08 +0100669 if(iter_id >= 0) {
670 clearInterval(iter_id);
671 }
672 //T.debugGrad();
673 iter_id = setInterval(step, 1);
674 if(true) { // (<%= $show_som %>) {
675 makeSOM(j, <%= $no_iterations %>);
676 }
Marc Kupietz83305222016-04-28 09:57:22 +0200677 }
Marc Kupietz39179ab2017-07-04 16:28:06 +0200678 var queryword;
679
Marc Kupietz66bfd952017-12-11 09:59:45 +0100680 function showCollocatorSOM() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100681 if (collocatorTable) {
682 var ctableData = collocatorTable.rows().data();
683 var nwords = [],
684 nranks = [];
685 for (var i=0; i < ctableData.length && i < 100; i++) {
686 nranks.push(ctableData[i].rank);
687 nwords.push(ctableData[i].word);
Marc Kupietz66bfd952017-12-11 09:59:45 +0100688 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100689 $.post('/derekovecs/getVecsByRanks',
690 JSON.stringify(nranks),
691 function(data, status){
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100692 showMap({target: " "+urlParams.get('word')+" ", mergedEnd: <%= $mergedEnd %>, words: nwords, vecs: data, ranks: nranks, marked: Array(100).fill(false)} );
Marc Kupietze6a7a732018-01-12 09:21:08 +0100693 }, 'json');
694 }
Marc Kupietz66bfd952017-12-11 09:59:45 +0100695 }
696
Marc Kupietz39179ab2017-07-04 16:28:06 +0200697 function onload() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100698 queryword = document.getElementById('word');
Marc Kupietz39179ab2017-07-04 16:28:06 +0200699 }
700
701 function queryKorAP() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100702 window.open('http://korap.ids-mannheim.de/kalamar/?q='+queryword.value, 'KorAP');
Marc Kupietz39179ab2017-07-04 16:28:06 +0200703 }
Marc Kupietz4dc270c2017-11-24 10:17:12 +0100704
705 function queryKorAPCII(query) {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100706 window.open('http://korap.ids-mannheim.de/kalamar/?ql=cosmas2&q='+query, 'KorAP');
Marc Kupietz4dc270c2017-11-24 10:17:12 +0100707 }
Marc Kupietz83305222016-04-28 09:57:22 +0200708 </script>
709 </head>
Marc Kupietz39179ab2017-07-04 16:28:06 +0200710 <body onload="onload()">
Marc Kupietz5a7f9ac2018-01-30 11:22:44 +0100711 <div style="display:none;" id="lfmd_ttt">PMI cubed [1], also called log-frequency biased mutual dependency [2]: $$\text{PMI}^3=\text{LFMD}=log_2\frac{p^3(w_1,w_2)}{p(w_1) p(w_2)}$$<p class="citation">[1] Daille, B. (1994): <a href="http://www.bdaille.com/index.php?option=com_docman&task=doc_download&gid=8&Itemid=">Approche mixte pour l’extraction automatique de terminologie: statistiques lexicales et filtres linguistiques</a>. PhD thesis, Université Paris 7.</p><p class="citation">[2] Thanopoulos, A., Fakotakis, N., Kokkinakis, G. (2002): <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.11.8101&rep=rep1&type=pdf">Comparative evaluation of collocation extraction metrics</a>. In: Proc. of LREC 2002: 620–625.</p></div>
Marc Kupietza0ffb392018-01-25 08:53:43 +0100712 <div style="display:none;" id="npmi_ttt">Normalized pointwise mutual information: $$\frac{log_2\frac{p(w_1,w_2)}{p(w_1)p(w_2)}}{-log_2(p(w_1,w_2))}$$<p class="citation">Bouma, Gerlof (2009): <a href="https://svn.spraakdata.gu.se/repos/gerlof/pub/www/Docs/npmi-pfd.pdf">Normalized (pointwise) mutual information in collocation extraction</a>. In Proceedings of GSCL.</p></div>
Marc Kupietz58270662017-12-04 12:10:06 +0100713 <div id="header">
714 <div id="pagetitle">
715 <h1>DeReKo-Vectors</h1>
Marc Kupietz4fcda0c2017-11-29 09:00:31 +0100716 </div>
Marc Kupietz58270662017-12-04 12:10:06 +0100717 <div id="options" class="widget">
718 <form id="queryform">
719 <input id="word" type="text" name="word" placeholder="Word(s) to be searched" value="<%= $word %>"
720 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."/>
721 <input id="SEARCH" type="button" value="SEARCH">
722 <input type="button" id="showoptions" name="showoptions" value="Options" />
723 </form>
724 <div id="dropdownoptions" style="display: none">
725 <form id="optionsform">
726 <div class="controlgroup-vertical">
727 <label for="cutoff">cut-off</label>
728 <input id="cutoff" type="text" name="cutoff" size="10" value="<%= $cutoff %>" title="Only consider the most frequent x word forms.">
729 <label for="dedupe">dedupe</label>
730 <input id="dedupe" type="checkbox" name="dedupe" value="1" <%= ($dedupe ? "checked" : "") %> title="radically filter out any near-duplicates">
731 % if($mergedEnd > 0) {
732 <label for="sbf">backw.</label>
733 <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.">
734 % }
735 <label for="neighbours">max. neighbours:</label>
736 <input id="neighbours" size="4" name="n" value="<%= $no_nbs %>">
737 <label for="no_iterations">max. iterations</label>
738 <input id="no_iterations" name="N" size="4" value="<%= $no_iterations %>">
739 <!-- <label for="dosom">SOM</label>
740 <input id="dosom" type="checkbox" name="som" value="1" <%= ($show_som ? "checked" : "") %>> -->
741 % if($collocators) {
742 <label for="sortby">window/sort</label>
743 <select id="sortby" name="sort">
744 <option value="0" <%= ($sort!=1 && $sort!=2? "selected":"") %>>auto focus</option>
745 <!-- <option value="1" <%= ($sort==1? "selected":"") %>>any single position</option>
746 <option value="2" <%= ($sort==2? "selected":"") %>>whole window</option> -->
747 </select>
748 % }
749 <input type="button" value="→ KorAP" onclick="queryKorAP();" title="query word with KorAP"/>
Marc Kupietz1acb3172018-02-17 09:41:26 +0100750 <input id="show-details" type="checkbox" name="show-details" value="1" >
751 <label for="show-details">
752 Show details
753 </label>
Marc Kupietz58270662017-12-04 12:10:06 +0100754 </div>
755 </form>
756 </div>
757 </div>
758 </div>
759 <div id="topwrapper">
760 <div style="visibility: hidden;" id="tabs">
761 <ul>
762 <li><a href="#tabs-1">Semantics (TSNE-map)</a></li>
763 <li><a href="#tabs-2">Semantics (SOM)</a></li>
764 <li><a href="#tabs-3">Syntagmatic (collocators)</a></li>
765 </ul>
Marc Kupietz384c9132018-03-19 16:45:24 +0100766 <div id="tabs-1" style="display: flex; padding: 5px; flex-flow: row wrap;">
Marc Kupietz58270662017-12-04 12:10:06 +0100767 % if($lists && (@$lists) > 0 && (@$lists)[0]) {
768 <div id="wrapper">
Marc Kupietz384c9132018-03-19 16:45:24 +0100769 <div id="first" style="width: 230px; margin-bottom: 15px;">
Marc Kupietz58270662017-12-04 12:10:06 +0100770 <table class="display compact nowrap" id="firsttable">
771 <thead>
772 <tr>
Marc Kupietz384c9132018-03-19 16:45:24 +0100773 <th align="right">#</th><th align="right">cos</th><th align="left">similars by w2v</th>
Marc Kupietz58270662017-12-04 12:10:06 +0100774 </tr>
775 </thead>
776 <tbody>
777 <tr>
778 <td align="right">
779 </td>
780 <td align="right">
781 </td>
782 <td></td>
783 </tr>
784 </tbody>
785 </table>
786 </div>
Marc Kupietza55a09a2018-07-06 13:30:30 +0200787 % if(0 && $haveSProfiles) {
Marc Kupietz384c9132018-03-19 16:45:24 +0100788 <div id="sprofilesdiv" style="width: 200px; padding-right: 10px;">
789 <table class="display compact nowrap" id="sprofiles">
790 <thead>
791 <tr>
792 <th align="right">cos</th><th align="left">similars by coll. profile</th>
793 </tr>
794 </thead>
795 <tbody>
796 <tr>
797 <td align="right">
798 </td>
799 <td></td>
800 </tr>
801 </tbody>
802 </table>
803 </div>
804 %}
805 <div id="second">
Marc Kupietz58270662017-12-04 12:10:06 +0100806 <div id="embed">
807 </div>
808 <div id="cost">
809 </div>
810 </div>
811 </div>
Marc Kupietz384c9132018-03-19 16:45:24 +0100812 % } elsif($word !~ /^\s*$/) {
813 <div id="wrapper">
814 <div id="not-found-dialog" title="Not found">
815 <p>ERROR: "<%= $word %>" not found in vocabluary.</p>
816 <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>
817 </div>
818 <script>
819 $( function() {
820 $( "#not-found-dialog" ).dialog({
821 autoOpen: true,
822 modal: true,
823 draggable: false,
824 height: "auto",
825 width: "auto",
826 resizable: false,
827 buttons: {
828 "OK": function() {
829 $( this ).dialog( "close" );
830 },
831 "Apply": function() {
832 window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
833 }
834 }
835 });
836 });
837 </script>
838 </div>
839 % }
Marc Kupietz58270662017-12-04 12:10:06 +0100840 </div>
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100841 <div id="tabs-2" style="display: flex; padding: 5px; flex-flow: row wrap;">
Marc Kupietz66bfd952017-12-11 09:59:45 +0100842 <div id="som2" style="width: 800;">
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100843 <div id="sominfo1"><span id="somcolor1"> </span> <span id="somword1"> </span> <span id="somcolor2"> </span> <span id="somword2"> </span> <span id="somcolor3"> </span></div>
844 <div id="sominfo" style="text-align: right">SOM iteration <span id="iterations">0</span></div>
Marc Kupietz58270662017-12-04 12:10:06 +0100845 </div>
Marc Kupietz58270662017-12-04 12:10:06 +0100846 </div>
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100847 <div id="tabs-3" style="display: flex; padding:5px; flex-flow: row wrap;">
848 <div style="margin-right: 20px; margin-bottom: 10px;" id="secondt">
Marc Kupietze6a7a732018-01-12 09:21:08 +0100849 <table class="display compact nowrap" id="secondtable">
Marc Kupietz58270662017-12-04 12:10:06 +0100850 <thead>
851 <tr>
852 % if($collocators) {
853 <th>#</th>
Marc Kupietz4116b432017-12-06 14:15:32 +0100854 <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>
855 <th align="right" title="Maximum activation of the collocator anywhere in the output layer.">max(a)</th>
856 <th title="Average raw activation of the collocator in the columns selected by auto-focus." align="right">⟨a⟩</th>
857 <th title="Sum of activations over the selected colunns normalized by the total activation sum of the selected columns." align="right">Σa/Σw'</th>
858 <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 +0100859 <th title="Sum of the activations over the whole window normalized by the total window sum (no auto-focus)." align="right">Σa/Σw</th>
Marc Kupietz384c9132018-03-19 16:45:24 +0100860 <th align="left">collocator (by w2v)</th>
Marc Kupietz58270662017-12-04 12:10:06 +0100861 % }
862 </tr>
863 </thead>
864 <tbody>
865 <tr>
866 <td align="right">
867 </td>
868 <td align="right">
869 </td>
870 <td align="right">
871 </td>
872 <td align="right">
873 </td>
874 <td align="right">
875 </td>
876 <td align="right">
877 </td>
Marc Kupietz58270662017-12-04 12:10:06 +0100878 </tr>
879 </tbody>
880 </table>
Marc Kupietz66bfd952017-12-11 09:59:45 +0100881 </div>
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100882 <div id="ccd" style="">
Marc Kupietze6a7a732018-01-12 09:21:08 +0100883 <table class="display compact nowrap" id="classicoloctable">
884 <thead>
Marc Kupietzcd136e22018-01-29 09:18:12 +0100885 % if($collocators) {
886 <tr>
887 <th>LLR</th>
Marc Kupietz5a7f9ac2018-01-30 11:22:44 +0100888 <th id="lfmd_tt">PMI³</th>
Marc Kupietzcd136e22018-01-29 09:18:12 +0100889 <th id="npmi_tt">nPMI</th>
Marc Kupietz5a7f9ac2018-01-30 11:22:44 +0100890 <th title="PMI³ restricted to left neighbour">l-PMI³</th>
891 <th title="PMI³ restricted to right neighbour">r-PMI³</th>
892 <th title="nPMI restricted to left neighbour">l-nPMI</th>
893 <th title="nPMI restricted to right neighbour">r-nPMI</th>
Marc Kupietzcd136e22018-01-29 09:18:12 +0100894 <th title="raw max frequency of collocation within window">raw</th>
Marc Kupietz384c9132018-03-19 16:45:24 +0100895 <th>collocator (by collocation analysis)</th>
Marc Kupietzcd136e22018-01-29 09:18:12 +0100896 </tr>
Marc Kupietz1acb3172018-02-17 09:41:26 +0100897 % }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100898 </thead>
899 <tbody>
900 <tr>
901 <td align="right">
902 </td>
903 <td align="right">
904 </td>
905 <td align="right">
906 </td>
907 <td align="right">
908 </td>
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100909 <td align="right">
910 </td>
911 <td align="right">
912 </td>
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100913 <td align="right"></td>
914 <td align="right"></td>
915 <td align="left"></td>
Marc Kupietze6a7a732018-01-12 09:21:08 +0100916 </tr>
917 </tbody>
918 </table>
919 </div>
Marc Kupietz384c9132018-03-19 16:45:24 +0100920 <!--
921 <div style="clear:both" ></div>
922 <div style="float: right; overflow: hidden" id="extra"><button onClick="showCollocatorSOM()"> </button></div>
923 -->
Marc Kupietz66bfd952017-12-11 09:59:45 +0100924 </div>
Marc Kupietz58270662017-12-04 12:10:06 +0100925 </div>
926 </div> <!-- topwrapper -->
927 <div style="clear: both;"></div>
928 </div>
Marc Kupietzebea4702018-01-12 09:16:09 +0100929 % if($training_args && (@$lists)[0]) {
930 <div class="info">
931 % if($training_args =~ /-type\s*3/) {
932 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 %>
933 % } else {
934 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 %>
935 % }
936 </div>
Marc Kupietz83305222016-04-28 09:57:22 +0200937 % }
Marc Kupietz58270662017-12-04 12:10:06 +0100938 </body>
Marc Kupietz83305222016-04-28 09:57:22 +0200939</html>