XSWEM
A simple and explainable deep learning model for NLP implemented in TensorFlow.
Based on SWEM-max as proposed by Shen et al. in Baseline Needs More Love: On Simple Word-Embedding-Based Models and Associated Pooling Mechanisms, 2018.
This package is currently in development. The purpose of this package is to make it easy to train and explain SWEM-max.
You can find demos of the functionality we have implemented in the notebooks directory of the package. Each notebook has a badge that allows you to run it yourself in Google Colab. We will add more notebooks as new functionality is added.
For a demo of how to train a basic SWEM-max model see train_xswem.ipynb.
Local Explanations
We are currently implementing some methods we have developed for local explanations.
local_explain_most_salient_words
So far we have only implemented the local_explain_most_salient_words method. This method extracts the words the model has learnt as most salient from a given input sentence. Below we show an example of this method using a sample from the ag_news dataset. This method is explained in more detail in the local_explain_most_salient_words.ipynb notebook.
Global Explanations
We have implemented the global explainability method proposed in section 4.1.1 of the original paper. You can see a demo of this method in the notebook global_explain_embedding_components.ipynb.
How to install
This package is hosted on PyPI and can be installed using pip.
pip install xswem
Metadata
Release files for xswem 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xswem-1.0.0.tar.gz | 8.6 kB | Without provenance | Details for xswem-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xswem-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for xswem-1.0.0-py3-none-any.whl |
Total release size: 17.5 kB
Release files / xswem-1.0.0.tar.gz
| Download URL | xswem-1.0.0.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a0c585f3f0bc2a9757e3e89b3e196b60c23832e8166359a309760a34d2228514
|
|
BLAKE2b-256 checksum How to use checksums |
d58369f3eab8a6030a18d55a89f2bbf24fb463a02baafaa0feb883e55b05b839
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
|
Release files / xswem-1.0.0-py3-none-any.whl
| Download URL | xswem-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a49700b44876d982829ccc852f81798b10da0cbae0373c99af8105dbf48428e4
|
|
BLAKE2b-256 checksum How to use checksums |
ceedcdac130e8c47dd6f18d63c7e827b67ca228f83baf66325da20c7302b2fd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
|
Security for xswem 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.