Skip to content

Commit 44804ce

Browse files
committed
Initial release!
0 parents  commit 44804ce

File tree

79 files changed

+153332
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+153332
-0
lines changed

.gitignore

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# Custom
2+
test/
3+
4+
5+
# Byte-compiled / optimized / DLL files
6+
__pycache__/
7+
*.py[cod]
8+
*$py.class
9+
10+
# C extensions
11+
*.so
12+
13+
# Distribution / packaging
14+
.Python
15+
build/
16+
develop-eggs/
17+
dist/
18+
downloads/
19+
eggs/
20+
.eggs/
21+
lib/
22+
lib64/
23+
parts/
24+
sdist/
25+
var/
26+
wheels/
27+
pip-wheel-metadata/
28+
share/python-wheels/
29+
*.egg-info/
30+
.installed.cfg
31+
*.egg
32+
MANIFEST
33+
34+
# PyInstaller
35+
# Usually these files are written by a python script from a template
36+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
37+
*.manifest
38+
*.spec
39+
40+
# Installer logs
41+
pip-log.txt
42+
pip-delete-this-directory.txt
43+
44+
# Unit test / coverage reports
45+
htmlcov/
46+
.tox/
47+
.nox/
48+
.coverage
49+
.coverage.*
50+
.cache
51+
nosetests.xml
52+
coverage.xml
53+
*.cover
54+
*.py,cover
55+
.hypothesis/
56+
.pytest_cache/
57+
58+
# Translations
59+
*.mo
60+
*.pot
61+
62+
# Django stuff:
63+
*.log
64+
local_settings.py
65+
db.sqlite3
66+
db.sqlite3-journal
67+
68+
# Flask stuff:
69+
instance/
70+
.webassets-cache
71+
72+
# Scrapy stuff:
73+
.scrapy
74+
75+
# Sphinx documentation
76+
docs/_build/
77+
78+
# PyBuilder
79+
target/
80+
81+
# Jupyter Notebook
82+
.ipynb_checkpoints
83+
84+
# IPython
85+
profile_default/
86+
ipython_config.py
87+
88+
# pyenv
89+
.python-version
90+
91+
# pipenv
92+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
94+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
95+
# install all needed dependencies.
96+
#Pipfile.lock
97+
98+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
99+
__pypackages__/
100+
101+
# Celery stuff
102+
celerybeat-schedule
103+
celerybeat.pid
104+
105+
# SageMath parsed files
106+
*.sage.py
107+
108+
# Environments
109+
.env
110+
.venv
111+
env/
112+
venv/
113+
ENV/
114+
env.bak/
115+
venv.bak/
116+
117+
# Spyder project settings
118+
.spyderproject
119+
.spyproject
120+
121+
# Rope project settings
122+
.ropeproject
123+
124+
# mkdocs documentation
125+
/site
126+
127+
# mypy
128+
.mypy_cache/
129+
.dmypy.json
130+
dmypy.json
131+
132+
# Pyre type checker
133+
.pyre/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Adam Coscia
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
# iScore
2+
3+
[![license](https://img.shields.io/badge/License-MIT-A54046)](https://github.com/AdamCoscia/iScore/blob/main/LICENSE)
4+
[![arxiv badge](https://img.shields.io/badge/arXiv-2403.04760-red)](https://arxiv.org/abs/2403.04760)
5+
[![DOI:10.1145/3640543.3645142](https://img.shields.io/badge/DOI-10.1145/3640543.3645142-blue)](https://doi.org/10.1145/3640543.3645142)
6+
7+
Upload, score, and visually compare multiple LLM-graded summaries simultaneously!
8+
9+
✍️📜🧑‍🏫📖💯
10+
11+
![The iScore System](https://github.com/AdamCoscia/iScore/blob/main/images/iscore.png)
12+
13+
## What is iScore?
14+
15+
The popularity of large language models (LLMs) has inspired LLM developers to incorporate them into adaptive educational tools that can **automatically score a summary written on a larger body of text** in a variety of educational settings such as classrooms and textbooks.
16+
Interactively exploring how LLMs score different summaries can help developers understand the decisions on which the LLMs base their scores, discover unintended biases, update the LLMs to address the biases and mitigate the potential pedagogical ramifications of prematurely deploying untested LLM-powered educational technologies.
17+
18+
iScore is an interactive visual analytics tool for developers to upload, score, and compare multiple summaries of a source text simultaneously.
19+
iScore introduces a new workflow for comparing the language features that contribute to different LLM scores:
20+
21+
1. First, users **upload, score and can manually revise and re-score** multiple source/summary pairs simultaneously.
22+
2. Then, users can **visually track how scores change** across revisions in the context of expert-scored LLM training data.
23+
3. Finally, users can **compare model weights** between words across model layers, as well as differences in scores between automatically revised **summary perturbations**.
24+
25+
Together, the views provide LLM developers with access to multiple summary comparison visualizations and several well-known LLM interpretability methods including attention attribution, input perturbation, and adversarial examples.
26+
Combining these visualizations and methods in a single visual interface broadly enables deeper analysis of LLM behavior that was previously **time-consuming** and **difficult to perform**.
27+
28+
This code accompanies the research paper:
29+
30+
**[iScore: Visual Analytics for Interpreting How Language Models Automatically Score Summaries][paper]**
31+
<span style="opacity: 70%">Adam Coscia, Langdon Holmes, Wesley Morris, Joon Suh Choi, Scott Crossley, Alex Endert</span>
32+
_ACM Conference on Intelligent User Interfaces (IUI), 2024_
33+
| [📖 Paper][paper] | [▶️ Live Demo][demo] | [🎞️ Demo Video][video] | [🧑‍💻 Code][code] |
34+
35+
## Features
36+
37+
<details>
38+
<summary> 🔍 Track how scores change across revisions, in the context of expert-scored training data:</summary>
39+
<img src="https://github.com/AdamCoscia/iScore/blob/main/images/scores-dashboard.png" width="60%">
40+
</details>
41+
42+
<details>
43+
<summary> ✏️ Compare differences in scores between automatically revised summary perturbations:</summary>
44+
<img src="https://github.com/AdamCoscia/iScore/blob/main/images/input-perturbation.png" width="60%">
45+
</details>
46+
47+
<details>
48+
<summary> 📊 Analyze model weights between tokens across model layers:</summary>
49+
<img src="https://github.com/AdamCoscia/iScore/blob/main/images/token-attention.png" width="60%">
50+
</details>
51+
52+
### Demo Video
53+
54+
🎞️ Watch the demo video for a full tutorial here: <https://youtu.be/EYJX-_fQPf0>
55+
56+
## Live Demo
57+
58+
🚀 For a live demo, visit: <https://adamcoscia.com/papers/iscore/demo/>
59+
60+
## Getting Started
61+
62+
🌱 You can test our visualizations on your own LLMs in just a few easy steps!
63+
64+
- Install Python `v3.9.x` ([latest release](https://www.python.org/downloads/release/python-3913/))
65+
- Clone this repo to your computer ([instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository))
66+
67+
```bash
68+
git clone [email protected]:AdamCoscia/iScore.git
69+
70+
# use --depth if you don't want to download the whole commit history
71+
git clone --depth 1 [email protected]:AdamCoscia/iScore.git
72+
```
73+
74+
### Interface
75+
76+
- A frontend vanilla HTML/CSS/JavaScript web app with D3.js and Tabulator!
77+
- Additional details can be found in [interface/README.md](interface/README.md)
78+
79+
Navigate to the interface folder:
80+
81+
```bash
82+
cd interface
83+
```
84+
85+
- If you are running Windows:
86+
87+
```bash
88+
py -3.9 -m http.server
89+
```
90+
91+
- If you are running MacOS / Linux:
92+
93+
```bash
94+
python3.9 -m http.server
95+
```
96+
97+
Navigate to [localhost:8000](http://localhost:8000/). You should see iScore running in your browser :)
98+
99+
### Server
100+
101+
- A backend Python 3.9 Flask web app to run local LLM models downloaded from Hugging Face!
102+
- Additional details can be found in [server/README.md](server/README.md)
103+
104+
Navigate to the server folder:
105+
106+
```bash
107+
cd server
108+
```
109+
110+
Create a virtual environment:
111+
112+
- If you are running Windows:
113+
114+
```bash
115+
# Start a virtual environment
116+
py -3.9 -m venv venv
117+
118+
# Activate the virtual environment
119+
.\venv\Scripts\activate
120+
```
121+
122+
- If you are running MacOS / Linux:
123+
124+
```bash
125+
# Start a virtual environment
126+
python3.9 -m venv venv
127+
128+
# Activate the virtual environment
129+
source venv/bin/activate
130+
```
131+
132+
Install dependencies:
133+
134+
```bash
135+
python -m pip install -r requirements.txt
136+
```
137+
138+
Install symspellpy `v6.7.7` ([instructions](https://symspellpy.readthedocs.io/en/latest/users/installing.html))
139+
140+
> symspellpy is a Python port of SymSpell `v6.7.1`
141+
> **Warning for MacOS users** - symspellpy has only been tested on Windows and Linux systems and is assumed to work on macOS!
142+
143+
Install PyTorch `v2.0.x` ([instructions](https://pytorch.org/get-started/locally/))
144+
145+
> PyTorch is installed separately because some systems may support CUDA, which requires a different installation process and can significantly speed up the tool.
146+
147+
1. First, check if your GPU can support CUDA ([link](https://developer.nvidia.com/cuda-gpus))
148+
2. Then, follow the instructions linked above to determine if your system can support CUDA for computation.
149+
150+
Then run the server:
151+
152+
```bash
153+
python main.py
154+
```
155+
156+
## Credits
157+
158+
Led by <a href='https://adamcoscia.com/' target='_blank'>Adam Coscia</a>, iScore is a result of a collaboration between visualization experts in human centered computing and interaction design as well as learning engineers with expertise in natural language processing (NLP) and developing learning tools from
159+
<img src="https://adamcoscia.com/assets/icons/other/gt-logo.png" alt="Interlocking GT" height="21" style="vertical-align: bottom;"/>
160+
Georgia Tech,
161+
<img src="https://adamcoscia.com/assets/icons/other/vanderbilt-logo.svg" alt="Interlocking GT" height="21" style="vertical-align: bottom;"/>
162+
Vanderbilt, and
163+
<img src="https://adamcoscia.com/assets/icons/other/gsu-logo.jpg" alt="Interlocking GT" height="21" style="vertical-align: bottom;"/>
164+
Georgia State.
165+
166+
iScore is created by
167+
<a href='https://adamcoscia.com/' target='_blank'>Adam Coscia</a>,
168+
Langdon Holmes,
169+
Wesley Morris,
170+
Joon Suh Choi,
171+
Scott Crossley,
172+
and
173+
Alex Endert.
174+
175+
## Citation
176+
177+
To learn more about iScore, please read our [research paper][paper] (published at [IUI '24](https://iui.acm.org/2024/)).
178+
179+
```bibtex
180+
@inproceedings{Coscia:2024:iScore,
181+
author = {Coscia, Adam and Holmes, Langdon and Morris, Wesley and Choi, Joon S. and Crossley, Scott and Endert, Alex},
182+
title = {iScore: Visual Analytics for Interpreting How Language Models Automatically Score Summaries},
183+
year = {2024},
184+
isbn = {979-8-4007-0508-3/24/03},
185+
publisher = {Association for Computing Machinery},
186+
address = {New York, NY, USA},
187+
url = {https://doi.org/10.1145/3640543.3645142},
188+
doi = {10.1145/3640543.3645142},
189+
booktitle = {Proceedings of the 2024 IUI Conference on Intelligent User Interfaces},
190+
location = {Greenville, SC, USA},
191+
series = {IUI '24}
192+
}
193+
```
194+
195+
## License
196+
197+
The software is available under the [MIT License](https://github.com/AdamCoscia/iScore/blob/main/LICENSE).
198+
199+
## Contact
200+
201+
If you have any questions, feel free to [open an issue](https://github.com/AdamCoscia/iScore/issues) or contact [Adam Coscia](https://adamcoscia.com).
202+
203+
[paper]: https://arxiv.org/abs/2403.04760
204+
[demo]: https://adamcoscia.com/papers/iscore/demo/
205+
[video]: https://youtu.be/EYJX-_fQPf0
206+
[code]: https://github.com/AdamCoscia/iScore

images/input-perturbation.png

815 KB
Loading

images/iscore.png

793 KB
Loading

images/scores-dashboard.png

921 KB
Loading

images/token-attention.png

628 KB
Loading

0 commit comments

Comments
 (0)