blob: 2882ea9fc9348a591eb25fac45e46bea5d3b8ab7 [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());
Marc Kupietzf19814b2019-01-21 16:50:19 +010046 $("#ll_tt").attr("title",$("#ll_ttt").html());
Marc Kupietza0ffb392018-01-25 08:53:43 +010047 }
48 );
49 });
50
51 //set things up so that we can shove raw html into what is shown in the tooltip;
52 // in this case, we will have already put into the title attribute the html that
53 // contains the MathJax rendered equations (via what we do in the callback).
54 $(function () {
55 $(document).tooltip({
56 content: function () {
57 return $(this).prop('title');
58 }
59 });
60 });
61
Marc Kupietze6a7a732018-01-12 09:21:08 +010062 $("input").bind("keydown", function(event) {
63 // track enter key
64 var keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode));
65 if (keycode == 13) { // keycode for enter key
66 // force the 'Enter Key' to implicitly click the Update button
67 document.getElementById('SEARCH').click();
68 return false;
69 } else {
70 return true;
71 }});
Marc Kupietzdab9f222017-11-29 14:22:59 +010072
Marc Kupietze871abd2018-01-25 16:18:27 +010073 var collocatorTable_activated = false;
Marc Kupietze6a7a732018-01-12 09:21:08 +010074 $( "#tabs" ).on( "tabsactivate", function( event, ui ) {
75 if (localStorage) localStorage['tab'] = ui.newTab.index();
Marc Kupietze871abd2018-01-25 16:18:27 +010076 if(ui.newTab.index() == 2 && !collocatorTable_activated) {
77 classicCollocatorTable.columns.adjust();
78 collocatorTable.columns.adjust();
79 collocatorTable_activated = true;
80 }
Marc Kupietze6a7a732018-01-12 09:21:08 +010081 });
82
83 $(function(){
84 $("#SEARCH").click(function() {
85 window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
Marc Kupietz58270662017-12-04 12:10:06 +010086 });
Marc Kupietze6a7a732018-01-12 09:21:08 +010087 });
Marc Kupietz0af83e32017-11-27 09:31:37 +010088
Marc Kupietze6a7a732018-01-12 09:21:08 +010089 function changeCharColor(txt, heat, word) {
90 var newText = "";
91 for (var i=0, l=txt.length; i<l; i++) {
92 newText += (i == 5 ? txt.charAt(i) : '<a href="http://korap.ids-mannheim.de/kalamar/?ql=cosmas2&q=' +
93 CIIsearchWords + ' /' + (i > 5? '%2B' : '-') + 'w' +
94 Math.abs(i-5) + ':' + Math.abs(i-5) + ' ' + word +
95 '" target="korap"><span style="background-color:' +
96 getHeatColor(heat[i]/maxHeat)+'">'+txt.charAt(i)+'</span></a>');
Marc Kupietzb6c615d2017-12-02 10:38:20 +010097 }
Marc Kupietze6a7a732018-01-12 09:21:08 +010098 return newText;
99 }
Marc Kupietzb6c615d2017-12-02 10:38:20 +0100100
Marc Kupietze6a7a732018-01-12 09:21:08 +0100101 function getHeatColor(value) {
102 var hue=((1-value)*120).toString(10);
103 return ["hsl(",hue,",90%,70%)"].join("");
104 }
105
106 function bitvec2window(n, heat, word) {
107 var str = n.toString(2).padStart(10, "0")
108 .replace(/^([0-9]{5})/, '$1x')
109 .replace(/0/g, '·')
110 .replace(/1/g, '+');
111 return changeCharColor(str, heat, word);
112 }
113
114 % use Mojo::ByteStream 'b';
115 var paraResults = <%= b(Mojo::JSON::to_json($lists)) %>;
116 var urlprefix = new URLSearchParams(window.location.search);
117 if (paraResults.length > 0 && paraResults[0] != null) {
118 var nvecs = [],
119 nwords = [],
120 nranks = [],
121 nmarked = [];
122 for(var i = 0; i < paraResults.length; i++) {
123 nwords = nwords.concat(paraResults[i].map(function(a){return a.word;}));
124 nvecs = nvecs.concat(paraResults[i].map(function(a){return a.vector;}));
125 nranks = nranks.concat(paraResults[i].map(function(a){return a.rank;}));
126 nmarked = nmarked.concat(paraResults[i].map(function(a){return a.marked;}));
Marc Kupietz0d4c0ca2017-12-04 09:18:56 +0100127 }
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100128 showMap({target: " "+urlParams.get('word')+" ", mergedEnd: <%= $mergedEnd %>, words: nwords, vecs: nvecs, ranks: nranks, marked: nmarked} );
Marc Kupietze6a7a732018-01-12 09:21:08 +0100129 var t = $('#firsttable').DataTable({
Marc Kupietzee894d52019-01-09 14:55:14 +0100130 data: [].concat.apply([], paraResults),
Marc Kupietze6a7a732018-01-12 09:21:08 +0100131 "sScrollY": "780px",
132 "bScrollCollapse": true,
133 "bPaginate": false,
134 "bJQueryUI": true,
135 "dom": '<"top">rt<"bottom"flp><"clear">',
Marc Kupietz384c9132018-03-19 16:45:24 +0100136 "initComplete":function(settings, json) {
137 $('td.paradigmator a').on('mousedown', function(e) {
138 return paradigmatorClick(e, paraResults[0][0].word, this.childNodes["0"].textContent);
139 });
140 },
Marc Kupietze6a7a732018-01-12 09:21:08 +0100141 "columns": [
142 { "data": "rank", type: "allnumeric" },
143 { "data": "dist", render: function ( data, type, row ) {return data.toFixed(3) }},
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100144 { "data": "word", class: "paradigmator", render: function ( data, type, row ) {
145 urlprefix.set("word", data); return '<a class="' + getMergedClass(row.rank) + '" href="?' + urlprefix + '">' + data + '</a>'
146 }}
Marc Kupietze6a7a732018-01-12 09:21:08 +0100147 ],
148 "columnDefs": [
149 { className: "dt-right", "targets": [0,1] },
150 { "searchable": false,
151 "orderable": false,
152 "targets": 0
153 },
154 { "orderSequence": [ "desc" ], "targets": [ 1 ] },
155 { "orderSequence": [ "asc", "desc" ], "targets": [ 2 ] },
156 ],
157 "oLanguage": {
158 "sSearch": "Filter: "
159 },
160 "order": [[ 1, 'desc' ]],
161 } );
Marc Kupietz0d4c0ca2017-12-04 09:18:56 +0100162
Marc Kupietze6a7a732018-01-12 09:21:08 +0100163 t.on( 'order.dt search.dt', function () {
164 t.column(0, {order:'applied'}).nodes().each( function (cell, i) {
165 cell.innerHTML = i+1;
166 } );
167 } ).draw();
168
169 $( "#first" ).clone().prependTo( "#tabs-2" );
170
171 }
172
173
174 var collocatorData = <%= b(Mojo::JSON::to_json($collocators)) %>;
175 var maxHeat; // = Math.max.apply(Math,collocatorData.map(function(o){return o.cprob;}))
176
177 if (collocatorData != null) {
178 maxHeat = Math.max.apply(Math,collocatorData.map(function(o){return Math.max.apply(Math,o.heat);}))
179 collocatorTable = $('#secondtable').DataTable({
180 data: collocatorData,
181 "sScrollY": "780px",
182 "bScrollCollapse": true,
183 "bPaginate": false,
184 "bJQueryUI": true,
185 "dom": '<"top">rt<"bottom"flp><"clear">',
186 "columns": [
187 { "data": "rank", type: "allnumeric" },
188 { "data": "pos", width: "7%", sClass: "dt-center mono compact", render: function ( data, type, row ) {return bitvec2window(data, row.heat, row.word) }},
189 { "data": "max", render: function ( data, type, row ) {return data.toFixed(3) }},
190 { "data": "average", render: function ( data, type, row ) {return data.toFixed(3) }},
191 { "data": "prob", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } },
192 { "data": "cprob", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } },
193 { "data": "overall", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } },
194 { "data": "word", sClass: "collocator" },
195 { "data": "rank", type: "allnumeric" }
196 ],
197 "columnDefs": [
198 { className: "dt-right", "targets": [0,2,3,4,5,6] },
199 { className: "dt-center", "targets": [ 1] },
200 { "searchable": false,
201 "orderable": false,
202 "targets": [0, 8]
203 },
204 { "type": "scientific", targets: [2,3,4,5,6] },
205 { "orderSequence": [ "desc" ], "targets": [ 2, 3, 4, 5, 6 ] },
206 { "orderSequence": [ "asc", "desc" ], "targets": [ 1, 7 ] },
207 { "targets": [8], "visible": false }
208 ],
209 "oLanguage": {
210 "sSearch": "Filter: "
211 },
212 "order": [[ 4, 'desc' ]],
213 } );
214 $.ajaxSetup({
215 type: 'POST',
216 timeout: 30000,
217 error: function(xhr) {
218 $('#display_error')
219 .html('Error: ' + xhr.status + ' ' + xhr.statusText);
220 }
Marc Kupietz78b434a2018-01-12 22:33:32 +0100221 });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100222
Marc Kupietz384c9132018-03-19 16:45:24 +0100223
224 if($('#sprofiles').length) {
225 similarProfileTable = $('#sprofiles').DataTable({
226 ajax: {
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100227 method: "GET",
Marc Kupietz384c9132018-03-19 16:45:24 +0100228 url: '/derekovecs/getSimilarProfiles',
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100229 dataType: 'json',
230 dataSrc: "",
231 timeout: 30000,
232 data: { w: paraResults[0][0].rank }
Marc Kupietz384c9132018-03-19 16:45:24 +0100233 },
234 "initComplete":function(settings, json){
235 $('td.paradigmator a').on('mousedown', function(e) {
236 if (e.which === 2) {
237 e.preventDefault();
238 queryKorAPalternatives(paraResults[0][0].word, this.childNodes["0"].textContent);
239 return false;
240 }
241 });
242 },
243 "sScrollY": "780px",
244 "bScrollCollapse": true,
245 "bPaginate": false,
246 "bJQueryUI": true,
247 "dom": '<"top">rt<"bottom"flp><"clear">',
248 "columns": [
249 { "data": "v", render: function ( data, type, row ) {return data.toFixed(3) }},
250 { "data": "w", sClass: "paradigmator", render: function ( data, type, row ) {urlprefix.set("word", data); return '<a href="?' + urlprefix + '">' + data + '</a>' } }
251 ],
252 "columnDefs": [
253 { className: "dt-right", "targets": [0] },
254 ],
255 "oLanguage": {
256 "sSearch": "Filter: "
257 },
258 "order": [[ 0, 'desc' ]],
259 });
260 }
261 // var filterQuot = /(^quot?=[A-Z])|(quot$)/g;
262 var filterQuot = /^quot/;
263 classicCollocatorTable = $('#classicoloctable').DataTable({
264 ajax: {
265 method: "GET",
266 url: '/derekovecs/getClassicCollocators',
267 dataType: 'json',
268 dataSrc: "",
269 timeout: 30000,
270 data: { w: paraResults[0][0].rank }
Marc Kupietz78b434a2018-01-12 22:33:32 +0100271 },
Marc Kupietzad783722018-01-13 17:45:21 +0100272 "initComplete":function(settings, json){
273 $("td.collocator").click(function(){
274 queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords);
275 });
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100276 classicCollocatorTable.columns(".detail").visible(false);
277 $("#ccd").css('width', '450px');
278 classicCollocatorTable.columns.adjust().draw();
Marc Kupietzad783722018-01-13 17:45:21 +0100279 },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100280 "sScrollY": "780px",
281 "bScrollCollapse": true,
282 "bPaginate": false,
283 "bJQueryUI": true,
284 "dom": '<"top">rt<"bottom"flp><"clear">',
285 "columns": [
286 // { "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 +0100287 { "data": "llr", render: function ( data, type, row ) {return data.toFixed(0) }},
288 { "data": "lfmd", render: function ( data, type, row ) {return data.toFixed(1) }},
Marc Kupietz1acb3172018-02-17 09:41:26 +0100289 // { "data": "fpmi", type: "scientific", render: function ( data, type, row ) {return data.toExponential(2) } },
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100290 { "data": "npmi", render: function ( data, type, row ) {return data.toFixed(2) }},
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100291 { "data": "llfmd", render: function ( data, type, row ) {return data.toFixed(1) }},
292 { "data": "rlfmd", render: function ( data, type, row ) {return data.toFixed(1) }},
293 { "data": "lnpmi", render: function ( data, type, row ) {return data.toFixed(2) }},
294 { "data": "rnpmi", render: function ( data, type, row ) {return data.toFixed(2) }},
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100295 { "data": "f" },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100296 { "data": "word", sClass: "collocator" }
297 ],
298 "columnDefs": [
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100299 { className: "dt-right", "targets": [0,1,2,3,4,5,6,7] },
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100300 { className: "dt-right detail", "targets": [3,4,5,6] },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100301 { "searchable": false,
302 "orderable": false,
303 "targets": []
304 },
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100305 { "orderSequence": [ "desc" ], "targets": [ 0, 1, 2,3,4,5,6,7 ] },
306 { "orderSequence": [ "asc", "desc" ], "targets": [ 8 ] },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100307 ],
308 "oLanguage": {
309 "sSearch": "Filter: "
310 },
311 "order": [[ 1, 'desc' ]],
312 });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100313
Marc Kupietz1acb3172018-02-17 09:41:26 +0100314
315 $('#show-details').change(function (e) {
316 var columns = classicCollocatorTable.columns(".detail");
317 if(this.checked) {
318 columns.visible(true);
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100319 $("#ccd").css('width', 'auto');
Marc Kupietz1acb3172018-02-17 09:41:26 +0100320 } else {
321 columns.visible(false);
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100322 $("#ccd").css('width', '450px');
Marc Kupietz1acb3172018-02-17 09:41:26 +0100323 }
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100324 classicCollocatorTable.columns.adjust().draw();
Marc Kupietz1acb3172018-02-17 09:41:26 +0100325 } );
326
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100327 $("td.collocator").click(function(){
328 queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords);
Marc Kupietzad783722018-01-13 17:45:21 +0100329 });
330
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100331 collocatorTable.on( 'order.dt search.dt', function () {
332 collocatorTable.column(0, {order:'applied'}).nodes().each( function (cell, i) {
333 cell.innerHTML = i+1;
334 } );
335 }).draw();
336 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100337
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100338 if (localStorage && !window.location.hash) { // let's not crash if some user has IE7
339 var index = parseInt(localStorage['tab']||'0');
340 $("#tabs").tabs({ active: index });
341 }
342 $("#tabs").css("visibility", "visible"); // now we can show the tabs
343 });
Marc Kupietz58270662017-12-04 12:10:06 +0100344
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100345 $(function(){
346 $("#dropdownoptions").dialog({
347 title: "Options",
348 autoOpen: false,
349 modal: false,
350 draggable: false,
351 height: "auto",
352 width: "auto",
353 resizable: false,
354 buttons: {
355 "Cancel": function() {
356 $( this ).dialog( "close" );
Marc Kupietze6a7a732018-01-12 09:21:08 +0100357 },
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100358 "Apply": function() {
359 window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
Marc Kupietze6a7a732018-01-12 09:21:08 +0100360 }
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100361 }
362 });
363 });
364
365 $(function(){
366 $("#showoptions").click(function(){
367 $("#dropdownoptions").dialog("open");
368 var target = $(this);
369 $("#dropdownoptions").dialog("widget").position({
370 my: 'left bottom',
371 at: 'left bottom',
372 of: target
Marc Kupietz58270662017-12-04 12:10:06 +0100373 });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100374 });
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100375 });
376
377 $( function() {
378 $( "#no_iterations" ).spinner({
379 spin: function( event, ui ) {
380 if ( ui.value < 1000 ) {
381 $( this ).spinner( "value", 1000 );
382 return false;
383 } else if ( ui.value > 10000 ) {
384 $( this ).spinner( "value", 10000 );
385 return false;
386 }
387 }
388 });
389 } );
390
391 $( function() {
392 $( "#neighbours" ).spinner({
393 spin: function( event, ui ) {
394 if ( ui.value < 0 ) {
395 $( this ).spinner( "value", 0 );
396 return false;
397 } else if ( ui.value > 200 ) {
398 $( this ).spinner( "value", 200 );
399 return false;
400 }
401 }
402 });
403 } );
404
405 $( function() {
406 $( "#cutoff" ).spinner({
407 spin: function( event, ui ) {
408 if ( ui.value < 100000 ) {
409 $( this ).spinner( "value", 100000 );
410 return false;
411 } else if ( ui.value > 2000000 ) {
412 $( this ).spinner( "value", 2000000 );
413 return false;
414 }
415 }
416 });
417 } );
418
419 $( function() {
420 $( "#tabs" ).tabs().addClass('tabs-min');
421 } );
422
423 $( function() {
424 $( ".controlgroup-vertical" ).controlgroup({
425 "direction": "vertical"
426 });
427 } );
428
429 $(function() {
430 $( document ).tooltip({
431 content: function() {
432 return $(this).attr('title');
433 }}
434 )
435 });
436
437 $(function () {
438 $(document).tooltip({
439 content: function () {
440 return $(this).prop('title');
441 },
442 show: null,
443 close: function (event, ui) {
444 ui.tooltip.hover(
445 function () {
446 $(this).stop(true).fadeTo(400, 1);
447 },
448 function () {
449 $(this).fadeOut("400", function () {
450 $(this).remove();
451 })
452 });
453 }
454 });
455 });
Marc Kupietz83305222016-04-28 09:57:22 +0200456 </script>
Marc Kupietz58270662017-12-04 12:10:06 +0100457 <script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script>
458 <script src="/derekovecs/js/tsne.js"></script>
459 <script src="/derekovecs/js/som.js"></script>
460 <script src="/derekovecs/js/labeler.js"></script>
Marc Kupietzcdd51302018-03-19 16:36:54 +0100461 <script src="/derekovecs/js/derekovcs.js"></script>
Marc Kupietz83305222016-04-28 09:57:22 +0200462 <script>
463
464 var opt = {epsilon: <%= $epsilon %>, perplexity: <%= $perplexity %>},
Marc Kupietz58270662017-12-04 12:10:06 +0100465 mapWidth = 800, // width map
466 mapHeight = 800,
467 jitterRadius = 7;
Marc Kupietz83305222016-04-28 09:57:22 +0200468
469 var T = new tsnejs.tSNE(opt); // create a tSNE instance
470
471 var Y;
472
473 var data;
474 var labeler;
475
476 function applyJitter() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100477 svg.selectAll('.tsnet')
478 .data(labels)
479 .transition()
480 .duration(50)
481 .attr("transform", function(d, i) {
482 T.Y[i][0] = (d.x - mapWidth/2 - tx)/ss/20;
483 T.Y[i][1] = (d.y - mapHeight/2 - ty)/ss/20;
484 return "translate(" +
Marc Kupietz384c9132018-03-19 16:45:24 +0100485 (d.x) + "," +
486 (d.y) + ")";
Marc Kupietze6a7a732018-01-12 09:21:08 +0100487 });
Marc Kupietz83305222016-04-28 09:57:22 +0200488 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100489
Marc Kupietz83305222016-04-28 09:57:22 +0200490 function updateEmbedding() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100491 var Y = T.getSolution();
492 svg.selectAll('.tsnet')
493 .data(data.words)
494 .attr("transform", function(d, i) {
495 return "translate(" +
Marc Kupietz384c9132018-03-19 16:45:24 +0100496 ((Y[i][0]*20*ss + tx) + mapWidth/2) + "," +
497 ((Y[i][1]*20*ss + ty) + mapHeight/2) + ")"; });
Marc Kupietz83305222016-04-28 09:57:22 +0200498 }
499
500 var svg;
501 var labels = [];
502 var anchor_array = [];
503 var text;
504
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100505 function getMergedClass(i) {
506 if(data.mergedEnd && i > data.mergedEnd) {
507 return " merged"
508 } else {
509 return "";
510 }
511 }
512
513 function getRankTooltip(i) {
514 if(data.mergedEnd) {
515 if(data.ranks[i] < data.mergedEnd) {
516 return "rank: "+i +" "+"freq. rank: "+(data.ranks[i]).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
517 } else {
518 return "rank: "+i +" "+"freq. rank: "+(data.ranks[i]-data.mergedEnd).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + " (merged vocab)";
519 }
520 } else {
521 return "rank: "+i +" "+"freq. rank: "+data.ranks[i].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
522 }
523 }
524
Marc Kupietz83305222016-04-28 09:57:22 +0200525 function drawEmbedding() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100526 var urlprefix = new URLSearchParams(window.location.search);
527 urlprefix.delete("word");
528 urlprefix.append("word","");
Marc Kupietz8f9c86a2017-12-04 17:17:13 +0100529
Marc Kupietze6a7a732018-01-12 09:21:08 +0100530 $("#embed").empty();
531 var div = d3.select("#embed");
Marc Kupietz34c08172017-11-29 17:08:47 +0100532
Marc Kupietze6a7a732018-01-12 09:21:08 +0100533 // get min and max in each column of Y
534 var Y = T.Y;
Marc Kupietz34c08172017-11-29 17:08:47 +0100535
Marc Kupietze6a7a732018-01-12 09:21:08 +0100536 svg = div.append("svg") // svg is global
537 .attr("width", mapWidth)
538 .attr("height", mapHeight);
Marc Kupietz34c08172017-11-29 17:08:47 +0100539
Marc Kupietze6a7a732018-01-12 09:21:08 +0100540 var g = svg.selectAll(".b")
541 .data(data.words)
542 .enter().append("g")
543 .attr("class", "tsnet");
Marc Kupietz34c08172017-11-29 17:08:47 +0100544
Marc Kupietze6a7a732018-01-12 09:21:08 +0100545 g.append("a")
546 .attr("xlink:href", function(word) {
547 return "?"+urlprefix+word; })
548 .attr("class", function(d, i) {
549 var res="";
550 if(data.marked[i]) {
551 res="marked ";
552 }
553 if(data.target.indexOf(" "+d+" ") >= 0) {
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100554 res += "target";
555 }
556 if(data.mergedEnd && data.ranks[i] >= data.mergedEnd) {
557 return res+" merged";
Marc Kupietze6a7a732018-01-12 09:21:08 +0100558 } else {
559 return res;
560 }
561 })
562 .attr("title", function(d, i) {
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100563 return getRankTooltip(i);
Marc Kupietze6a7a732018-01-12 09:21:08 +0100564 })
565 .append("text")
566 .attr("text-anchor", "top")
567 .attr("font-size", 12)
568 .text(function(d) { return d; });
Marc Kupietz34c08172017-11-29 17:08:47 +0100569
Marc Kupietz384c9132018-03-19 16:45:24 +0100570 g.append("svg:title")
571 .text(function(d, i) {
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100572 return getRankTooltip(i);
Marc Kupietz384c9132018-03-19 16:45:24 +0100573 });
574
Marc Kupietze6a7a732018-01-12 09:21:08 +0100575 var zoomListener = d3.behavior.zoom()
576 .scaleExtent([0.1, 10])
577 .center([0,0])
578 .on("zoom", zoomHandler);
579 zoomListener(svg);
Marc Kupietz83305222016-04-28 09:57:22 +0200580 }
581
582 var tx=0, ty=0;
583 var ss=1;
584 var iter_id=-1;
585
586 function zoomHandler() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100587 tx = d3.event.translate[0];
588 ty = d3.event.translate[1];
589 ss = d3.event.scale;
590 updateEmbedding();
Marc Kupietz83305222016-04-28 09:57:22 +0200591 }
592
593 var stepnum = 0;
594
595 function stopStep() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100596 clearInterval(iter_id);
597 text = svg.selectAll("text");
Marc Kupietz34c08172017-11-29 17:08:47 +0100598
Marc Kupietze6a7a732018-01-12 09:21:08 +0100599 // jitter function needs different data and co-ordinate representation
600 labels = d3.range(data.words.length).map(function(i) {
601 var x = (T.Y[i][0]*20*ss + tx) + mapWidth/2;
602 var y = (T.Y[i][1]*20*ss + ty) + mapHeight/2;
603 anchor_array.push({x: x, y: y, r: jitterRadius});
604 return {
605 x: x,
606 y: y,
607 name: data.words[i]
608 };
609 });
Marc Kupietz34c08172017-11-29 17:08:47 +0100610
Marc Kupietze6a7a732018-01-12 09:21:08 +0100611 // get the actual label bounding boxes for the jitter function
612 var index = 0;
613 text.each(function() {
614 labels[index].width = this.getBBox().width;
615 labels[index].height = this.getBBox().height;
616 index += 1;
617 });
Marc Kupietz83305222016-04-28 09:57:22 +0200618
Marc Kupietz34c08172017-11-29 17:08:47 +0100619
Marc Kupietze6a7a732018-01-12 09:21:08 +0100620 // setTimeout(updateEmbedding, 1);
621 // setTimeout(
622 labeler = d3.labeler()
623 .label(labels)
624 .anchor(anchor_array)
625 .width(mapWidth)
626 .height(mapHeight)
627 .update(applyJitter);
628 // .start(1000);
Marc Kupietz83305222016-04-28 09:57:22 +0200629
Marc Kupietze6a7a732018-01-12 09:21:08 +0100630 iter_id = setInterval(jitterStep, 1);
Marc Kupietz83305222016-04-28 09:57:22 +0200631 }
632
633 var jitter_i=0;
634
635 function jitterStep() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100636 if(jitter_i++ > 100) {
637 clearInterval(iter_id);
638 } else {
639 labeler.start2(10);
640 applyJitter();
641 }
Marc Kupietz83305222016-04-28 09:57:22 +0200642 }
643
644 var last_cost=1000;
645
646 function step() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100647 var i = T.iter;
Marc Kupietz34c08172017-11-29 17:08:47 +0100648
Marc Kupietze6a7a732018-01-12 09:21:08 +0100649 if(i > <%= $no_iterations %>) {
650 stopStep();
651 } else {
652 var cost = Math.round(T.step() * 100000) / 100000; // do a few steps
653 $("#cost").html("tsne iteration " + i + ", cost: " + cost.toFixed(5));
654 if(i % 250 == 0 && cost >= last_cost) {
655 stopStep();
Marc Kupietz58270662017-12-04 12:10:06 +0100656 } else {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100657 last_cost = cost;
658 updateEmbedding();
Marc Kupietz58270662017-12-04 12:10:06 +0100659 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100660 }
Marc Kupietz83305222016-04-28 09:57:22 +0200661 }
662
663 function showMap(j) {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100664 data=j;
665 T.iter=0;
666 iter_id = -1;
667 last_cost=1000;
668 T.initDataRaw(data.vecs); // init embedding
669 drawEmbedding(); // draw initial embedding
Marc Kupietz78114532017-11-29 17:00:16 +0100670
Marc Kupietze6a7a732018-01-12 09:21:08 +0100671 if(iter_id >= 0) {
672 clearInterval(iter_id);
673 }
674 //T.debugGrad();
675 iter_id = setInterval(step, 1);
676 if(true) { // (<%= $show_som %>) {
677 makeSOM(j, <%= $no_iterations %>);
678 }
Marc Kupietz83305222016-04-28 09:57:22 +0200679 }
Marc Kupietz39179ab2017-07-04 16:28:06 +0200680 var queryword;
681
Marc Kupietz66bfd952017-12-11 09:59:45 +0100682 function showCollocatorSOM() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100683 if (collocatorTable) {
684 var ctableData = collocatorTable.rows().data();
685 var nwords = [],
686 nranks = [];
687 for (var i=0; i < ctableData.length && i < 100; i++) {
688 nranks.push(ctableData[i].rank);
689 nwords.push(ctableData[i].word);
Marc Kupietz66bfd952017-12-11 09:59:45 +0100690 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100691 $.post('/derekovecs/getVecsByRanks',
692 JSON.stringify(nranks),
693 function(data, status){
Marc Kupietz2e2e4db2018-12-21 15:07:37 +0100694 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 +0100695 }, 'json');
696 }
Marc Kupietz66bfd952017-12-11 09:59:45 +0100697 }
698
Marc Kupietz39179ab2017-07-04 16:28:06 +0200699 function onload() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100700 queryword = document.getElementById('word');
Marc Kupietz39179ab2017-07-04 16:28:06 +0200701 }
702
703 function queryKorAP() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100704 window.open('http://korap.ids-mannheim.de/kalamar/?q='+queryword.value, 'KorAP');
Marc Kupietz39179ab2017-07-04 16:28:06 +0200705 }
Marc Kupietz4dc270c2017-11-24 10:17:12 +0100706
707 function queryKorAPCII(query) {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100708 window.open('http://korap.ids-mannheim.de/kalamar/?ql=cosmas2&q='+query, 'KorAP');
Marc Kupietz4dc270c2017-11-24 10:17:12 +0100709 }
Marc Kupietz83305222016-04-28 09:57:22 +0200710 </script>
711 </head>
Marc Kupietz39179ab2017-07-04 16:28:06 +0200712 <body onload="onload()">
Marc Kupietz5a7f9ac2018-01-30 11:22:44 +0100713 <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 +0100714 <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 Kupietzf19814b2019-01-21 16:50:19 +0100715 <div style="display:none;" id="ll_ttt">Log-likelihood: $$2*\sum_{ij}O_{ij}*log\frac{O_{ij}}{E_{ij}}$$<p class="citation">Evert, Stefan (2004): <a href="http://purl.org/stefan.evert/PUB/Evert2004phd.pdf">The Statistics of Word Cooccurrences: Word Pairs and Collocations.</a> PhD dissertation, IMS, University of Stuttgart. Published in 2005, URN urn:nbn:de:bsz:93-opus-23714.</p></div>
Marc Kupietz58270662017-12-04 12:10:06 +0100716 <div id="header">
717 <div id="pagetitle">
Marc Kupietzc053d972019-01-10 10:41:51 +0100718 <h1>DeReKoVecs</h1>
719 <h2><%== $title %></h2>
Marc Kupietz4fcda0c2017-11-29 09:00:31 +0100720 </div>
Marc Kupietz58270662017-12-04 12:10:06 +0100721 <div id="options" class="widget">
722 <form id="queryform">
723 <input id="word" type="text" name="word" placeholder="Word(s) to be searched" value="<%= $word %>"
724 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."/>
725 <input id="SEARCH" type="button" value="SEARCH">
726 <input type="button" id="showoptions" name="showoptions" value="Options" />
727 </form>
728 <div id="dropdownoptions" style="display: none">
729 <form id="optionsform">
730 <div class="controlgroup-vertical">
731 <label for="cutoff">cut-off</label>
732 <input id="cutoff" type="text" name="cutoff" size="10" value="<%= $cutoff %>" title="Only consider the most frequent x word forms.">
733 <label for="dedupe">dedupe</label>
734 <input id="dedupe" type="checkbox" name="dedupe" value="1" <%= ($dedupe ? "checked" : "") %> title="radically filter out any near-duplicates">
735 % if($mergedEnd > 0) {
736 <label for="sbf">backw.</label>
737 <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.">
738 % }
739 <label for="neighbours">max. neighbours:</label>
740 <input id="neighbours" size="4" name="n" value="<%= $no_nbs %>">
741 <label for="no_iterations">max. iterations</label>
742 <input id="no_iterations" name="N" size="4" value="<%= $no_iterations %>">
743 <!-- <label for="dosom">SOM</label>
744 <input id="dosom" type="checkbox" name="som" value="1" <%= ($show_som ? "checked" : "") %>> -->
745 % if($collocators) {
746 <label for="sortby">window/sort</label>
747 <select id="sortby" name="sort">
748 <option value="0" <%= ($sort!=1 && $sort!=2? "selected":"") %>>auto focus</option>
749 <!-- <option value="1" <%= ($sort==1? "selected":"") %>>any single position</option>
750 <option value="2" <%= ($sort==2? "selected":"") %>>whole window</option> -->
751 </select>
752 % }
753 <input type="button" value="→ KorAP" onclick="queryKorAP();" title="query word with KorAP"/>
Marc Kupietz1acb3172018-02-17 09:41:26 +0100754 <input id="show-details" type="checkbox" name="show-details" value="1" >
755 <label for="show-details">
756 Show details
757 </label>
Marc Kupietz58270662017-12-04 12:10:06 +0100758 </div>
759 </form>
760 </div>
761 </div>
762 </div>
763 <div id="topwrapper">
764 <div style="visibility: hidden;" id="tabs">
765 <ul>
766 <li><a href="#tabs-1">Semantics (TSNE-map)</a></li>
767 <li><a href="#tabs-2">Semantics (SOM)</a></li>
Marc Kupietzbb3da6a2019-01-22 15:21:38 +0100768 <li><a href="#tabs-3">Syntagmatic (collocates)</a></li>
Marc Kupietz58270662017-12-04 12:10:06 +0100769 </ul>
Marc Kupietz384c9132018-03-19 16:45:24 +0100770 <div id="tabs-1" style="display: flex; padding: 5px; flex-flow: row wrap;">
Marc Kupietz58270662017-12-04 12:10:06 +0100771 % if($lists && (@$lists) > 0 && (@$lists)[0]) {
772 <div id="wrapper">
Marc Kupietz384c9132018-03-19 16:45:24 +0100773 <div id="first" style="width: 230px; margin-bottom: 15px;">
Marc Kupietz58270662017-12-04 12:10:06 +0100774 <table class="display compact nowrap" id="firsttable">
775 <thead>
776 <tr>
Marc Kupietz384c9132018-03-19 16:45:24 +0100777 <th align="right">#</th><th align="right">cos</th><th align="left">similars by w2v</th>
Marc Kupietz58270662017-12-04 12:10:06 +0100778 </tr>
779 </thead>
780 <tbody>
781 <tr>
782 <td align="right">
783 </td>
784 <td align="right">
785 </td>
786 <td></td>
787 </tr>
788 </tbody>
789 </table>
790 </div>
Marc Kupietza55a09a2018-07-06 13:30:30 +0200791 % if(0 && $haveSProfiles) {
Marc Kupietz384c9132018-03-19 16:45:24 +0100792 <div id="sprofilesdiv" style="width: 200px; padding-right: 10px;">
793 <table class="display compact nowrap" id="sprofiles">
794 <thead>
795 <tr>
796 <th align="right">cos</th><th align="left">similars by coll. profile</th>
797 </tr>
798 </thead>
799 <tbody>
800 <tr>
801 <td align="right">
802 </td>
803 <td></td>
804 </tr>
805 </tbody>
806 </table>
807 </div>
808 %}
809 <div id="second">
Marc Kupietz58270662017-12-04 12:10:06 +0100810 <div id="embed">
811 </div>
812 <div id="cost">
813 </div>
814 </div>
815 </div>
Marc Kupietz384c9132018-03-19 16:45:24 +0100816 % } elsif($word !~ /^\s*$/) {
817 <div id="wrapper">
818 <div id="not-found-dialog" title="Not found">
819 <p>ERROR: "<%= $word %>" not found in vocabluary.</p>
820 <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>
821 </div>
822 <script>
823 $( function() {
824 $( "#not-found-dialog" ).dialog({
825 autoOpen: true,
826 modal: true,
827 draggable: false,
828 height: "auto",
829 width: "auto",
830 resizable: false,
831 buttons: {
832 "OK": function() {
833 $( this ).dialog( "close" );
834 },
835 "Apply": function() {
836 window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
837 }
838 }
839 });
840 });
841 </script>
842 </div>
843 % }
Marc Kupietz58270662017-12-04 12:10:06 +0100844 </div>
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100845 <div id="tabs-2" style="display: flex; padding: 5px; flex-flow: row wrap;">
Marc Kupietz66bfd952017-12-11 09:59:45 +0100846 <div id="som2" style="width: 800;">
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100847 <div id="sominfo1"><span id="somcolor1"> </span> <span id="somword1"> </span> <span id="somcolor2"> </span> <span id="somword2"> </span> <span id="somcolor3"> </span></div>
848 <div id="sominfo" style="text-align: right">SOM iteration <span id="iterations">0</span></div>
Marc Kupietz58270662017-12-04 12:10:06 +0100849 </div>
Marc Kupietz58270662017-12-04 12:10:06 +0100850 </div>
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100851 <div id="tabs-3" style="display: flex; padding:5px; flex-flow: row wrap;">
852 <div style="margin-right: 20px; margin-bottom: 10px;" id="secondt">
Marc Kupietze6a7a732018-01-12 09:21:08 +0100853 <table class="display compact nowrap" id="secondtable">
Marc Kupietz58270662017-12-04 12:10:06 +0100854 <thead>
855 <tr>
856 % if($collocators) {
857 <th>#</th>
Marc Kupietz4116b432017-12-06 14:15:32 +0100858 <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>
859 <th align="right" title="Maximum activation of the collocator anywhere in the output layer.">max(a)</th>
860 <th title="Average raw activation of the collocator in the columns selected by auto-focus." align="right">⟨a⟩</th>
861 <th title="Sum of activations over the selected colunns normalized by the total activation sum of the selected columns." align="right">Σa/Σw'</th>
862 <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 +0100863 <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 Kupietzbb3da6a2019-01-22 15:21:38 +0100864 <th align="left">collocate (by w2v)</th>
Marc Kupietz58270662017-12-04 12:10:06 +0100865 % }
866 </tr>
867 </thead>
868 <tbody>
869 <tr>
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>
880 <td align="right">
881 </td>
Marc Kupietz58270662017-12-04 12:10:06 +0100882 </tr>
883 </tbody>
884 </table>
Marc Kupietz66bfd952017-12-11 09:59:45 +0100885 </div>
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100886 <div id="ccd" style="">
Marc Kupietze6a7a732018-01-12 09:21:08 +0100887 <table class="display compact nowrap" id="classicoloctable">
888 <thead>
Marc Kupietzcd136e22018-01-29 09:18:12 +0100889 % if($collocators) {
890 <tr>
Marc Kupietzcd136e22018-01-29 09:18:12 +0100891 <th id="npmi_tt">nPMI</th>
Marc Kupietzf19814b2019-01-21 16:50:19 +0100892 <th id="ll_tt">LL</th>
893 <th id="lfmd_tt">MI³</th>
Marc Kupietz5a7f9ac2018-01-30 11:22:44 +0100894 <th title="PMI³ restricted to left neighbour">l-PMI³</th>
895 <th title="PMI³ restricted to right neighbour">r-PMI³</th>
896 <th title="nPMI restricted to left neighbour">l-nPMI</th>
897 <th title="nPMI restricted to right neighbour">r-nPMI</th>
Marc Kupietzbb3da6a2019-01-22 15:21:38 +0100898 <th title="raw frequency sum of collocation within window">raw</th>
899 <th>collocate (by CA)</th>
Marc Kupietzcd136e22018-01-29 09:18:12 +0100900 </tr>
Marc Kupietz1acb3172018-02-17 09:41:26 +0100901 % }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100902 </thead>
903 <tbody>
904 <tr>
905 <td align="right">
906 </td>
907 <td align="right">
908 </td>
909 <td align="right">
910 </td>
911 <td align="right">
912 </td>
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100913 <td align="right">
914 </td>
915 <td align="right">
916 </td>
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100917 <td align="right"></td>
918 <td align="right"></td>
919 <td align="left"></td>
Marc Kupietze6a7a732018-01-12 09:21:08 +0100920 </tr>
921 </tbody>
922 </table>
923 </div>
Marc Kupietz384c9132018-03-19 16:45:24 +0100924 <!--
925 <div style="clear:both" ></div>
926 <div style="float: right; overflow: hidden" id="extra"><button onClick="showCollocatorSOM()"> </button></div>
927 -->
Marc Kupietz66bfd952017-12-11 09:59:45 +0100928 </div>
Marc Kupietz58270662017-12-04 12:10:06 +0100929 </div>
930 </div> <!-- topwrapper -->
931 <div style="clear: both;"></div>
932 </div>
Marc Kupietzebea4702018-01-12 09:16:09 +0100933 % if($training_args && (@$lists)[0]) {
934 <div class="info">
935 % if($training_args =~ /-type\s*3/) {
936 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 %>
937 % } else {
938 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 %>
939 % }
940 </div>
Marc Kupietz83305222016-04-28 09:57:22 +0200941 % }
Marc Kupietz58270662017-12-04 12:10:06 +0100942 </body>
Marc Kupietz83305222016-04-28 09:57:22 +0200943</html>