diff --git a/NLP_tools-EZmaster/public/v1/en/ner/analyze.ini b/NLP_tools-EZmaster/public/v1/en/ner/analyze.ini index 2978918..54ac863 100644 --- a/NLP_tools-EZmaster/public/v1/en/ner/analyze.ini +++ b/NLP_tools-EZmaster/public/v1/en/ner/analyze.ini @@ -34,7 +34,8 @@ args = ner args = fix('-o') args = env('output','doc') -args = fix('-lang','en').join(' ') +args = fix('-lang') +args = en [dump] indent = env('indent', false) diff --git a/NLP_tools-EZmaster/public/v1/en/npchunker/analyze.ini b/NLP_tools-EZmaster/public/v1/en/npchunker/analyze.ini index 334c734..415eaf3 100644 --- a/NLP_tools-EZmaster/public/v1/en/npchunker/analyze.ini +++ b/NLP_tools-EZmaster/public/v1/en/npchunker/analyze.ini @@ -34,7 +34,8 @@ args = NPchunker args = fix('-o') args = env('output','doc') -args = fix('-lang','en').join(' ') +args = fix('-lang') +args = en [dump] indent = env('indent', false) diff --git a/NLP_tools-EZmaster/public/v1/en/npchunkerdp/analyze.ini b/NLP_tools-EZmaster/public/v1/en/npchunkerdp/analyze.ini index 85a9c96..af3ab76 100644 --- a/NLP_tools-EZmaster/public/v1/en/npchunkerdp/analyze.ini +++ b/NLP_tools-EZmaster/public/v1/en/npchunkerdp/analyze.ini @@ -34,7 +34,8 @@ args = NPchunkerDP args = fix('-o') args = env('output','doc') -args = fix('-lang','en').join(' ') +args = fix('-lang') +args = en [dump] indent = env('indent', false) diff --git a/NLP_tools-EZmaster/public/v1/en/postagger/analyze.ini b/NLP_tools-EZmaster/public/v1/en/postagger/analyze.ini index 919c28e..c295f4f 100644 --- a/NLP_tools-EZmaster/public/v1/en/postagger/analyze.ini +++ b/NLP_tools-EZmaster/public/v1/en/postagger/analyze.ini @@ -34,7 +34,8 @@ args = POStagger args = fix('-o') args = env('output','doc') -args = fix('-lang','en').join(' ') +args = fix('-lang') +args = en [dump] indent = env('indent', false) diff --git a/NLP_tools-EZmaster/public/v1/en/stemmer/analyze.ini b/NLP_tools-EZmaster/public/v1/en/stemmer/analyze.ini index aaf047e..4463304 100644 --- a/NLP_tools-EZmaster/public/v1/en/stemmer/analyze.ini +++ b/NLP_tools-EZmaster/public/v1/en/stemmer/analyze.ini @@ -34,7 +34,8 @@ args = stemmer args = fix('-o') args = env('output','doc') -args = fix('-lang','en').join(' ') +args = fix('-lang') +args = en [dump] indent = env('indent', false) diff --git a/NLP_tools-EZmaster/public/v1/en/termmatcher/analyze.ini b/NLP_tools-EZmaster/public/v1/en/termmatcher/analyze.ini index 9df6c8f..689418d 100644 --- a/NLP_tools-EZmaster/public/v1/en/termmatcher/analyze.ini +++ b/NLP_tools-EZmaster/public/v1/en/termmatcher/analyze.ini @@ -34,7 +34,8 @@ args = termMatcher args = fix('-o') args = env('output','doc') -args = fix('-lang','en').join(' ') +args = fix('-lang') +args = en [dump] indent = env('indent', false) diff --git a/NLP_tools-EZmaster/public/v1/fr/postagger/analyze.ini b/NLP_tools-EZmaster/public/v1/fr/postagger/analyze.ini index 8a13c38..9960b56 100644 --- a/NLP_tools-EZmaster/public/v1/fr/postagger/analyze.ini +++ b/NLP_tools-EZmaster/public/v1/fr/postagger/analyze.ini @@ -34,7 +34,8 @@ args = lefff_tagger args = fix('-o') args = env('output','doc') -args = fix('-lang','fr').join(' ') +args = fix('-lang') +args = fr [dump] indent = env('indent', false) diff --git a/NLP_tools-EZmaster/public/v1/fr/stemmer/analyze.ini b/NLP_tools-EZmaster/public/v1/fr/stemmer/analyze.ini index 64bf928..50155d2 100644 --- a/NLP_tools-EZmaster/public/v1/fr/stemmer/analyze.ini +++ b/NLP_tools-EZmaster/public/v1/fr/stemmer/analyze.ini @@ -34,7 +34,8 @@ args = stemmer args = fix('-o') args = env('output','doc') -args = fix('-lang','fr').join(' ') +args = fix('-lang') +args = fr [dump] indent = env('indent', false) diff --git a/NLP_tools-EZmaster/test_EZ/run_test_NLPtools_EZ.py b/NLP_tools-EZmaster/test_EZ/run_test_NLPtools_EZ.py index 2ee7175..abbf72b 100644 --- a/NLP_tools-EZmaster/test_EZ/run_test_NLPtools_EZ.py +++ b/NLP_tools-EZmaster/test_EZ/run_test_NLPtools_EZ.py @@ -1,37 +1,53 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +# usage : +# python3 run_test_NLPtools_EZ.py +# """ @author: stephane schneider """ import requests -engines=["postagger", "stemmer", "npchunker", "npchunkerdp"] -outputs=['doc', 'json', 'list'] +outputs=['doc', 'json'] +languages=['en','fr'] +# dev +# uri="http://nlptools-02.tdmservices.intra.inist.fr" +# prod +uri="https://nlp-tools-1.services.inist.fr" # parameter headers = {'content-type': 'application/octet-stream'} - query= {"indent": "true"} # data : # -- fonctionne pas # doc = "../data/data.json" # test_files = { 'file': open(doc, 'rb')} # response = requests.post(url , params = query, files = test_files , stream=True, headers=headers) -doc ="""[ - {"id":"PhnlUo_d6LoJPLN3YUjh5qBLc","value":"Non-local effects by homogenization or 3D–1D dimension reduction in elastic materials reinforced by stiff fibers.We first consider an elastic thin heterogeneous cylinder of radius of order ε: the interior of the cylinder is occupied by a stiff material (fiber) that is surrounded by a soft material (matrix). By assuming that the elasticity tensor of the fiber does not scale with ε and that of the matrix scales with ε2, we prove that the one dimensional model is a nonlocal system.We then consider a reference configuration domain filled out by periodically distributed rods similar to those described above. We prove that the homogenized model is a second order nonlocal problem.In particular, we show that the homogenization problem is directly connected to the 3D–1D dimensional reduction problem."}, - ]""" -for engine in engines: - for output in outputs: - url ="http://nlptools-02.tdmservices.intra.inist.fr/v1/en/{}/analyze".format(engine) - query['output'] = output - response = requests.post(url , params = query, data = doc.encode('utf-8'), stream=True, headers=headers) - - print("\n------------ {} ({}) :".format(engine,output )) - print("REQUETES STATUS : {}".format(response.status_code)) - print("HEADERS : {}\n".format(response.headers)) - if response.status_code == 200: - print(response.text) - else: - print("ERREUR : nothing found !") +for language in languages: + + if language == "en": + engines=["postagger", "stemmer", "npchunker", "npchunkerdp", "termatcher", "ner"] + doc="""[ + {"id":"PhnlUo_d6LoJPLN3YUjh5qBLc","value":"Non-local effects by homogenization or 3D–1D dimension reduction in elastic materials reinforced by stiff fibers.We first consider an elastic thin heterogeneous cylinder of radius of order ε: the interior of the cylinder is occupied by a stiff material (fiber) that is surrounded by a soft material (matrix). By assuming that the elasticity tensor of the fiber does not scale with ε and that of the matrix scales with ε2, we prove that the one dimensional model is a nonlocal system.We then consider a reference configuration domain filled out by periodically distributed rods similar to those described above. We prove that the homogenized model is a second order nonlocal problem.In particular, we show that the homogenization problem is directly connected to the 3D–1D dimensional reduction problem."}, + ]""" + else: + engines=["postagger", "stemmer"] + doc="""[ + {"id":"xBKeVishRTsAqsdsqJn5YWo0HpuD","value":"Le déplacement chimique des carbones en phase gazeuse et en fonction de la concentration dans dix-neuf solvants dans le but de séparer les différents termes de constante dus aux interactions"}, + ]""" + + for engine in engines: + for output in outputs: + url ="{}/v1/{}/{}/analyze".format(uri, language, engine) + query['output'] = output + response = requests.post(url , params = query, data = doc.encode('utf-8'), stream=True, headers=headers) + + print("\n------------ {} ({}) :".format(engine,output )) + print("REQUETES STATUS : {}".format(response.status_code)) + print("HEADERS : {}\n".format(response.headers)) + if response.status_code == 200: + print(response.text) + else: + print("ERREUR : nothing found !")