Multiple fixes listed in 2024-01-03 changelog

This commit is contained in:
lkrsnik 2024-01-22 14:56:12 +01:00
parent 9dc7561238
commit 5095bc8404
6 changed files with 254 additions and 394 deletions

62
app.py
View File

@ -14,6 +14,18 @@ from stark import run
UPLOAD_FOLDER = 'uploads' UPLOAD_FOLDER = 'uploads'
ALLOWED_EXTENSIONS = {'conllu'} ALLOWED_EXTENSIONS = {'conllu'}
DAYS_BEFORE_DELETION = 1 DAYS_BEFORE_DELETION = 1
TABLE_COLUMNS2DISPLAYED_TABLE_COLUMNS = {
'Tree': 'Tree',
'Absolute frequency': 'Frequency',
'Number of nodes': 'Number of nodes',
'Head node': 'Head node',
'Grew-match URL': 'Grew-match URL',
'Order': 'Order',
'MI': 'MI',
'logDice': 'logDice',
't-score': 't-score'
}
DISPLAYED_TABLE_COLUMNS2TABLE_COLUMNS = {v: k for k, v in TABLE_COLUMNS2DISPLAYED_TABLE_COLUMNS.items()}
def create_app(): def create_app():
@ -73,17 +85,10 @@ def create_app():
f.save(secure_filename(f.filename)) f.save(secure_filename(f.filename))
return 'file uploaded successfully' return 'file uploaded successfully'
@app.route('/about', methods=['GET']) @app.route('/about', methods=['GET'])
def about(): def about():
return render_template('about.html') return render_template('about.html')
# @app.route('/result/<result_id>/download', methods=['GET'])
# def download_result(result_id):
# return
@app.route('/result/<result_id>', methods=['GET', 'POST']) @app.route('/result/<result_id>', methods=['GET', 'POST'])
def result(result_id): def result(result_id):
@ -99,15 +104,16 @@ def create_app():
# TODO TEST VARYING SIZES OF TEXT IN TABLE # TODO TEST VARYING SIZES OF TEXT IN TABLE
return send_file(os.path.join('media', result_id), as_attachment=True, download_name='results.tsv') return send_file(os.path.join('media', result_id), as_attachment=True, download_name='results.tsv')
order_by = request.args.get('order_by') order_by_display = request.args.get('order_by')
order_by = DISPLAYED_TABLE_COLUMNS2TABLE_COLUMNS[order_by_display[:-1]] if order_by_display is not None else None
order_type = request.args.get('order_type') order_type = request.args.get('order_type')
with open(os.path.join('media', result_id), 'r') as rf: with open(os.path.join('media', result_id), 'r') as rf:
content = list(csv.reader(rf, delimiter='\t')) content = list(csv.reader(rf, delimiter='\t'))
head = content[0] head = content[0]
content_dict = {h: [] for h in head} content_dict = {h: [] for h in head}
if order_by is not None and order_by[:-1] in head: if order_by is not None and order_by in head:
sort_id = head.index(order_by[:-1]) sort_id = head.index(order_by)
if order_type == 'asc': if order_type == 'asc':
# check if a number can be converted to float or int # check if a number can be converted to float or int
ordered_content = sorted(content[1:], key=lambda x: -1 * float(x[sort_id]) if x[sort_id].isnumeric() or re.match(r'^-?\d+(?:\.\d+)$', x[sort_id]) is not None else x[sort_id], reverse=True) ordered_content = sorted(content[1:], key=lambda x: -1 * float(x[sort_id]) if x[sort_id].isnumeric() or re.match(r'^-?\d+(?:\.\d+)$', x[sort_id]) is not None else x[sort_id], reverse=True)
@ -120,11 +126,12 @@ def create_app():
for j, v in enumerate(row): for j, v in enumerate(row):
content_dict[head[j]].append(v) content_dict[head[j]].append(v)
# content.sort(key=lambda x: x[1]) displayed_head = [TABLE_COLUMNS2DISPLAYED_TABLE_COLUMNS[col] for col in head if col in TABLE_COLUMNS2DISPLAYED_TABLE_COLUMNS]
a = request displayed_content_dict = {}
print(result_id) for column, v in content_dict.items():
return render_template('result.html', head_row=head, content=content_dict) if column in TABLE_COLUMNS2DISPLAYED_TABLE_COLUMNS:
displayed_content_dict[TABLE_COLUMNS2DISPLAYED_TABLE_COLUMNS[column]] = v
return render_template('result.html', head_row=displayed_head, content=displayed_content_dict)
@app.route('/', methods=['GET', 'POST']) @app.route('/', methods=['GET', 'POST'])
def index(): def index():
@ -188,7 +195,7 @@ def create_app():
# TODO EXPAND NODE TYPE # TODO EXPAND NODE TYPE
node_type_options = {'upos', 'form', 'lemma', 'upos', 'xpos', 'feats', 'deprel'} node_type_options = {'upos', 'form', 'lemma', 'upos', 'xpos', 'feats', 'deprel'}
if len(node_type) == 0: if len(node_type) == 0:
validation['node_type'] = 'Please provide information about node type.' validation['node_type'] = 'Please select at least one node type.'
return False return False
for el in node_type: for el in node_type:
@ -219,6 +226,7 @@ def create_app():
configs['complete_tree_type'] = True configs['complete_tree_type'] = True
configs['dependency_type'] = 'labeled_trees' in form and form['labeled_trees'] == 'on' 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['node_order'] = 'fixed_order' in form and form['fixed_order'] == 'on'
configs['association_measures'] = 'association_measures' in form and form['association_measures'] == 'on'
configs['label_whitelist'] = [] configs['label_whitelist'] = []
configs['root_whitelist'] = [] configs['root_whitelist'] = []
@ -240,23 +248,19 @@ def create_app():
if configs['compare'] is not None: if configs['compare'] is not None:
configs['other_input_path'] = configs['compare'] configs['other_input_path'] = configs['compare']
######################################## configs['grew_match'] = True
#config = configparser.ConfigParser()
#config.read('config.ini')
# configs = read_configs(config, args)
configs['association_measures'] = False
configs['grew_match'] = 'grewmatch_patterns' in form and form['grewmatch_patterns'] == 'on'
configs['depsearch'] = False configs['depsearch'] = False
name = ''.join(random.choices(string.ascii_uppercase + string.digits, k=60)) name = ''.join(random.choices(string.ascii_uppercase + string.digits, k=60))
configs['output'] = os.path.join('media', name) configs['output'] = os.path.join('media', name)
if len(validation) > 0:
run(configs) return render_template('index.html', validation=validation)
# TODO DELETE STORED FILE AFTER PROCESSING try:
run(configs)
except Exception as e:
validation['general'] = 'Processing failed! Please recheck your settings.'
if len(validation) > 0:
return render_template('index.html', validation=validation)
return redirect(url_for('result', result_id=name)) return redirect(url_for('result', result_id=name))
# return send_file(configs['output'], as_attachment=True)
# return render_template('index.html')
return render_template('index.html') return render_template('index.html')
return app return app

