{"id":21594077,"url":"https://github.com/ornl/tx2","last_synced_at":"2025-07-24T23:37:59.868Z","repository":{"id":56332453,"uuid":"317984984","full_name":"ORNL/tx2","owner":"ORNL","description":"Transformer eXplainability and eXploration","archived":false,"fork":false,"pushed_at":"2024-10-24T13:53:16.000Z","size":8751,"stargazers_count":19,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T05:40:33.880Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ORNL.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-02T20:36:44.000Z","updated_at":"2024-10-24T13:51:32.000Z","dependencies_parsed_at":"2024-10-23T23:52:04.895Z","dependency_job_id":null,"html_url":"https://github.com/ORNL/tx2","commit_stats":{"total_commits":100,"total_committers":3,"mean_commits":"33.333333333333336","dds":"0.16000000000000003","last_synced_commit":"4cd72d2f2f8c56cc3e46b83d809e76b64f0fa102"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORNL%2Ftx2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORNL%2Ftx2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORNL%2Ftx2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ORNL%2Ftx2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ORNL","download_url":"https://codeload.github.com/ORNL/tx2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317732,"owners_count":21083525,"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":[],"created_at":"2024-11-24T17:15:53.337Z","updated_at":"2025-04-10T23:40:42.123Z","avatar_url":"https://github.com/ORNL.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TX2\r\n\r\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\r\n[![PyPI version](https://badge.fury.io/py/tx2.svg)](https://badge.fury.io/py/tx2)\r\n[![JOSS status](https://joss.theoj.org/papers/b7c161917e5a31af052a597bf98f0e94/status.svg)](https://joss.theoj.org/papers/b7c161917e5a31af052a597bf98f0e94)\r\n[![tests](https://github.com/ORNL/tx2/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/ORNL/tx2/actions/workflows/tests.yml)\r\n\r\nWelcome to TX2! This library is intended to aid in the explorability and explainability of\r\ntransformer classification networks, or transformer language models with sequence classification\r\nheads. The basic function of this library is to take a trained transformer and\r\ntest/train dataset and produce an ipywidget dashboard as seen in the screenshot below,\r\nwhich can be displayed in a jupyter notebook or jupyter lab.\r\n\r\n![screenshot]( https://raw.githubusercontent.com/ORNL/tx2/master/sphinx/source/screenshot.png)\r\n\r\nNOTE: Currently this library's implementation is partially torch-dependent, and so will\r\nnot work with tensorflow/keras models - we hope to address this limitation in the future!\r\n\r\n## Installation\r\n\r\nYou can install this package from pypi:\r\n\r\n```bash\r\npip install tx2\r\n```\r\n\r\nNOTE: depending on the environment, it may be better to install some of the dependencies separately before\r\npip installing tx2, e.g. in conda:\r\n```bash\r\nconda install pytorch pandas scikit-learn=1.1 numpy=1.22 -c conda-forge\r\n```\r\n\r\n## Examples\r\n\r\nExample jupyter notebooks demonstrating and testing the usage of this library can be\r\nfound in the [examples\r\nfolder](https://github.com/ORNL/tx2/tree/master/examples).\r\n\r\nNote that these notebooks can take a while to run the first time, especially\r\nif a GPU is not in use.\r\n\r\nPackages you'll need to install for the notebooks to work (in addition to the\r\nconda installs above):\r\n\r\n```bash\r\npip install tqdm transformers==4.21 datasets==2.4\r\n```\r\n\r\nRunning through each full notebook will produce the ipywidget dashboard near the\r\nend.\r\n\r\nThe tests in this repository do not depend on transformers, so raw library\r\nfunctionality can be tested by running `pytest` in the project root.\r\n\r\n## Documentation\r\n\r\nThe documentation can be viewed at [https://ornl.github.io/tx2/](https://ornl.github.io/tx2/).\r\n\r\nThe documentation can also be built from scratch with sphinx as needed.\r\n\r\nInstall all required dependencies:\r\n```bash\r\npip install -r requirements.txt\r\n```\r\n\r\nBuild documentation:\r\n\r\n```bash\r\ncd docs\r\nmake html\r\n```\r\n\r\nThe `docs/build/html` folder will now contain an `index.html`\r\n\r\nTwo notebooks demonstrating the dashboard and how to use TX2 are included\r\nin the `examples` folder, highlighting the default and custom approaches\r\nas discussed in the Basic Usage page of the documentation.\r\n\r\n## Citation\r\n\r\nTo cite usage of TX2 in a publication, the DOI for this code is [https://doi.org/10.21105/joss.03652](https://doi.org/10.21105/joss.03652)\r\n\r\nbibtex:\r\n```bibtex\r\n@article{Martindale2021,\r\n  doi = {10.21105/joss.03652},\r\n  url = {https://doi.org/10.21105/joss.03652},\r\n  year = {2021},\r\n  publisher = {The Open Journal},\r\n  volume = {6},\r\n  number = {68},\r\n  pages = {3652},\r\n  author = {Nathan Martindale and Scott L. Stewart},\r\n  title = {TX$^2$: Transformer eXplainability and eXploration},\r\n  journal = {Journal of Open Source Software}\r\n}\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fornl%2Ftx2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fornl%2Ftx2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fornl%2Ftx2/lists"}