Jupiter Widget library for BRAT visualization and annotation functionality.
MIT License
$brat-widget is a Jupiter Widget library for BRAT visualization and text annotation. This is an extension of original BRAT, an intuitive web-based tool for text annotation supported by Natural Language Processing (NLP) technology.
BRAT has been developed for rich structured annotation for a variety of NLP tasks and aims to support manual curation efforts and increase annotator productivity using NLP techniques. $brat-widget is implemented using Jupyter Notebook technology with the intention of create and share documents that contain embedded code and execution results to help the annotators to gain skills on NLP and Corpus that they need. It has been implemented using a client-server architecture with communication over HTTP using JavaScript Object Notation (JSON). The server is a RESTful web service and the tool can easily be extended or adapted to switch out the server or client.
For development purposes, you need npm 3.10 and node.js 6.11 installed, and some python packages than can be see it in the following list of steps using virtualenv as package-enviroment manager.
Install $brat-widget by running:
virtualenv -p python3 env
source ./env/bin/activate
pip install ipywidgets
pip install jupyterlab
jupyter nbextension enable --py widgetsnbextension --sys-prefix
pip install twine
The easiest way to star playing with the widget is using the reinit.sh script that is
included in this project. Assuming that you have your virtualenv environment already activated
(the second step in the list above source ./env/bin/activate
), you have the following
options:
./reinit.sh -c
: clear all the npm installations made previously, prepare the./reinit.sh -s
: prepare the brad-widget python package (previously downloaded./reinit.sh -s -c
or ./reinit.sh -sc
: clear all the npm installations made previously,./reinit.sh -d -c
or ./reinit.sh -dc
: clear all the npm installations made previously,Once $brat-widget installed, a new browser window (or a new tab) is started showing the Notebook Dashboard. A sort of control panel that allows (among other things) to select which notebook to open.
Now, you can navigate through web interface tree and select Notebooks folder.
There in you can run the Test.ipynb
notebook.
Additional actions can be performed:
In order to generate a new package version and distribute it follow the next steps:
pip install twine
jupyter labextension uninstall brat-widget
jupyter nbextension uninstall --sys-prefix brat_widget
pip uninstall -y brat-widget
./dev-clean.sh
python setup.py build
cp -r ./js/brat_widget/static ./brat_widget/
python setup.py sdist
python setup.py bdist_wheel
pip install readme_renderer
twine check dist/*
twine upload dist/*
pushd js
git clean -fdx
npm install
npm pack
npm adduser
npm publish
popd
git tag -a 0.2.4 -m "comment"
git push
git push --tags
If you are having issues, please let us know. We have a mailing list located at: [email protected]
The project is licensed under the BSD license.