View File

@ -74,4 +74,18 @@ td {
text-align: center; text-align: center;
border-right: solid 1px #bbbbbb; border-right: solid 1px #bbbbbb;
border-left: solid 1px #bbbbbb; border-left: solid 1px #bbbbbb;
} }
.validation-error {
display: block;
color: #F44336;
position: relative;
min-height: 18px;
font-size: 12px;
}
@media only screen and (min-width: 993px) {
.container {
width: 60%;
}
}

View File

@ -1,4 +1,55 @@
// Global array to store input names
var globalInputList = ['tree_size_min', 'tree_size_max', 'file', 'association_measures', 'labeled_trees', 'node_type_upos', 'fixed_order', 'input_url', 'node_type_lemma', 'root_restriction', 'node_type_form'];
// Function to store values to local storage
function storeValuesToLocalstorage() {
globalInputList.forEach(function(inputName) {
var inputElement = $('[name="' + inputName + '"]');
if (inputElement.length > 0) {
var inputType = inputElement.attr('type');
if (inputType === 'text' | inputType === 'hidden') {
localStorage.setItem(inputName, inputElement.val());
} else if (inputType === 'checkbox') {
localStorage.setItem(inputName, inputElement.prop('checked'));
}
}
});
}
// Function to read values from local storage
function readValuesFromLocalstorage() {
globalInputList.forEach(function(inputName) {
var inputElement = $('[name="' + inputName + '"]');
if (inputElement.length > 0) {
var inputType = inputElement.attr('type');
if (inputType === 'text') {
var text_val = localStorage.getItem(inputName);
if (text_val !== '' & text_val !== null) {
// set label to active
$("label[for='" + inputElement.attr('id') + "']").addClass('active');
}
inputElement.val(text_val);
} else if (inputType === 'checkbox') {
var check_value = localStorage.getItem(inputName);
if (check_value !== null) {
inputElement.prop('checked', check_value === 'true');
}
}
}
});
var tree_size_min = localStorage.getItem('tree_size_min') !== null ? localStorage.getItem('tree_size_min') : 2;
var tree_size_max = localStorage.getItem('tree_size_max') !== null ? localStorage.getItem('tree_size_max') : 3;
return [tree_size_min, tree_size_max]
}
document.addEventListener("DOMContentLoaded", function(event) { document.addEventListener("DOMContentLoaded", function(event) {
tree_size = readValuesFromLocalstorage()
var valuesForSlider = [2,3,4,5]; var valuesForSlider = [2,3,4,5];
var format = { var format = {
@ -11,7 +62,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
}; };
var slider = document.getElementById('slider'); var slider = document.getElementById('slider');
noUiSlider.create(slider, { noUiSlider.create(slider, {
start: [2, 3], start: [tree_size[0], tree_size[1]],
connect: true, connect: true,
tooltips: true, tooltips: true,
step: 1, step: 1,
@ -30,11 +81,15 @@ document.addEventListener("DOMContentLoaded", function(event) {
}); // end of document ready }); // end of document ready
$(document).ready(function(){ $(document).ready(function(){
$('#advanced-tree').hide(); $('.input-field input[type="checkbox"]').on('change', function() {
$('.input-field span.helper-text').hide(); var isChecked = $('.input-field input[type="checkbox"]:checked').length > 0;
$('.input-field').bind('mouseenter', function(e) { $('#node-type-error').hide();
$(this).find('span.helper-text').show('fast')
}); });
$('#submit-form input').on('change', function() {
$('#unknown-error').hide();
});
$('#advanced-tree').hide();
var advancedTreeExpanded = false; var advancedTreeExpanded = false;
$('#advanced-tree-expand').bind('click', function(e) { $('#advanced-tree-expand').bind('click', function(e) {
if (!advancedTreeExpanded){ if (!advancedTreeExpanded){
@ -46,10 +101,6 @@ document.addEventListener("DOMContentLoaded", function(event) {
$('#advanced-tree').hide('fast'); $('#advanced-tree').hide('fast');
$('#advanced-tree-expand i').text('add'); $('#advanced-tree-expand i').text('add');
} }
$(this).find('span.helper-text').show('fast')
});
$('.input-field').bind('mouseleave', function(e) {
$(this).find('span.helper-text').hide('fast')
}); });
}); });
@ -66,6 +117,8 @@ document.addEventListener("DOMContentLoaded", function(event) {
.attr("name", "tree_size_max") .attr("name", "tree_size_max")
.attr("value", tree_size_max) .attr("value", tree_size_max)
.appendTo("#submit-form"); .appendTo("#submit-form");
storeValuesToLocalstorage();
return true; return true;
}); });
})(jQuery); // end of jQuery name space })(jQuery); // end of jQuery name space

View File

@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<title>Starter Template - Materialize</title> <title>STARK</title>
<!-- CSS --> <!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
@ -13,72 +13,12 @@
</head> </head>
<body> <body>
<nav class="grey darken-2" role="navigation"> <nav class="grey darken-2" role="navigation">
<div class="nav-wrapper container"><a id="logo-container" href="#" class="brand-logo">STARK</a> <div class="nav-wrapper container"><a id="logo-container" href="/" class="brand-logo">STARK</a>
<!-- <ul class="right hide-on-med-and-down">-->
<!-- <li><a href="#">Navbar Link</a></li>-->
<!-- </ul>-->
<!-- <ul id="nav-mobile" class="sidenav">-->
<!-- <li><a href="#">Navbar Link</a></li>-->
<!-- </ul>-->
<!-- <a href="#" data-target="nav-mobile" class="sidenav-trigger"><i class="material-icons">menu</i></a>-->
<ul id="nav-mobile" class="right hide-on-med-and-down"> <ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="/">Processing</a></li>
<li><a href="/about">About</a></li> <li><a href="/about">About</a></li>
</ul> </ul>
</div> </div>
</nav> </nav>
<!-- <div class="section no-pad-bot" id="index-banner">-->
<!-- <div class="container">-->
<!-- <br><br>-->
<!-- <h1 class="header center orange-text">Starter Template</h1>-->
<!-- <div class="row center">-->
<!-- <h5 class="header col s12 light">A modern responsive front-end framework based on Material Design</h5>-->
<!-- </div>-->
<!-- <div class="row center">-->
<!-- <a href="http://materializecss.com/getting-started.html" id="download-button" class="btn-large waves-effect waves-light orange">Get Started</a>-->
<!-- </div>-->
<!-- <br><br>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="container">-->
<!-- <div class="section">-->
<!-- &lt;!&ndash; Icon Section &ndash;&gt;-->
<!-- <div class="row">-->
<!-- <div class="col s12 m4">-->
<!-- <div class="icon-block">-->
<!-- <h2 class="center light-blue-text"><i class="material-icons">flash_on</i></h2>-->
<!-- <h5 class="center">Speeds up development</h5>-->
<!-- <p class="light">We did most of the heavy lifting for you to provide a default stylings that incorporate our custom components. Additionally, we refined animations and transitions to provide a smoother experience for developers.</p>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col s12 m4">-->
<!-- <div class="icon-block">-->
<!-- <h2 class="center light-blue-text"><i class="material-icons">group</i></h2>-->
<!-- <h5 class="center">User Experience Focused</h5>-->
<!-- <p class="light">By utilizing elements and principles of Material Design, we were able to create a framework that incorporates components and animations that provide more feedback to users. Additionally, a single underlying responsive system across all platforms allow for a more unified user experience.</p>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col s12 m4">-->
<!-- <div class="icon-block">-->
<!-- <h2 class="center light-blue-text"><i class="material-icons">settings</i></h2>-->
<!-- <h5 class="center">Easy to work with</h5>-->
<!-- <p class="light">We have provided detailed documentation as well as specific code examples to help new users get started. We are also always open to feedback and can answer any questions a user may have about Materialize.</p>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <br><br>-->
<div class="container"> <div class="container">
<br> <br>
<div class="row"> <div class="row">
@ -95,27 +35,7 @@
<div class="col l6 s12"> <div class="col l6 s12">
<h5 class="white-text">Credits</h5> <h5 class="white-text">Credits</h5>
<p class="grey-text text-lighten-4">Add some logos here?</p> <p class="grey-text text-lighten-4">Add some logos here?</p>
</div> </div>
<!-- <div class="col l3 s12">-->
<!-- <h5 class="white-text">Settings</h5>-->
<!-- <ul>-->
<!-- <li><a class="white-text" href="#!">Link 1</a></li>-->
<!-- <li><a class="white-text" href="#!">Link 2</a></li>-->
<!-- <li><a class="white-text" href="#!">Link 3</a></li>-->
<!-- <li><a class="white-text" href="#!">Link 4</a></li>-->
<!-- </ul>-->
<!-- </div>-->
<!-- <div class="col l3 s12">-->
<!-- <h5 class="white-text">Connect</h5>-->
<!-- <ul>-->
<!-- <li><a class="white-text" href="#!">Link 1</a></li>-->
<!-- <li><a class="white-text" href="#!">Link 2</a></li>-->
<!-- <li><a class="white-text" href="#!">Link 3</a></li>-->
<!-- <li><a class="white-text" href="#!">Link 4</a></li>-->
<!-- </ul>-->
<!-- </div>-->
</div> </div>
</div> </div>
<div class="footer-copyright"> <div class="footer-copyright">

View File

@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<title>Starter Template - Materialize</title> <title>STARK</title>
<!-- CSS --> <!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
@ -13,215 +13,162 @@
</head> </head>
<body> <body>
<nav class="grey darken-2" role="navigation"> <nav class="grey darken-2" role="navigation">
<div class="nav-wrapper container"><a id="logo-container" href="#" class="brand-logo">STARK</a> <div class="nav-wrapper container"><a id="logo-container" href="/" class="brand-logo">STARK</a>
<!-- <ul class="right hide-on-med-and-down">-->
<!-- <li><a href="#">Navbar Link</a></li>-->
<!-- </ul>-->
<!-- <ul id="nav-mobile" class="sidenav">-->
<!-- <li><a href="#">Navbar Link</a></li>-->
<!-- </ul>-->
<!-- <a href="#" data-target="nav-mobile" class="sidenav-trigger"><i class="material-icons">menu</i></a>-->
<ul id="nav-mobile" class="right hide-on-med-and-down"> <ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="/">Processing</a></li>
<li><a href="/about">About</a></li> <li><a href="/about">About</a></li>
</ul> </ul>
</div> </div>
</nav> </nav>
<!-- <div class="section no-pad-bot" id="index-banner">--> <div class="container">
<!-- <div class="container">--> <br>
<!-- <br><br>--> <div class="row">
<!-- <h1 class="header center orange-text">Starter Template</h1>--> <div class="col s12">
<!-- <div class="row center">--> <p class="caption">Welcome to the online demo interface for STARK - a highly-customizible tool designed to extract various types of syntactic trees from dependency-parsed corpora (treebanks). Unlike the original command-line version, this user-friendly interface offers a streamlined set of settings, which are described in more detail here. Simply upload your treebank and click SUBMIT to view the initial results!</p>
<!-- <h5 class="header col s12 light">A modern responsive front-end framework based on Material Design</h5>--> <form action="{{ url_for('index') }}" method="POST" enctype="multipart/form-data" id="submit-form">
<!-- </div>--> <h4>Input data</h4>
<!-- <div class="row center">--> <div class="card">
<!-- <a href="http://materializecss.com/getting-started.html" id="download-button" class="btn-large waves-effect waves-light orange">Get Started</a>--> <div class="card-content">
<!-- </div>--> <label><b>Upload a treebank</b> in CONLL-U format</label>
<!-- <br><br>--> <div class = "file-field input-field">
<div class = "btn">
<!-- </div>--> <span>Browse</span>
<!-- </div>--> <input type = "file" name="file"/>
<!-- <div class="container">-->
<!-- <div class="section">-->
<!-- &lt;!&ndash; Icon Section &ndash;&gt;-->
<!-- <div class="row">-->
<!-- <div class="col s12 m4">-->
<!-- <div class="icon-block">-->
<!-- <h2 class="center light-blue-text"><i class="material-icons">flash_on</i></h2>-->
<!-- <h5 class="center">Speeds up development</h5>-->
<!-- <p class="light">We did most of the heavy lifting for you to provide a default stylings that incorporate our custom components. Additionally, we refined animations and transitions to provide a smoother experience for developers.</p>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col s12 m4">-->
<!-- <div class="icon-block">-->
<!-- <h2 class="center light-blue-text"><i class="material-icons">group</i></h2>-->
<!-- <h5 class="center">User Experience Focused</h5>-->
<!-- <p class="light">By utilizing elements and principles of Material Design, we were able to create a framework that incorporates components and animations that provide more feedback to users. Additionally, a single underlying responsive system across all platforms allow for a more unified user experience.</p>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col s12 m4">-->
<!-- <div class="icon-block">-->
<!-- <h2 class="center light-blue-text"><i class="material-icons">settings</i></h2>-->
<!-- <h5 class="center">Easy to work with</h5>-->
<!-- <p class="light">We have provided detailed documentation as well as specific code examples to help new users get started. We are also always open to feedback and can answer any questions a user may have about Materialize.</p>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <br><br>-->
<div class="container">
<br>
<div class="row">
<div class="col s12">
<p class="caption">Welcome to the online demo interface for STARK - a highly-customizible tool designed to extract various types of syntactic trees from dependency-parsed corpora (treebanks). Unlike the original command-line version, this user-friendly interface offers a streamlined set of settings, which are described in more detail here. Simply upload your treebank and click SUBMIT to view the initial results!</p>
<form action="{{ url_for('index') }}" method="POST" enctype="multipart/form-data" id="submit-form">
<h4>Input data</h4>
<div class="card">
<div class="card-content">
<label><b>Upload a treebank</b> in CONLL-U format</label>
<div class = "file-field input-field">
<div class = "btn">
<span>Browse</span>
<input type = "file" name="file"/>
</div>
<div class = "file-path-wrapper">
<input class="file-path validate" type="text" placeholder="Upload"/>
</div>
</div> </div>
<div class="row"> <div class = "file-path-wrapper">
<div class="input-field col s12"> <input class="file-path validate{% if 'file' in validation %} invalid{% endif %}" type="text" placeholder="Upload"/>
<input id="input_url" name="input_url" type="text" class="validate"> {% if 'file' in validation %}
<label for="input_url"><u>Or</u> insert a URL link to a treebank in CONLL-U format</label> <span class="helper-text" data-error="{{validation['file']}}"></span>
<!-- <span class="helper-text" data-error="wrong" data-success="right">Insert a link to treebank in CONLL-U format.</span>--> {% endif %}
</div> </div>
</div>
<div class="row">
<div class="input-field col s12">
<input id="input_url" name="input_url" type="text" class="validate{% if 'input_url' in validation %} invalid{% endif %}">
<label for="input_url"><u>Or</u> insert a URL link to a treebank in CONLL-U format</label>
{% if 'input_url' in validation %}
<span class="helper-text" data-error="{{validation['input_url']}}"></span>
{% endif %}
</div> </div>
</div> </div>
</div> </div>
<br> </div>
<h4>Tree specification</h4> <br>
<div class="card"> <h4>Tree specification</h4>
<div class="card-content"> <div class="card">
<label><b>Tree size</b>: number of tokens in the tree (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--size" title="Help"><span class="menu-title sr-only">Help</span></a>)</label> <div class="card-content">
<div class="row"> <label><b>Tree size</b>: number of tokens in the tree (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--size" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
<div class="input-field col s12"> <div class="row">
<br /> <div class="input-field col s12">
<div id="slider"></div> <br />
</div> <div id="slider"></div>
</div> </div>
</div>
<label><b>Node type</b>: token characteristics to consider (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--node_type" title="Help"><span class="menu-title sr-only">Help</span></a>)</label> <label><b>Node type</b>: token characteristics to consider (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--node_type" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
<div class="row"> <div class="row">
<div class="input-field">
<div class="col s4">
<label>
<input type="checkbox" class="filled-in {% if 'node_type' in validation %} invalid{% endif %}" name="node_type_upos" checked="checked" />
<span>Part-of-speech</span>
{% if 'node_type' in validation %}
<span class="helper-text" data-error="{{validation['node_type']}}"></span>
{% endif %}
</label>
</div>
<div class="col s4">
<label>
<input type="checkbox" class="filled-in" name="node_type_lemma"/>
<span>Lemma</span>
</label>
</div>
<div class="col s4">
<label>
<input type="checkbox" class="filled-in" name="node_type_form"/>
<span>Form</span>
</label>
</div>
<!-- Shared error message for all checkboxes -->
{% if 'node_type' in validation %}
<div class="col s12">
<span class="validation-error" id="node-type-error">{{ validation['node_type'] }}</span>
</div>
{% endif %}
</div>
</div>
</div>
</div>
<br>
<h4><a class="waves-effect waves-light inline" id="advanced-tree-expand"><i class="material-icons">add</i></a> Advanced settings</h4>
<div class="card" id="advanced-tree">
<div class="card-content">
<div class="row">
<div class="col s12">
<label><b>Labeled trees</b>: include names of dependency relations (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--labeled" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
<div class="input-field"> <div class="input-field">
<div class="col s4"> <div class="switch">
<label> <label>
<input type="checkbox" class="filled-in" name="node_type_upos" checked="checked" /> No
<span>UPOS</span> <input type="checkbox" name="labeled_trees" checked="checked">
<span class="lever"></span>
Yes
</label> </label>
</div> </div>
<div class="col s4"> </div>
</div>
</div>
<div class="row">
<div class="col s12">
<label><b>Fixed order</b>: differentiate trees based on surface word order (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--fixed" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
<div class="input-field">
<div class="switch">
<label> <label>
<input type="checkbox" class="filled-in" name="node_type_form"/> No
<span>form</span> <input type="checkbox" name="fixed_order" checked="checked">
<span class="lever"></span>
Yes
</label> </label>
</div> </div>
<div class="col s4"> </div>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<input id="root_restriction" name="root_restriction" type="text" class="validate">
<label for="root_restriction"><b>Head</b>: specify potential restrictions on the head node (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--head" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
</div>
</div>
<div class="row">
<div class="col s12">
<label><b>Association measures</b>: print MI, MI3, Dice, logDice, t-score and simple-LL scores (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--association_measures" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
<div class="input-field">
<div class="switch">
<label> <label>
<input type="checkbox" class="filled-in" name="node_type_lemma"/> No
<span>lemma</span> <input type="checkbox" name="association_measures">
<span class="lever"></span>
Yes
</label> </label>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<br> </div>
<h4><a class="waves-effect waves-light inline" id="advanced-tree-expand"><i class="material-icons">add</i></a> Advanced settings</h4> {% if 'general' in validation %}
<div class="card" id="advanced-tree"> <div class="col s12">
<div class="card-content"> <span class="validation-error" id="unknown-error">{{ validation['general'] }}</span>
<div class="row"> </div>
<div class="col s6"> </br>
<label><b>Labeled trees</b>: include names of dependency relations (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--labeled" title="Help"><span class="menu-title sr-only">Help</span></a>)</label> {% endif %}
<div class="input-field"> <button class="btn waves-effect waves-light btn-large" type="submit" name="action">Submit
<div class="switch"> <i class="material-icons right">send</i>
<label> </button>
No </form>
<input type="checkbox" name="labeled_trees" checked="checked">
<span class="lever"></span>
Yes
</label>
</div>
</div>
</div>
<div class="col s6">
<label><b>Fixed order</b>: differentiate trees based on surface word order (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--fixed" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
<div class="input-field">
<div class="switch">
<label>
No
<input type="checkbox" name="fixed_order" checked="checked">
<span class="lever"></span>
Yes
</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<input id="root_restriction" name="root_restriction" type="text" class="validate">
<label for="root_restriction"><b>Head</b>: specify potential restrictions on the head node (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--head" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
</div>
</div>
<div class="row">
<div class="col s6">
<label><b>Association measures</b>: print MI, MI3, Dice, logDice, t-score and simple-LL scores (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--association_measures" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
<div class="input-field">
<div class="switch">
<label>
No
<input type="checkbox" name="association_measures">
<span class="lever"></span>
Yes
</label>
</div>
</div>
</div>
<div class="col s6">
<label><b>Grew-match</b>: convert tree structures to Grew-match patterns (<a class="nav-link" href="https://github.com/clarinsi/STARK/blob/master/settings.md#--grew_match" title="Help"><span class="menu-title sr-only">Help</span></a>)</label>
<div class="input-field">
<div class="switch">
<label>
No
<input type="checkbox" name="grewmatch_patterns">
<span class="lever"></span>
Yes
</label>
</div>
</div>
</div>
</div>
</div>
</div>
<button class="btn waves-effect waves-light btn-large" type="submit" name="action">Submit
<i class="material-icons right">send</i>
</button>
</form>
</div>
</div> </div>
</div>
</div> </div>
<footer class="page-footer light-blue"> <footer class="page-footer light-blue">
@ -233,24 +180,6 @@
</div> </div>
<!-- <div class="col l3 s12">-->
<!-- <h5 class="white-text">Settings</h5>-->
<!-- <ul>-->
<!-- <li><a class="white-text" href="#!">Link 1</a></li>-->
<!-- <li><a class="white-text" href="#!">Link 2</a></li>-->
<!-- <li><a class="white-text" href="#!">Link 3</a></li>-->
<!-- <li><a class="white-text" href="#!">Link 4</a></li>-->
<!-- </ul>-->
<!-- </div>-->
<!-- <div class="col l3 s12">-->
<!-- <h5 class="white-text">Connect</h5>-->
<!-- <ul>-->
<!-- <li><a class="white-text" href="#!">Link 1</a></li>-->
<!-- <li><a class="white-text" href="#!">Link 2</a></li>-->
<!-- <li><a class="white-text" href="#!">Link 3</a></li>-->
<!-- <li><a class="white-text" href="#!">Link 4</a></li>-->
<!-- </ul>-->
<!-- </div>-->
</div> </div>
</div> </div>
<div class="footer-copyright"> <div class="footer-copyright">

View File

@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<title>Starter Template - Materialize</title> <title>STARK</title>
<!-- CSS --> <!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
@ -13,83 +13,23 @@
</head> </head>
<body> <body>
<nav class="grey darken-2" role="navigation"> <nav class="grey darken-2" role="navigation">
<div class="nav-wrapper container"><a id="logo-container" href="#" class="brand-logo">STARK</a> <div class="nav-wrapper container"><a id="logo-container" href="/" class="brand-logo">STARK</a>
<!-- <ul class="right hide-on-med-and-down">-->
<!-- <li><a href="#">Navbar Link</a></li>-->
<!-- </ul>-->
<!-- <ul id="nav-mobile" class="sidenav">-->
<!-- <li><a href="#">Navbar Link</a></li>-->
<!-- </ul>-->
<!-- <a href="#" data-target="nav-mobile" class="sidenav-trigger"><i class="material-icons">menu</i></a>-->
<ul id="nav-mobile" class="right hide-on-med-and-down"> <ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="/">Processing</a></li>
<li><a href="/about">About</a></li> <li><a href="/about">About</a></li>
</ul> </ul>
</div> </div>
</nav> </nav>
<div class="section no-pad-bot" id="index-banner"> <div class="container">
<div class="container"> <br>
<!-- <br><br>--> <div class="row">
<!-- <h1 class="header center orange-text">Starter Template</h1>--> <div class="col s12">
<!-- <div class="row center">--> <form action="{{ url_for('result', result_id=request.view_args['result_id']) }}" method="POST" enctype="multipart/form-data" id="submit-form">
<!-- <h5 class="header col s12 light">A modern responsive front-end framework based on Material Design</h5>--> <button class="btn waves-effect waves-light btn-large" type="submit" name="action">Download complete results
<!-- </div>--> <i class="material-icons right">download</i>
<!-- <div class="row center">--> </button>
<!-- <a href="http://materializecss.com/getting-started.html" id="download-button" class="btn-large waves-effect waves-light orange">Get Started</a>--> </form>
<!-- </div>-->
<!-- <br><br>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="container">-->
<!-- <div class="section">-->
<!-- &lt;!&ndash; Icon Section &ndash;&gt;-->
<!-- <div class="row">-->
<!-- <div class="col s12 m4">-->
<!-- <div class="icon-block">-->
<!-- <h2 class="center light-blue-text"><i class="material-icons">flash_on</i></h2>-->
<!-- <h5 class="center">Speeds up development</h5>-->
<!-- <p class="light">We did most of the heavy lifting for you to provide a default stylings that incorporate our custom components. Additionally, we refined animations and transitions to provide a smoother experience for developers.</p>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col s12 m4">-->
<!-- <div class="icon-block">-->
<!-- <h2 class="center light-blue-text"><i class="material-icons">group</i></h2>-->
<!-- <h5 class="center">User Experience Focused</h5>-->
<!-- <p class="light">By utilizing elements and principles of Material Design, we were able to create a framework that incorporates components and animations that provide more feedback to users. Additionally, a single underlying responsive system across all platforms allow for a more unified user experience.</p>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col s12 m4">-->
<!-- <div class="icon-block">-->
<!-- <h2 class="center light-blue-text"><i class="material-icons">settings</i></h2>-->
<!-- <h5 class="center">Easy to work with</h5>-->
<!-- <p class="light">We have provided detailed documentation as well as specific code examples to help new users get started. We are also always open to feedback and can answer any questions a user may have about Materialize.</p>-->
<!-- </div>-->
<!-- </div>-->
</div> </div>
</div> </div>
<!-- <br><br>-->
<div class="container">
<br>
<div class="row">
<div class="col s12">
<form action="{{ url_for('result', result_id=request.view_args['result_id']) }}" method="POST" enctype="multipart/form-data" id="submit-form">
<button class="btn waves-effect waves-light btn-large" type="submit" name="action">Download complete results
<i class="material-icons right">download</i>
</button>
</form>
</div>
</div>
<!-- Your table with many columns --> <!-- Your table with many columns -->
<div class="table-wrapper"> <div class="table-wrapper">