Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
Marc Kupietz | c053d97 | 2019-01-10 10:41:51 +0100 | [diff] [blame] | 4 | <% my $plain_title = $title; $plain_title=~s/<[^>]+>//g; %> |
| 5 | <title><%= $plain_title %>:<%= $word %> DeReKo-Word-Vector-Distances</title> |
Marc Kupietz | 80bd7b9 | 2017-07-04 16:25:54 +0200 | [diff] [blame] | 6 | <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 7 | <link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Condensed" rel="stylesheet"> |
Marc Kupietz | 80bd7b9 | 2017-07-04 16:25:54 +0200 | [diff] [blame] | 8 | <script src="http://code.jquery.com/jquery-latest.min.js"></script> |
Marc Kupietz | 5f532b3 | 2019-01-23 10:03:18 +0100 | [diff] [blame] | 9 | <script src = "https://cdn.datatables.net/1.10.18/js/jquery.dataTables.min.js"></script> |
| 10 | <script src = "https://cdn.datatables.net/fixedcolumns/3.2.5/js/dataTables.fixedColumns.min.js"></script> |
| 11 | <script src = "https://cdn.datatables.net/plug-ins/1.10.18/sorting/scientific.js"></script> |
| 12 | <script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML'></script> |
| 13 | <link rel="stylesheet" href="https://cdn.datatables.net/1.10.18/css/jquery.dataTables.min.css"> |
Marc Kupietz | 4949d23 | 2018-03-19 16:43:18 +0100 | [diff] [blame] | 14 | <link rel="stylesheet" href="/derekovecs/css/derekovecs.css"> |
Marc Kupietz | 80bd7b9 | 2017-07-04 16:25:54 +0200 | [diff] [blame] | 15 | <script |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 16 | src="http://code.jquery.com/ui/1.12.1/jquery-ui.min.js" |
| 17 | integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" |
| 18 | crossorigin="anonymous"></script> |
Marc Kupietz | 80bd7b9 | 2017-07-04 16:25:54 +0200 | [diff] [blame] | 19 | <script> |
Marc Kupietz | a0ffb39 | 2018-01-25 08:53:43 +0100 | [diff] [blame] | 20 | 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 Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 28 | var urlParams = new URLSearchParams(window.location.search); |
Marc Kupietz | b3a2e4f | 2017-12-08 17:25:53 +0100 | [diff] [blame] | 29 | var currentWords = urlParams.get("word"); |
Marc Kupietz | a0ffb39 | 2018-01-25 08:53:43 +0100 | [diff] [blame] | 30 | var CIIsearchWords = (currentWords && currentWords.includes(" ") ? '('+currentWords.replace(/ +/g, " oder ")+')' : currentWords); |
Marc Kupietz | 66bfd95 | 2017-12-11 09:59:45 +0100 | [diff] [blame] | 31 | var collocatorTable = null; |
Marc Kupietz | a6e08f0 | 2017-12-01 22:06:21 +0100 | [diff] [blame] | 32 | |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 33 | $(document).ready(function() { |
Marc Kupietz | 694610d | 2017-11-25 18:30:03 +0100 | [diff] [blame] | 34 | |
Marc Kupietz | a0ffb39 | 2018-01-25 08:53:43 +0100 | [diff] [blame] | 35 | $('#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 () { |
Marc Kupietz | 7bd5523 | 2019-01-22 15:29:06 +0100 | [diff] [blame] | 44 | $("#mi_tt").attr("title",$("#pmi_ttt").html()); |
Marc Kupietz | a0ffb39 | 2018-01-25 08:53:43 +0100 | [diff] [blame] | 45 | $("#lfmd_tt").attr("title",$("#lfmd_ttt").html()); |
Marc Kupietz | 7bd5523 | 2019-01-22 15:29:06 +0100 | [diff] [blame] | 46 | $("#md_tt").attr("title",$("#md_ttt").html()); |
Marc Kupietz | a0ffb39 | 2018-01-25 08:53:43 +0100 | [diff] [blame] | 47 | $("#npmi_tt").attr("title",$("#npmi_ttt").html()); |
Marc Kupietz | f19814b | 2019-01-21 16:50:19 +0100 | [diff] [blame] | 48 | $("#ll_tt").attr("title",$("#ll_ttt").html()); |
Marc Kupietz | 7bd5523 | 2019-01-22 15:29:06 +0100 | [diff] [blame] | 49 | $("#logdice_tt").attr("title",$("#logdice_ttt").html()); |
Marc Kupietz | 63b268f | 2019-01-22 22:34:29 +0100 | [diff] [blame] | 50 | $("#logdiceaf_tt").attr("title",$("#logdiceaf_ttt").html()); |
Marc Kupietz | a0ffb39 | 2018-01-25 08:53:43 +0100 | [diff] [blame] | 51 | } |
| 52 | ); |
| 53 | }); |
| 54 | |
| 55 | //set things up so that we can shove raw html into what is shown in the tooltip; |
| 56 | // in this case, we will have already put into the title attribute the html that |
| 57 | // contains the MathJax rendered equations (via what we do in the callback). |
| 58 | $(function () { |
| 59 | $(document).tooltip({ |
| 60 | content: function () { |
| 61 | return $(this).prop('title'); |
| 62 | } |
| 63 | }); |
| 64 | }); |
| 65 | |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 66 | $("input").bind("keydown", function(event) { |
| 67 | // track enter key |
| 68 | var keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode)); |
| 69 | if (keycode == 13) { // keycode for enter key |
| 70 | // force the 'Enter Key' to implicitly click the Update button |
| 71 | document.getElementById('SEARCH').click(); |
| 72 | return false; |
| 73 | } else { |
| 74 | return true; |
| 75 | }}); |
Marc Kupietz | dab9f22 | 2017-11-29 14:22:59 +0100 | [diff] [blame] | 76 | |
Marc Kupietz | e871abd | 2018-01-25 16:18:27 +0100 | [diff] [blame] | 77 | var collocatorTable_activated = false; |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 78 | $( "#tabs" ).on( "tabsactivate", function( event, ui ) { |
| 79 | if (localStorage) localStorage['tab'] = ui.newTab.index(); |
Marc Kupietz | e871abd | 2018-01-25 16:18:27 +0100 | [diff] [blame] | 80 | if(ui.newTab.index() == 2 && !collocatorTable_activated) { |
| 81 | classicCollocatorTable.columns.adjust(); |
| 82 | collocatorTable.columns.adjust(); |
| 83 | collocatorTable_activated = true; |
| 84 | } |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 85 | }); |
| 86 | |
| 87 | $(function(){ |
| 88 | $("#SEARCH").click(function() { |
| 89 | window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self"); |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 90 | }); |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 91 | }); |
Marc Kupietz | 0af83e3 | 2017-11-27 09:31:37 +0100 | [diff] [blame] | 92 | |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 93 | function changeCharColor(txt, heat, word) { |
| 94 | var newText = ""; |
| 95 | for (var i=0, l=txt.length; i<l; i++) { |
| 96 | newText += (i == 5 ? txt.charAt(i) : '<a href="http://korap.ids-mannheim.de/kalamar/?ql=cosmas2&q=' + |
| 97 | CIIsearchWords + ' /' + (i > 5? '%2B' : '-') + 'w' + |
| 98 | Math.abs(i-5) + ':' + Math.abs(i-5) + ' ' + word + |
| 99 | '" target="korap"><span style="background-color:' + |
| 100 | getHeatColor(heat[i]/maxHeat)+'">'+txt.charAt(i)+'</span></a>'); |
Marc Kupietz | b6c615d | 2017-12-02 10:38:20 +0100 | [diff] [blame] | 101 | } |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 102 | return newText; |
| 103 | } |
Marc Kupietz | b6c615d | 2017-12-02 10:38:20 +0100 | [diff] [blame] | 104 | |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 105 | function getHeatColor(value) { |
| 106 | var hue=((1-value)*120).toString(10); |
| 107 | return ["hsl(",hue,",90%,70%)"].join(""); |
| 108 | } |
| 109 | |
Marc Kupietz | 63b268f | 2019-01-22 22:34:29 +0100 | [diff] [blame] | 110 | function bitmask2window(n) { |
| 111 | var str = n.toString(2).padStart(10, "0") |
| 112 | .replace(/^([0-9]{5})/, '$1 ') |
| 113 | .replace(/0/g, '·') |
| 114 | .replace(/1/g, '+'); |
| 115 | return str; |
| 116 | } |
| 117 | |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 118 | function bitvec2window(n, heat, word) { |
| 119 | var str = n.toString(2).padStart(10, "0") |
| 120 | .replace(/^([0-9]{5})/, '$1x') |
| 121 | .replace(/0/g, '·') |
| 122 | .replace(/1/g, '+'); |
| 123 | return changeCharColor(str, heat, word); |
| 124 | } |
| 125 | |
| 126 | % use Mojo::ByteStream 'b'; |
| 127 | var paraResults = <%= b(Mojo::JSON::to_json($lists)) %>; |
| 128 | var urlprefix = new URLSearchParams(window.location.search); |
| 129 | if (paraResults.length > 0 && paraResults[0] != null) { |
| 130 | var nvecs = [], |
| 131 | nwords = [], |
| 132 | nranks = [], |
| 133 | nmarked = []; |
| 134 | for(var i = 0; i < paraResults.length; i++) { |
| 135 | nwords = nwords.concat(paraResults[i].map(function(a){return a.word;})); |
| 136 | nvecs = nvecs.concat(paraResults[i].map(function(a){return a.vector;})); |
| 137 | nranks = nranks.concat(paraResults[i].map(function(a){return a.rank;})); |
| 138 | nmarked = nmarked.concat(paraResults[i].map(function(a){return a.marked;})); |
Marc Kupietz | 0d4c0ca | 2017-12-04 09:18:56 +0100 | [diff] [blame] | 139 | } |
Marc Kupietz | 2e2e4db | 2018-12-21 15:07:37 +0100 | [diff] [blame] | 140 | showMap({target: " "+urlParams.get('word')+" ", mergedEnd: <%= $mergedEnd %>, words: nwords, vecs: nvecs, ranks: nranks, marked: nmarked} ); |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 141 | var t = $('#firsttable').DataTable({ |
Marc Kupietz | ee894d5 | 2019-01-09 14:55:14 +0100 | [diff] [blame] | 142 | data: [].concat.apply([], paraResults), |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 143 | "sScrollY": "780px", |
| 144 | "bScrollCollapse": true, |
| 145 | "bPaginate": false, |
| 146 | "bJQueryUI": true, |
| 147 | "dom": '<"top">rt<"bottom"flp><"clear">', |
Marc Kupietz | 384c913 | 2018-03-19 16:45:24 +0100 | [diff] [blame] | 148 | "initComplete":function(settings, json) { |
| 149 | $('td.paradigmator a').on('mousedown', function(e) { |
| 150 | return paradigmatorClick(e, paraResults[0][0].word, this.childNodes["0"].textContent); |
| 151 | }); |
| 152 | }, |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 153 | "columns": [ |
| 154 | { "data": "rank", type: "allnumeric" }, |
| 155 | { "data": "dist", render: function ( data, type, row ) {return data.toFixed(3) }}, |
Marc Kupietz | 2e2e4db | 2018-12-21 15:07:37 +0100 | [diff] [blame] | 156 | { "data": "word", class: "paradigmator", render: function ( data, type, row ) { |
| 157 | urlprefix.set("word", data); return '<a class="' + getMergedClass(row.rank) + '" href="?' + urlprefix + '">' + data + '</a>' |
| 158 | }} |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 159 | ], |
| 160 | "columnDefs": [ |
| 161 | { className: "dt-right", "targets": [0,1] }, |
| 162 | { "searchable": false, |
| 163 | "orderable": false, |
| 164 | "targets": 0 |
| 165 | }, |
| 166 | { "orderSequence": [ "desc" ], "targets": [ 1 ] }, |
| 167 | { "orderSequence": [ "asc", "desc" ], "targets": [ 2 ] }, |
| 168 | ], |
| 169 | "oLanguage": { |
| 170 | "sSearch": "Filter: " |
| 171 | }, |
| 172 | "order": [[ 1, 'desc' ]], |
| 173 | } ); |
Marc Kupietz | 0d4c0ca | 2017-12-04 09:18:56 +0100 | [diff] [blame] | 174 | |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 175 | t.on( 'order.dt search.dt', function () { |
| 176 | t.column(0, {order:'applied'}).nodes().each( function (cell, i) { |
| 177 | cell.innerHTML = i+1; |
| 178 | } ); |
| 179 | } ).draw(); |
| 180 | |
| 181 | $( "#first" ).clone().prependTo( "#tabs-2" ); |
| 182 | |
| 183 | } |
| 184 | |
| 185 | |
| 186 | var collocatorData = <%= b(Mojo::JSON::to_json($collocators)) %>; |
| 187 | var maxHeat; // = Math.max.apply(Math,collocatorData.map(function(o){return o.cprob;})) |
| 188 | |
| 189 | if (collocatorData != null) { |
| 190 | maxHeat = Math.max.apply(Math,collocatorData.map(function(o){return Math.max.apply(Math,o.heat);})) |
| 191 | collocatorTable = $('#secondtable').DataTable({ |
| 192 | data: collocatorData, |
| 193 | "sScrollY": "780px", |
| 194 | "bScrollCollapse": true, |
| 195 | "bPaginate": false, |
| 196 | "bJQueryUI": true, |
| 197 | "dom": '<"top">rt<"bottom"flp><"clear">', |
| 198 | "columns": [ |
| 199 | { "data": "rank", type: "allnumeric" }, |
| 200 | { "data": "pos", width: "7%", sClass: "dt-center mono compact", render: function ( data, type, row ) {return bitvec2window(data, row.heat, row.word) }}, |
| 201 | { "data": "max", render: function ( data, type, row ) {return data.toFixed(3) }}, |
| 202 | { "data": "average", render: function ( data, type, row ) {return data.toFixed(3) }}, |
| 203 | { "data": "prob", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } }, |
| 204 | { "data": "cprob", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } }, |
| 205 | { "data": "overall", type: "scientific", render: function ( data, type, row ) {return data.toExponential(3) } }, |
| 206 | { "data": "word", sClass: "collocator" }, |
| 207 | { "data": "rank", type: "allnumeric" } |
| 208 | ], |
| 209 | "columnDefs": [ |
| 210 | { className: "dt-right", "targets": [0,2,3,4,5,6] }, |
| 211 | { className: "dt-center", "targets": [ 1] }, |
| 212 | { "searchable": false, |
| 213 | "orderable": false, |
| 214 | "targets": [0, 8] |
| 215 | }, |
| 216 | { "type": "scientific", targets: [2,3,4,5,6] }, |
| 217 | { "orderSequence": [ "desc" ], "targets": [ 2, 3, 4, 5, 6 ] }, |
| 218 | { "orderSequence": [ "asc", "desc" ], "targets": [ 1, 7 ] }, |
| 219 | { "targets": [8], "visible": false } |
| 220 | ], |
| 221 | "oLanguage": { |
| 222 | "sSearch": "Filter: " |
| 223 | }, |
| 224 | "order": [[ 4, 'desc' ]], |
| 225 | } ); |
| 226 | $.ajaxSetup({ |
| 227 | type: 'POST', |
| 228 | timeout: 30000, |
| 229 | error: function(xhr) { |
| 230 | $('#display_error') |
| 231 | .html('Error: ' + xhr.status + ' ' + xhr.statusText); |
| 232 | } |
Marc Kupietz | 78b434a | 2018-01-12 22:33:32 +0100 | [diff] [blame] | 233 | }); |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 234 | |
Marc Kupietz | 384c913 | 2018-03-19 16:45:24 +0100 | [diff] [blame] | 235 | |
| 236 | if($('#sprofiles').length) { |
| 237 | similarProfileTable = $('#sprofiles').DataTable({ |
| 238 | ajax: { |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 239 | method: "GET", |
Marc Kupietz | 384c913 | 2018-03-19 16:45:24 +0100 | [diff] [blame] | 240 | url: '/derekovecs/getSimilarProfiles', |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 241 | dataType: 'json', |
| 242 | dataSrc: "", |
| 243 | timeout: 30000, |
| 244 | data: { w: paraResults[0][0].rank } |
Marc Kupietz | 384c913 | 2018-03-19 16:45:24 +0100 | [diff] [blame] | 245 | }, |
| 246 | "initComplete":function(settings, json){ |
| 247 | $('td.paradigmator a').on('mousedown', function(e) { |
| 248 | if (e.which === 2) { |
| 249 | e.preventDefault(); |
| 250 | queryKorAPalternatives(paraResults[0][0].word, this.childNodes["0"].textContent); |
| 251 | return false; |
| 252 | } |
| 253 | }); |
| 254 | }, |
| 255 | "sScrollY": "780px", |
| 256 | "bScrollCollapse": true, |
| 257 | "bPaginate": false, |
| 258 | "bJQueryUI": true, |
| 259 | "dom": '<"top">rt<"bottom"flp><"clear">', |
| 260 | "columns": [ |
| 261 | { "data": "v", render: function ( data, type, row ) {return data.toFixed(3) }}, |
| 262 | { "data": "w", sClass: "paradigmator", render: function ( data, type, row ) {urlprefix.set("word", data); return '<a href="?' + urlprefix + '">' + data + '</a>' } } |
| 263 | ], |
| 264 | "columnDefs": [ |
| 265 | { className: "dt-right", "targets": [0] }, |
| 266 | ], |
| 267 | "oLanguage": { |
| 268 | "sSearch": "Filter: " |
| 269 | }, |
| 270 | "order": [[ 0, 'desc' ]], |
| 271 | }); |
| 272 | } |
| 273 | // var filterQuot = /(^quot?=[A-Z])|(quot$)/g; |
| 274 | var filterQuot = /^quot/; |
| 275 | classicCollocatorTable = $('#classicoloctable').DataTable({ |
| 276 | ajax: { |
| 277 | method: "GET", |
| 278 | url: '/derekovecs/getClassicCollocators', |
| 279 | dataType: 'json', |
| 280 | dataSrc: "", |
| 281 | timeout: 30000, |
| 282 | data: { w: paraResults[0][0].rank } |
Marc Kupietz | 78b434a | 2018-01-12 22:33:32 +0100 | [diff] [blame] | 283 | }, |
Marc Kupietz | ad78372 | 2018-01-13 17:45:21 +0100 | [diff] [blame] | 284 | "initComplete":function(settings, json){ |
| 285 | $("td.collocator").click(function(){ |
| 286 | queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords); |
| 287 | }); |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 288 | classicCollocatorTable.columns(".detail").visible(false); |
Marc Kupietz | 63b268f | 2019-01-22 22:34:29 +0100 | [diff] [blame] | 289 | $("#ccd").css('width', '680px'); |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 290 | classicCollocatorTable.columns.adjust().draw(); |
Marc Kupietz | ad78372 | 2018-01-13 17:45:21 +0100 | [diff] [blame] | 291 | }, |
Marc Kupietz | 9c1a3d2 | 2019-01-23 10:04:18 +0100 | [diff] [blame] | 292 | "createdRow": function (row, data, rowIndex) { |
| 293 | $.each($('td.collocator', row), function (colIndex) { |
| 294 | $(this).attr('title', "f("+data.word+")="+data.f2.toLocaleString("en-GB")); |
| 295 | }); |
| 296 | }, |
Marc Kupietz | 78b434a | 2018-01-12 22:33:32 +0100 | [diff] [blame] | 297 | "sScrollY": "780px", |
| 298 | "bScrollCollapse": true, |
| 299 | "bPaginate": false, |
| 300 | "bJQueryUI": true, |
| 301 | "dom": '<"top">rt<"bottom"flp><"clear">', |
| 302 | "columns": [ |
| 303 | // { "data": "pos", width: "7%", sClass: "dt-center mono compact", render: function ( data, type, row ) {return bitvec2window(data, row.heat, row.word) }}, |
Marc Kupietz | b4b53ca | 2018-01-25 08:57:11 +0100 | [diff] [blame] | 304 | { "data": "llr", render: function ( data, type, row ) {return data.toFixed(0) }}, |
Marc Kupietz | 7bd5523 | 2019-01-22 15:29:06 +0100 | [diff] [blame] | 305 | { "data": "pmi", render: function ( data, type, row ) {return data.toFixed(2) }}, |
| 306 | { "data": "md", render: function ( data, type, row ) {return data.toFixed(2) }}, |
| 307 | { "data": "lfmd", render: function ( data, type, row ) {return data.toFixed(2) }}, |
Marc Kupietz | 1acb317 | 2018-02-17 09:41:26 +0100 | [diff] [blame] | 308 | // { "data": "fpmi", type: "scientific", render: function ( data, type, row ) {return data.toExponential(2) } }, |
Marc Kupietz | 7bd5523 | 2019-01-22 15:29:06 +0100 | [diff] [blame] | 309 | { "data": "npmi", render: function ( data, type, row ) {return data.toFixed(3) }}, |
| 310 | { "data": "dice", render: function ( data, type, row ) {return data.toExponential(2) }}, |
| 311 | { "data": "ld", render: function ( data, type, row ) {return data.toFixed(2) }}, |
Marc Kupietz | 63b268f | 2019-01-22 22:34:29 +0100 | [diff] [blame] | 312 | { "data": "af", render: function ( data, type, row ) {return data.toFixed(2) }}, |
| 313 | { "data": "win", width: "auto", sClass: "dt-center mono compact", render: function ( data, type, row ) {return bitmask2window(data) }}, |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 314 | { "data": "llfmd", render: function ( data, type, row ) {return data.toFixed(1) }}, |
| 315 | { "data": "rlfmd", render: function ( data, type, row ) {return data.toFixed(1) }}, |
| 316 | { "data": "lnpmi", render: function ( data, type, row ) {return data.toFixed(2) }}, |
| 317 | { "data": "rnpmi", render: function ( data, type, row ) {return data.toFixed(2) }}, |
Marc Kupietz | b4b53ca | 2018-01-25 08:57:11 +0100 | [diff] [blame] | 318 | { "data": "f" }, |
Marc Kupietz | 78b434a | 2018-01-12 22:33:32 +0100 | [diff] [blame] | 319 | { "data": "word", sClass: "collocator" } |
| 320 | ], |
| 321 | "columnDefs": [ |
Marc Kupietz | 63b268f | 2019-01-22 22:34:29 +0100 | [diff] [blame] | 322 | { className: "dt-right", "targets": [0,1,2,3,4,5,6,7,9,10,11,12,13] }, |
| 323 | { className: "dt-right detail", "targets": [5,9,10,11,12] }, |
Marc Kupietz | 78b434a | 2018-01-12 22:33:32 +0100 | [diff] [blame] | 324 | { "searchable": false, |
| 325 | "orderable": false, |
| 326 | "targets": [] |
| 327 | }, |
Marc Kupietz | 63b268f | 2019-01-22 22:34:29 +0100 | [diff] [blame] | 328 | { "orderSequence": [ "desc" ], "targets": [0,1,2,3,4,5,6,7,9,10,11,12,13] }, |
| 329 | { "orderSequence": [ "asc", "desc" ], "targets": [8,14] }, |
Marc Kupietz | 78b434a | 2018-01-12 22:33:32 +0100 | [diff] [blame] | 330 | ], |
| 331 | "oLanguage": { |
| 332 | "sSearch": "Filter: " |
| 333 | }, |
Marc Kupietz | 63b268f | 2019-01-22 22:34:29 +0100 | [diff] [blame] | 334 | "order": [[ 7, 'desc' ]], |
Marc Kupietz | 78b434a | 2018-01-12 22:33:32 +0100 | [diff] [blame] | 335 | }); |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 336 | |
Marc Kupietz | 1acb317 | 2018-02-17 09:41:26 +0100 | [diff] [blame] | 337 | |
| 338 | $('#show-details').change(function (e) { |
| 339 | var columns = classicCollocatorTable.columns(".detail"); |
| 340 | if(this.checked) { |
| 341 | columns.visible(true); |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 342 | $("#ccd").css('width', 'auto'); |
Marc Kupietz | 1acb317 | 2018-02-17 09:41:26 +0100 | [diff] [blame] | 343 | } else { |
| 344 | columns.visible(false); |
Marc Kupietz | 08bfd40 | 2019-01-23 10:05:17 +0100 | [diff] [blame^] | 345 | $("#ccd").css('width', '680px'); |
Marc Kupietz | 1acb317 | 2018-02-17 09:41:26 +0100 | [diff] [blame] | 346 | } |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 347 | classicCollocatorTable.columns.adjust().draw(); |
Marc Kupietz | 1acb317 | 2018-02-17 09:41:26 +0100 | [diff] [blame] | 348 | } ); |
| 349 | |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 350 | $("td.collocator").click(function(){ |
| 351 | queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords); |
Marc Kupietz | ad78372 | 2018-01-13 17:45:21 +0100 | [diff] [blame] | 352 | }); |
| 353 | |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 354 | collocatorTable.on( 'order.dt search.dt', function () { |
| 355 | collocatorTable.column(0, {order:'applied'}).nodes().each( function (cell, i) { |
| 356 | cell.innerHTML = i+1; |
| 357 | } ); |
| 358 | }).draw(); |
| 359 | } |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 360 | |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 361 | if (localStorage && !window.location.hash) { // let's not crash if some user has IE7 |
| 362 | var index = parseInt(localStorage['tab']||'0'); |
| 363 | $("#tabs").tabs({ active: index }); |
| 364 | } |
| 365 | $("#tabs").css("visibility", "visible"); // now we can show the tabs |
| 366 | }); |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 367 | |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 368 | $(function(){ |
| 369 | $("#dropdownoptions").dialog({ |
| 370 | title: "Options", |
| 371 | autoOpen: false, |
| 372 | modal: false, |
| 373 | draggable: false, |
| 374 | height: "auto", |
| 375 | width: "auto", |
| 376 | resizable: false, |
| 377 | buttons: { |
| 378 | "Cancel": function() { |
| 379 | $( this ).dialog( "close" ); |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 380 | }, |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 381 | "Apply": function() { |
| 382 | window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self"); |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 383 | } |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 384 | } |
| 385 | }); |
| 386 | }); |
| 387 | |
| 388 | $(function(){ |
| 389 | $("#showoptions").click(function(){ |
| 390 | $("#dropdownoptions").dialog("open"); |
| 391 | var target = $(this); |
| 392 | $("#dropdownoptions").dialog("widget").position({ |
| 393 | my: 'left bottom', |
| 394 | at: 'left bottom', |
| 395 | of: target |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 396 | }); |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 397 | }); |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 398 | }); |
| 399 | |
| 400 | $( function() { |
| 401 | $( "#no_iterations" ).spinner({ |
| 402 | spin: function( event, ui ) { |
| 403 | if ( ui.value < 1000 ) { |
| 404 | $( this ).spinner( "value", 1000 ); |
| 405 | return false; |
| 406 | } else if ( ui.value > 10000 ) { |
| 407 | $( this ).spinner( "value", 10000 ); |
| 408 | return false; |
| 409 | } |
| 410 | } |
| 411 | }); |
| 412 | } ); |
| 413 | |
| 414 | $( function() { |
| 415 | $( "#neighbours" ).spinner({ |
| 416 | spin: function( event, ui ) { |
| 417 | if ( ui.value < 0 ) { |
| 418 | $( this ).spinner( "value", 0 ); |
| 419 | return false; |
| 420 | } else if ( ui.value > 200 ) { |
| 421 | $( this ).spinner( "value", 200 ); |
| 422 | return false; |
| 423 | } |
| 424 | } |
| 425 | }); |
| 426 | } ); |
| 427 | |
| 428 | $( function() { |
| 429 | $( "#cutoff" ).spinner({ |
| 430 | spin: function( event, ui ) { |
| 431 | if ( ui.value < 100000 ) { |
| 432 | $( this ).spinner( "value", 100000 ); |
| 433 | return false; |
| 434 | } else if ( ui.value > 2000000 ) { |
| 435 | $( this ).spinner( "value", 2000000 ); |
| 436 | return false; |
| 437 | } |
| 438 | } |
| 439 | }); |
| 440 | } ); |
| 441 | |
| 442 | $( function() { |
| 443 | $( "#tabs" ).tabs().addClass('tabs-min'); |
| 444 | } ); |
| 445 | |
| 446 | $( function() { |
| 447 | $( ".controlgroup-vertical" ).controlgroup({ |
| 448 | "direction": "vertical" |
| 449 | }); |
| 450 | } ); |
| 451 | |
| 452 | $(function() { |
| 453 | $( document ).tooltip({ |
| 454 | content: function() { |
| 455 | return $(this).attr('title'); |
| 456 | }} |
| 457 | ) |
| 458 | }); |
| 459 | |
| 460 | $(function () { |
| 461 | $(document).tooltip({ |
| 462 | content: function () { |
| 463 | return $(this).prop('title'); |
| 464 | }, |
| 465 | show: null, |
| 466 | close: function (event, ui) { |
| 467 | ui.tooltip.hover( |
| 468 | function () { |
| 469 | $(this).stop(true).fadeTo(400, 1); |
| 470 | }, |
| 471 | function () { |
| 472 | $(this).fadeOut("400", function () { |
| 473 | $(this).remove(); |
| 474 | }) |
| 475 | }); |
| 476 | } |
| 477 | }); |
| 478 | }); |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 479 | </script> |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 480 | <script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script> |
| 481 | <script src="/derekovecs/js/tsne.js"></script> |
| 482 | <script src="/derekovecs/js/som.js"></script> |
| 483 | <script src="/derekovecs/js/labeler.js"></script> |
Marc Kupietz | cdd5130 | 2018-03-19 16:36:54 +0100 | [diff] [blame] | 484 | <script src="/derekovecs/js/derekovcs.js"></script> |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 485 | <script> |
| 486 | |
| 487 | var opt = {epsilon: <%= $epsilon %>, perplexity: <%= $perplexity %>}, |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 488 | mapWidth = 800, // width map |
| 489 | mapHeight = 800, |
| 490 | jitterRadius = 7; |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 491 | |
| 492 | var T = new tsnejs.tSNE(opt); // create a tSNE instance |
| 493 | |
| 494 | var Y; |
| 495 | |
| 496 | var data; |
| 497 | var labeler; |
| 498 | |
| 499 | function applyJitter() { |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 500 | svg.selectAll('.tsnet') |
| 501 | .data(labels) |
| 502 | .transition() |
| 503 | .duration(50) |
| 504 | .attr("transform", function(d, i) { |
| 505 | T.Y[i][0] = (d.x - mapWidth/2 - tx)/ss/20; |
| 506 | T.Y[i][1] = (d.y - mapHeight/2 - ty)/ss/20; |
| 507 | return "translate(" + |
Marc Kupietz | 384c913 | 2018-03-19 16:45:24 +0100 | [diff] [blame] | 508 | (d.x) + "," + |
| 509 | (d.y) + ")"; |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 510 | }); |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 511 | } |
Marc Kupietz | 34c0817 | 2017-11-29 17:08:47 +0100 | [diff] [blame] | 512 | |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 513 | function updateEmbedding() { |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 514 | var Y = T.getSolution(); |
| 515 | svg.selectAll('.tsnet') |
| 516 | .data(data.words) |
| 517 | .attr("transform", function(d, i) { |
| 518 | return "translate(" + |
Marc Kupietz | 384c913 | 2018-03-19 16:45:24 +0100 | [diff] [blame] | 519 | ((Y[i][0]*20*ss + tx) + mapWidth/2) + "," + |
| 520 | ((Y[i][1]*20*ss + ty) + mapHeight/2) + ")"; }); |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 521 | } |
| 522 | |
| 523 | var svg; |
| 524 | var labels = []; |
| 525 | var anchor_array = []; |
| 526 | var text; |
| 527 | |
Marc Kupietz | 2e2e4db | 2018-12-21 15:07:37 +0100 | [diff] [blame] | 528 | function getMergedClass(i) { |
| 529 | if(data.mergedEnd && i > data.mergedEnd) { |
| 530 | return " merged" |
| 531 | } else { |
| 532 | return ""; |
| 533 | } |
| 534 | } |
| 535 | |
| 536 | function getRankTooltip(i) { |
| 537 | if(data.mergedEnd) { |
| 538 | if(data.ranks[i] < data.mergedEnd) { |
| 539 | return "rank: "+i +" "+"freq. rank: "+(data.ranks[i]).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
| 540 | } else { |
| 541 | return "rank: "+i +" "+"freq. rank: "+(data.ranks[i]-data.mergedEnd).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + " (merged vocab)"; |
| 542 | } |
| 543 | } else { |
| 544 | return "rank: "+i +" "+"freq. rank: "+data.ranks[i].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
| 545 | } |
| 546 | } |
| 547 | |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 548 | function drawEmbedding() { |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 549 | var urlprefix = new URLSearchParams(window.location.search); |
| 550 | urlprefix.delete("word"); |
| 551 | urlprefix.append("word",""); |
Marc Kupietz | 8f9c86a | 2017-12-04 17:17:13 +0100 | [diff] [blame] | 552 | |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 553 | $("#embed").empty(); |
| 554 | var div = d3.select("#embed"); |
Marc Kupietz | 34c0817 | 2017-11-29 17:08:47 +0100 | [diff] [blame] | 555 | |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 556 | // get min and max in each column of Y |
| 557 | var Y = T.Y; |
Marc Kupietz | 34c0817 | 2017-11-29 17:08:47 +0100 | [diff] [blame] | 558 | |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 559 | svg = div.append("svg") // svg is global |
| 560 | .attr("width", mapWidth) |
| 561 | .attr("height", mapHeight); |
Marc Kupietz | 34c0817 | 2017-11-29 17:08:47 +0100 | [diff] [blame] | 562 | |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 563 | var g = svg.selectAll(".b") |
| 564 | .data(data.words) |
| 565 | .enter().append("g") |
| 566 | .attr("class", "tsnet"); |
Marc Kupietz | 34c0817 | 2017-11-29 17:08:47 +0100 | [diff] [blame] | 567 | |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 568 | g.append("a") |
| 569 | .attr("xlink:href", function(word) { |
| 570 | return "?"+urlprefix+word; }) |
| 571 | .attr("class", function(d, i) { |
| 572 | var res=""; |
| 573 | if(data.marked[i]) { |
| 574 | res="marked "; |
| 575 | } |
| 576 | if(data.target.indexOf(" "+d+" ") >= 0) { |
Marc Kupietz | 2e2e4db | 2018-12-21 15:07:37 +0100 | [diff] [blame] | 577 | res += "target"; |
| 578 | } |
| 579 | if(data.mergedEnd && data.ranks[i] >= data.mergedEnd) { |
| 580 | return res+" merged"; |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 581 | } else { |
| 582 | return res; |
| 583 | } |
| 584 | }) |
| 585 | .attr("title", function(d, i) { |
Marc Kupietz | 2e2e4db | 2018-12-21 15:07:37 +0100 | [diff] [blame] | 586 | return getRankTooltip(i); |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 587 | }) |
| 588 | .append("text") |
| 589 | .attr("text-anchor", "top") |
| 590 | .attr("font-size", 12) |
| 591 | .text(function(d) { return d; }); |
Marc Kupietz | 34c0817 | 2017-11-29 17:08:47 +0100 | [diff] [blame] | 592 | |
Marc Kupietz | 384c913 | 2018-03-19 16:45:24 +0100 | [diff] [blame] | 593 | g.append("svg:title") |
| 594 | .text(function(d, i) { |
Marc Kupietz | 2e2e4db | 2018-12-21 15:07:37 +0100 | [diff] [blame] | 595 | return getRankTooltip(i); |
Marc Kupietz | 384c913 | 2018-03-19 16:45:24 +0100 | [diff] [blame] | 596 | }); |
| 597 | |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 598 | var zoomListener = d3.behavior.zoom() |
| 599 | .scaleExtent([0.1, 10]) |
| 600 | .center([0,0]) |
| 601 | .on("zoom", zoomHandler); |
| 602 | zoomListener(svg); |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 603 | } |
| 604 | |
| 605 | var tx=0, ty=0; |
| 606 | var ss=1; |
| 607 | var iter_id=-1; |
| 608 | |
| 609 | function zoomHandler() { |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 610 | tx = d3.event.translate[0]; |
| 611 | ty = d3.event.translate[1]; |
| 612 | ss = d3.event.scale; |
| 613 | updateEmbedding(); |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 614 | } |
| 615 | |
| 616 | var stepnum = 0; |
| 617 | |
| 618 | function stopStep() { |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 619 | clearInterval(iter_id); |
| 620 | text = svg.selectAll("text"); |
Marc Kupietz | 34c0817 | 2017-11-29 17:08:47 +0100 | [diff] [blame] | 621 | |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 622 | // jitter function needs different data and co-ordinate representation |
| 623 | labels = d3.range(data.words.length).map(function(i) { |
| 624 | var x = (T.Y[i][0]*20*ss + tx) + mapWidth/2; |
| 625 | var y = (T.Y[i][1]*20*ss + ty) + mapHeight/2; |
| 626 | anchor_array.push({x: x, y: y, r: jitterRadius}); |
| 627 | return { |
| 628 | x: x, |
| 629 | y: y, |
| 630 | name: data.words[i] |
| 631 | }; |
| 632 | }); |
Marc Kupietz | 34c0817 | 2017-11-29 17:08:47 +0100 | [diff] [blame] | 633 | |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 634 | // get the actual label bounding boxes for the jitter function |
| 635 | var index = 0; |
| 636 | text.each(function() { |
| 637 | labels[index].width = this.getBBox().width; |
| 638 | labels[index].height = this.getBBox().height; |
| 639 | index += 1; |
| 640 | }); |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 641 | |
Marc Kupietz | 34c0817 | 2017-11-29 17:08:47 +0100 | [diff] [blame] | 642 | |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 643 | // setTimeout(updateEmbedding, 1); |
| 644 | // setTimeout( |
| 645 | labeler = d3.labeler() |
| 646 | .label(labels) |
| 647 | .anchor(anchor_array) |
| 648 | .width(mapWidth) |
| 649 | .height(mapHeight) |
| 650 | .update(applyJitter); |
| 651 | // .start(1000); |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 652 | |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 653 | iter_id = setInterval(jitterStep, 1); |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 654 | } |
| 655 | |
| 656 | var jitter_i=0; |
| 657 | |
| 658 | function jitterStep() { |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 659 | if(jitter_i++ > 100) { |
| 660 | clearInterval(iter_id); |
| 661 | } else { |
| 662 | labeler.start2(10); |
| 663 | applyJitter(); |
| 664 | } |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 665 | } |
| 666 | |
| 667 | var last_cost=1000; |
| 668 | |
| 669 | function step() { |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 670 | var i = T.iter; |
Marc Kupietz | 34c0817 | 2017-11-29 17:08:47 +0100 | [diff] [blame] | 671 | |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 672 | if(i > <%= $no_iterations %>) { |
| 673 | stopStep(); |
| 674 | } else { |
| 675 | var cost = Math.round(T.step() * 100000) / 100000; // do a few steps |
| 676 | $("#cost").html("tsne iteration " + i + ", cost: " + cost.toFixed(5)); |
| 677 | if(i % 250 == 0 && cost >= last_cost) { |
| 678 | stopStep(); |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 679 | } else { |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 680 | last_cost = cost; |
| 681 | updateEmbedding(); |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 682 | } |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 683 | } |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 684 | } |
| 685 | |
| 686 | function showMap(j) { |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 687 | data=j; |
| 688 | T.iter=0; |
| 689 | iter_id = -1; |
| 690 | last_cost=1000; |
| 691 | T.initDataRaw(data.vecs); // init embedding |
| 692 | drawEmbedding(); // draw initial embedding |
Marc Kupietz | 7811453 | 2017-11-29 17:00:16 +0100 | [diff] [blame] | 693 | |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 694 | if(iter_id >= 0) { |
| 695 | clearInterval(iter_id); |
| 696 | } |
| 697 | //T.debugGrad(); |
| 698 | iter_id = setInterval(step, 1); |
| 699 | if(true) { // (<%= $show_som %>) { |
| 700 | makeSOM(j, <%= $no_iterations %>); |
| 701 | } |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 702 | } |
Marc Kupietz | 39179ab | 2017-07-04 16:28:06 +0200 | [diff] [blame] | 703 | var queryword; |
| 704 | |
Marc Kupietz | 66bfd95 | 2017-12-11 09:59:45 +0100 | [diff] [blame] | 705 | function showCollocatorSOM() { |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 706 | if (collocatorTable) { |
| 707 | var ctableData = collocatorTable.rows().data(); |
| 708 | var nwords = [], |
| 709 | nranks = []; |
| 710 | for (var i=0; i < ctableData.length && i < 100; i++) { |
| 711 | nranks.push(ctableData[i].rank); |
| 712 | nwords.push(ctableData[i].word); |
Marc Kupietz | 66bfd95 | 2017-12-11 09:59:45 +0100 | [diff] [blame] | 713 | } |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 714 | $.post('/derekovecs/getVecsByRanks', |
| 715 | JSON.stringify(nranks), |
| 716 | function(data, status){ |
Marc Kupietz | 2e2e4db | 2018-12-21 15:07:37 +0100 | [diff] [blame] | 717 | showMap({target: " "+urlParams.get('word')+" ", mergedEnd: <%= $mergedEnd %>, words: nwords, vecs: data, ranks: nranks, marked: Array(100).fill(false)} ); |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 718 | }, 'json'); |
| 719 | } |
Marc Kupietz | 66bfd95 | 2017-12-11 09:59:45 +0100 | [diff] [blame] | 720 | } |
| 721 | |
Marc Kupietz | 39179ab | 2017-07-04 16:28:06 +0200 | [diff] [blame] | 722 | function onload() { |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 723 | queryword = document.getElementById('word'); |
Marc Kupietz | 39179ab | 2017-07-04 16:28:06 +0200 | [diff] [blame] | 724 | } |
| 725 | |
| 726 | function queryKorAP() { |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 727 | window.open('http://korap.ids-mannheim.de/kalamar/?q='+queryword.value, 'KorAP'); |
Marc Kupietz | 39179ab | 2017-07-04 16:28:06 +0200 | [diff] [blame] | 728 | } |
Marc Kupietz | 4dc270c | 2017-11-24 10:17:12 +0100 | [diff] [blame] | 729 | |
| 730 | function queryKorAPCII(query) { |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 731 | window.open('http://korap.ids-mannheim.de/kalamar/?ql=cosmas2&q='+query, 'KorAP'); |
Marc Kupietz | 4dc270c | 2017-11-24 10:17:12 +0100 | [diff] [blame] | 732 | } |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 733 | </script> |
| 734 | </head> |
Marc Kupietz | 39179ab | 2017-07-04 16:28:06 +0200 | [diff] [blame] | 735 | <body onload="onload()"> |
Marc Kupietz | 7bd5523 | 2019-01-22 15:29:06 +0100 | [diff] [blame] | 736 | <div style="display:none;" id="pmi_ttt">Pointwise mutual information: $$\text{MI}=\text{MI}=log_2\frac{p(w_1,w_2)}{p(w_1) p(w_2)}$$<p class="citation">Church, K. W. and Hanks, P. (1990): Word association norms, mutual information, and lexicography. Comput. Linguist. 16, 1 (March 1990), 22-29.</p></div> |
| 737 | <div style="display:none;" id="md_ttt">Pointwise mutual information squared [1], also called mutual dependency [2]: $$\text{MI}^2=\text{MD}=log_2\frac{p^2(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> |
| 738 | <div style="display:none;" id="lfmd_ttt">Pointwise mutual information cubed [1], also called log-frequency biased mutual dependency [2]: $$\text{MI}^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 Kupietz | a0ffb39 | 2018-01-25 08:53:43 +0100 | [diff] [blame] | 739 | <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 Kupietz | 9f732f0 | 2019-01-22 16:19:51 +0100 | [diff] [blame] | 740 | <div style="display:none;" id="ll_ttt">Log-likelihood: $$2*\sum_{ij}O_{ij}*log\frac{O_{ij}}{E_{ij}}$$<p class="citation">Dunning, T. (1993): Accurate methods for the statistics of surprise and coincidence. Comput. Linguist. 19, 1 (March 1993), 61-74.</p> |
| 741 | <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 Kupietz | 7bd5523 | 2019-01-22 15:29:06 +0100 | [diff] [blame] | 742 | <div style="display:none;" id="logdice_ttt">Log-Dice: $$14 + log_2 \frac{2*(f_{12}+ε)}{(f_1+ε) + (f_2+ε)}$$<p class="citation">Rychlý, Pavel (2008): <a href="http://www.fi.muni.cz/usr/sojka/download/raslan2008/13.pdf">A lexicographer-friendly association score.</a> In Proceedings of Recent Advances in Slavonic Natural Language Processing, RASLAN, 6–9, 2008</p></div> |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 743 | <div id="header"> |
| 744 | <div id="pagetitle"> |
Marc Kupietz | c053d97 | 2019-01-10 10:41:51 +0100 | [diff] [blame] | 745 | <h1>DeReKoVecs</h1> |
| 746 | <h2><%== $title %></h2> |
Marc Kupietz | 4fcda0c | 2017-11-29 09:00:31 +0100 | [diff] [blame] | 747 | </div> |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 748 | <div id="options" class="widget"> |
| 749 | <form id="queryform"> |
| 750 | <input id="word" type="text" name="word" placeholder="Word(s) to be searched" value="<%= $word %>" |
| 751 | 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."/> |
| 752 | <input id="SEARCH" type="button" value="SEARCH"> |
| 753 | <input type="button" id="showoptions" name="showoptions" value="Options" /> |
| 754 | </form> |
| 755 | <div id="dropdownoptions" style="display: none"> |
| 756 | <form id="optionsform"> |
| 757 | <div class="controlgroup-vertical"> |
| 758 | <label for="cutoff">cut-off</label> |
| 759 | <input id="cutoff" type="text" name="cutoff" size="10" value="<%= $cutoff %>" title="Only consider the most frequent x word forms."> |
| 760 | <label for="dedupe">dedupe</label> |
| 761 | <input id="dedupe" type="checkbox" name="dedupe" value="1" <%= ($dedupe ? "checked" : "") %> title="radically filter out any near-duplicates"> |
| 762 | % if($mergedEnd > 0) { |
| 763 | <label for="sbf">backw.</label> |
| 764 | <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."> |
| 765 | % } |
| 766 | <label for="neighbours">max. neighbours:</label> |
| 767 | <input id="neighbours" size="4" name="n" value="<%= $no_nbs %>"> |
| 768 | <label for="no_iterations">max. iterations</label> |
| 769 | <input id="no_iterations" name="N" size="4" value="<%= $no_iterations %>"> |
| 770 | <!-- <label for="dosom">SOM</label> |
| 771 | <input id="dosom" type="checkbox" name="som" value="1" <%= ($show_som ? "checked" : "") %>> --> |
| 772 | % if($collocators) { |
| 773 | <label for="sortby">window/sort</label> |
| 774 | <select id="sortby" name="sort"> |
| 775 | <option value="0" <%= ($sort!=1 && $sort!=2? "selected":"") %>>auto focus</option> |
| 776 | <!-- <option value="1" <%= ($sort==1? "selected":"") %>>any single position</option> |
| 777 | <option value="2" <%= ($sort==2? "selected":"") %>>whole window</option> --> |
| 778 | </select> |
| 779 | % } |
| 780 | <input type="button" value="→ KorAP" onclick="queryKorAP();" title="query word with KorAP"/> |
Marc Kupietz | 1acb317 | 2018-02-17 09:41:26 +0100 | [diff] [blame] | 781 | <input id="show-details" type="checkbox" name="show-details" value="1" > |
| 782 | <label for="show-details"> |
| 783 | Show details |
| 784 | </label> |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 785 | </div> |
| 786 | </form> |
| 787 | </div> |
| 788 | </div> |
| 789 | </div> |
| 790 | <div id="topwrapper"> |
| 791 | <div style="visibility: hidden;" id="tabs"> |
| 792 | <ul> |
| 793 | <li><a href="#tabs-1">Semantics (TSNE-map)</a></li> |
| 794 | <li><a href="#tabs-2">Semantics (SOM)</a></li> |
Marc Kupietz | bb3da6a | 2019-01-22 15:21:38 +0100 | [diff] [blame] | 795 | <li><a href="#tabs-3">Syntagmatic (collocates)</a></li> |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 796 | </ul> |
Marc Kupietz | 384c913 | 2018-03-19 16:45:24 +0100 | [diff] [blame] | 797 | <div id="tabs-1" style="display: flex; padding: 5px; flex-flow: row wrap;"> |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 798 | % if($lists && (@$lists) > 0 && (@$lists)[0]) { |
| 799 | <div id="wrapper"> |
Marc Kupietz | 384c913 | 2018-03-19 16:45:24 +0100 | [diff] [blame] | 800 | <div id="first" style="width: 230px; margin-bottom: 15px;"> |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 801 | <table class="display compact nowrap" id="firsttable"> |
| 802 | <thead> |
| 803 | <tr> |
Marc Kupietz | 384c913 | 2018-03-19 16:45:24 +0100 | [diff] [blame] | 804 | <th align="right">#</th><th align="right">cos</th><th align="left">similars by w2v</th> |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 805 | </tr> |
| 806 | </thead> |
| 807 | <tbody> |
| 808 | <tr> |
| 809 | <td align="right"> |
| 810 | </td> |
| 811 | <td align="right"> |
| 812 | </td> |
| 813 | <td></td> |
| 814 | </tr> |
| 815 | </tbody> |
| 816 | </table> |
| 817 | </div> |
Marc Kupietz | a55a09a | 2018-07-06 13:30:30 +0200 | [diff] [blame] | 818 | % if(0 && $haveSProfiles) { |
Marc Kupietz | 384c913 | 2018-03-19 16:45:24 +0100 | [diff] [blame] | 819 | <div id="sprofilesdiv" style="width: 200px; padding-right: 10px;"> |
| 820 | <table class="display compact nowrap" id="sprofiles"> |
| 821 | <thead> |
| 822 | <tr> |
| 823 | <th align="right">cos</th><th align="left">similars by coll. profile</th> |
| 824 | </tr> |
| 825 | </thead> |
| 826 | <tbody> |
| 827 | <tr> |
| 828 | <td align="right"> |
| 829 | </td> |
| 830 | <td></td> |
| 831 | </tr> |
| 832 | </tbody> |
| 833 | </table> |
| 834 | </div> |
| 835 | %} |
| 836 | <div id="second"> |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 837 | <div id="embed"> |
| 838 | </div> |
| 839 | <div id="cost"> |
| 840 | </div> |
| 841 | </div> |
| 842 | </div> |
Marc Kupietz | 384c913 | 2018-03-19 16:45:24 +0100 | [diff] [blame] | 843 | % } elsif($word !~ /^\s*$/) { |
| 844 | <div id="wrapper"> |
| 845 | <div id="not-found-dialog" title="Not found"> |
| 846 | <p>ERROR: "<%= $word %>" not found in vocabluary.</p> |
| 847 | <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> |
| 848 | </div> |
| 849 | <script> |
| 850 | $( function() { |
| 851 | $( "#not-found-dialog" ).dialog({ |
| 852 | autoOpen: true, |
| 853 | modal: true, |
| 854 | draggable: false, |
| 855 | height: "auto", |
| 856 | width: "auto", |
| 857 | resizable: false, |
| 858 | buttons: { |
| 859 | "OK": function() { |
| 860 | $( this ).dialog( "close" ); |
| 861 | }, |
| 862 | "Apply": function() { |
| 863 | window.open($(location).attr('pathname')+'?'+$('form').serialize(), "_self"); |
| 864 | } |
| 865 | } |
| 866 | }); |
| 867 | }); |
| 868 | </script> |
| 869 | </div> |
| 870 | % } |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 871 | </div> |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 872 | <div id="tabs-2" style="display: flex; padding: 5px; flex-flow: row wrap;"> |
Marc Kupietz | 66bfd95 | 2017-12-11 09:59:45 +0100 | [diff] [blame] | 873 | <div id="som2" style="width: 800;"> |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 874 | <div id="sominfo1"><span id="somcolor1"> </span> <span id="somword1"> </span> <span id="somcolor2"> </span> <span id="somword2"> </span> <span id="somcolor3"> </span></div> |
| 875 | <div id="sominfo" style="text-align: right">SOM iteration <span id="iterations">0</span></div> |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 876 | </div> |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 877 | </div> |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 878 | <div id="tabs-3" style="display: flex; padding:5px; flex-flow: row wrap;"> |
| 879 | <div style="margin-right: 20px; margin-bottom: 10px;" id="secondt"> |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 880 | <table class="display compact nowrap" id="secondtable"> |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 881 | <thead> |
| 882 | <tr> |
| 883 | % if($collocators) { |
| 884 | <th>#</th> |
Marc Kupietz | 4116b43 | 2017-12-06 14:15:32 +0100 | [diff] [blame] | 885 | <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> |
| 886 | <th align="right" title="Maximum activation of the collocator anywhere in the output layer.">max(a)</th> |
| 887 | <th title="Average raw activation of the collocator in the columns selected by auto-focus." align="right">⟨a⟩</th> |
| 888 | <th title="Sum of activations over the selected colunns normalized by the total activation sum of the selected columns." align="right">Σa/Σw'</th> |
| 889 | <th title="Co-norm of the column-normalized activations over the colunns selected by the auto-focus." align="right">⊥(a/c)</th> |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 890 | <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 Kupietz | bb3da6a | 2019-01-22 15:21:38 +0100 | [diff] [blame] | 891 | <th align="left">collocate (by w2v)</th> |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 892 | % } |
| 893 | </tr> |
| 894 | </thead> |
| 895 | <tbody> |
| 896 | <tr> |
| 897 | <td align="right"> |
| 898 | </td> |
| 899 | <td align="right"> |
| 900 | </td> |
| 901 | <td align="right"> |
| 902 | </td> |
| 903 | <td align="right"> |
| 904 | </td> |
| 905 | <td align="right"> |
| 906 | </td> |
| 907 | <td align="right"> |
| 908 | </td> |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 909 | </tr> |
| 910 | </tbody> |
| 911 | </table> |
Marc Kupietz | 66bfd95 | 2017-12-11 09:59:45 +0100 | [diff] [blame] | 912 | </div> |
Marc Kupietz | deb8f62 | 2018-03-12 09:41:00 +0100 | [diff] [blame] | 913 | <div id="ccd" style=""> |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 914 | <table class="display compact nowrap" id="classicoloctable"> |
| 915 | <thead> |
Marc Kupietz | cd136e2 | 2018-01-29 09:18:12 +0100 | [diff] [blame] | 916 | % if($collocators) { |
| 917 | <tr> |
Marc Kupietz | f19814b | 2019-01-21 16:50:19 +0100 | [diff] [blame] | 918 | <th id="ll_tt">LL</th> |
Marc Kupietz | fab14a7 | 2019-01-22 16:20:29 +0100 | [diff] [blame] | 919 | <th id="mi_tt">MI</th> |
| 920 | <th id="md_tt">MI²</th> |
Marc Kupietz | f19814b | 2019-01-21 16:50:19 +0100 | [diff] [blame] | 921 | <th id="lfmd_tt">MI³</th> |
Marc Kupietz | fab14a7 | 2019-01-22 16:20:29 +0100 | [diff] [blame] | 922 | <th id="npmi_tt">nPMI</th> |
| 923 | <th id="dice_tt">dice</th> |
Marc Kupietz | 63b268f | 2019-01-22 22:34:29 +0100 | [diff] [blame] | 924 | <th id="logdice_tt">LD</th> |
| 925 | <th id="logdiceaf_tt">LDaf</th> |
| 926 | <th id="af_win">af-window</th> |
Marc Kupietz | 5a7f9ac | 2018-01-30 11:22:44 +0100 | [diff] [blame] | 927 | <th title="PMI³ restricted to left neighbour">l-PMI³</th> |
| 928 | <th title="PMI³ restricted to right neighbour">r-PMI³</th> |
| 929 | <th title="nPMI restricted to left neighbour">l-nPMI</th> |
| 930 | <th title="nPMI restricted to right neighbour">r-nPMI</th> |
Marc Kupietz | bb3da6a | 2019-01-22 15:21:38 +0100 | [diff] [blame] | 931 | <th title="raw frequency sum of collocation within window">raw</th> |
| 932 | <th>collocate (by CA)</th> |
Marc Kupietz | cd136e2 | 2018-01-29 09:18:12 +0100 | [diff] [blame] | 933 | </tr> |
Marc Kupietz | 1acb317 | 2018-02-17 09:41:26 +0100 | [diff] [blame] | 934 | % } |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 935 | </thead> |
| 936 | <tbody> |
| 937 | <tr> |
| 938 | <td align="right"> |
| 939 | </td> |
| 940 | <td align="right"> |
| 941 | </td> |
| 942 | <td align="right"> |
| 943 | </td> |
| 944 | <td align="right"> |
| 945 | </td> |
Marc Kupietz | cfcdcfc | 2018-01-24 09:51:26 +0100 | [diff] [blame] | 946 | <td align="right"> |
| 947 | </td> |
| 948 | <td align="right"> |
| 949 | </td> |
Marc Kupietz | b4b53ca | 2018-01-25 08:57:11 +0100 | [diff] [blame] | 950 | <td align="right"></td> |
Marc Kupietz | 63b268f | 2019-01-22 22:34:29 +0100 | [diff] [blame] | 951 | <td align="left"></td> |
| 952 | <td align="right"></td> |
| 953 | <td align="right"></td> |
| 954 | <td align="right"></td> |
Marc Kupietz | b4b53ca | 2018-01-25 08:57:11 +0100 | [diff] [blame] | 955 | <td align="right"></td> |
| 956 | <td align="left"></td> |
Marc Kupietz | e6a7a73 | 2018-01-12 09:21:08 +0100 | [diff] [blame] | 957 | </tr> |
| 958 | </tbody> |
| 959 | </table> |
| 960 | </div> |
Marc Kupietz | 384c913 | 2018-03-19 16:45:24 +0100 | [diff] [blame] | 961 | <!-- |
| 962 | <div style="clear:both" ></div> |
| 963 | <div style="float: right; overflow: hidden" id="extra"><button onClick="showCollocatorSOM()"> </button></div> |
| 964 | --> |
Marc Kupietz | 66bfd95 | 2017-12-11 09:59:45 +0100 | [diff] [blame] | 965 | </div> |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 966 | </div> |
| 967 | </div> <!-- topwrapper --> |
| 968 | <div style="clear: both;"></div> |
| 969 | </div> |
Marc Kupietz | ebea470 | 2018-01-12 09:16:09 +0100 | [diff] [blame] | 970 | % if($training_args && (@$lists)[0]) { |
| 971 | <div class="info"> |
| 972 | % if($training_args =~ /-type\s*3/) { |
| 973 | 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 %> |
| 974 | % } else { |
| 975 | 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 %> |
| 976 | % } |
| 977 | </div> |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 978 | % } |
Marc Kupietz | 5827066 | 2017-12-04 12:10:06 +0100 | [diff] [blame] | 979 | </body> |
Marc Kupietz | 8330522 | 2016-04-28 09:57:22 +0200 | [diff] [blame] | 980 | </html> |