{"id":14970727,"url":"https://github.com/kieranlitschel/xswem","last_synced_at":"2026-01-18T22:02:32.721Z","repository":{"id":54622770,"uuid":"323610365","full_name":"KieranLitschel/XSWEM","owner":"KieranLitschel","description":"A simple and explainable deep learning model for NLP.","archived":false,"fork":false,"pushed_at":"2021-02-07T23:32:00.000Z","size":183,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T12:03:26.961Z","etag":null,"topics":["deep-learning","explainable","fast","global-explanation","glove","keras","local-explanation","machine-learning","model","nlp","simple","swem","tensorflow","word-embeddings"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KieranLitschel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-22T11:45:56.000Z","updated_at":"2021-02-07T20:45:39.000Z","dependencies_parsed_at":"2022-08-13T21:50:40.214Z","dependency_job_id":null,"html_url":"https://github.com/KieranLitschel/XSWEM","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KieranLitschel%2FXSWEM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KieranLitschel%2FXSWEM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KieranLitschel%2FXSWEM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KieranLitschel%2FXSWEM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KieranLitschel","download_url":"https://codeload.github.com/KieranLitschel/XSWEM/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247189413,"owners_count":20898689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","explainable","fast","global-explanation","glove","keras","local-explanation","machine-learning","model","nlp","simple","swem","tensorflow","word-embeddings"],"created_at":"2024-09-24T13:44:03.170Z","updated_at":"2026-01-18T22:02:32.677Z","avatar_url":"https://github.com/KieranLitschel.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# XSWEM\n\n[![Build Status](https://img.shields.io/travis/KieranLitschel/XSWEM/main.svg?label=main)](https://travis-ci.org/KieranLitschel/XSWEM) [![Build Status](https://img.shields.io/travis/KieranLitschel/XSWEM/develop.svg?label=develop)](https://travis-ci.org/KieranLitschel/XSWEM)\n\nA simple and explainable deep learning model for NLP implemented in TensorFlow.\n\nBased 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](https://arxiv.org/pdf/1805.09843.pdf).\n\nThis package is currently in development. The purpose of this package is to make it easy to train and explain SWEM-max. \n\nYou can find demos of the functionality we have implemented in the [notebooks](https://github.com/KieranLitschel/XSWEM/blob/main/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.\n\nFor a demo of how to train a basic SWEM-max model see [train_xswem.ipynb](https://github.com/KieranLitschel/XSWEM/blob/main/notebooks/train_xswem.ipynb).\n\n## Local Explanations\n\nWe are currently implementing some methods we have developed for local explanations.\n\n### local_explain_most_salient_words\n\nSo 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](https://huggingface.co/datasets/viewer/?dataset=ag_news) dataset. This method is explained in more detail in the [local_explain_most_salient_words.ipynb](https://github.com/KieranLitschel/XSWEM/blob/main/notebooks/local_explain_most_salient_words.ipynb) notebook.\n\n![local_explain_most_salient_words.png](https://github.com/KieranLitschel/XSWEM/blob/main/resources/images/local_explain_most_salient_words.png)\n\n## Global Explanations\n\nWe 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](https://github.com/KieranLitschel/XSWEM/blob/main/notebooks/global_explain_embedding_components.ipynb).\n\n## How to install\n\nThis package is hosted on [PyPI](https://pypi.org/project/xswem/) and can be installed using pip.\n\n```\npip install xswem\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkieranlitschel%2Fxswem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkieranlitschel%2Fxswem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkieranlitschel%2Fxswem/lists"}