Commit 7e733730 authored by Administrator's avatar Administrator

[FIX] tags.

parent 763392fa
...@@ -49,7 +49,7 @@ CELERY_IMPORTS=("node.models","gargantext_web.celery") ...@@ -49,7 +49,7 @@ CELERY_IMPORTS=("node.models","gargantext_web.celery")
SECRET_KEY = 'bt)3n9v&a02cu7^^=+u_t2tmn8ex5fvx8$x4r*j*pb1yawd+rz' SECRET_KEY = 'bt)3n9v&a02cu7^^=+u_t2tmn8ex5fvx8$x4r*j*pb1yawd+rz'
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = False
MAINTENANCE = False MAINTENANCE = False
TEMPLATE_DEBUG = True TEMPLATE_DEBUG = True
......
...@@ -231,11 +231,13 @@ def extract_ngrams(corpus, keys): ...@@ -231,11 +231,13 @@ def extract_ngrams(corpus, keys):
terms = ' '.join([token for token, tag in ngram]).lower() terms = ' '.join([token for token, tag in ngram]).lower()
# TODO BUG here # TODO BUG here
if n == 1: if n == 1:
tag_id = cache.Tag[ngram[0][1]].id #tag_id = cache.Tag[ngram[0][1]].id
#tag_id = 1 tag_id = 1
#print('tag_id', tag_id) #print('tag_id', tag_id)
elif n > 1: elif n > 1:
tag_id = cache.Tag['NN'].id tag_id = 1
#tag_id = cache.Tag[ngram[0][1]].id
#tag_id = cache.Tag['NN'].id
#tag_id = 14 #tag_id = 14
#print('tag_id_2', tag_id) #print('tag_id_2', tag_id)
node_ngram_list[node_id][terms] += 1 node_ngram_list[node_id][terms] += 1
......
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