Commit 98dba491 authored by Administrator's avatar Administrator

[FEAT] If ngrams have not been extracted yet, then cooc is not computed.

parent 0400df17
......@@ -58,7 +58,7 @@ def apply_workflow(corpus_id):
# With Django ORM
corpus_django = models.Node.objects.get(id=corpus_id)
corpus_django.metadata['Processing'] = 0
corpus_django.metadata['Processing'] = "2"
corpus_django.save()
print("-" *60)
......@@ -73,5 +73,12 @@ def apply_workflow(corpus_id):
extract_ngrams(corpus, ['title'])
compute_tfidf(corpus)
try:
corpus_django.metadata['Processing'] = 0
corpus_django.save()
except Exception as error:
print(error)
......@@ -288,8 +288,10 @@ def corpus(request, project_id, corpus_id):
try:
processing = corpus.metadata['Processing']
except:
except Exception as error:
print(error)
processing = 0
print('processing', processing)
html = t.render(Context({\
'user': user,\
......
......@@ -131,7 +131,7 @@
<div class="col-md-4">
<div class="jumbotron">
{% if processing == "1" %}
{% if processing >= "1" %}
<h3> <img width="20px" src="{% static "js/libs/img2/loading-bar.gif" %}"></img> Graph (later)</h3>
{% else %}
<h3><a href="/project/{{project.id}}/corpus/{{ corpus.id }}/explorer">Graph</a></h3>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment