Added Complexity measures

This commit is contained in:
2026-08-01 20:27:51 +02:00
parent 023a220d1c
commit 1572fc826b
10 changed files with 117 additions and 57 deletions
+7 -2
View File
@@ -174,7 +174,9 @@ def create_app():
'BIC': gettext('BIC'),
'MI': gettext('MI'),
'logDice': gettext('logDice'),
't-score': gettext('t-score')
't-score': gettext('t-score'),
'Max depth': gettext('Max depth'),
'MDD': gettext('MDD')
}
if 'Absolute frequency in second treebank' in head:
table_columns2displayed_table_columns['Absolute frequency'] = gettext('Frequency in A')
@@ -254,7 +256,9 @@ def create_app():
'BIC': gettext('BIC'),
'MI': gettext('MI'),
'logDice': gettext('logDice'),
't-score': gettext('t-score')
't-score': gettext('t-score'),
'Max depth': gettext('Max depth'),
'MDD': gettext('MDD')
}
if 'Absolute frequency in second treebank' in head:
table_columns2displayed_table_columns['Absolute frequency'] = gettext('Frequency in A')
@@ -407,6 +411,7 @@ def create_app():
configs['dependency_type'] = 'labeled_trees' in form and form['labeled_trees'] == 'on'
configs['node_order'] = 'fixed_order' in form and form['fixed_order'] == 'on'
configs['association_measures'] = 'association_measures' in form and form['association_measures'] == 'on'
configs['complexity_measures'] = 'yes' if 'complexity_measures' in form and form['complexity_measures'] == 'on' else 'no'
configs['label_whitelist'] = []
configs['root_whitelist'] = []
+68 -52
View File
@@ -1,14 +1,14 @@
# Translations template for PROJECT.
# Copyright (C) 2025 ORGANIZATION
# Copyright (C) 2026 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2026.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2025-05-17 13:14+0200\n"
"POT-Creation-Date: 2026-08-01 20:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,126 +17,134 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.14.0\n"
#: app.py:164 app.py:244
#: app.py:164 app.py:246
msgid "Tree"
msgstr ""
#: app.py:165 app.py:245
#: app.py:165 app.py:247
msgid "Frequency"
msgstr ""
#: app.py:166 app.py:246
#: app.py:166 app.py:248
msgid "Frequency in B"
msgstr ""
#: app.py:167 app.py:247
#: app.py:167 app.py:249
msgid "Order"
msgstr ""
#: app.py:168 app.py:248
#: app.py:168 app.py:250
msgid "Number of nodes"
msgstr ""
#: app.py:169 app.py:249
#: app.py:169 app.py:251
msgid "Head node"
msgstr ""
#: app.py:170 app.py:250
#: app.py:170 app.py:252
msgid "Grew-match URL"
msgstr ""
#: app.py:171 app.py:251
#: app.py:171 app.py:253
msgid "Max depth"
msgstr ""
#: app.py:172 app.py:254
msgid "MDD"
msgstr ""
#: app.py:173 app.py:255
msgid "Ratio"
msgstr ""
#: app.py:172 app.py:252
#: app.py:174 app.py:256
msgid "%DIFF"
msgstr ""
#: app.py:173 app.py:253
#: app.py:175 app.py:257
msgid "OR"
msgstr ""
#: app.py:174 app.py:254
#: app.py:176 app.py:258
msgid "BIC"
msgstr ""
#: app.py:175 app.py:255
#: app.py:177 app.py:259
msgid "MI"
msgstr ""
#: app.py:176 app.py:256
#: app.py:178 app.py:260
msgid "logDice"
msgstr ""
#: app.py:177 app.py:257
#: app.py:179 app.py:261
msgid "t-score"
msgstr ""
#: app.py:180 app.py:260
#: app.py:182 app.py:264
msgid "Frequency in A"
msgstr ""
#: app.py:341 app.py:342
#: app.py:345 app.py:346
msgid "Please insert either input url or file, not both of them."
msgstr ""
#: app.py:352 app.py:447
#: app.py:356 app.py:452
msgid "Incorrect URL!"
msgstr ""
#: app.py:354 app.py:355
#: app.py:358 app.py:359
msgid "Please insert either input url or provide a file."
msgstr ""
#: app.py:361
#: app.py:365
msgid ""
"Please insert an integer number or a range separated with `-`, without "
"spaces. Example: 3 or 2-4."
msgstr ""
#: app.py:366
#: app.py:370
msgid ""
"Please set a maximum display size to a number equal or lower to 4, when "
"extracting Incomplete trees. Or search through complete trees (Complete "
"trees parameter)."
msgstr ""
#: app.py:375
#: app.py:379
msgid "Please select at least one node type."
msgstr ""
#: app.py:380
#: app.py:384
msgid "Node option"
msgstr ""
#: app.py:380
#: app.py:384
msgid "is not supported. Please enter valid options."
msgstr ""
#: app.py:435 app.py:436
#: app.py:440 app.py:441
msgid "Please insert either compare url or file, not both of them."
msgstr ""
#: app.py:459
#: app.py:464
msgid "Please insert an Integer."
msgstr ""
#: app.py:495
#: app.py:500
msgid ""
"Processing failed! Please recheck your settings, e.g. input format or "
"head node description."
msgstr ""
#: app.py:504
#: app.py:509
msgid "Frequency "
msgstr ""
#: app.py:504
#: app.py:509
msgid "Frequency in A "
msgstr ""
#: app.py:505 templates/base.html:23 templates/base.html:24
#: app.py:510 templates/base.html:23 templates/base.html:24
#: templates/base.html:26 templates/index.html:8 templates/result.html:21
msgid "code"
msgstr ""
@@ -193,11 +201,11 @@ msgstr ""
msgid "impressum_card_content"
msgstr ""
#: templates/about.html:83
#: templates/about.html:60
msgid "about_card_content"
msgstr ""
#: templates/about.html:94
#: templates/about.html:65
msgid "version_card_content"
msgstr ""
@@ -245,20 +253,20 @@ msgstr ""
msgid "Upload a treebank"
msgstr ""
#: templates/index.html:12 templates/index.html:20 templates/index.html:191
#: templates/index.html:198
#: templates/index.html:12 templates/index.html:20 templates/index.html:206
#: templates/index.html:213
msgid "in CONLL-U format"
msgstr ""
#: templates/index.html:12 templates/index.html:43 templates/index.html:83
#: templates/index.html:98 templates/index.html:120 templates/index.html:126
#: templates/index.html:132 templates/index.html:142 templates/index.html:148
#: templates/index.html:156 templates/index.html:171 templates/index.html:190
#: templates/index.html:191
#: templates/index.html:156 templates/index.html:186 templates/index.html:205
#: templates/index.html:206
msgid "Help"
msgstr ""
#: templates/index.html:15 templates/index.html:194
#: templates/index.html:15 templates/index.html:209
msgid "Browse"
msgstr ""
@@ -266,11 +274,11 @@ msgstr ""
msgid "Upload"
msgstr ""
#: templates/index.html:29 templates/index.html:208
#: templates/index.html:29 templates/index.html:223
msgid "Or"
msgstr ""
#: templates/index.html:29 templates/index.html:208
#: templates/index.html:29 templates/index.html:223
msgid "insert a URL link to a treebank in CONLL-U format"
msgstr ""
@@ -311,12 +319,12 @@ msgid "include names of dependency relations"
msgstr ""
#: templates/index.html:87 templates/index.html:102 templates/index.html:160
#: templates/index.html:175
#: templates/index.html:175 templates/index.html:190
msgid "No"
msgstr ""
#: templates/index.html:90 templates/index.html:105 templates/index.html:163
#: templates/index.html:178
#: templates/index.html:178 templates/index.html:193
msgid "Yes"
msgstr ""
@@ -381,46 +389,54 @@ msgid "print MI, logDice and t-score"
msgstr ""
#: templates/index.html:171
msgid "Complexity measures"
msgstr ""
#: templates/index.html:171
msgid "print maximum tree depth and mean dependency distance (MDD)"
msgstr ""
#: templates/index.html:186
msgid "Complete trees"
msgstr ""
#: templates/index.html:171
#: templates/index.html:186
msgid "extract head node with all its dependants"
msgstr ""
#: templates/index.html:171
#: templates/index.html:186
msgid ""
"Note: Extracting incomplete trees ('No' option) is slow and limited to a "
"maximum tree size of 4 nodes."
msgstr ""
#: templates/index.html:186
#: templates/index.html:201
msgid "Compare treebanks"
msgstr ""
#: templates/index.html:190
#: templates/index.html:205
msgid ""
"Select a reference treebank to identify key phenomena (prints the "
"&#37;DIFF, BIC and OR keyness scores)."
msgstr ""
#: templates/index.html:191 templates/index.html:198
#: templates/index.html:206 templates/index.html:213
msgid "Upload a compare corpus"
msgstr ""
#: templates/index.html:224
#: templates/index.html:239
msgid "Submit"
msgstr ""
#: templates/index.html:232
#: templates/index.html:247
msgid "No results"
msgstr ""
#: templates/index.html:233
#: templates/index.html:248
msgid "Processing with your settings didnt produce any results!"
msgstr ""
#: templates/index.html:249
#: templates/index.html:264
msgid ""
"Extracting incomplete trees ('No' option) is slow and limited to a "
"maximum tree size of 4 nodes."
+1 -1
View File
@@ -1,5 +1,5 @@
Flask==3.0.0
requests==2.31.0
flask-babel==4.0.0
stark-trees==3.1.0
stark-trees @ git+https://github.com/clarinsi/STARK.git@f0a61fe59bdc9b123beabfcdb78544ae01c961d2
conllu==6.0.0
+1 -1
View File
@@ -19,7 +19,7 @@ setup(name='stark-api',
'Flask==3.0.0',
'requests==2.31.0',
'flask-babel==4.0.0',
'stark-trees==3.1.0',
'stark-trees @ git+https://github.com/clarinsi/STARK.git@f0a61fe59bdc9b123beabfcdb78544ae01c961d2',
'conllu==6.0.0'
],
)
+1 -1
View File
@@ -1,5 +1,5 @@
// Global array to store input names
var globalInputList = ['display_size', 'file', 'association_measures', 'labeled_trees', 'node_type_upos', 'fixed_order', 'input_url', 'node_type_lemma', 'root_restriction', 'node_type_form', 'frequency_threshold', 'node_type_none', 'query', 'compare_url', 'compare_file', 'ignored_labels', 'complete_trees'];
var globalInputList = ['display_size', 'file', 'association_measures', 'complexity_measures', 'labeled_trees', 'node_type_upos', 'fixed_order', 'input_url', 'node_type_lemma', 'root_restriction', 'node_type_form', 'frequency_threshold', 'node_type_none', 'query', 'compare_url', 'compare_file', 'ignored_labels', 'complete_trees'];
var visualInputList = ['advanced-tree-expand', 'compare-expand']
// Function to store values to local storage
+15
View File
@@ -166,6 +166,21 @@
</div>
</div>
</div>
<div class="row">
<div class="col s12">
<label><b>{{ _('Complexity measures') }}</b>: {{ _('print maximum tree depth and mean dependency distance (MDD)') }}</label>
<div class="input-field">
<div class="switch">
<label>
{{ _('No') }}
<input class="complexity_measures" type="checkbox" name="complexity_measures">
<span class="lever"></span>
{{ _('Yes') }}
</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col s12">
<label><b>{{ _('Complete trees') }}</b>: {{ _('extract head node with all its dependants') }} (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/advanced.md#--complete" target="_blank" title="{{ _('Help') }}"><span class="menu-title sr-only">{{ _('Help') }}</span></a>). {{_("Note: Extracting incomplete trees ('No' option) is slow and limited to a maximum tree size of 4 nodes.") }}</label>
Binary file not shown.
+12
View File
@@ -425,6 +425,18 @@ msgstr "specify the minimum frequency of a tree in the treebank"
msgid "Association measures"
msgstr "Association measures"
msgid "Complexity measures"
msgstr "Complexity measures"
msgid "print maximum tree depth and mean dependency distance (MDD)"
msgstr "print maximum tree depth and mean dependency distance (MDD)"
msgid "Max depth"
msgstr "Max depth"
msgid "MDD"
msgstr "MDD"
#: templates/index.html:156
msgid "print MI, logDice and t-score"
msgstr "print MI, logDice and t-score"
Binary file not shown.
+12
View File
@@ -423,6 +423,18 @@ msgstr "najmanjše število pojavitev drevesa v korpusu"
msgid "Association measures"
msgstr "Mere povezovalnosti"
msgid "Complexity measures"
msgstr "Mere kompleksnosti"
msgid "print maximum tree depth and mean dependency distance (MDD)"
msgstr "izpiše največjo globino drevesa in povprečno razdaljo odvisnosti (MDD)"
msgid "Max depth"
msgstr "Največja globina"
msgid "MDD"
msgstr "MDD"
#: templates/index.html:156
msgid "print MI, logDice and t-score"
msgstr "izračun vrednosti MI, logDice in t-test"