A simple, modular active learning library for text classification.
Project description
Active Learning for Text Classifcation in Python.
Installation | Quick Start | Docs
Small-Text provides state-of-the-art Active Learning for Text Classification. Several components are provided, which are abstracted via generic interfaces, so that you can easily mix and match many classifiers and query strategies to build active learning experiments or applications.
What is Active Learning? Active Learning allows you to efficiently label training data in a small-data scenario.
Features
- Provides unified interfaces for Active Learning so that you can easily mix and match query strategies with classifiers provided by sklearn, Pytorch, or transformers.
- Supports GPU-based Pytorch models and integrates transformers so that you can use state-of-the-art Text Classification models for Active Learning.
- GPU is optional: In case of a CPU-only use case, a lightweight installation only requires a minimal set of dependencies.
- Multiple scientifically evaluated components are pre-implemented and ready to use (Query Strategies, Initialization Strategies, and Stopping Criteria).
News
-
March Beta Release (v1.0.0b3) - March 06, 2022
- Consolidated interfaces: Renamed and unified some arguments before v1.0.0.
- New query strategy: ContrastiveActiveLearning.
-
🎉 Beta Release (v1.0.0b1) - February 22, 2022
- New features: multi-label classification and stopping criteria are now supported.
- Added/revised large parts of the documentation.
Installation
Small-text can be easily installed via pip:
pip install small-text
For a full installation include the transformers extra requirement:
pip install small-text[transformers]
Requires Python 3.7 or newer. For using the GPU, CUDA 10.1 or newer is required. More information regarding the installation can be found in the documentation.
Quick Start
For a quick start, see the provided examples for binary classification, pytorch multi-class classification, and transformer-based multi-class classification, or check out the notebooks.
Notebooks
# | Notebook | |
---|---|---|
1 | Intro: Active Learning for Text Classification with Small-Text | |
2 | Using Stopping Criteria for Active Learning |
Documentation
Read the latest documentation (currently work in progress) here.
Alternatives
Contribution
Contributions are welcome. Details can be found in CONTRIBUTING.md.
Acknowledgments
This software was created by Christopher Schröder (@chschroeder) at Leipzig University's NLP group which is a part of the Webis research network. The encompassing project was funded by the Development Bank of Saxony (SAB) under project number 100335729.
Citation
A preprint which introduces small-text is available here:
Small-text: Active Learning for Text Classification in Python.
@misc{schroeder2021smalltext,
title={Small-Text: Active Learning for Text Classification in Python},
author={Christopher Schröder and Lydia Müller and Andreas Niekler and Martin Potthast},
year={2021},
eprint={2107.10314},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
License
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
Built Distribution
Hashes for small_text-1.0.0b3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58b98e37f8f88afbb99d754ce7a1401c262860570ed1d49b29a6a8888f979d85 |
|
MD5 | 476b00744d230c6fa651af33fada0d87 |
|
BLAKE2b-256 | 12251d946e10570ecac9f54b142bfe4c23c8152e071d3a809851a362048e8c83 |