Commit 67adf215 by manetta

staarting the word2vec analysis

parent 2408e31b
......@@ -40,19 +40,19 @@
<div id="export-container">
<h1>Export</h1>
Export these results with the following credits.
<br>source: <input id="source" type="text" name="source" value="{% if source %}{{ source }}{% endif %}">,
<br>source: <input id="source" type="text" name="source" value="{% if source %}{{ source }}{% endif %}" required>,
<br>author(s):
{% if author %}
{% for a in author %}
<input class="author" type="text" name="author" value="{{a}}">
<input class="author" type="text" name="author" value="{{a}}" required>
{% endfor %}
{% else %}
<input class="author" type="text" name="author">
<input class="author" type="text" name="author" required>
{% endif %}
<span id="another" class="author"></span><button id="addauthor" class="export">add one more author</button>,
<br>filename: <input id="filename" type="text" name="filename" value="{{ filename }}">
<br><button id="export" name="pdf">.pdf</button><img src="../img/loading.gif" class="loading" id="pdf" />
<button id="export" name="html">.html</button><img src="../img/loading.gif" class="loading" id="html" />.
<br>filename: <input id="filename" type="text" name="filename" value="{{ filename }}" required>
<br><input id="export" name="pdf" type="submit" value=".pdf"><img src="../img/loading.gif" class="loading" id="pdf" />
<input id="export" name="html" type="submit" value=".html"><img src="../img/loading.gif" class="loading" id="html" />.
</div>
</div>
{% endif %}
......@@ -68,50 +68,55 @@
i =+ 1;
});
$('button#export').click(function(e){
$('input#export').click(function(e){
e.preventDefault();
var name = $(this).attr('name');
var cgi = 'export.cgi';
var results = $('#results').html();
var source = $('#source').val();
var filename = $('#filename').val();
var title = $('#titled').val();
author = '';
$('input.author').each(function(){
if(author != ''){
author = author + ', ' +($(this).val());
}
else{
author = $(this).val();
}
});
$.ajax({
url: cgi,
method: "post",
data: {
filename : filename,
title : title,
source : source,
author : author,
results : results
},
dataType: "html",
success: function(){
window.location.hash = 'export';
$('input#state').val('export');
if(name == 'html'){
var win = window.open('/output/html/'+filename+'.html', '_blank');
if(filename != ''){
var name = $(this).attr('name');
var cgi = 'export.cgi';
var results = $('#results').html();
var source = $('#source').val();
var filename = $('#filename').val();
var title = $('#titled').val();
author = '';
$('input.author').each(function(){
if(author != ''){
author = author + ', ' +($(this).val());
}
if(name == 'pdf'){
var win = window.open('/output/pdf/'+filename+'.pdf', '_blank');
else{
author = $(this).val();
}
if (win) {
win.focus();
} else {
alert('Please allow popups for this website');
});
$.ajax({
url: cgi,
method: "post",
data: {
filename : filename,
title : title,
source : source,
author : author,
results : results
},
dataType: "html",
success: function(){
window.location.hash = 'export';
$('input#state').val('export');
if(name == 'html'){
var win = window.open('/output/html/'+filename+'.html', '_blank');
}
if(name == 'pdf'){
var win = window.open('/output/pdf/'+filename+'.pdf', '_blank');
}
if (win) {
win.focus();
} else {
alert('Please allow popups for this website');
}
}
}
})
})
}
else{
alert('Please enter a filename.');
}
});
</script>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -718,3 +718,82 @@ Nearest to magic: minutely, grasped, possession, shrinededicated, preferred, mis
Nearest to happy: groan, miserable, inclemency, uncle, things, philosopher, arabian, existing, preserve, vacancy,
Nearest to magic: burnt, original, vices, preceded, inexhaustible, owes, assemblages, meal, songs, bears,
Nearest to happy: excite, ago, towards, reason, peace, seemed, control, persevere, cold, england,
Nearest to magic: burnt, preceded, original, inexhaustible, rested, routine, apprehension, vices, assemblages, stars,
Nearest to happy: ago, unquenched, letters, sorrows, england, persevere, drop, charged, sent, endeavouring,
Nearest to overlooked: impose, released,, twenty, matter.
, finds,, experimental, past, inducements, Liberty,, adds,
Nearest to make: received, on,, take., right,, never
, discussed, transitory, former, hygienic, frankly,
Nearest to overlooked: impose, released,, Is, intellectual, one., Liberty,, twenty, bearing,, acquired, past,
Nearest to make: former, accurst,, right,, received, convert, too,
, seems, adopt, very
, distinguished.,
Nearest to overlooked: impose, acquired, released,, Is, one., Liberty,, finds,, matter.
, change
, twenty,
Nearest to make: convert, accurst,, former, distinguished., right,, too,
, minor, nakedly, seems, seemed,
Nearest to overlooked: impose, acquired, released,, one., Liberty,, Is, finds,, matter.
, change
, luck,
Nearest to make: give, convert, accurst,, distinguished., former, nakedly, seemed, right,, say,, minor,
Nearest to overlooked: released,, Liberty,, acquired, impose, one., Is, period, matter.
, luck, finds,,
Nearest to make: give, convert, accurst,, distinguished., nakedly, former, right,, say,, too,
, irrevocable,,
Nearest to overlooked: Liberty,, released,, period, collapse, luck, matter.
, other., impose, Is, one.,
Nearest to make: give, convert, accurst,, nakedly, expand, irrevocable,, former, distinguished., early
, too,
,
Nearest to overlooked: other., Liberty,, released,, art, collapse, luck, fancy, matter.
, period, surroundings,
Nearest to make: give, expand, convert, early
, irrevocable,, accurst,, nakedly, should,, be,
, ascribes,
Nearest to overlooked: other., art, fancy, collapse, Liberty,, matter.
, ways, surroundings, released,, luck,
Nearest to make: give, expand, early
, believe,, evade, convert, be,
, pupil, ascribes, irrevocable,,
Nearest to overlooked: other., art, fancy, collapse, ways, playmates, matter.
, composition, Liberty,, housing,,
Nearest to make: believe,, give, early
, evade, be,
, expand, pupil, ascribes, render, convert,
Nearest to overlooked: art, other., fancy, playmates, collapse, ways, composition, twenties, mothers,, housing,,
Nearest to make: believe,, early
, be,
, give, evade, pupil, render, ascribes, mean, suggest,
Nearest to overlooked: art, playmates, other., fancy, twenties, ways, collapse, composition, mothers,, Empire,,
Nearest to make: believe,, give, render, pupil, be,
, early
, mean, evade, spread, write,

463 KB | W: | H:

465 KB | W: | H:

algoliterary_encounter/word2vec/tsne20.png
algoliterary_encounter/word2vec/tsne20.png
algoliterary_encounter/word2vec/tsne20.png
algoliterary_encounter/word2vec/tsne20.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -30,7 +30,7 @@ from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflow as tf
# ***********************************************************************************
# # Step 1: Download data.
# Step 1: Download data.
# ***********************************************************************************
url = 'http://mattmahoney.net/dc/'
......@@ -64,7 +64,7 @@ def read_data(filename):
# ALGOLIT step 1: read data from plain text file
# ***********************************************************************************
filename = 'frankenstein_gutenberg_tf.txt'
filename = 'input/Mankind-in-the-Making.txt'
words = []
def read_input_text(filename):
......@@ -429,8 +429,7 @@ with graph.as_default():
"""
Step 5: Begin training.
"""
# num_steps = 100001
num_steps = 10001
num_steps = 100001
with tf.Session(graph=graph) as session:
# We must initialize all variables before we use them.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment