diff --git a/nlp-tools/README.md b/nlp-tools/README.md index 8ad27f5..d74a24c 100644 --- a/nlp-tools/README.md +++ b/nlp-tools/README.md @@ -7,7 +7,7 @@ Liste des traitements NLP disponibles : -| Composant |français | anglais | name | +| Engine |français | anglais | name | |---|---|---|---| |Stemming| X | X | stemmer | |Etiquettage en partie du discours | X | X | POStagger | diff --git a/nlp-tools/test_EZ/run_test_NLPtools_EZ.py b/nlp-tools/test_EZ/run_test_NLPtools_EZ.py index 75f31e6..ae750ba 100755 --- a/nlp-tools/test_EZ/run_test_NLPtools_EZ.py +++ b/nlp-tools/test_EZ/run_test_NLPtools_EZ.py @@ -1,78 +1,78 @@ -#!/usr/bin/env python3 -# -# Batterie de test les webservices nlptools -# -# -*- coding: utf-8 -*- -# usage : -# python3 run_test_NLPtools_EZ.py -# -""" -@author: stephane schneider -""" -import requests - -outputs=['doc', 'json'] -languages=['en','fr'] - -https_proxy="http://proxyout.inist.fr:8080/" -http_proxy="http://proxyout.inist.fr:8080/" - -proxyDict = { - "http" : http_proxy, - "https" : https_proxy, - } - -# dev -# uri="http://nlptools-02.tdmservices.intra.inist.fr" -# prod -uri_prod="https://nlp-tools-2.services.inist.fr" -uri_dev="http://nlptools-02.tdmservices.intra.inist.fr" -uri_prod_sp="http://vptdmservices.intra.inist.fr:35268" -#changer la valeur de uri pour pointer vers la dev ou la prod -uri=uri_dev - -# parameter -headers = {'content-type': 'application/octet-stream'} -query= {"indent": "true"} - -doc_en="""[ - {"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."} - ]""" -doc_en1="""[ - {"id": "paDxcIPh8aDRAi18YAhjivtuE", - "value": "Dynamics of fully coupled rotators with unimodal and bimodal frequencies distribution."} - ]""" -doc_fr="""[ - {"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"} - ]""" -# 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) -#{stemmer,termMatcher,ner,NPchunker,POStagger,gazetteer,NPchunkerDP,lefff_tagger} - -for language in languages: - - if language == "en": - engines=["postagger", "stemmer", "npchunker", "npchunkerdp", "termmatcher", "ner"] - doc=doc_en1 - else: - engines=["postagger", "stemmer"] - doc=doc_fr - - 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) #proxies=proxyDict - - print("\n------------ {} ({} - {}) :".format(engine,output,language )) - print(url) - print("REQUEST STATUS : {}".format(response.status_code)) - print("HEADERS : {}\n".format(response.headers)) - if response.status_code == 200: - print(response.text) - else: - print("ERROR : nothing found !") - +#!/usr/bin/env python3 +# +# Batterie de test les webservices nlptools +# +# -*- coding: utf-8 -*- +# usage : +# python3 run_test_NLPtools_EZ.py +# +""" +@author: stephane schneider +""" +import requests + +outputs=['doc', 'json'] +languages=['en','fr'] + +https_proxy="http://proxyout.inist.fr:8080/" +http_proxy="http://proxyout.inist.fr:8080/" + +proxyDict = { + "http" : http_proxy, + "https" : https_proxy, + } + +# dev +# uri="http://nlptools-02.tdmservices.intra.inist.fr" +# prod +uri_prod="https://nlp-tools-2.services.inist.fr" +uri_dev="http://nlptools-02.tdmservices.intra.inist.fr" +uri_prod_sp="http://vptdmservices.intra.inist.fr:35268" +#changer la valeur de uri pour pointer vers la dev ou la prod +uri=uri_dev + +# parameter +headers = {'content-type': 'application/octet-stream'} +query= {"indent": "true"} + +doc_en="""[ + {"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."} + ]""" +doc_en1="""[ + {"id": "paDxcIPh8aDRAi18YAhjivtuE", + "value": "Dynamics of fully coupled rotators with unimodal and bimodal frequencies distribution."} + ]""" +doc_fr="""[ + {"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"} + ]""" +# 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) +#{stemmer,termMatcher,ner,NPchunker,POStagger,gazetteer,NPchunkerDP,lefff_tagger} + +for language in languages: + + if language == "en": + engines=["postagger", "stemmer", "npchunker", "npchunkerdp", "termmatcher", "ner"] + doc=doc_en1 + else: + engines=["postagger", "stemmer"] + doc=doc_fr + + 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) #proxies=proxyDict + + print("\n------------ {} ({} - {}) :".format(engine,output,language )) + print(url) + print("REQUEST STATUS : {}".format(response.status_code)) + print("HEADERS : {}\n".format(response.headers)) + if response.status_code == 200: + print(response.text) + else: + print("ERROR : nothing found !") + diff --git a/nlp-tools/v1/en/ner/analyze.ini b/nlp-tools/v1/en/ner/analyze.ini index 9501bb7..15dbfc9 100644 --- a/nlp-tools/v1/en/ner/analyze.ini +++ b/nlp-tools/v1/en/ner/analyze.ini @@ -14,7 +14,7 @@ post.parameters.1.description = Indent or not the JSON Result [use] -plugin = @ezs/local +plugin = @ezs/spawn plugin = @ezs/basics plugin = @ezs/storage plugin = @ezs/analytics diff --git a/nlp-tools/v1/en/npchunker/analyze.ini b/nlp-tools/v1/en/npchunker/analyze.ini index 68213fe..add2c34 100644 --- a/nlp-tools/v1/en/npchunker/analyze.ini +++ b/nlp-tools/v1/en/npchunker/analyze.ini @@ -14,7 +14,7 @@ post.parameters.1.description = Indent or not the JSON Result [use] -plugin = @ezs/local +plugin = @ezs/spawn plugin = @ezs/basics plugin = @ezs/storage plugin = @ezs/analytics diff --git a/nlp-tools/v1/en/npchunkerdp/analyze.ini b/nlp-tools/v1/en/npchunkerdp/analyze.ini index 8456cb8..616d0e1 100644 --- a/nlp-tools/v1/en/npchunkerdp/analyze.ini +++ b/nlp-tools/v1/en/npchunkerdp/analyze.ini @@ -14,7 +14,7 @@ post.parameters.1.description = Indent or not the JSON Result [use] -plugin = @ezs/local +plugin = @ezs/spawn plugin = @ezs/basics plugin = @ezs/storage plugin = @ezs/analytics diff --git a/nlp-tools/v1/en/postagger/analyze.ini b/nlp-tools/v1/en/postagger/analyze.ini index 8506271..04b626f 100644 --- a/nlp-tools/v1/en/postagger/analyze.ini +++ b/nlp-tools/v1/en/postagger/analyze.ini @@ -14,7 +14,7 @@ post.parameters.1.description = Indent or not the JSON Result [use] -plugin = @ezs/local +plugin = @ezs/spawn plugin = @ezs/basics plugin = @ezs/storage plugin = @ezs/analytics diff --git a/nlp-tools/v1/en/stemmer/analyze.ini b/nlp-tools/v1/en/stemmer/analyze.ini index c426baf..f3ce537 100644 --- a/nlp-tools/v1/en/stemmer/analyze.ini +++ b/nlp-tools/v1/en/stemmer/analyze.ini @@ -14,7 +14,7 @@ post.parameters.1.description = Indent or not the JSON Result [use] -plugin = @ezs/local +plugin = @ezs/spawn plugin = @ezs/basics plugin = @ezs/storage plugin = @ezs/analytics diff --git a/nlp-tools/v1/en/termmatcher/analyze.ini b/nlp-tools/v1/en/termmatcher/analyze.ini index 7d4a5d8..07799d6 100644 --- a/nlp-tools/v1/en/termmatcher/analyze.ini +++ b/nlp-tools/v1/en/termmatcher/analyze.ini @@ -14,7 +14,7 @@ post.parameters.1.description = Indent or not the JSON Result [use] -plugin = @ezs/local +plugin = @ezs/spawn plugin = @ezs/basics plugin = @ezs/storage plugin = @ezs/analytics diff --git a/nlp-tools/v1/fr/postagger/analyze.ini b/nlp-tools/v1/fr/postagger/analyze.ini index 5f27a83..688b25b 100644 --- a/nlp-tools/v1/fr/postagger/analyze.ini +++ b/nlp-tools/v1/fr/postagger/analyze.ini @@ -14,7 +14,7 @@ post.parameters.1.description = Indent or not the JSON Result [use] -plugin = @ezs/local +plugin = @ezs/spawn plugin = @ezs/basics plugin = @ezs/storage plugin = @ezs/analytics diff --git a/nlp-tools/v1/fr/stemmer/analyze.ini b/nlp-tools/v1/fr/stemmer/analyze.ini index 8ceade5..68adf24 100644 --- a/nlp-tools/v1/fr/stemmer/analyze.ini +++ b/nlp-tools/v1/fr/stemmer/analyze.ini @@ -14,7 +14,7 @@ post.parameters.1.description = Indent or not the JSON Result [use] -plugin = @ezs/local +plugin = @ezs/spawn plugin = @ezs/basics plugin = @ezs/storage plugin = @ezs/analytics