Skip to content

Gradiant/elg_nlpnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nlpnet Natural Language Processing with neural networks

nlpnet is a Python library for Natural Language Processing tasks based on neural networks. This repository contains a dockerized API built over nlpnet for integrate it into the ELG. This implementation performs part-of-speech tagging and semantic role labeling.

Its original code can be found here https://github.com/erickrf/nlpnet.

Install

sh docker-build.sh

Run

docker run --rm -p 0.0.0.0:8866:8866 --name nlpnet elg_nlpnet:1.0.3

Use

  • Tagger : two types:
    • Part of Speach (POS):
      curl -X POST  http://127.0.0.1:8866/tag_process/pos -H 'Content-Type: application/json' -d '{ "type":"text", "content":"O rato roeu a roupa do rei de Roma." }'
      
    • Semantic Role Labeling (SRL)
      curl -X POST  http://127.0.0.1:8866/tag_process/srl -H 'Content-Type: application/json' -d '{ "type":"text", "content":"O rato roeu a roupa do rei de Roma." }'
      

Test

In the folder test you have the files for testing the API according to the ELG specifications. It uses an API that acts as a proxy with your dockerized API that checks both the requests and the responses. For this follow the instructions:

  1. Launch the test: sudo docker-compose --env-file [env file] up . Env file are nlpnet_pos.envand nlpnet_srl.env.

  2. Make the requests, instead of to your API's endpoint, to the test's endpoint:

       curl -X POST  http://0.0.0.0:8866/processText/service -H 'Content-Type: application/json' -d '{ "type":"text", "content":"O rato roeu a roupa do rei de Roma."}'
    
  3. If your request and the API's response is compliance with the ELG API, you will receive the response.

    1. If the request is incorrect: Probably you will don't have a response and the test tool will not show any message in logs.
    2. If the response is incorrect: You will see in the logs that the request is proxied to your API, that it answers, but the test tool does not accept that response. You must analyze the logs.

Citation

The original work of this tool is:

  • https://github.com/erickrf/nlpnet
  • SRL Model: Fonseca, E. R. and Rosa, J.L.G. A Two-Step Convolutional Neural Network Approach for Semantic Role Labeling. Proceedings of the 2013 International Joint Conference on Neural Networks, 2013. p. 2955-2961
  • PoS Model: Fonseca, E. R. and Rosa, J.L.G. Mac-Morpho Revisited: Towards Robust Part-of-Speech Tagging. Proceedings of the 9th Brazilian Symposium in Information and Human Language Technology, 2013. p. 98-107
  • More info: http://nilc.icmc.usp.br/nlpnet/

The license of the original work is MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •