Commit 94f66317 authored by delanoe's avatar delanoe

[FEAT] TurboParser again with us.

parent 622ce865
...@@ -102,12 +102,12 @@ INDEXED_HYPERDATA = { ...@@ -102,12 +102,12 @@ INDEXED_HYPERDATA = {
} }
from gargantext.util.taggers import EnglishMeltTagger, FrenchMeltTagger from gargantext.util.taggers import EnglishMeltTagger, FrenchMeltTagger, TurboTagger
LANGUAGES = { LANGUAGES = {
'en': { 'en': {
'tagger': EnglishMeltTagger, #'tagger': EnglishMeltTagger,
#'tagger': TurboTagger, 'tagger': TurboTagger,
#'tagger': NltkTagger, #'tagger': NltkTagger,
}, },
'fr': { 'fr': {
......
...@@ -15,13 +15,14 @@ CONFIGURATION ...@@ -15,13 +15,14 @@ CONFIGURATION
The settings for the server can be found in `settings.py`. The settings for the server can be found in `settings.py`.
Please ensure the TCP port is not already in use on your machine, and that the path to the models are correct. Please ensure the TCP port is not already in use on your machine, and that the path to the models are correct.
START for tests START server in console
=============== =======================
python3 server.py launchServeur.sh
"CTRL + c" to shut down "CTRL + c" to shut down
START/STOP THE SERVER START/STOP THE DAEMON SERVER (DEPRECATED)
===================== =========================================
Simply run the following command to start: `./nlpserver start` Simply run the following command to start: `./nlpserver start`
To stop: `./nlpserver stop` To stop: `./nlpserver stop`
......
#!/bin/bash
export LD_LIBRARY_PATH=":/srv/gargantext_lib/taggers/nlpserver/TurboParser/deps/local/lib:"
source /srv/env_3-5/bin/activate
python server.py
...@@ -7,25 +7,30 @@ def print(text): ...@@ -7,25 +7,30 @@ def print(text):
print('PREPARING TURBOPARSER') print('PREPARING TURBOPARSER')
import turboparser import turboparser
turbo_interface = turboparser.PTurboParser() turbo_interface = turboparser.PTurboParser()
print('TURBOPARSER PREPARED')
print('LOADING TOKENIZERS') print('LOADING TOKENIZERS')
import nltk import nltk
sentence_tokenizer = nltk.data.load(tokenizer_model) sentence_tokenizer = nltk.data.load(tokenizer_model)
word_tokenizer = nltk.TreebankWordTokenizer() word_tokenizer = nltk.TreebankWordTokenizer()
print('TOKENIZERS LOADED')
if 'TAG' in implemented_methods or 'LEMMATIZE' in implemented_methods: if 'TAG' in implemented_methods or 'LEMMATIZE' in implemented_methods:
print('LOADING TAGGER') print('LOADING TAGGER')
tagger = turbo_interface.create_tagger() tagger = turbo_interface.create_tagger()
tagger.load_tagger_model(b_tagger_model) tagger.load_tagger_model(b_tagger_model)
print('TAGGER LOADED')
if 'LEMMATIZE' in implemented_methods or 'TAG' in implemented_methods or 'PARSE' in implemented_methods: if 'LEMMATIZE' in implemented_methods or 'TAG' in implemented_methods or 'PARSE' in implemented_methods:
print('LOADING LEMMATIZER') print('LOADING LEMMATIZER')
from lemmatizer import lemmatize from lemmatizer import lemmatize
print('LEMMATIZER LOADED')
if 'PARSE' in implemented_methods: if 'PARSE' in implemented_methods:
print('LOADING PARSER') print('LOADING PARSER')
parser = turbo_interface.create_parser() parser = turbo_interface.create_parser()
parser.load_parser_model(b_parser_model) parser.load_parser_model(b_parser_model)
print('PARSER LOADED')
def split_sentences(text): def split_sentences(text):
......
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