blob: 4745c90e21b23003cf2cb44a0d3d4fa4887bc5b9 [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 Kupietze6a7a732018-01-12 09:21:08 +0100126 showMap({target: " "+urlParams.get('word')+" ", mergedEnd: 0, words: nwords, vecs: nvecs, ranks: nranks, marked: nmarked} );
127 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 Kupietz384c9132018-03-19 16:45:24 +0100142 { "data": "word", class: "paradigmator", render: function ( data, type, row ) {urlprefix.set("word", data); return '<a href="?' + urlprefix + '">' + data + '</a>' }}
Marc Kupietze6a7a732018-01-12 09:21:08 +0100143 ],
144 "columnDefs": [
145 { className: "dt-right", "targets": [0,1] },
146 { "searchable": false,
147 "orderable": false,
148 "targets": 0
149 },
150 { "orderSequence": [ "desc" ], "targets": [ 1 ] },
151 { "orderSequence": [ "asc", "desc" ], "targets": [ 2 ] },
152 ],
153 "oLanguage": {
154 "sSearch": "Filter: "
155 },
156 "order": [[ 1, 'desc' ]],
157 } );
Marc Kupietz0d4c0ca2017-12-04 09:18:56 +0100158
Marc Kupietze6a7a732018-01-12 09:21:08 +0100159 t.on( 'order.dt search.dt', function () {
160 t.column(0, {order:'applied'}).nodes().each( function (cell, i) {
161 cell.innerHTML = i+1;
162 } );
163 } ).draw();
164
165 $( "#first" ).clone().prependTo( "#tabs-2" );
166
167 }
168
169
170 var collocatorData = <%= b(Mojo::JSON::to_json($collocators)) %>;
171 var maxHeat; // = Math.max.apply(Math,collocatorData.map(function(o){return o.cprob;}))
172
173 if (collocatorData != null) {
174 maxHeat = Math.max.apply(Math,collocatorData.map(function(o){return Math.max.apply(Math,o.heat);}))
175 collocatorTable = $('#secondtable').DataTable({
176 data: collocatorData,
177 "sScrollY": "780px",
178 "bScrollCollapse": true,
179 "bPaginate": false,
180 "bJQueryUI": true,
181 "dom": '<"top">rt<"bottom"flp><"clear">',
182 "columns": [
183 { "data": "rank", type: "allnumeric" },
184 { "data": "pos", width: "7%", sClass: "dt-center mono compact", render: function ( data, type, row ) {return bitvec2window(data, row.heat, row.word) }},
185 { "data": "max", render: function ( data, type, row ) {return data.toFixed(3) }},
186 { "data": "average", render: function ( data, type, row ) {return data.toFixed(3) }},
187 { "data": "prob", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } },
188 { "data": "cprob", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } },
189 { "data": "overall", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } },
190 { "data": "word", sClass: "collocator" },
191 { "data": "rank", type: "allnumeric" }
192 ],
193 "columnDefs": [
194 { className: "dt-right", "targets": [0,2,3,4,5,6] },
195 { className: "dt-center", "targets": [ 1] },
196 { "searchable": false,
197 "orderable": false,
198 "targets": [0, 8]
199 },
200 { "type": "scientific", targets: [2,3,4,5,6] },
201 { "orderSequence": [ "desc" ], "targets": [ 2, 3, 4, 5, 6 ] },
202 { "orderSequence": [ "asc", "desc" ], "targets": [ 1, 7 ] },
203 { "targets": [8], "visible": false }
204 ],
205 "oLanguage": {
206 "sSearch": "Filter: "
207 },
208 "order": [[ 4, 'desc' ]],
209 } );
210 $.ajaxSetup({
211 type: 'POST',
212 timeout: 30000,
213 error: function(xhr) {
214 $('#display_error')
215 .html('Error: ' + xhr.status + ' ' + xhr.statusText);
216 }
Marc Kupietz78b434a2018-01-12 22:33:32 +0100217 });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100218
Marc Kupietz384c9132018-03-19 16:45:24 +0100219
220 if($('#sprofiles').length) {
221 similarProfileTable = $('#sprofiles').DataTable({
222 ajax: {
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100223 method: "GET",
Marc Kupietz384c9132018-03-19 16:45:24 +0100224 url: '/derekovecs/getSimilarProfiles',
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100225 dataType: 'json',
226 dataSrc: "",
227 timeout: 30000,
228 data: { w: paraResults[0][0].rank }
Marc Kupietz384c9132018-03-19 16:45:24 +0100229 },
230 "initComplete":function(settings, json){
231 $('td.paradigmator a').on('mousedown', function(e) {
232 if (e.which === 2) {
233 e.preventDefault();
234 queryKorAPalternatives(paraResults[0][0].word, this.childNodes["0"].textContent);
235 return false;
236 }
237 });
238 },
239 "sScrollY": "780px",
240 "bScrollCollapse": true,
241 "bPaginate": false,
242 "bJQueryUI": true,
243 "dom": '<"top">rt<"bottom"flp><"clear">',
244 "columns": [
245 { "data": "v", render: function ( data, type, row ) {return data.toFixed(3) }},
246 { "data": "w", sClass: "paradigmator", render: function ( data, type, row ) {urlprefix.set("word", data); return '<a href="?' + urlprefix + '">' + data + '</a>' } }
247 ],
248 "columnDefs": [
249 { className: "dt-right", "targets": [0] },
250 ],
251 "oLanguage": {
252 "sSearch": "Filter: "
253 },
254 "order": [[ 0, 'desc' ]],
255 });
256 }
257 // var filterQuot = /(^quot?=[A-Z])|(quot$)/g;
258 var filterQuot = /^quot/;
259 classicCollocatorTable = $('#classicoloctable').DataTable({
260 ajax: {
261 method: "GET",
262 url: '/derekovecs/getClassicCollocators',
263 dataType: 'json',
264 dataSrc: "",
265 timeout: 30000,
266 data: { w: paraResults[0][0].rank }
Marc Kupietz78b434a2018-01-12 22:33:32 +0100267 },
Marc Kupietzad783722018-01-13 17:45:21 +0100268 "initComplete":function(settings, json){
269 $("td.collocator").click(function(){
270 queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords);
271 });
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100272 classicCollocatorTable.columns(".detail").visible(false);
273 $("#ccd").css('width', '450px');
274 classicCollocatorTable.columns.adjust().draw();
Marc Kupietzad783722018-01-13 17:45:21 +0100275 },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100276 "sScrollY": "780px",
277 "bScrollCollapse": true,
278 "bPaginate": false,
279 "bJQueryUI": true,
280 "dom": '<"top">rt<"bottom"flp><"clear">',
281 "columns": [
282 // { "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 +0100283 { "data": "llr", render: function ( data, type, row ) {return data.toFixed(0) }},
284 { "data": "lfmd", render: function ( data, type, row ) {return data.toFixed(1) }},
Marc Kupietz1acb3172018-02-17 09:41:26 +0100285 // { "data": "fpmi", type: "scientific", render: function ( data, type, row ) {return data.toExponential(2) } },
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100286 { "data": "npmi", render: function ( data, type, row ) {return data.toFixed(2) }},
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100287 { "data": "llfmd", render: function ( data, type, row ) {return data.toFixed(1) }},
288 { "data": "rlfmd", render: function ( data, type, row ) {return data.toFixed(1) }},
289 { "data": "lnpmi", render: function ( data, type, row ) {return data.toFixed(2) }},
290 { "data": "rnpmi", render: function ( data, type, row ) {return data.toFixed(2) }},
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100291 { "data": "f" },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100292 { "data": "word", sClass: "collocator" }
293 ],
294 "columnDefs": [
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100295 { className: "dt-right", "targets": [0,1,2,3,4,5,6,7] },
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100296 { className: "dt-right detail", "targets": [3,4,5,6] },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100297 { "searchable": false,
298 "orderable": false,
299 "targets": []
300 },
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100301 { "orderSequence": [ "desc" ], "targets": [ 0, 1, 2,3,4,5,6,7 ] },
302 { "orderSequence": [ "asc", "desc" ], "targets": [ 8 ] },
Marc Kupietz78b434a2018-01-12 22:33:32 +0100303 ],
304 "oLanguage": {
305 "sSearch": "Filter: "
306 },
307 "order": [[ 1, 'desc' ]],
308 });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100309
Marc Kupietz1acb3172018-02-17 09:41:26 +0100310
311 $('#show-details').change(function (e) {
312 var columns = classicCollocatorTable.columns(".detail");
313 if(this.checked) {
314 columns.visible(true);
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100315 $("#ccd").css('width', 'auto');
Marc Kupietz1acb3172018-02-17 09:41:26 +0100316 } else {
317 columns.visible(false);
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100318 $("#ccd").css('width', '450px');
Marc Kupietz1acb3172018-02-17 09:41:26 +0100319 }
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100320 classicCollocatorTable.columns.adjust().draw();
Marc Kupietz1acb3172018-02-17 09:41:26 +0100321 } );
322
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100323 $("td.collocator").click(function(){
324 queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords);
Marc Kupietzad783722018-01-13 17:45:21 +0100325 });
326
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100327 collocatorTable.on( 'order.dt search.dt', function () {
328 collocatorTable.column(0, {order:'applied'}).nodes().each( function (cell, i) {
329 cell.innerHTML = i+1;
330 } );
331 }).draw();
332 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100333
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100334 if (localStorage && !window.location.hash) { // let's not crash if some user has IE7
335 var index = parseInt(localStorage['tab']||'0');
336 $("#tabs").tabs({ active: index });
337 }
338 $("#tabs").css("visibility", "visible"); // now we can show the tabs
339 });
Marc Kupietz58270662017-12-04 12:10:06 +0100340
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100341 $(function(){
342 $("#dropdownoptions").dialog({
343 title: "Options",
344 autoOpen: false,
345 modal: false,
346 draggable: false,
347 height: "auto",
348 width: "auto",
349 resizable: false,
350 buttons: {
351 "Cancel": function() {
352 $( this ).dialog( "close" );
Marc Kupietze6a7a732018-01-12 09:21:08 +0100353 },
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100354 "Apply": function() {
355 window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
Marc Kupietze6a7a732018-01-12 09:21:08 +0100356 }
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100357 }
358 });
359 });
360
361 $(function(){
362 $("#showoptions").click(function(){
363 $("#dropdownoptions").dialog("open");
364 var target = $(this);
365 $("#dropdownoptions").dialog("widget").position({
366 my: 'left bottom',
367 at: 'left bottom',
368 of: target
Marc Kupietz58270662017-12-04 12:10:06 +0100369 });
Marc Kupietze6a7a732018-01-12 09:21:08 +0100370 });
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100371 });
372
373 $( function() {
374 $( "#no_iterations" ).spinner({
375 spin: function( event, ui ) {
376 if ( ui.value < 1000 ) {
377 $( this ).spinner( "value", 1000 );
378 return false;
379 } else if ( ui.value > 10000 ) {
380 $( this ).spinner( "value", 10000 );
381 return false;
382 }
383 }
384 });
385 } );
386
387 $( function() {
388 $( "#neighbours" ).spinner({
389 spin: function( event, ui ) {
390 if ( ui.value < 0 ) {
391 $( this ).spinner( "value", 0 );
392 return false;
393 } else if ( ui.value > 200 ) {
394 $( this ).spinner( "value", 200 );
395 return false;
396 }
397 }
398 });
399 } );
400
401 $( function() {
402 $( "#cutoff" ).spinner({
403 spin: function( event, ui ) {
404 if ( ui.value < 100000 ) {
405 $( this ).spinner( "value", 100000 );
406 return false;
407 } else if ( ui.value > 2000000 ) {
408 $( this ).spinner( "value", 2000000 );
409 return false;
410 }
411 }
412 });
413 } );
414
415 $( function() {
416 $( "#tabs" ).tabs().addClass('tabs-min');
417 } );
418
419 $( function() {
420 $( ".controlgroup-vertical" ).controlgroup({
421 "direction": "vertical"
422 });
423 } );
424
425 $(function() {
426 $( document ).tooltip({
427 content: function() {
428 return $(this).attr('title');
429 }}
430 )
431 });
432
433 $(function () {
434 $(document).tooltip({
435 content: function () {
436 return $(this).prop('title');
437 },
438 show: null,
439 close: function (event, ui) {
440 ui.tooltip.hover(
441 function () {
442 $(this).stop(true).fadeTo(400, 1);
443 },
444 function () {
445 $(this).fadeOut("400", function () {
446 $(this).remove();
447 })
448 });
449 }
450 });
451 });
Marc Kupietz83305222016-04-28 09:57:22 +0200452 </script>
Marc Kupietz58270662017-12-04 12:10:06 +0100453 <script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script>
454 <script src="/derekovecs/js/tsne.js"></script>
455 <script src="/derekovecs/js/som.js"></script>
456 <script src="/derekovecs/js/labeler.js"></script>
Marc Kupietzcdd51302018-03-19 16:36:54 +0100457 <script src="/derekovecs/js/derekovcs.js"></script>
Marc Kupietz83305222016-04-28 09:57:22 +0200458 <script>
459
460 var opt = {epsilon: <%= $epsilon %>, perplexity: <%= $perplexity %>},
Marc Kupietz58270662017-12-04 12:10:06 +0100461 mapWidth = 800, // width map
462 mapHeight = 800,
463 jitterRadius = 7;
Marc Kupietz83305222016-04-28 09:57:22 +0200464
465 var T = new tsnejs.tSNE(opt); // create a tSNE instance
466
467 var Y;
468
469 var data;
470 var labeler;
471
472 function applyJitter() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100473 svg.selectAll('.tsnet')
474 .data(labels)
475 .transition()
476 .duration(50)
477 .attr("transform", function(d, i) {
478 T.Y[i][0] = (d.x - mapWidth/2 - tx)/ss/20;
479 T.Y[i][1] = (d.y - mapHeight/2 - ty)/ss/20;
480 return "translate(" +
Marc Kupietz384c9132018-03-19 16:45:24 +0100481 (d.x) + "," +
482 (d.y) + ")";
Marc Kupietze6a7a732018-01-12 09:21:08 +0100483 });
Marc Kupietz83305222016-04-28 09:57:22 +0200484 }
Marc Kupietz34c08172017-11-29 17:08:47 +0100485
Marc Kupietz83305222016-04-28 09:57:22 +0200486 function updateEmbedding() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100487 var Y = T.getSolution();
488 svg.selectAll('.tsnet')
489 .data(data.words)
490 .attr("transform", function(d, i) {
491 return "translate(" +
Marc Kupietz384c9132018-03-19 16:45:24 +0100492 ((Y[i][0]*20*ss + tx) + mapWidth/2) + "," +
493 ((Y[i][1]*20*ss + ty) + mapHeight/2) + ")"; });
Marc Kupietz83305222016-04-28 09:57:22 +0200494 }
495
496 var svg;
497 var labels = [];
498 var anchor_array = [];
499 var text;
500
501 function drawEmbedding() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100502 var urlprefix = new URLSearchParams(window.location.search);
503 urlprefix.delete("word");
504 urlprefix.append("word","");
Marc Kupietz8f9c86a2017-12-04 17:17:13 +0100505
Marc Kupietze6a7a732018-01-12 09:21:08 +0100506 $("#embed").empty();
507 var div = d3.select("#embed");
Marc Kupietz34c08172017-11-29 17:08:47 +0100508
Marc Kupietze6a7a732018-01-12 09:21:08 +0100509 // get min and max in each column of Y
510 var Y = T.Y;
Marc Kupietz34c08172017-11-29 17:08:47 +0100511
Marc Kupietze6a7a732018-01-12 09:21:08 +0100512 svg = div.append("svg") // svg is global
513 .attr("width", mapWidth)
514 .attr("height", mapHeight);
Marc Kupietz34c08172017-11-29 17:08:47 +0100515
Marc Kupietze6a7a732018-01-12 09:21:08 +0100516 var g = svg.selectAll(".b")
517 .data(data.words)
518 .enter().append("g")
519 .attr("class", "tsnet");
Marc Kupietz34c08172017-11-29 17:08:47 +0100520
Marc Kupietze6a7a732018-01-12 09:21:08 +0100521 g.append("a")
522 .attr("xlink:href", function(word) {
523 return "?"+urlprefix+word; })
524 .attr("class", function(d, i) {
525 var res="";
526 if(data.marked[i]) {
527 res="marked ";
528 }
529 if(data.target.indexOf(" "+d+" ") >= 0) {
530 return res+"target";
531 } else if(data.ranks[i] < data.mergedEnd) {
532 return res+"merged";
533 } else {
534 return res;
535 }
536 })
537 .attr("title", function(d, i) {
538 if(data.mergedEnd > 0) {
539 if(data.ranks[i] >= data.mergedEnd) {
540 return "rank: "+i +" "+"freq. rank: "+(data.ranks[i]).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
541 } else {
542 return "rank: "+i +" "+"freq. rank: "+data.ranks[i].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + " (merged vocab)";
543 }
544 } else {
545 return "rank: "+i +" "+"freq. rank: "+data.ranks[i].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
546 }
547 })
548 .append("text")
549 .attr("text-anchor", "top")
550 .attr("font-size", 12)
551 .text(function(d) { return d; });
Marc Kupietz34c08172017-11-29 17:08:47 +0100552
Marc Kupietz384c9132018-03-19 16:45:24 +0100553 g.append("svg:title")
554 .text(function(d, i) {
555 return "distance rank: "+ i +" "+"\nfrequency rank: "+data.ranks[i].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
556 });
557
Marc Kupietze6a7a732018-01-12 09:21:08 +0100558 var zoomListener = d3.behavior.zoom()
559 .scaleExtent([0.1, 10])
560 .center([0,0])
561 .on("zoom", zoomHandler);
562 zoomListener(svg);
Marc Kupietz83305222016-04-28 09:57:22 +0200563 }
564
565 var tx=0, ty=0;
566 var ss=1;
567 var iter_id=-1;
568
569 function zoomHandler() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100570 tx = d3.event.translate[0];
571 ty = d3.event.translate[1];
572 ss = d3.event.scale;
573 updateEmbedding();
Marc Kupietz83305222016-04-28 09:57:22 +0200574 }
575
576 var stepnum = 0;
577
578 function stopStep() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100579 clearInterval(iter_id);
580 text = svg.selectAll("text");
Marc Kupietz34c08172017-11-29 17:08:47 +0100581
Marc Kupietze6a7a732018-01-12 09:21:08 +0100582 // jitter function needs different data and co-ordinate representation
583 labels = d3.range(data.words.length).map(function(i) {
584 var x = (T.Y[i][0]*20*ss + tx) + mapWidth/2;
585 var y = (T.Y[i][1]*20*ss + ty) + mapHeight/2;
586 anchor_array.push({x: x, y: y, r: jitterRadius});
587 return {
588 x: x,
589 y: y,
590 name: data.words[i]
591 };
592 });
Marc Kupietz34c08172017-11-29 17:08:47 +0100593
Marc Kupietze6a7a732018-01-12 09:21:08 +0100594 // get the actual label bounding boxes for the jitter function
595 var index = 0;
596 text.each(function() {
597 labels[index].width = this.getBBox().width;
598 labels[index].height = this.getBBox().height;
599 index += 1;
600 });
Marc Kupietz83305222016-04-28 09:57:22 +0200601
Marc Kupietz34c08172017-11-29 17:08:47 +0100602
Marc Kupietze6a7a732018-01-12 09:21:08 +0100603 // setTimeout(updateEmbedding, 1);
604 // setTimeout(
605 labeler = d3.labeler()
606 .label(labels)
607 .anchor(anchor_array)
608 .width(mapWidth)
609 .height(mapHeight)
610 .update(applyJitter);
611 // .start(1000);
Marc Kupietz83305222016-04-28 09:57:22 +0200612
Marc Kupietze6a7a732018-01-12 09:21:08 +0100613 iter_id = setInterval(jitterStep, 1);
Marc Kupietz83305222016-04-28 09:57:22 +0200614 }
615
616 var jitter_i=0;
617
618 function jitterStep() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100619 if(jitter_i++ > 100) {
620 clearInterval(iter_id);
621 } else {
622 labeler.start2(10);
623 applyJitter();
624 }
Marc Kupietz83305222016-04-28 09:57:22 +0200625 }
626
627 var last_cost=1000;
628
629 function step() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100630 var i = T.iter;
Marc Kupietz34c08172017-11-29 17:08:47 +0100631
Marc Kupietze6a7a732018-01-12 09:21:08 +0100632 if(i > <%= $no_iterations %>) {
633 stopStep();
634 } else {
635 var cost = Math.round(T.step() * 100000) / 100000; // do a few steps
636 $("#cost").html("tsne iteration " + i + ", cost: " + cost.toFixed(5));
637 if(i % 250 == 0 && cost >= last_cost) {
638 stopStep();
Marc Kupietz58270662017-12-04 12:10:06 +0100639 } else {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100640 last_cost = cost;
641 updateEmbedding();
Marc Kupietz58270662017-12-04 12:10:06 +0100642 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100643 }
Marc Kupietz83305222016-04-28 09:57:22 +0200644 }
645
646 function showMap(j) {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100647 data=j;
648 T.iter=0;
649 iter_id = -1;
650 last_cost=1000;
651 T.initDataRaw(data.vecs); // init embedding
652 drawEmbedding(); // draw initial embedding
Marc Kupietz78114532017-11-29 17:00:16 +0100653
Marc Kupietze6a7a732018-01-12 09:21:08 +0100654 if(iter_id >= 0) {
655 clearInterval(iter_id);
656 }
657 //T.debugGrad();
658 iter_id = setInterval(step, 1);
659 if(true) { // (<%= $show_som %>) {
660 makeSOM(j, <%= $no_iterations %>);
661 }
Marc Kupietz83305222016-04-28 09:57:22 +0200662 }
Marc Kupietz39179ab2017-07-04 16:28:06 +0200663 var queryword;
664
Marc Kupietz66bfd952017-12-11 09:59:45 +0100665 function showCollocatorSOM() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100666 if (collocatorTable) {
667 var ctableData = collocatorTable.rows().data();
668 var nwords = [],
669 nranks = [];
670 for (var i=0; i < ctableData.length && i < 100; i++) {
671 nranks.push(ctableData[i].rank);
672 nwords.push(ctableData[i].word);
Marc Kupietz66bfd952017-12-11 09:59:45 +0100673 }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100674 $.post('/derekovecs/getVecsByRanks',
675 JSON.stringify(nranks),
676 function(data, status){
677 showMap({target: " "+urlParams.get('word')+" ", mergedEnd: 0, words: nwords, vecs: data, ranks: nranks, marked: Array(100).fill(false)} );
678 }, 'json');
679 }
Marc Kupietz66bfd952017-12-11 09:59:45 +0100680 }
681
Marc Kupietz39179ab2017-07-04 16:28:06 +0200682 function onload() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100683 queryword = document.getElementById('word');
Marc Kupietz39179ab2017-07-04 16:28:06 +0200684 }
685
686 function queryKorAP() {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100687 window.open('http://korap.ids-mannheim.de/kalamar/?q='+queryword.value, 'KorAP');
Marc Kupietz39179ab2017-07-04 16:28:06 +0200688 }
Marc Kupietz4dc270c2017-11-24 10:17:12 +0100689
690 function queryKorAPCII(query) {
Marc Kupietze6a7a732018-01-12 09:21:08 +0100691 window.open('http://korap.ids-mannheim.de/kalamar/?ql=cosmas2&q='+query, 'KorAP');
Marc Kupietz4dc270c2017-11-24 10:17:12 +0100692 }
Marc Kupietz83305222016-04-28 09:57:22 +0200693 </script>
694 </head>
Marc Kupietz39179ab2017-07-04 16:28:06 +0200695 <body onload="onload()">
Marc Kupietz5a7f9ac2018-01-30 11:22:44 +0100696 <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 +0100697 <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 +0100698 <div id="header">
699 <div id="pagetitle">
700 <h1>DeReKo-Vectors</h1>
Marc Kupietz4fcda0c2017-11-29 09:00:31 +0100701 </div>
Marc Kupietz58270662017-12-04 12:10:06 +0100702 <div id="options" class="widget">
703 <form id="queryform">
704 <input id="word" type="text" name="word" placeholder="Word(s) to be searched" value="<%= $word %>"
705 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."/>
706 <input id="SEARCH" type="button" value="SEARCH">
707 <input type="button" id="showoptions" name="showoptions" value="Options" />
708 </form>
709 <div id="dropdownoptions" style="display: none">
710 <form id="optionsform">
711 <div class="controlgroup-vertical">
712 <label for="cutoff">cut-off</label>
713 <input id="cutoff" type="text" name="cutoff" size="10" value="<%= $cutoff %>" title="Only consider the most frequent x word forms.">
714 <label for="dedupe">dedupe</label>
715 <input id="dedupe" type="checkbox" name="dedupe" value="1" <%= ($dedupe ? "checked" : "") %> title="radically filter out any near-duplicates">
716 % if($mergedEnd > 0) {
717 <label for="sbf">backw.</label>
718 <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.">
719 % }
720 <label for="neighbours">max. neighbours:</label>
721 <input id="neighbours" size="4" name="n" value="<%= $no_nbs %>">
722 <label for="no_iterations">max. iterations</label>
723 <input id="no_iterations" name="N" size="4" value="<%= $no_iterations %>">
724 <!-- <label for="dosom">SOM</label>
725 <input id="dosom" type="checkbox" name="som" value="1" <%= ($show_som ? "checked" : "") %>> -->
726 % if($collocators) {
727 <label for="sortby">window/sort</label>
728 <select id="sortby" name="sort">
729 <option value="0" <%= ($sort!=1 && $sort!=2? "selected":"") %>>auto focus</option>
730 <!-- <option value="1" <%= ($sort==1? "selected":"") %>>any single position</option>
731 <option value="2" <%= ($sort==2? "selected":"") %>>whole window</option> -->
732 </select>
733 % }
734 <input type="button" value="→ KorAP" onclick="queryKorAP();" title="query word with KorAP"/>
Marc Kupietz1acb3172018-02-17 09:41:26 +0100735 <input id="show-details" type="checkbox" name="show-details" value="1" >
736 <label for="show-details">
737 Show details
738 </label>
Marc Kupietz58270662017-12-04 12:10:06 +0100739 </div>
740 </form>
741 </div>
742 </div>
743 </div>
744 <div id="topwrapper">
745 <div style="visibility: hidden;" id="tabs">
746 <ul>
747 <li><a href="#tabs-1">Semantics (TSNE-map)</a></li>
748 <li><a href="#tabs-2">Semantics (SOM)</a></li>
749 <li><a href="#tabs-3">Syntagmatic (collocators)</a></li>
750 </ul>
Marc Kupietz384c9132018-03-19 16:45:24 +0100751 <div id="tabs-1" style="display: flex; padding: 5px; flex-flow: row wrap;">
Marc Kupietz58270662017-12-04 12:10:06 +0100752 % if($lists && (@$lists) > 0 && (@$lists)[0]) {
753 <div id="wrapper">
Marc Kupietz384c9132018-03-19 16:45:24 +0100754 <div id="first" style="width: 230px; margin-bottom: 15px;">
Marc Kupietz58270662017-12-04 12:10:06 +0100755 <table class="display compact nowrap" id="firsttable">
756 <thead>
757 <tr>
Marc Kupietz384c9132018-03-19 16:45:24 +0100758 <th align="right">#</th><th align="right">cos</th><th align="left">similars by w2v</th>
Marc Kupietz58270662017-12-04 12:10:06 +0100759 </tr>
760 </thead>
761 <tbody>
762 <tr>
763 <td align="right">
764 </td>
765 <td align="right">
766 </td>
767 <td></td>
768 </tr>
769 </tbody>
770 </table>
771 </div>
Marc Kupietza55a09a2018-07-06 13:30:30 +0200772 % if(0 && $haveSProfiles) {
Marc Kupietz384c9132018-03-19 16:45:24 +0100773 <div id="sprofilesdiv" style="width: 200px; padding-right: 10px;">
774 <table class="display compact nowrap" id="sprofiles">
775 <thead>
776 <tr>
777 <th align="right">cos</th><th align="left">similars by coll. profile</th>
778 </tr>
779 </thead>
780 <tbody>
781 <tr>
782 <td align="right">
783 </td>
784 <td></td>
785 </tr>
786 </tbody>
787 </table>
788 </div>
789 %}
790 <div id="second">
Marc Kupietz58270662017-12-04 12:10:06 +0100791 <div id="embed">
792 </div>
793 <div id="cost">
794 </div>
795 </div>
796 </div>
Marc Kupietz384c9132018-03-19 16:45:24 +0100797 % } elsif($word !~ /^\s*$/) {
798 <div id="wrapper">
799 <div id="not-found-dialog" title="Not found">
800 <p>ERROR: "<%= $word %>" not found in vocabluary.</p>
801 <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>
802 </div>
803 <script>
804 $( function() {
805 $( "#not-found-dialog" ).dialog({
806 autoOpen: true,
807 modal: true,
808 draggable: false,
809 height: "auto",
810 width: "auto",
811 resizable: false,
812 buttons: {
813 "OK": function() {
814 $( this ).dialog( "close" );
815 },
816 "Apply": function() {
817 window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self");
818 }
819 }
820 });
821 });
822 </script>
823 </div>
824 % }
Marc Kupietz58270662017-12-04 12:10:06 +0100825 </div>
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100826 <div id="tabs-2" style="display: flex; padding: 5px; flex-flow: row wrap;">
Marc Kupietz66bfd952017-12-11 09:59:45 +0100827 <div id="som2" style="width: 800;">
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100828 <div id="sominfo1"><span id="somcolor1"> </span> <span id="somword1"> </span> <span id="somcolor2"> </span> <span id="somword2"> </span> <span id="somcolor3"> </span></div>
829 <div id="sominfo" style="text-align: right">SOM iteration <span id="iterations">0</span></div>
Marc Kupietz58270662017-12-04 12:10:06 +0100830 </div>
Marc Kupietz58270662017-12-04 12:10:06 +0100831 </div>
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100832 <div id="tabs-3" style="display: flex; padding:5px; flex-flow: row wrap;">
833 <div style="margin-right: 20px; margin-bottom: 10px;" id="secondt">
Marc Kupietze6a7a732018-01-12 09:21:08 +0100834 <table class="display compact nowrap" id="secondtable">
Marc Kupietz58270662017-12-04 12:10:06 +0100835 <thead>
836 <tr>
837 % if($collocators) {
838 <th>#</th>
Marc Kupietz4116b432017-12-06 14:15:32 +0100839 <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>
840 <th align="right" title="Maximum activation of the collocator anywhere in the output layer.">max(a)</th>
841 <th title="Average raw activation of the collocator in the columns selected by auto-focus." align="right">⟨a⟩</th>
842 <th title="Sum of activations over the selected colunns normalized by the total activation sum of the selected columns." align="right">Σa/Σw'</th>
843 <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 +0100844 <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 +0100845 <th align="left">collocator (by w2v)</th>
Marc Kupietz58270662017-12-04 12:10:06 +0100846 % }
847 </tr>
848 </thead>
849 <tbody>
850 <tr>
851 <td align="right">
852 </td>
853 <td align="right">
854 </td>
855 <td align="right">
856 </td>
857 <td align="right">
858 </td>
859 <td align="right">
860 </td>
861 <td align="right">
862 </td>
Marc Kupietz58270662017-12-04 12:10:06 +0100863 </tr>
864 </tbody>
865 </table>
Marc Kupietz66bfd952017-12-11 09:59:45 +0100866 </div>
Marc Kupietzdeb8f622018-03-12 09:41:00 +0100867 <div id="ccd" style="">
Marc Kupietze6a7a732018-01-12 09:21:08 +0100868 <table class="display compact nowrap" id="classicoloctable">
869 <thead>
Marc Kupietzcd136e22018-01-29 09:18:12 +0100870 % if($collocators) {
871 <tr>
872 <th>LLR</th>
Marc Kupietz5a7f9ac2018-01-30 11:22:44 +0100873 <th id="lfmd_tt">PMI³</th>
Marc Kupietzcd136e22018-01-29 09:18:12 +0100874 <th id="npmi_tt">nPMI</th>
Marc Kupietz5a7f9ac2018-01-30 11:22:44 +0100875 <th title="PMI³ restricted to left neighbour">l-PMI³</th>
876 <th title="PMI³ restricted to right neighbour">r-PMI³</th>
877 <th title="nPMI restricted to left neighbour">l-nPMI</th>
878 <th title="nPMI restricted to right neighbour">r-nPMI</th>
Marc Kupietzcd136e22018-01-29 09:18:12 +0100879 <th title="raw max frequency of collocation within window">raw</th>
Marc Kupietz384c9132018-03-19 16:45:24 +0100880 <th>collocator (by collocation analysis)</th>
Marc Kupietzcd136e22018-01-29 09:18:12 +0100881 </tr>
Marc Kupietz1acb3172018-02-17 09:41:26 +0100882 % }
Marc Kupietze6a7a732018-01-12 09:21:08 +0100883 </thead>
884 <tbody>
885 <tr>
886 <td align="right">
887 </td>
888 <td align="right">
889 </td>
890 <td align="right">
891 </td>
892 <td align="right">
893 </td>
Marc Kupietzcfcdcfc2018-01-24 09:51:26 +0100894 <td align="right">
895 </td>
896 <td align="right">
897 </td>
Marc Kupietzb4b53ca2018-01-25 08:57:11 +0100898 <td align="right"></td>
899 <td align="right"></td>
900 <td align="left"></td>
Marc Kupietze6a7a732018-01-12 09:21:08 +0100901 </tr>
902 </tbody>
903 </table>
904 </div>
Marc Kupietz384c9132018-03-19 16:45:24 +0100905 <!--
906 <div style="clear:both" ></div>
907 <div style="float: right; overflow: hidden" id="extra"><button onClick="showCollocatorSOM()"> </button></div>
908 -->
Marc Kupietz66bfd952017-12-11 09:59:45 +0100909 </div>
Marc Kupietz58270662017-12-04 12:10:06 +0100910 </div>
911 </div> <!-- topwrapper -->
912 <div style="clear: both;"></div>
913 </div>
Marc Kupietzebea4702018-01-12 09:16:09 +0100914 % if($training_args && (@$lists)[0]) {
915 <div class="info">
916 % if($training_args =~ /-type\s*3/) {
917 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 %>
918 % } else {
919 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 %>
920 % }
921 </div>
Marc Kupietz83305222016-04-28 09:57:22 +0200922 % }
Marc Kupietz58270662017-12-04 12:10:06 +0100923 </body>
Marc Kupietz83305222016-04-28 09:57:22 +0200924</html>