-
Notifications
You must be signed in to change notification settings - Fork 16
/
corpus_info.html
200 lines (192 loc) · 9.23 KB
/
corpus_info.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
{% extends 'layouts/base.html' %}
{% import 'macros/header_macros.html' as header_macros %}
{% block page_title %}Corpus {{corpus.name}}{% endblock %}
{% set visible = corpus.displayed_columns_by_name %}
{% block content %}
<p class="container">
{{ header_macros.render_corpus(corpus) }}
<div>
<section id="statistics">
<h2>{{ _('Statistics') }}</h2>
<div class="row">
<div class="offset-md-2 col-md-2 stats-fact">
<i class="fa fa-book fa-3x"></i>
<em>{{stats.word_count|thousands}}</em>
{{ _('words') }}
</div>
<div class="col-md-2 stats-fact">
<i class="fa fa-edit fa-3x"></i>
<em>{{stats.changes|thousands}}</em>
{{ _('annotations') }} <br />{{ _('corrected') }}
</div>
<div class="col-md-2 stats-fact">
<i class="fa fa-bug fa-3x"></i>
<em>{{stats.unallowed|thousands}}</em>
{{ _('unallowed') }} <br /> {{ _('values') }}
</div>
<div class="col-md-2 stats-fact">
<i class="fa fa-strikethrough fa-3x"></i>
<em>{{stats.forms_edited|thousands}}</em>
{{ _('forms') }} <br /> {{ _('edited') }}
</div>
</div>
<div class="row">
<div class="offset-md-3 col-md-2">
{% if "lemma" in visible %}
<div class="single-chart">
<svg viewBox="0 0 36 36" class="circular-chart green">
<path class="circle-bg"
d="M18 2.0845
a 15.9155 15.9155 0 0 1 0 31.831
a 15.9155 15.9155 0 0 1 0 -31.831"
></path>
<path class="circle"
stroke-dasharray="{{ 100 - stats.lemma_acc|int}}, 100"
d="M18 2.0845
a 15.9155 15.9155 0 0 1 0 31.831
a 15.9155 15.9155 0 0 1 0 -31.831"
></path>
<text x="18" y="20.35" class="percentage">{{'%0.2f' % (100 - stats.lemma_acc)}}%</text>
</svg>
<p class="stats-info">
{{_("lemma were correct from lemmatization. It means you corrected %(count)s lemma.", count=stats.lemma_count)}}
</p>
</div>
{% endif %}
</div>
<div class="col-md-2">
{% if "morph" in visible %}
<div class="single-chart">
<svg viewBox="0 0 36 36" class="circular-chart green">
<path class="circle-bg"
d="M18 2.0845
a 15.9155 15.9155 0 0 1 0 31.831
a 15.9155 15.9155 0 0 1 0 -31.831"></path>
<path class="circle"
stroke-dasharray="{{ 100 - stats.morph_acc|int}}, 100"
d="M18 2.0845
a 15.9155 15.9155 0 0 1 0 31.831
a 15.9155 15.9155 0 0 1 0 -31.831"></path>
<text x="18" y="20.35" class="percentage">{{'%0.2f' % (100 - stats.morph_acc)}}%</text>
</svg>
<p class="stats-info">
{{_("morphologies were correct from lemmatization. It means you corrected %(count)s morphologies.", count=stats.morph_count)}}
</p>
</div>
{% endif %}
</div>
<div class="col-md-2">
{% if "POS" in visible %}
<div class="single-chart">
<svg viewBox="0 0 36 36" class="circular-chart green">
<path class="circle-bg"
d="M18 2.0845
a 15.9155 15.9155 0 0 1 0 31.831
a 15.9155 15.9155 0 0 1 0 -31.831"
></path>
<path class="circle"
stroke-dasharray="{{ 100 - stats.pos_acc|int}}, 100"
d="M18 2.0845
a 15.9155 15.9155 0 0 1 0 31.831
a 15.9155 15.9155 0 0 1 0 -31.831"
></path>
<text x="18" y="20.35" class="percentage">{{'%0.2f' % (100 - stats.pos_acc)}}%</text>
</svg>
<p class="stats-info">
{{_("POS were correct from lemmatization. It means you corrected %(count)s POS.", count=stats.pos_count)}}
</p>
</div>
{% endif %}
</div>
</div>
<h3>{{ _('Annotations over time') }}</h3>
<div class="row">
<div class="offset-md-3 col-md-6">
<div id="corrections-per-day" class="ct-chart"></div>
</div>
</div>
<h3>{{ _('Most common corrections') }}</h3>
<form action="{{url_for('.corpus_get', corpus_id=corpus.id)}}" method="GET" class="col-md-2">
<div class="input-group mb-3 input-group-sm">
<input type="number" name="limit"
class="form-control" placeholder="" aria-label="Example text with button addon"
aria-describedby="button-addon1" value="10" />
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="submit" id="button-addon1">{{ _('See more') }}</button>
</div>
</div>
</form>
<div class="row">
<div class="col-lg-3">
{% if "lemma" in visible %}
<h4>{{ _('Lemma') }}</h4>
<table class="table table-xs table-striped">
<thead class="thead-dark"><tr><th>{{ _('Count') }}</th><th>{{ _('Corrected') }}</th><th>{{ _('Original') }}</th></tr></thead>
<tbody>
{% for count, lemma_new, lemma in lemma_cor %}
<tr><td>{{count}}</td><td>{{lemma_new}}</td><td>{{lemma}}</td></tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
<div class="col-lg-6">
{% if "morph" in visible %}
<h4>{{ _('Morphology') }}</h4>
<table class="table table-xs table-striped">
<thead class="thead-dark"><tr><th>{{ _('Count') }}</th><th>{{ _('Corrected') }}</th><th>{{ _('Original') }}</th></tr></thead>
<tbody>
{% for count, lemma_new, lemma in morph_cor %}
<tr><td>{{count}}</td><td>{{lemma_new}}</td><td>{{lemma}}</td></tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
<div class="col-lg-3">
{% if "POS" in visible %}
<h4>{{ _('POS') }}</h4>
<table class="table table-xs table-striped">
<thead class="thead-dark"><tr><th>{{ _('Count') }}</th><th>{{ _('Corrected') }}</th><th>{{ _('Original') }}</th></tr></thead>
<tbody>
{% for count, lemma_new, lemma in pos_cor %}
<tr><td>{{count}}</td><td>{{lemma_new}}</td><td>{{lemma}}</td></tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
</div>
</section>
</div>
{% endblock %}
{% block custom_head_tags %}
<link rel="stylesheet" href="{{url_for("static", filename="css/chartist.css")}}" />
<script type="text/javascript" src="{{url_for("static", filename="js/chartist.js")}}"></script>
<script type="text/javascript" src="{{url_for("static", filename="js/moments.js")}}"></script>
<script type="text/javascript">
'use strict';
const stats = {{ corpus.changes_per_day()|json|safe }};
const options = {
fullWidth: true,
axisX: {
type: Chartist.FixedScaleAxis,
divisor: 5,
labelInterpolationFnc: function(value) {
return moment(value).format('MMM D');
}
},
height: 300
};
const data = {
series: [
stats.map((cnt_and_day) => {
return {x : Date.parse(cnt_and_day[1]), y: cnt_and_day[0]};
})
]
}
$(document).ready(function() {
new Chartist.Line('#corrections-per-day', data, options);
});
</script>
{% endblock %}