<h2>NLTK Results</h2>
{% for key, type in test_data.iteritems() %}
{% set el = key|lower %}
{% set title = el|replace('_', ' ')|capitalize %}
<div class="panel panel-default">
	<div class="panel-heading">
		<h4 class="panel-title">
			<a data-toggle="collapse" data-parent="#accordion" href="#{{ el }}">
				{{ title }}
			</a>
		</h4>
	</div>
	<div id="{{ el }}" class="panel-collapse collapse in">
		<div class="panel-body">
			{% if type %}
			<ul>
				{% for word in type %}
				<li>{{ word }}</li>
				{% endfor %}
			</ul>
			{% else %}
			<p class="label label-danger">No results.</p>
			{% endif %}
		</div>
	</div>
</div>
{% endfor %}

<h2>NLTK Results</h2>
{% set test_data = data %}
{% if data %}
{% for key, type in data.iteritems() %}
{% set el = key|lower %}
{% set title = el|replace('_', ' ')|capitalize %}
<div class="panel panel-default">
	<div class="panel-heading">
		<h4 class="panel-title">
			<a data-toggle="collapse" data-parent="#accordion" href="#{{ el }}">
				{{ title }}
			</a>
		</h4>
	</div>
	<div id="{{ el }}" class="panel-collapse collapse in">
		<div class="panel-body">
			{% if type %}
			<ul>
				{% for word in type %}
				<li>{{ word }}</li>
				{% endfor %}
			</ul>
			{% else %}
			<p class="label label-danger">No results.</p>
			{% endif %}
		</div>
	</div>
</div>
{% endfor %}
{% else %}
<p class="label label-danger">No data.</p>
{% endif %}

Add error handling when nltk is not used
Add error handling when nltk is not used
