Skip to content

Commit

Permalink
chore: very first draft
Browse files Browse the repository at this point in the history
  • Loading branch information
severinsimmler committed Oct 17, 2018
1 parent 6620879 commit 6e71a1a
Show file tree
Hide file tree
Showing 8 changed files with 188 additions and 203 deletions.
4 changes: 2 additions & 2 deletions application/schema.sql
Expand Up @@ -2,11 +2,11 @@ DROP TABLE IF EXISTS textfiles;
DROP TABLE IF EXISTS model;

CREATE TABLE textfiles (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT UNIQUE NOT NULL,
text TEXT NOT NULL
);

CREATE TABLE model (
id INTEGER PRIMARY KEY AUTOINCREMENT
doc_topic TEXT NOT NULL,
topics TEXT NOT NULL
);
46 changes: 46 additions & 0 deletions application/templates/document.html
@@ -0,0 +1,46 @@
{% extends "layout.html" %}

{% block main %}
<main class="main">
<div class="main_content">
<h1>{{ title }}</h1>
<h4>Topics Distribution</h4>
<p class="chart">
{% for descriptor, value in distribution %}
<span data-balloon="{{ descriptor }}" data-balloon-pos="down" class="block">
<span class="value">{{ value }}%</span>
</span>
{% endfor %}
</p>



<div class="row -narrow" style="border-top: none;">
<div class="column"">
<h4 style=" margin-top: 0px;">Top 3: Similar Documents</h4>
{% for document in similar_documents %}
<p><button class="topic" style="width: 100%;">{{ document }}</button></p>
{% endfor %}
<h4>Related Topics</h4>
{% for topic in related_topics %}
<p><button class="topic" style="width: 100%;">{{ topic }}</button></p>
{% endfor %}
</div>
<div class="column -wide">
<h4 style="margin-top: 0px;">Original Text</h4>
{% for paragraph in text %}
<p style="text-align: justify;">{{ paragraph }}</p>
{% endfor %}
</div>
</div>
</div>
</div>
<script>
$('.value').each(function () {
var text = $(this).text();
$(this).parent().css('width', text);
});
</script>
</main>

{% endblock %}
103 changes: 0 additions & 103 deletions application/templates/documents.html

This file was deleted.

4 changes: 2 additions & 2 deletions application/templates/topic-presence.html
Expand Up @@ -7,8 +7,8 @@ <h1>Relative presence of all topics in the corpus</h1>
<p>This overview page is the entry point to exploring the text corpus. The topics are ranked by their relative
presence in the whole corpus and display each in a bar with width proportional to the topic’s presence score. You
can navigate through your corpus by clicking on the topics.</p>
{% for topic in presence %}
<p><button class="topic" style="width: {{ topic[1] }}%;">{{ topic[0] }}</button></p>
{% for topic, width in presence %}
<p><button class="topic" style="width: {{ width }}%;">{{ topic }}</button></p>
{% endfor %}
<blockquote>Mathematically, the topic model has two goals in explaining the
documents. First, it wants its topics to place high probability on few terms. Second, it wants to attach documents
Expand Down
35 changes: 35 additions & 0 deletions application/templates/topic.html
@@ -0,0 +1,35 @@
{% extends "layout.html" %}

{% block main %}
<main class="main">
<div class="main_content">
<h1>{{ topic }}</h1>
<div class="row -narrow" style="border-top: none;">
<div class="column"">
<h4 style=" margin-top: 0px;">Top 3: Similar Topics</h4>
{% for topic in similar_topics %}
<p><button class="topic" style="width: 100%;">{{ topic }}</button></p>
{% endfor %}
<h4>Related Words</h4>
{% for word in related_words %}
<p><button class="topic" style="width: 100%;">{{ word }}</button></p>
{% endfor %}
</div>
<div class="column -wide">
<h4 style="margin-top: 0px;">Related Documents</h4>
{% for document in related_documents %}
<p><button class="topic" style="width: 100%;">{{ document }}</button></p>
{% endfor %}
</div>
</div>
</div>
</div>
<script>
$('.value').each(function () {
var text = $(this).text();
$(this).parent().css('width', text);
});
</script>
</main>

{% endblock %}
65 changes: 0 additions & 65 deletions application/templates/topics.html

This file was deleted.

0 comments on commit 6e71a1a

Please sign in to comment.