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