Skip to main content

ReaderBench library written in python

Project description

ReaderBench Python

Install

We recommend using virtual environments, as some packages require an exact version.
If you only want to use the package do the following:

  1. python3 -m venv rbenv (create virutal environment named rbenv)
  2. source rbenv/bin/activate (actiavte virtual env)
  3. pip3 uninstall setuptools && pip3 install setuptools && pip3 install --upgrade pip && pip3 install --no-cache-dir rbpy-rb

If you want to contribute to the code base of package:

  1. git clone git@git.readerbench.com:ReaderBench/readerbenchpy.git && cd readerbenchpy/
  2. python3 -m venv rbenv (create virutal environment named rbenv)
  3. source rbenv/bin/activate (actiavte virtual env)
  4. pip3 uninstall setuptools && pip3 install setuptools && pip3 install --upgrade pip
  5. pip3 install -r requirements.txt
  6. python3 -m spacy download xx_ent_wiki_sm

You may also need some spacy models which are downloaded through spacy.
You have to download these spacy models by yourself, using the command:
python3 -m spacy download name_of_the_model (do not install them with sudo if you are in a virtual environment) The logger will also write instructions on which models you need, and how to download them.

Be careful, you need to have spacy 2.1.3. If you change the version of spacy (you had a previous version) you need to reinstall xx_ent_wiki_sm model.

For neural coref errors install it as follows: https://github.com/huggingface/neuralcoref#spacystringsstringstore-size-changed-error

If you want to install spellchecking also you need this non-python lib: sudo apt-get install libhunspell-1.6-0 libhunspell-dev and then pip3 install hunspell If you want to use it for RO you need to provide the dictionary for the hunspell (in /usr/share/hunspell) You can download them from https://nextcloud.readerbench.com/index.php/s/yDsRYE4XJfPsYQo/download (put both files in /usr/share/hunspell)

Usage

For usage (parsing, lemmatization, NER, wordnet, content words, indices etc.) see file usage.py from https://git.readerbench.com/ReaderBench/readerbenchpy

Developer instructions

How to use the logger

In each file you have to initialize the logger:

from rb.utils.rblogger import Logger  
logger = Logger.get_logger() 
logger.info("info msg")
logger.warning("warning msg")  
logger.error()

How to push the wheel on pip

  1. rm -r dist/
  2. pip3 install twine wheel
  3. ./upload_to_pypi.sh

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rbpy-rb-0.6.6.tar.gz (1.4 MB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page