Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
severinsimmler committed Nov 22, 2018
1 parent 3a32671 commit 3d1a2c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 3 additions & 3 deletions application/templates/detail-document.html
Expand Up @@ -13,15 +13,15 @@ <h4>Topic Distribution</h4>
<div class="row -narrow" style="border-top: none;">
<div class="column">
<h4 style=" margin-top: 0px;">Top 10: Related Topics</h4>
{% for topic, proportion in related_topics %}
<p><a class="main_button" style="width: {{ proportion }}%;" href="{{ url_for('topics', topic=topic) }}">{{ topic }}</a></p>
{% for topic in related_topics %}
<p><a class="main_button" style="width: 100%;" href="{{ url_for('topics', topic=topic) }}">{{ topic }}</a></p>
{% endfor %}
<h4>Top 3: Similar Documents</h4>
{% for title, proportion in similar_documents %}
<p><a class="main_button" style="width: {{ proportion }}%;" href="{{ url_for('documents', title=title) }}">{{ title }}</a></p>
{% endfor %}
</div>
<div class="column">
<div class="column -wide">
<h4 style="margin-top: 0px;">Original Text</h4>
{% for paragraph in text %}
<p style="text-align: justify;">{{ paragraph }}</p>
Expand Down
8 changes: 1 addition & 7 deletions application/views.py
Expand Up @@ -206,12 +206,6 @@ def documents(title):
logging.info("Get related topics...")
related_topics = document_topic.loc[title].sort_values(ascending=False) * 100
distribution = list(related_topics.to_dict().items())
related_topics_proportions = utils.scale(related_topics, minimum=70)
related_topics_proportions = pd.Series(related_topics_proportions, index=related_topics.index)
related_topics_proportions = related_topics_proportions.sort_values(ascending=False)

# Convert pandas.Series to a 2-D array:
related_topics_proportions = list(utils.series2array(related_topics_proportions))

logging.info("Get similar documents...")
similar_docs = document_similarites[title].sort_values(ascending=False)[1:4]
Expand Down Expand Up @@ -241,7 +235,7 @@ def documents(title):
text=text,
distribution=distribution,
similar_documents=similar_docs_proportions,
related_topics=related_topics_proportions)
related_topics=related_topics.index)


@web.route("/parameters")
Expand Down

0 comments on commit 3d1a2c7

Please sign in to comment.