Skip to main content


Project description



supportr is a package used to predict the value of support of texts.

It is based on a fine tuned BERT model.


Use pip

If pip is installed, supportr could be installed directly from it:

pip install supportr



Usage and Example

Notes: During your first usage, the package will download a model file automatically, which is about 400MB.


predict is the core method of this package, which takes a single text of a list of texts, and returns a list of raw values in [1,5] (higher means more support, while lower means less).

Simplest usage

You may directly import supportr and use the default predict method, e.g.:

>>> import supportr
>>> supportr.predict(["I am totally agree with you"])

Construct from class

Alternatively, you may also construct the object from class, where you could customize the model path and device:

>>> from supportr import Supportr
>>> sr = Supportr()

# Predict a single text
>>> sr.predict(["I am totally agree with you"])

# Predict a list of texts
>>> preds = sr.predict(['I am totally agree with you','I hate you'])
>>> f"Raw values are {preds}"
[3.836493  1.7458204]

More detail on how to construct the object is available in docstrings.

Model using multiprocessing when preprocessing a large dataset into BERT input features

If you want to use several cpu cores via multiprocessing while preprocessing a large dataset, you may construct the object via

>>> pr = Supportr(CPU_COUNT=cpu_cpunt, CHUNKSIZE=chunksize)

If you want to faster the code through multi gpus, you may construct the object via

>>> pr = Supportr(is_paralleled=True, BATCH_SIZE = batch_size)


Junjie Wu (

Project details

Download files

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

Files for supportr, version 1.2
Filename, size File type Python version Upload date Hashes
Filename, size supportr-1.2-py3-none-any.whl (7.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size supportr-1.2.tar.gz (6.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page