https://github.com/dcavar/spacy-json-nlp

spaCy wrapper for JSON-NLP.

https://github.com/dcavar/spacy-json-nlp

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 5 committers (40.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.9%) to scientific vocabulary

Keywords

json natural-language-processing nlp spacy
Last synced: 4 months ago · JSON representation

Repository

spaCy wrapper for JSON-NLP.

Basic Info
Statistics
  • Stars: 12
  • Watchers: 4
  • Forks: 2
  • Open Issues: 0
  • Releases: 0
Topics
json natural-language-processing nlp spacy
Created almost 7 years ago · Last pushed over 6 years ago
Metadata Files
Readme License

README.md

spaCy to JSON-NLP

(C) 2019 by Damir Cavar, Oren Baldinger, Maanvitha Gongalla, Anurag Kumar, Murali Kammili

Brought to you by the NLP-Lab.org!

This only works with spaCy 2.1.0!

I had the same issue. I downgraded Spacy from 2.1.4 to 2.1.0 and numpy to 1.14.5 to resolve.

Introduction

Currently this module requires Python 3.6+.

This module provides a spaCy v2.1 wrapper for JSON-NLP. It takes the spaCy output and generates a JSON-NLP output. It also provides a Microservice wrapper that allows you to launch the spaCy module as a persistent RESTful service using Flask or other WSGI-based server.

Since this microservice is built on spaCy, you will need to have its models download, for example:

python -m spacy download en
python -m spacy download en_core_web_md

Additional Pipeline Modules

spaCy allows for the addition of additional models as pipeline modules. We provide such integrations for coreference and phrase structure trees.

Anaphora and Coreference Resolution

We provide HuggingFace coreference resolution, a fast system tightly integrated into spaCy. Note that the first time the parser is run, it will download the coreference models if they are not already present. These models only work for English.

Phrase Structure Trees (Constituency Parse)

We provide the CPU version of the benepar parser, a highly accurate phrase structure parser. Bear in mind it is a Tensorflow module, as such it has a notable start-up time, and relatively high memory requirements (4GB+).

If you have a GPU available, you can install the GPU version of the module with:

pip install --upgrade benepar[gpu] 

Microservice

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

python spacyjsonnlp/server.py

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

from spacyjsonnlp.server import app as application

To disable a pipeline component (such as phrase structure parsing), add

application.constituents = False

The full list of properties that can be disabled or enabled are - constituents - dependencies - coreference - expressions

The microservice exposes the following URIs: - /constituents - /dependencies - /coreference - /expressions - /token_list

These URIs are shortcuts to disable the other components of the parse. In all cases, tokenList will be included in the JSON-NLP output. An example url is:

http://localhost:5000/dependencies?text=I am a sentence

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.

The spaCy language model to use for parsing can be selected with the spacy_model parameter.

Here is an example GET call:

http://localhost:5000?spacy_model=en&constituents=0&text=I am a sentence.

Owner

  • Name: Damir Cavar
  • Login: dcavar
  • Kind: user
  • Location: Bloomington, IN
  • Company: Indiana University

GitHub Events

Total
Last Year

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 45
  • Total Committers: 5
  • Avg Commits per committer: 9.0
  • Development Distribution Score (DDS): 0.644
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Damir Cavar d****r@m****m 16
anurag_kumar a****5@g****m 15
Oren Baldinger o****g@i****u 12
blf11139 b****9@g****m 1
anuragkumar95 a****6@i****u 1
Committer Domains (Top 20 + Academic)
iu.edu: 2 me.com: 1

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 35 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 20
  • Total maintainers: 1
pypi.org: spacyjsonnlp

The Python spaCy JSON-NLP package

  • Versions: 20
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 35 Last month
Rankings
Dependent packages count: 10.1%
Stargazers count: 16.0%
Average: 18.1%
Forks count: 19.1%
Dependent repos count: 21.6%
Downloads: 23.6%
Maintainers (1)
Last synced: 5 months ago

Dependencies

requirements.txt pypi
  • spacy ==2.1.0
setup.py pypi
  • benepar *
  • neuralcoref >=4.0
  • pyjsonnlp >=0.2.12
  • spacy >=2.1