The Python Xrenner JSON-NLP package
Project description
Xrenner to JSON-NLP
(C) 2019 by Damir Cavar, Oren Baldinger, Maanvitha Gongalla, Anurag Kumar, Murali Kammili, Boli Fang
Brought to you by the NLP-Lab.org!
Introduction
Xrenner wrapper for JSON-NLP. Xrenner specializes in coreference and anaphora resolution, in a more highly annotated manner than just a coreference chain.
CoreNLP
Xrenner requires a Dependency Parse from CoreNLP.
The XrennerPipeline
class will take care of the details, however it requires an available CoreNLP server.
The easiest way to create one is with Docker:
docker pull nlpbox/corenlp
docker run -p 9000:9000 -ti nlpbox/corenlp
To test this, open a new tab,
wget -q --post-data "Although they didn't like it, they accepted the offer." 'localhost:9000/?properties={"annotators":"depparse","outputFormat":"conll"}' -O /dev/stdout
You then need to create a .env
file in the root of the project, follow the example in sample_env
.
The default entry that corresponds to the Docker command above is:
CORENLP_SERVER=http://localhost:9000
Microservice
The JSON-NLP repository provides a Microservice class, with a pre-built implementation of Flask. To run it, execute:
python xrennerjsonnlp/server.py
Since server.py
extends the Flask app, a WSGI file would contain:
from xrennerjsonnlp.server import app as application
Text is provided to the microservice with the text
parameter, via either GET
or POST
. If you pass url
as a parameter, the microservice will scrape that url and process the text of the website.
Here is an example GET
call:
http://localhost:5000?text=John went to the store. He bought some milk.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for xrennerjsonnlp-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 280556d29ed6946f3e325455f5459cdeb46a504212641b194f18e8e26b5aabb6 |
|
MD5 | ad531000adfb1c46256719fa416b61ad |
|
BLAKE2b-256 | b902ead9161292f9d54e089cd09897f68a803f6347e76dd8b99bdd4e218a8418 |