How mythilikalidhasan/llm-bias-demonstration works
This is a single-file Streamlit demonstration of how training-data balance affects gender-associated answers. The principal workflow presents examples, trains or balances the demonstration data, accepts a question, and displays an answer with a bias indicator and before/after comparison. The README documents TF-IDF and Logistic Regression; the sampled code excerpt does not show their implementation, so those stages are represented at the documented level. The app.py excerpt is partial, so the graph omits unverified internal calls.
Main entry points: app.py Streamlit app
Components 11
Interactive app
- Streamlit app
app.py - Training data view
app.py - Question input
app.py
Data and learning
- Training data
app.py - Data balancing
app.py - TF-IDF vectorizer
app.py - Logistic Regression
app.py
Responses and bias
- Response generation
app.py - Bias indicator
app.py - Results comparison
app.py
Other components
- User
Connections 16
- User → Streamlit app: uses
README.md - Streamlit app → Training data view: renders
app.py - Streamlit app → Question input: presents
app.py - Training data view → Training data: displays
README.md - Streamlit app → Training data: trains from
README.md - Streamlit app → Data balancing: balances
README.md - Data balancing → Training data: replaces
app.py - Training data → TF-IDF vectorizer: vectorizes
README.md - TF-IDF vectorizer → Logistic Regression: feeds
README.md - Streamlit app → Response generation: generates
README.md - Question input → Response generation: submits question
README.md - Logistic Regression → Response generation: informs
README.md - Response generation → Bias indicator: assesses
README.md - Streamlit app → Results comparison: presents
README.md - Training data → Results comparison: provides baseline
README.md - Data balancing → Results comparison: provides balanced case
README.md