Skip to main content

A Custom Jupyter Widget Library for selecting text and assigning tag to selected span

Project description

text_selector

A Custom Jupyter Widget for selecting part of text and assingning it one of tags.

Use the widget with the active learning tool:
https://github.com/IINemo/active_learning_toolbox/tree/seq

Usage:

An example of use case can be found in example.ipynb
Note: if you have less than 10 tags you don't need to pass colors, otherwise you have too.

The result is represented via widgets public field res. It can be in 1 of 3 states:

  1. Empty: nobody selected anything in widget
  2. Containing string of None: text doesn't contain any squences and user checked this widget as "Done"
  3. Containing dicts with selected sequences

Installation

To install this extension simply run folowing comands:

$ pip install text_selector
$ jupyter nbextension enable --py --sys-prefix text_selector

To install for jupyterlab

$ jupyter labextension install text_selector

For a development installation (requires npm) run in terminal:

$ git clone https://github.com/randomunrandom/text_selector.git
$ cd text_selector
$ pip install -e .
$ jupyter nbextension install --py --symlink --sys-prefix text_selector
$ jupyter nbextension enable --py --sys-prefix text_selector
$ jupyter labextension install js

Docker

To create and start docker container run:

$ git clone https://github.com/randomunrandom/text_selector.git
$ cd text_selector
$ docker build -t text_selector .
$ docker run -p 8888:8888 -it --rm --name text_selector text_selector

if port 8888 is occupied change ${port} to any available port

$ docker run -p ${port}:8888 -it --rm --name text_selector text_selector

Cite

@inproceedings{shelmanov2019bibm,
    title={Active Learning with Deep Pre-trained Models for Sequence Tagging of Clinical and Biomedical Texts},
    author={Artem Shelmanov and Vadim Liventsev and Danil Kireev and Nikita Khromov and Alexander Panchenko and Irina Fedulova and Dmitry V. Dylov},
    booktitle={Proceedings of International Conference on Bioinformatics & Biomedicine (BIBM)},
    year={2019}
}


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

text_selector-2.3.0.tar.gz (185.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

text_selector-2.3.0-py2.py3-none-any.whl (367.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file text_selector-2.3.0.tar.gz.

File metadata

  • Download URL: text_selector-2.3.0.tar.gz
  • Upload date:
  • Size: 185.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0.post20200127 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for text_selector-2.3.0.tar.gz
Algorithm Hash digest
SHA256 b2edfb26e92d176ab36abf6c919a4a49bb702c832ce4b1a2eeb15390d52af92e
MD5 eb913a2b196db83311e13fba5e043ef3
BLAKE2b-256 2ed5766348dc635699902333720bee478cbc93ef91e558a8b9b1325d83962151

See more details on using hashes here.

File details

Details for the file text_selector-2.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: text_selector-2.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 367.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0.post20200127 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for text_selector-2.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 30342b43e3518e69af8479c74e37d6c02c7f8fdc0b85e897924735259efcdd8c
MD5 7d9d4399dda694d62814613726055a73
BLAKE2b-256 24383a3a75fb7e38f92ffb828d56205e1b3f9b0784b3d2646ee48a648f0cbdba

See more details on using hashes here.

Supported by

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