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