poetry/templates/comparison.html
{% extends "base.html" %}
{% load static from staticfiles %}
{% block custom_head %}
<script src="{% static 'js/markup.js' %}"></script>
{% endblock %}
{% block accents_active %} class="active" {% endblock %}
{% block content %}
<div class="page-header">
<h3>Сравнение разметок</h3>
</div>
<div class="row">
<div class="col-lg-12">
<table class="table table-hover">
<thead>
<th width="20%" class="text-center">Документ</th>
<th width="20%" class="text-center">Тестовая версия разметки</th>
<th width="20%" class="text-center">Эталонная версия разметки</th>
<th width="10%" class="text-center">Accuracy</th>
<th width="10%" class="text-center">Precision</th>
<th width="10%" class="text-center">Recall</th>
<th width="10%" class="text-center">F-мера</th>
</thead>
{% for poem, test, standard, accuracy, precision, recall, f1 in comparisons %}
<tr>
<td>{{ poem.name }}</td>
<td class="text-center"><a href="{% url 'corpus:markup' pk=test.pk %}">{{ test.markup_version }} - {{ test.author }}</a></td>
<td class="text-center"><a href="{% url 'corpus:markup' pk=standard.pk %}">{{ test.markup_version }} - {{ standard.author }}</a></td>
<td class="text-center">{{ accuracy|floatformat:3 }} </td>
<td class="text-center">{{ precision|floatformat:3 }} </td>
<td class="text-center">{{ recall|floatformat:3 }} </td>
<td class="text-center">{{ f1|floatformat:3 }} </td>
</tr>
{% endfor %}
</table>
{% if comparisons|length > 1 %}
<p><b>Средняя точность:</b> {{ avg_accuracy|floatformat:3 }}</p>
<p><b>Средняя F-мера:</b> {{ avg_f1|floatformat:3 }}</p>
<a class="btn btn-warning compare-csv">Скачать CSV</a>
{% endif %}
</div>
</div>
{% endblock %}