Commit 94f66317 authored by delanoe's avatar delanoe

[FEAT] TurboParser again with us.

parent 622ce865
......@@ -102,12 +102,12 @@ INDEXED_HYPERDATA = {
}
from gargantext.util.taggers import EnglishMeltTagger, FrenchMeltTagger
from gargantext.util.taggers import EnglishMeltTagger, FrenchMeltTagger, TurboTagger
LANGUAGES = {
'en': {
'tagger': EnglishMeltTagger,
#'tagger': TurboTagger,
#'tagger': EnglishMeltTagger,
'tagger': TurboTagger,
#'tagger': NltkTagger,
},
'fr': {
......
......@@ -15,13 +15,14 @@ CONFIGURATION
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.
START for tests
===============
python3 server.py
START server in console
=======================
launchServeur.sh
"CTRL + c" to shut down
START/STOP THE SERVER
=====================
START/STOP THE DAEMON SERVER (DEPRECATED)
=========================================
Simply run the following command to start: `./nlpserver start`
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):
print('PREPARING TURBOPARSER')
import turboparser
turbo_interface = turboparser.PTurboParser()
print('TURBOPARSER PREPARED')
print('LOADING TOKENIZERS')
import nltk
sentence_tokenizer = nltk.data.load(tokenizer_model)
word_tokenizer = nltk.TreebankWordTokenizer()
print('TOKENIZERS LOADED')
if 'TAG' in implemented_methods or 'LEMMATIZE' in implemented_methods:
print('LOADING TAGGER')
tagger = turbo_interface.create_tagger()
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:
print('LOADING LEMMATIZER')
from lemmatizer import lemmatize
print('LEMMATIZER LOADED')
if 'PARSE' in implemented_methods:
print('LOADING PARSER')
parser = turbo_interface.create_parser()
parser.load_parser_model(b_parser_model)
print('PARSER LOADED')
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