blob: 76cc8c3974ddaab91b482c3e9f629149ffb9d542 [file] [log] [blame]
Marc Kupietz83305222016-04-28 09:57:22 +02001<!DOCTYPE html>
2<html>
3 <head>
Marc Kupietzc053d972019-01-10 10:41:51 +01004 <% my $plain_title = $title; $plain_title=~s/<[^>]+>//g; %>
5 <title><%= $plain_title %>:<%= $word %> DeReKo-Word-Vector-Distances</title>
Marc Kupietz80bd7b92017-07-04 16:25:54 +02006 <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
Marc Kupietz58270662017-12-04 12:10:06 +01007 <link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Condensed" rel="stylesheet">
Marc Kupietz80bd7b92017-07-04 16:25:54 +02008 <script src="http://code.jquery.com/jquery-latest.min.js"></script>
Marc Kupietz58270662017-12-04 12:10:06 +01009 <script src = "https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
10 <script src = "https://cdn.datatables.net/fixedcolumns/3.2.3/js/dataTables.fixedColumns.min.js"></script>
11 <script src = "https://cdn.datatables.net/plug-ins/1.10.16/sorting/scientific.js"></script>
Marc Kupietza0ffb392018-01-25 08:53:43 +010012 <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 +010013 <link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
Marc Kupietz4949d232018-03-19 16:43:18 +010014 <link rel="stylesheet" href="/derekovecs/css/derekovecs.css">
Marc Kupietz80bd7b92017-07-04 16:25:54 +020015 <script
Marc Kupietze6a7a732018-01-12 09:21:08 +010016 src="http://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
17 integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
18 crossorigin="anonymous"></script>
Marc Kupietz80bd7b92017-07-04 16:25:54 +020019 <script>
Marc Kupietza0ffb392018-01-25 08:53:43 +010020 MathJax.Hub.Config({
21 config: ["MMLorHTML.js"],
22 jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML", "output/PreviewHTML"],
23 extensions: ["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js", "fast-preview.js", "AssistiveMML.js", "a11y/accessibility-menu.js"],
24 TeX: {
25 extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
26 }
27 });
Marc Kupietz58270662017-12-04 12:10:06 +010028 var urlParams = new URLSearchParams(window.location.search);
Marc Kupietzb3a2e4f2017-12-08 17:25:53 +010029 var currentWords = urlParams.get("word");
Marc Kupietza0ffb392018-01-25 08:53:43 +010030 var CIIsearchWords = (currentWords && currentWords.includes(" ") ? '('+currentWords.replace(/ +/g, " oder ")+')' : currentWords);
Marc Kupietz66bfd952017-12-11 09:59:45 +010031 var collocatorTable = null;
Marc Kupietza6e08f02017-12-01 22:06:21 +010032
Marc Kupietz58270662017-12-04 12:10:06 +010033 $(document).ready(function() {
Marc Kupietz694610d2017-11-25 18:30:03 +010034
Marc Kupietza0ffb392018-01-25 08:53:43 +010035 $('#firstable').hide();
36 //Set up a callback to hear back when MathJax is done rendering the equations
37 // it finds
38 $('#ccd').load(
39 '@Url.Action("ActionResultMethod","ControllerName",{controller parameters})',
40 function () {
41 MathJax.Hub.Queue(
42 ["Typeset",MathJax.Hub,"ccd"],
43 function () {
44 $("#lfmd_tt").attr("title",$("#lfmd_ttt").html());
45 $("#npmi_tt").attr("title",$("#npmi_ttt").html());
46 }
47 );
48 });
49
50 //set things up so that we can shove raw html into what is shown in the tooltip;
51 // in this case, we will have already put into the title attribute the html that
52 // contains the MathJax rendered equations (via what we do in the callback).
53 $(function () {
54 $(document).tooltip({
55 content: function () {
56 return $(this).prop('title');
57 }
58 });
59 });
60
Marc Kupietze6a7a732018-01-12 09:21:08 +010061 $("input").bind("keydown", function(event) {
62 // track enter key
63 var keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode));
64 if (keycode == 13) { // keycode for enter key
65 // force the 'Enter Key' to implicitly click the Update button
66 document.getElementById('SEARCH').click();
67 return false;
68 } else {
69 return true;
70 }});
Marc Kupietzdab9f222017-11-29 14:22:59 +010071
Marc Kupietze871abd2018-01-25 16:18:27 +010072 var collocatorTable_activated = false;
Marc Kupietze6a7a732018-01-12 09:21:08 +010073 $( "#tabs" ).on( "tabsactivate", function( event, ui ) {
74 if (localStorage) localStorage['tab'] = ui.newTab.index();
Marc Kupietze871abd2018-01-25 16:18:27 +010075 if(ui.newTab.index() == 2 && !collocatorTable_activated) {
76 classicCollocatorTable.columns.adjust();
77 collocatorTable.columns.adjust();
78 collocatorTable_activated = true;
79 }
Marc Kupietze6a7a732018-01-12 09:21:08 +010080 });
81
82 $(function(){
83 $("#SEARCH").click(function() {
84 window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
Marc Kupietz58270662017-12-04 12:10:06 +010085 });
Marc Kupietze6a7a732018-01-12 09:21:08 +010086 });
Marc Kupietz0af83e32017-11-27 09:31:37 +010087
Marc Kupietze6a7a732018-01-12 09:21:08 +010088 function changeCharColor(txt, heat, word) {
89 var newText = "";
90 for (var i=0, l=txt.length; i<l; i++) {
91 newText += (i == 5 ? txt.charAt(i) : '<a href="http://korap.ids-mannheim.de/kalamar/?ql=cosmas2&q=' +
92 CIIsearchWords + ' /' + (i > 5? '%2B' : '-') + 'w' +
93 Math.abs(i-5) + ':' + Math.abs(i-5) + ' ' + word +
94 '" target="korap"><span style="background-color:' +
95 getHeatColor(heat[i]/maxHeat)+'">'+txt.charAt(i)+'</span></a>');
Marc Kupietzb6c615d2017-12-02 10:38:20 +010096 }
Marc Kupietze6a7a732018-01-12 09:21:08 +010097 return newText;
98 }
Marc Kupietzb6c615d2017-12-02 10:38:20 +010099
Marc Kupietze6a7a732018-01-12 09:21:08 +0100100 function getHeatColor(value) {
101 var hue=((1-value)*120).toString(10);
102 return ["hsl(",hue,",90%,70%)"].join("");
103 }
104
105 function bitvec2window(n, heat, word) {
106 var str = n.toString(2).padStart(10, "0")
107 .replace(/^([0-9]{5})/, '$1x')
108 .replace(/0/g, '·')
109 .replace(/1/g, '+');
110 return changeCharColor(str, heat, word);
111 }
112
113 % use Mojo::ByteStream 'b';
114 var paraResults = <%= b(Mojo::JSON::to_json($lists)) %>;
115 var urlprefix = new URLSearchParams(window.location.search);
116 if (paraResults.length > 0 && paraResults[0] != null) {
117 var nvecs = [],
118 nwords = [],
119 nranks = [],
120 nmarked = [];
121 for(var i = 0; i < paraResults.length; i++) {
122 nwords = nwords.concat(paraResults[i].map(function(a){return a.word;}));
123 nvecs = nvecs.concat(paraResults[i].map(function(a){return a.vector;}));
124 nranks = nranks.concat(paraResults[i].map(function(a){return a.rank;}));
125 nmarked = nmarked.concat(paraResults[i].map(function(a){return a.marked;}));
Marc Kupietz0d4c0ca2017-12-04 09:18:56 +0100126 }
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100127 showMap({target: " "+urlParams.get('word')+" ", mergedEnd: <%= $mergedEnd %>, words: nwords, vecs: nvecs, ranks: nranks, marked: nmarked} );
Marc Kupietze6a7a732018-01-12 09:21:08 +0100128 var t = $('#firsttable').DataTable({
Marc Kupietzee894d52019-01-09 14:55:14 +0100129 data: [].concat.apply([], paraResults),
Marc Kupietze6a7a732018-01-12 09:21:08 +0100130 "sScrollY": "780px",
131 "bScrollCollapse": true,
132 "bPaginate": false,
133 "bJQueryUI": true,
134 "dom": '<"top">rt<"bottom"flp><"clear">',
Marc Kupietz384c9132018-03-19 16:45:24 +0100135 "initComplete":function(settings, json) {
136 $('td.paradigmator a').on('mousedown', function(e) {
137 return paradigmatorClick(e, paraResults[0][0].word, this.childNodes["0"].textContent);
138 });
139 },
Marc Kupietze6a7a732018-01-12 09:21:08 +0100140 "columns": [
141 { "data": "rank", type: "allnumeric" },
142 { "data": "dist", render: function ( data, type, row ) {return data.toFixed(3) }},
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100143 { "data": "word", class: "paradigmator", render: function ( data, type, row ) {
144 urlprefix.set("word", data); return '<a class="' + getMergedClass(row.rank) + '" href="?' + urlprefix + '">' + data + '</a>'
145 }}
Marc Kupietze6a7a732018-01-12 09:21:08 +0100146 ],
147 "columnDefs": [
148 { className: "dt-right", "targets": [0,1] },
149 { "searchable": false,
150 "orderable": false,
151 "targets": 0
152 },
153 { "orderSequence": [ "desc" ], "targets": [ 1 ] },
154 { "orderSequence": [ "asc", "desc" ], "targets": [ 2 ] },
155 ],
156 "oLanguage": {
157 "sSearch": "Filter: "
158 },
159 "order": [[ 1, 'desc' ]],
160 } );
Marc Kupietz0d4c0ca2017-12-04 09:18:56 +0100161
Marc Kupietze6a7a732018-01-12 09:21:08 +0100162 t.on( 'order.dt search.dt', function () {
163 t.column(0, {order:'applied'}).nodes().each( function (cell, i) {
164 cell.innerHTML = i+1;
165 } );
166 } ).draw();
167
168 $( "#first" ).clone().prependTo( "#tabs-2" );
169
170 }
171
172
173 var collocatorData = <%= b(Mojo::JSON::to_json($collocators)) %>;
174 var maxHeat; // = Math.max.apply(Math,collocatorData.map(function(o){return o.cprob;}))
175
176 if (collocatorData != null) {
177 maxHeat = Math.max.apply(Math,collocatorData.map(function(o){return Math.max.apply(Math,o.heat);}))
178 collocatorTable = $('#secondtable').DataTable({
179 data: collocatorData,
180 "sScrollY": "780px",
181 "bScrollCollapse": true,
182 "bPaginate": false,
183 "bJQueryUI": true,
184 "dom": '<"top">rt<"bottom"flp><"clear">',
185 "columns": [
186 { "data": "rank", type: "allnumeric" },
187 { "data": "pos", width: "7%", sClass: "dt-center mono compact", render: function ( data, type, row ) {return bitvec2window(data, row.heat, row.word) }},
188 { "data": "max", render: function ( data, type, row ) {return data.toFixed(3) }},
189 { "data": "average", render: function ( data, type, row ) {return data.toFixed(3) }},
190 { "data": "prob", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } },
191 { "data": "cprob", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } },
192 { "data": "overall", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } },
193 { "data": "word", sClass: "collocator" },
194 { "data": "rank", type: "allnumeric" }
195 ],
196 "columnDefs": [
197 { className: "dt-right", "targets": [0,2,3,4,5,6] },
198 { className: "dt-center", "targets": [ 1] },
199 { "searchable": false,
200 "orderable": false,
201 "targets": [0, 8]
202 },
203 { "type": "scientific", targets: [2,3,4,5,6] },
204 { "orderSequence": [ "desc" ], "targets": [ 2, 3, 4, 5, 6 ] },
205 { "orderSequence": [ "asc", "desc" ], "targets": [ 1, 7 ] },
206 { "targets": [8], "visible": false }
207 ],
208 "oLanguage": {
209 "sSearch": "Filter: "
210 },
211 "order": [[ 4, 'desc' ]],
212 } );
213 $.ajaxSetup({
214 type: 'POST',
215 timeout: 30000,
216 error: function(xhr) {
217 $('#display_error')
218 .html('Error: ' + xhr.status + ' ' + xhr.statusText);
219 }
Marc Kupietz78b434a2018-01-12 22:33:32 +0100220 });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100221
Marc Kupietz384c9132018-03-19 16:45:24 +0100222
223 if($('#sprofiles').length) {
224 similarProfileTable = $('#sprofiles').DataTable({
225 ajax: {
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100226 method: "GET",
Marc Kupietz384c9132018-03-19 16:45:24 +0100227 url: '/derekovecs/getSimilarProfiles',
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100228 dataType: 'json',
229 dataSrc: "",
230 timeout: 30000,
231 data: { w: paraResults[0][0].rank }
Marc Kupietz384c9132018-03-19 16:45:24 +0100232 },
233 "initComplete":function(settings, json){
234 $('td.paradigmator a').on('mousedown', function(e) {
235 if (e.which === 2) {
236 e.preventDefault();
237 queryKorAPalternatives(paraResults[0][0].word, this.childNodes["0"].textContent);
238 return false;
239 }
240 });
241 },
242 "sScrollY": "780px",
243 "bScrollCollapse": true,
244 "bPaginate": false,
245 "bJQueryUI": true,
246 "dom": '<"top">rt<"bottom"flp><"clear">',
247 "columns": [
248 { "data": "v", render: function ( data, type, row ) {return data.toFixed(3) }},
249 { "data": "w", sClass: "paradigmator", render: function ( data, type, row ) {urlprefix.set("word", data); return '<a href="?' + urlprefix + '">' + data + '</a>' } }
250 ],
251 "columnDefs": [
252 { className: "dt-right", "targets": [0] },
253 ],
254 "oLanguage": {
255 "sSearch": "Filter: "
256 },
257 "order": [[ 0, 'desc' ]],
258 });
259 }
260 // var filterQuot = /(^quot?=[A-Z])|(quot$)/g;
261 var filterQuot = /^quot/;
262 classicCollocatorTable = $('#classicoloctable').DataTable({
263 ajax: {
264 method: "GET",
265 url: '/derekovecs/getClassicCollocators',
266 dataType: 'json',
267 dataSrc: "",
268 timeout: 30000,
269 data: { w: paraResults[0][0].rank }
Marc Kupietz78b434a2018-01-12 22:33:32 +0100270 },
Marc Kupietzad783722018-01-13 17:45:21 +0100271 "initComplete":function(settings, json){
272 $("td.collocator").click(function(){
273 queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords);
274 });
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100275 classicCollocatorTable.columns(".detail").visible(false);
276 $("#ccd").css('width', '450px');
277 classicCollocatorTable.columns.adjust().draw();
Marc Kupietzad783722018-01-13 17:45:21 +0100278 },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100279 "sScrollY": "780px",
280 "bScrollCollapse": true,
281 "bPaginate": false,
282 "bJQueryUI": true,
283 "dom": '<"top">rt<"bottom"flp><"clear">',
284 "columns": [
285 // { "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 +0100286 { "data": "llr", render: function ( data, type, row ) {return data.toFixed(0) }},
287 { "data": "lfmd", render: function ( data, type, row ) {return data.toFixed(1) }},
Marc Kupietz1acb3172018-02-17 09:41:26 +0100288 // { "data": "fpmi", type: "scientific", render: function ( data, type, row ) {return data.toExponential(2) } },
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100289 { "data": "npmi", render: function ( data, type, row ) {return data.toFixed(2) }},
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100290 { "data": "llfmd", render: function ( data, type, row ) {return data.toFixed(1) }},
291 { "data": "rlfmd", render: function ( data, type, row ) {return data.toFixed(1) }},
292 { "data": "lnpmi", render: function ( data, type, row ) {return data.toFixed(2) }},
293 { "data": "rnpmi", render: function ( data, type, row ) {return data.toFixed(2) }},
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100294 { "data": "f" },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100295 { "data": "word", sClass: "collocator" }
296 ],
297 "columnDefs": [
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100298 { className: "dt-right", "targets": [0,1,2,3,4,5,6,7] },
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100299 { className: "dt-right detail", "targets": [3,4,5,6] },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100300 { "searchable": false,
301 "orderable": false,
302 "targets": []
303 },
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100304 { "orderSequence": [ "desc" ], "targets": [ 0, 1, 2,3,4,5,6,7 ] },
305 { "orderSequence": [ "asc", "desc" ], "targets": [ 8 ] },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100306 ],
307 "oLanguage": {
308 "sSearch": "Filter: "
309 },
310 "order": [[ 1, 'desc' ]],
311 });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100312
Marc Kupietz1acb3172018-02-17 09:41:26 +0100313
314 $('#show-details').change(function (e) {
315 var columns = classicCollocatorTable.columns(".detail");
316 if(this.checked) {
317 columns.visible(true);
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100318 $("#ccd").css('width', 'auto');
Marc Kupietz1acb3172018-02-17 09:41:26 +0100319 } else {
320 columns.visible(false);
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100321 $("#ccd").css('width', '450px');
Marc Kupietz1acb3172018-02-17 09:41:26 +0100322 }
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100323 classicCollocatorTable.columns.adjust().draw();
Marc Kupietz1acb3172018-02-17 09:41:26 +0100324 } );
325
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100326 $("td.collocator").click(function(){
327 queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords);
Marc Kupietzad783722018-01-13 17:45:21 +0100328 });
329
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100330 collocatorTable.on( 'order.dt search.dt', function () {
331 collocatorTable.column(0, {order:'applied'}).nodes().each( function (cell, i) {
332 cell.innerHTML = i+1;
333 } );
334 }).draw();
335 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100336
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100337 if (localStorage && !window.location.hash) { // let's not crash if some user has IE7
338 var index = parseInt(localStorage['tab']||'0');
339 $("#tabs").tabs({ active: index });
340 }
341 $("#tabs").css("visibility", "visible"); // now we can show the tabs
342 });
Marc Kupietz58270662017-12-04 12:10:06 +0100343
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100344 $(function(){
345 $("#dropdownoptions").dialog({
346 title: "Options",
347 autoOpen: false,
348 modal: false,
349 draggable: false,
350 height: "auto",
351 width: "auto",
352 resizable: false,
353 buttons: {
354 "Cancel": function() {
355 $( this ).dialog( "close" );
Marc Kupietze6a7a732018-01-12 09:21:08 +0100356 },
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100357 "Apply": function() {
358 window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
Marc Kupietze6a7a732018-01-12 09:21:08 +0100359 }
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100360 }
361 });
362 });
363
364 $(function(){
365 $("#showoptions").click(function(){
366 $("#dropdownoptions").dialog("open");
367 var target = $(this);
368 $("#dropdownoptions").dialog("widget").position({
369 my: 'left bottom',
370 at: 'left bottom',
371 of: target
Marc Kupietz58270662017-12-04 12:10:06 +0100372 });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100373 });
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100374 });
375
376 $( function() {
377 $( "#no_iterations" ).spinner({
378 spin: function( event, ui ) {
379 if ( ui.value < 1000 ) {
380 $( this ).spinner( "value", 1000 );
381 return false;
382 } else if ( ui.value > 10000 ) {
383 $( this ).spinner( "value", 10000 );
384 return false;
385 }
386 }
387 });
388 } );
389
390 $( function() {
391 $( "#neighbours" ).spinner({
392 spin: function( event, ui ) {
393 if ( ui.value < 0 ) {
394 $( this ).spinner( "value", 0 );
395 return false;
396 } else if ( ui.value > 200 ) {
397 $( this ).spinner( "value", 200 );
398 return false;
399 }
400 }
401 });
402 } );
403
404 $( function() {
405 $( "#cutoff" ).spinner({
406 spin: function( event, ui ) {
407 if ( ui.value < 100000 ) {
408 $( this ).spinner( "value", 100000 );
409 return false;
410 } else if ( ui.value > 2000000 ) {
411 $( this ).spinner( "value", 2000000 );
412 return false;
413 }
414 }
415 });
416 } );
417
418 $( function() {
419 $( "#tabs" ).tabs().addClass('tabs-min');
420 } );
421
422 $( function() {
423 $( ".controlgroup-vertical" ).controlgroup({
424 "direction": "vertical"
425 });
426 } );
427
428 $(function() {
429 $( document ).tooltip({
430 content: function() {
431 return $(this).attr('title');
432 }}
433 )
434 });
435
436 $(function () {
437 $(document).tooltip({
438 content: function () {
439 return $(this).prop('title');
440 },
441 show: null,
442 close: function (event, ui) {
443 ui.tooltip.hover(
444 function () {
445 $(this).stop(true).fadeTo(400, 1);
446 },
447 function () {
448 $(this).fadeOut("400", function () {
449 $(this).remove();
450 })
451 });
452 }
453 });
454 });
Marc Kupietz83305222016-04-28 09:57:22 +0200455 </script>
Marc Kupietz58270662017-12-04 12:10:06 +0100456 <script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script>
457 <script src="/derekovecs/js/tsne.js"></script>
458 <script src="/derekovecs/js/som.js"></script>
459 <script src="/derekovecs/js/labeler.js"></script>
Marc Kupietzcdd51302018-03-19 16:36:54 +0100460 <script src="/derekovecs/js/derekovcs.js"></script>
Marc Kupietz83305222016-04-28 09:57:22 +0200461 <script>
462
463 var opt = {epsilon: <%= $epsilon %>, perplexity: <%= $perplexity %>},
Marc Kupietz58270662017-12-04 12:10:06 +0100464 mapWidth = 800, // width map
465 mapHeight = 800,
466 jitterRadius = 7;
Marc Kupietz83305222016-04-28 09:57:22 +0200467
468 var T = new tsnejs.tSNE(opt); // create a tSNE instance
469
470 var Y;
471
472 var data;
473 var labeler;
474
475 function applyJitter() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100476 svg.selectAll('.tsnet')
477 .data(labels)
478 .transition()
479 .duration(50)
480 .attr("transform", function(d, i) {
481 T.Y[i][0] = (d.x - mapWidth/2 - tx)/ss/20;
482 T.Y[i][1] = (d.y - mapHeight/2 - ty)/ss/20;
483 return "translate(" +
Marc Kupietz384c9132018-03-19 16:45:24 +0100484 (d.x) + "," +
485 (d.y) + ")";
Marc Kupietze6a7a732018-01-12 09:21:08 +0100486 });
Marc Kupietz83305222016-04-28 09:57:22 +0200487 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100488
Marc Kupietz83305222016-04-28 09:57:22 +0200489 function updateEmbedding() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100490 var Y = T.getSolution();
491 svg.selectAll('.tsnet')
492 .data(data.words)
493 .attr("transform", function(d, i) {
494 return "translate(" +
Marc Kupietz384c9132018-03-19 16:45:24 +0100495 ((Y[i][0]*20*ss + tx) + mapWidth/2) + "," +
496 ((Y[i][1]*20*ss + ty) + mapHeight/2) + ")"; });
Marc Kupietz83305222016-04-28 09:57:22 +0200497 }
498
499 var svg;
500 var labels = [];
501 var anchor_array = [];
502 var text;
503
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100504 function getMergedClass(i) {
505 if(data.mergedEnd && i > data.mergedEnd) {
506 return " merged"
507 } else {
508 return "";
509 }
510 }
511
512 function getRankTooltip(i) {
513 if(data.mergedEnd) {
514 if(data.ranks[i] < data.mergedEnd) {
515 return "rank: "+i +" "+"freq. rank: "+(data.ranks[i]).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
516 } else {
517 return "rank: "+i +" "+"freq. rank: "+(data.ranks[i]-data.mergedEnd).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + " (merged vocab)";
518 }
519 } else {
520 return "rank: "+i +" "+"freq. rank: "+data.ranks[i].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
521 }
522 }
523
Marc Kupietz83305222016-04-28 09:57:22 +0200524 function drawEmbedding() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100525 var urlprefix = new URLSearchParams(window.location.search);
526 urlprefix.delete("word");
527 urlprefix.append("word","");
Marc Kupietz8f9c86a2017-12-04 17:17:13 +0100528
Marc Kupietze6a7a732018-01-12 09:21:08 +0100529 $("#embed").empty();
530 var div = d3.select("#embed");
Marc Kupietz34c08172017-11-29 17:08:47 +0100531
Marc Kupietze6a7a732018-01-12 09:21:08 +0100532 // get min and max in each column of Y
533 var Y = T.Y;
Marc Kupietz34c08172017-11-29 17:08:47 +0100534
Marc Kupietze6a7a732018-01-12 09:21:08 +0100535 svg = div.append("svg") // svg is global
536 .attr("width", mapWidth)
537 .attr("height", mapHeight);
Marc Kupietz34c08172017-11-29 17:08:47 +0100538
Marc Kupietze6a7a732018-01-12 09:21:08 +0100539 var g = svg.selectAll(".b")
540 .data(data.words)
541 .enter().append("g")
542 .attr("class", "tsnet");
Marc Kupietz34c08172017-11-29 17:08:47 +0100543
Marc Kupietze6a7a732018-01-12 09:21:08 +0100544 g.append("a")
545 .attr("xlink:href", function(word) {
546 return "?"+urlprefix+word; })
547 .attr("class", function(d, i) {
548 var res="";
549 if(data.marked[i]) {
550 res="marked ";
551 }
552 if(data.target.indexOf(" "+d+" ") >= 0) {
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100553 res += "target";
554 }
555 if(data.mergedEnd && data.ranks[i] >= data.mergedEnd) {
556 return res+" merged";
Marc Kupietze6a7a732018-01-12 09:21:08 +0100557 } else {
558 return res;
559 }
560 })
561 .attr("title", function(d, i) {
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100562 return getRankTooltip(i);
Marc Kupietze6a7a732018-01-12 09:21:08 +0100563 })
564 .append("text")
565 .attr("text-anchor", "top")
566 .attr("font-size", 12)
567 .text(function(d) { return d; });
Marc Kupietz34c08172017-11-29 17:08:47 +0100568
Marc Kupietz384c9132018-03-19 16:45:24 +0100569 g.append("svg:title")
570 .text(function(d, i) {
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100571 return getRankTooltip(i);
Marc Kupietz384c9132018-03-19 16:45:24 +0100572 });
573
Marc Kupietze6a7a732018-01-12 09:21:08 +0100574 var zoomListener = d3.behavior.zoom()
575 .scaleExtent([0.1, 10])
576 .center([0,0])
577 .on("zoom", zoomHandler);
578 zoomListener(svg);
Marc Kupietz83305222016-04-28 09:57:22 +0200579 }
580
581 var tx=0, ty=0;
582 var ss=1;
583 var iter_id=-1;
584
585 function zoomHandler() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100586 tx = d3.event.translate[0];
587 ty = d3.event.translate[1];
588 ss = d3.event.scale;
589 updateEmbedding();
Marc Kupietz83305222016-04-28 09:57:22 +0200590 }
591
592 var stepnum = 0;
593
594 function stopStep() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100595 clearInterval(iter_id);
596 text = svg.selectAll("text");
Marc Kupietz34c08172017-11-29 17:08:47 +0100597
Marc Kupietze6a7a732018-01-12 09:21:08 +0100598 // jitter function needs different data and co-ordinate representation
599 labels = d3.range(data.words.length).map(function(i) {
600 var x = (T.Y[i][0]*20*ss + tx) + mapWidth/2;
601 var y = (T.Y[i][1]*20*ss + ty) + mapHeight/2;
602 anchor_array.push({x: x, y: y, r: jitterRadius});
603 return {
604 x: x,
605 y: y,
606 name: data.words[i]
607 };
608 });
Marc Kupietz34c08172017-11-29 17:08:47 +0100609
Marc Kupietze6a7a732018-01-12 09:21:08 +0100610 // get the actual label bounding boxes for the jitter function
611 var index = 0;
612 text.each(function() {
613 labels[index].width = this.getBBox().width;
614 labels[index].height = this.getBBox().height;
615 index += 1;
616 });
Marc Kupietz83305222016-04-28 09:57:22 +0200617
Marc Kupietz34c08172017-11-29 17:08:47 +0100618
Marc Kupietze6a7a732018-01-12 09:21:08 +0100619 // setTimeout(updateEmbedding, 1);
620 // setTimeout(
621 labeler = d3.labeler()
622 .label(labels)
623 .anchor(anchor_array)
624 .width(mapWidth)
625 .height(mapHeight)
626 .update(applyJitter);
627 // .start(1000);
Marc Kupietz83305222016-04-28 09:57:22 +0200628
Marc Kupietze6a7a732018-01-12 09:21:08 +0100629 iter_id = setInterval(jitterStep, 1);
Marc Kupietz83305222016-04-28 09:57:22 +0200630 }
631
632 var jitter_i=0;
633
634 function jitterStep() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100635 if(jitter_i++ > 100) {
636 clearInterval(iter_id);
637 } else {
638 labeler.start2(10);
639 applyJitter();
640 }
Marc Kupietz83305222016-04-28 09:57:22 +0200641 }
642
643 var last_cost=1000;
644
645 function step() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100646 var i = T.iter;
Marc Kupietz34c08172017-11-29 17:08:47 +0100647
Marc Kupietze6a7a732018-01-12 09:21:08 +0100648 if(i > <%= $no_iterations %>) {
649 stopStep();
650 } else {
651 var cost = Math.round(T.step() * 100000) / 100000; // do a few steps
652 $("#cost").html("tsne iteration " + i + ", cost: " + cost.toFixed(5));
653 if(i % 250 == 0 && cost >= last_cost) {
654 stopStep();
Marc Kupietz58270662017-12-04 12:10:06 +0100655 } else {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100656 last_cost = cost;
657 updateEmbedding();
Marc Kupietz58270662017-12-04 12:10:06 +0100658 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100659 }
Marc Kupietz83305222016-04-28 09:57:22 +0200660 }
661
662 function showMap(j) {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100663 data=j;
664 T.iter=0;
665 iter_id = -1;
666 last_cost=1000;
667 T.initDataRaw(data.vecs); // init embedding
668 drawEmbedding(); // draw initial embedding
Marc Kupietz78114532017-11-29 17:00:16 +0100669
Marc Kupietze6a7a732018-01-12 09:21:08 +0100670 if(iter_id >= 0) {
671 clearInterval(iter_id);
672 }
673 //T.debugGrad();
674 iter_id = setInterval(step, 1);
675 if(true) { // (<%= $show_som %>) {
676 makeSOM(j, <%= $no_iterations %>);
677 }
Marc Kupietz83305222016-04-28 09:57:22 +0200678 }
Marc Kupietz39179ab2017-07-04 16:28:06 +0200679 var queryword;
680
Marc Kupietz66bfd952017-12-11 09:59:45 +0100681 function showCollocatorSOM() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100682 if (collocatorTable) {
683 var ctableData = collocatorTable.rows().data();
684 var nwords = [],
685 nranks = [];
686 for (var i=0; i < ctableData.length && i < 100; i++) {
687 nranks.push(ctableData[i].rank);
688 nwords.push(ctableData[i].word);
Marc Kupietz66bfd952017-12-11 09:59:45 +0100689 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100690 $.post('/derekovecs/getVecsByRanks',
691 JSON.stringify(nranks),
692 function(data, status){
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100693 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 +0100694 }, 'json');
695 }
Marc Kupietz66bfd952017-12-11 09:59:45 +0100696 }
697
Marc Kupietz39179ab2017-07-04 16:28:06 +0200698 function onload() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100699 queryword = document.getElementById('word');
Marc Kupietz39179ab2017-07-04 16:28:06 +0200700 }
701
702 function queryKorAP() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100703 window.open('http://korap.ids-mannheim.de/kalamar/?q='+queryword.value, 'KorAP');
Marc Kupietz39179ab2017-07-04 16:28:06 +0200704 }
Marc Kupietz4dc270c2017-11-24 10:17:12 +0100705
706 function queryKorAPCII(query) {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100707 window.open('http://korap.ids-mannheim.de/kalamar/?ql=cosmas2&q='+query, 'KorAP');
Marc Kupietz4dc270c2017-11-24 10:17:12 +0100708 }
Marc Kupietz83305222016-04-28 09:57:22 +0200709 </script>
710 </head>
Marc Kupietz39179ab2017-07-04 16:28:06 +0200711 <body onload="onload()">
Marc Kupietz5a7f9ac2018-01-30 11:22:44 +0100712 <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 +0100713 <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 +0100714 <div id="header">
715 <div id="pagetitle">
Marc Kupietzc053d972019-01-10 10:41:51 +0100716 <h1>DeReKoVecs</h1>
717 <h2><%== $title %></h2>
Marc Kupietz4fcda0c2017-11-29 09:00:31 +0100718 </div>
Marc Kupietz58270662017-12-04 12:10:06 +0100719 <div id="options" class="widget">
720 <form id="queryform">
721 <input id="word" type="text" name="word" placeholder="Word(s) to be searched" value="<%= $word %>"
722 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."/>
723 <input id="SEARCH" type="button" value="SEARCH">
724 <input type="button" id="showoptions" name="showoptions" value="Options" />
725 </form>
726 <div id="dropdownoptions" style="display: none">
727 <form id="optionsform">
728 <div class="controlgroup-vertical">
729 <label for="cutoff">cut-off</label>
730 <input id="cutoff" type="text" name="cutoff" size="10" value="<%= $cutoff %>" title="Only consider the most frequent x word forms.">
731 <label for="dedupe">dedupe</label>
732 <input id="dedupe" type="checkbox" name="dedupe" value="1" <%= ($dedupe ? "checked" : "") %> title="radically filter out any near-duplicates">
733 % if($mergedEnd > 0) {
734 <label for="sbf">backw.</label>
735 <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.">
736 % }
737 <label for="neighbours">max. neighbours:</label>
738 <input id="neighbours" size="4" name="n" value="<%= $no_nbs %>">
739 <label for="no_iterations">max. iterations</label>
740 <input id="no_iterations" name="N" size="4" value="<%= $no_iterations %>">
741 <!-- <label for="dosom">SOM</label>
742 <input id="dosom" type="checkbox" name="som" value="1" <%= ($show_som ? "checked" : "") %>> -->
743 % if($collocators) {
744 <label for="sortby">window/sort</label>
745 <select id="sortby" name="sort">
746 <option value="0" <%= ($sort!=1 && $sort!=2? "selected":"") %>>auto focus</option>
747 <!-- <option value="1" <%= ($sort==1? "selected":"") %>>any single position</option>
748 <option value="2" <%= ($sort==2? "selected":"") %>>whole window</option> -->
749 </select>
750 % }
751 <input type="button" value="→ KorAP" onclick="queryKorAP();" title="query word with KorAP"/>
Marc Kupietz1acb3172018-02-17 09:41:26 +0100752 <input id="show-details" type="checkbox" name="show-details" value="1" >
753 <label for="show-details">
754 Show details
755 </label>
Marc Kupietz58270662017-12-04 12:10:06 +0100756 </div>
757 </form>
758 </div>
759 </div>
760 </div>
761 <div id="topwrapper">
762 <div style="visibility: hidden;" id="tabs">
763 <ul>
764 <li><a href="#tabs-1">Semantics (TSNE-map)</a></li>
765 <li><a href="#tabs-2">Semantics (SOM)</a></li>
766 <li><a href="#tabs-3">Syntagmatic (collocators)</a></li>
767 </ul>
Marc Kupietz384c9132018-03-19 16:45:24 +0100768 <div id="tabs-1" style="display: flex; padding: 5px; flex-flow: row wrap;">
Marc Kupietz58270662017-12-04 12:10:06 +0100769 % if($lists && (@$lists) > 0 && (@$lists)[0]) {
770 <div id="wrapper">
Marc Kupietz384c9132018-03-19 16:45:24 +0100771 <div id="first" style="width: 230px; margin-bottom: 15px;">
Marc Kupietz58270662017-12-04 12:10:06 +0100772 <table class="display compact nowrap" id="firsttable">
773 <thead>
774 <tr>
Marc Kupietz384c9132018-03-19 16:45:24 +0100775 <th align="right">#</th><th align="right">cos</th><th align="left">similars by w2v</th>
Marc Kupietz58270662017-12-04 12:10:06 +0100776 </tr>
777 </thead>
778 <tbody>
779 <tr>
780 <td align="right">
781 </td>
782 <td align="right">
783 </td>
784 <td></td>
785 </tr>
786 </tbody>
787 </table>
788 </div>
Marc Kupietza55a09a2018-07-06 13:30:30 +0200789 % if(0 && $haveSProfiles) {
Marc Kupietz384c9132018-03-19 16:45:24 +0100790 <div id="sprofilesdiv" style="width: 200px; padding-right: 10px;">
791 <table class="display compact nowrap" id="sprofiles">
792 <thead>
793 <tr>
794 <th align="right">cos</th><th align="left">similars by coll. profile</th>
795 </tr>
796 </thead>
797 <tbody>
798 <tr>
799 <td align="right">
800 </td>
801 <td></td>
802 </tr>
803 </tbody>
804 </table>
805 </div>
806 %}
807 <div id="second">
Marc Kupietz58270662017-12-04 12:10:06 +0100808 <div id="embed">
809 </div>
810 <div id="cost">
811 </div>
812 </div>
813 </div>
Marc Kupietz384c9132018-03-19 16:45:24 +0100814 % } elsif($word !~ /^\s*$/) {
815 <div id="wrapper">
816 <div id="not-found-dialog" title="Not found">
817 <p>ERROR: "<%= $word %>" not found in vocabluary.</p>
818 <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>
819 </div>
820 <script>
821 $( function() {
822 $( "#not-found-dialog" ).dialog({
823 autoOpen: true,
824 modal: true,
825 draggable: false,
826 height: "auto",
827 width: "auto",
828 resizable: false,
829 buttons: {
830 "OK": function() {
831 $( this ).dialog( "close" );
832 },
833 "Apply": function() {
834 window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
835 }
836 }
837 });
838 });
839 </script>
840 </div>
841 % }
Marc Kupietz58270662017-12-04 12:10:06 +0100842 </div>
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100843 <div id="tabs-2" style="display: flex; padding: 5px; flex-flow: row wrap;">
Marc Kupietz66bfd952017-12-11 09:59:45 +0100844 <div id="som2" style="width: 800;">
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100845 <div id="sominfo1"><span id="somcolor1"> </span> <span id="somword1"> </span> <span id="somcolor2"> </span> <span id="somword2"> </span> <span id="somcolor3"> </span></div>
846 <div id="sominfo" style="text-align: right">SOM iteration <span id="iterations">0</span></div>
Marc Kupietz58270662017-12-04 12:10:06 +0100847 </div>
Marc Kupietz58270662017-12-04 12:10:06 +0100848 </div>
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100849 <div id="tabs-3" style="display: flex; padding:5px; flex-flow: row wrap;">
850 <div style="margin-right: 20px; margin-bottom: 10px;" id="secondt">
Marc Kupietze6a7a732018-01-12 09:21:08 +0100851 <table class="display compact nowrap" id="secondtable">
Marc Kupietz58270662017-12-04 12:10:06 +0100852 <thead>
853 <tr>
854 % if($collocators) {
855 <th>#</th>
Marc Kupietz4116b432017-12-06 14:15:32 +0100856 <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>
857 <th align="right" title="Maximum activation of the collocator anywhere in the output layer.">max(a)</th>
858 <th title="Average raw activation of the collocator in the columns selected by auto-focus." align="right">⟨a⟩</th>
859 <th title="Sum of activations over the selected colunns normalized by the total activation sum of the selected columns." align="right">Σa/Σw'</th>
860 <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 +0100861 <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 +0100862 <th align="left">collocator (by w2v)</th>
Marc Kupietz58270662017-12-04 12:10:06 +0100863 % }
864 </tr>
865 </thead>
866 <tbody>
867 <tr>
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>
878 <td align="right">
879 </td>
Marc Kupietz58270662017-12-04 12:10:06 +0100880 </tr>
881 </tbody>
882 </table>
Marc Kupietz66bfd952017-12-11 09:59:45 +0100883 </div>
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100884 <div id="ccd" style="">
Marc Kupietze6a7a732018-01-12 09:21:08 +0100885 <table class="display compact nowrap" id="classicoloctable">
886 <thead>
Marc Kupietzcd136e22018-01-29 09:18:12 +0100887 % if($collocators) {
888 <tr>
889 <th>LLR</th>
Marc Kupietz5a7f9ac2018-01-30 11:22:44 +0100890 <th id="lfmd_tt">PMI³</th>
Marc Kupietzcd136e22018-01-29 09:18:12 +0100891 <th id="npmi_tt">nPMI</th>
Marc Kupietz5a7f9ac2018-01-30 11:22:44 +0100892 <th title="PMI³ restricted to left neighbour">l-PMI³</th>
893 <th title="PMI³ restricted to right neighbour">r-PMI³</th>
894 <th title="nPMI restricted to left neighbour">l-nPMI</th>
895 <th title="nPMI restricted to right neighbour">r-nPMI</th>
Marc Kupietzcd136e22018-01-29 09:18:12 +0100896 <th title="raw max frequency of collocation within window">raw</th>
Marc Kupietz384c9132018-03-19 16:45:24 +0100897 <th>collocator (by collocation analysis)</th>
Marc Kupietzcd136e22018-01-29 09:18:12 +0100898 </tr>
Marc Kupietz1acb3172018-02-17 09:41:26 +0100899 % }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100900 </thead>
901 <tbody>
902 <tr>
903 <td align="right">
904 </td>
905 <td align="right">
906 </td>
907 <td align="right">
908 </td>
909 <td align="right">
910 </td>
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100911 <td align="right">
912 </td>
913 <td align="right">
914 </td>
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100915 <td align="right"></td>
916 <td align="right"></td>
917 <td align="left"></td>
Marc Kupietze6a7a732018-01-12 09:21:08 +0100918 </tr>
919 </tbody>
920 </table>
921 </div>
Marc Kupietz384c9132018-03-19 16:45:24 +0100922 <!--
923 <div style="clear:both" ></div>
924 <div style="float: right; overflow: hidden" id="extra"><button onClick="showCollocatorSOM()"> </button></div>
925 -->
Marc Kupietz66bfd952017-12-11 09:59:45 +0100926 </div>
Marc Kupietz58270662017-12-04 12:10:06 +0100927 </div>
928 </div> <!-- topwrapper -->
929 <div style="clear: both;"></div>
930 </div>
Marc Kupietzebea4702018-01-12 09:16:09 +0100931 % if($training_args && (@$lists)[0]) {
932 <div class="info">
933 % if($training_args =~ /-type\s*3/) {
934 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 %>
935 % } else {
936 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 %>
937 % }
938 </div>
Marc Kupietz83305222016-04-28 09:57:22 +0200939 % }
Marc Kupietz58270662017-12-04 12:10:06 +0100940 </body>
Marc Kupietz83305222016-04-28 09:57:22 +0200941</html>