semvec/pypi-packages huggingface dataset:
xrennerjsonnlp 0.0.5
The Python Xrenner JSON-NLP package

# 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.

## Required Dependency Parse

Xrenner requires a [Dependency Parse](https://en.wikipedia.org/wiki/Dependency_grammar) in [CoNLL-U] format. 
This can come from [CoreNLP], or another parser that provides universal dependencies in [CoNNL-U] format.
There are two ways to accomplish this:

### CoreNLP Server

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

### Provide your own CoNLL-U

Use the `XrennerPipeline.process_conll` function, with your conll data passed as a string via
the `conll` argument.

You may find the `pyjsonnlp.conversion.to_conllu` function helpful for converting [JSON-NLP],
maybe from [spaCy], to [CoNLL-U].


## 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.

The `process_conll` endpoint mentioned above is available at the `/process_conll`
URI. Instead of passing `text`, pass `conll`. A POST operation will be easier than GET 
in this situation.



[Damir Cavar]: http://damir.cavar.me/ "Damir Cavar"
[Oren Baldinger]: https://oren.baldinger.me/ "Oren Baldinger"
[NLP-Lab.org]: http://nlp-lab.org/ "NLP-Lab.org"
[JSON-NLP]: https://github.com/dcavar/JSON-NLP "JSON-NLP"
[Flair]: https://github.com/zalandoresearch/flair "Flair"
[spaCy]: https://spacy.io/ "spaCy"
[NLTK]: http://nltk.org/ "Natural Language Processing Toolkit"
[Polyglot]: https://github.com/aboSamoor/polyglot "Polyglot"
[Xrenner]: https://github.com/amir-zeldes/xrenner "Xrenner"
[CONLL-U]: https://universaldependencies.org/format.html "CONLL-U"
[Docker]: https://www.docker.com/ "Docker"
[CoreNLP]: https://stanfordnlp.github.io/CoreNLP/ "Stanford CoreNLP"
[Flask]: http://flask.pocoo.org/ "Flask"
polyglotjsonnlp 0.2.6
The Python Polyglot JSON-NLP package

# Polyglot 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


[Polyglot] wrapper for [JSON-NLP].





[Damir Cavar]: http://damir.cavar.me/ "Damir Cavar"
[NLP-Lab.org]: http://nlp-lab.org/ "NLP-Lab.org"
[JSON-NLP]: https://github.com/dcavar/JSON-NLP "JSON-NLP"
[Flair]: https://github.com/zalandoresearch/flair "Flair"
[spaCy]: https://spacy.io/ "spaCy"
[NLTK]: http://nltk.org/ "Natural Language Processing Toolkit"
[Polyglot]: https://github.com/aboSamoor/polyglot "Polyglot" 
[Xrenner]: https://github.com/amir-zeldes/xrenner "Xrenner"
[CONLL-U]: https://universaldependencies.org/format.html "CONLL-U"
nltkjsonnlp 0.0.5
The Python NLTK JSON-NLP package

# NLTK-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

[NLTK] wrapper to [JSON-NLP]. [NLTK] has a wide variety of capabilities, but for our purposes
we are limiting it to [WordNet], [VerbNet], and [FrameNet]. Other packages such as [spaCy] and 
[Flair] are more accurately able to annotate things like part of speech tags and dependency 
parses. See below for instruction on how to unify outputs from multiple packages.

## Microservice

The [JSON-NLP] repository provides a Microservice class, with a pre-built implementation of [Flask]. To run it, execute:

    python nltkjsonnlp/server.py

Since `server.py` extends the [Flask] app, a WSGI file would contain:

    from nltkjsonnlp.server import app as application

## Pipeline

[JSON-NLP] provides a simple `Pipeline` interface that we implement as `NltkPipeline`:

    pipeline = nltkjsonnlp.NltkPipeline()
    print(pipeline.process(text='I am a sentence.'))

## Unification

To make the best use of this pipeline, it is best to unify it with a more accurate and complete
pipeline such as [spaCy-NLP-Json]:

    class UnifiedPipeline(pyjsonnlp.pipeline.Pipeline):
        def __init__(self):
            super(UnifiedPipeline, self).__init__()
            self.spacy = spacynlpjson.SpacyPipeline()
            self.nltk = nltkjsonnlp.NltkPipeline()

        def process(self, text='', coreferences=True, constituents=False, dependencies=True, expressions=True,
                    **kwargs) -> OrderedDict:
            # start with a spacy parse
            spacy_json = self.spacy.process(text, spacy_model='en_core_web_md', constituents=False,
                                            coreferences=coreferences, dependencies=dependencies, expressions=False)
            # the get an nltk parse
            nltk_json = self.nltk.process(text)

            # unify the parses
            return pyjsonnlp.unification.unifier.add_annotation_to_a_from_b(a=spacy_json, 
                                                                            b=nltk_json, annotation='tokens')



[Damir Cavar]: http://damir.cavar.me/ "Damir Cavar"
[Oren Baldinger]: https://oren.baldinger.me/ "Oren Baldinger"
[NLP-Lab.org]: http://nlp-lab.org/ "NLP-Lab.org"
[JSON-NLP]: https://github.com/dcavar/JSON-NLP "JSON-NLP"
[Flair]: https://github.com/zalandoresearch/flair "Flair"
[spaCy]: https://spacy.io/ "spaCy"
[NLTK]: http://nltk.org/ "Natural Language Processing Toolkit"
[Polyglot]: https://github.com/aboSamoor/polyglot "Polyglot" 
[Xrenner]: https://github.com/amir-zeldes/xrenner "Xrenner"
[CONLL-U]: https://universaldependencies.org/format.html "CONLL-U"
[spaCy-NLP-Json]: https://github.com/dcavar/spaCy-JSON-NLP "spaCy-JSON-NLP"
[WordNet]: https://wordnet.princeton.edu/ "Wordnet"
[FrameNet]: https://framenet.icsi.berkeley.edu/fndrupal/ "FrameNet"
[VerbNet]: https://verbs.colorado.edu/~mpalmer/projects/verbnet.html "VerbNet"