davanstrien / dhd-demo

huggingface.co
Total runs: 5
24-hour runs: 0
7-day runs: 0
30-day runs: -4
Model's Last Updated: May 05 2026
text-classification

Introduction of dhd-demo

Model Details of dhd-demo

dhd-demo: ModernBERT Jim Crow law classifier

Fine-tuned answerdotai/ModernBERT-base on biglam/on_the_books to classify North Carolina session-law sections (1866–1967) as Jim Crow laws or not.

Built as a live demo for the Digital Humanities & Discovery webinar (2026-05-05) showing end-to-end fine-tuning via hf jobs .

Labels
  • 0 = no_jim_crow
  • 1 = jim_crow
Training data

biglam/on_the_books — 1,785 expert-labeled chapter/section pairs from NC session laws, 512 positive / 1,273 negative. Split 90/10 (stratified) for train/eval. Class imbalance handled with inverse-frequency cross-entropy weights.

Training setup
Base model answerdotai/ModernBERT-base
Epochs 4
Batch size 16
Learning rate 5e-5
Warmup steps 50
Weight decay 0.01
Max sequence length 1024
Precision bf16
Loss weighted cross-entropy
Seed 42
Hardware 1× NVIDIA L4 (24 GB) via hf jobs
Train runtime 223 s
Evaluation (held-out 10% split, n=179)
Metric Value
Accuracy 0.9832
F1 (positive class) 0.9709
Precision 0.9615
Recall 0.9804
F1 (macro) 0.9796
ROC-AUC 0.9980
Per-epoch results
Epoch Train loss Val loss Accuracy F1 Precision Recall ROC-AUC
1 0.0856 0.1061 0.9553 0.9273 0.8644 1.0000 0.9960
2 0.0353 0.0538 0.9777 0.9615 0.9434 0.9804 0.9989
3 0.0015 0.1310 0.9777 0.9600 0.9796 0.9412 0.9980
4 0.0019 0.0949 0.9832 0.9709 0.9615 0.9804 0.9980
Usage
from transformers import pipeline

clf = pipeline("text-classification", model="davanstrien/dhd-demo")
clf("All schools for the white and colored races shall be kept separate.")
Limitations
  • Trained on North Carolina laws, 1866–1967. Will not transfer cleanly to other jurisdictions or modern legal language.
  • The training labels reflect what named expert sources / project staff flagged. The negative class is "not flagged," not "verified non-discriminatory."
  • OCR noise from period scans is present in training and will be present at inference time on similar corpora.
  • Eval set is small (n=179); treat the high metrics as encouraging but bounded by sample size.

See the dataset card for full context, including the Algorithms of Resistance framing of the original On the Books project at UNC Chapel Hill Libraries.

Citation

Please cite the original project:

On the Books: Jim Crow and Algorithms of Resistance. University of North Carolina at Chapel Hill Libraries. https://onthebooks.lib.unc.edu — DOI: https://doi.org/10.17615/5c4g-sd44

Framework versions
  • Transformers 5.7.0
  • PyTorch 2.11.0+cu130
  • Datasets 4.8.5
  • Tokenizers 0.22.2

Runs of davanstrien dhd-demo on huggingface.co

5
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
-4
30-day runs

More Information About dhd-demo huggingface.co Model

More dhd-demo license Visit here:

https://choosealicense.com/licenses/apache-2.0

dhd-demo huggingface.co

dhd-demo huggingface.co is an AI model on huggingface.co that provides dhd-demo's model effect (), which can be used instantly with this davanstrien dhd-demo model. huggingface.co supports a free trial of the dhd-demo model, and also provides paid use of the dhd-demo. Support call dhd-demo model through api, including Node.js, Python, http.

davanstrien dhd-demo online free

dhd-demo huggingface.co is an online trial and call api platform, which integrates dhd-demo's modeling effects, including api services, and provides a free online trial of dhd-demo, you can try dhd-demo online for free by clicking the link below.

davanstrien dhd-demo online free url in huggingface.co:

https://huggingface.co/davanstrien/dhd-demo

dhd-demo install

dhd-demo is an open source model from GitHub that offers a free installation service, and any user can find dhd-demo on GitHub to install. At the same time, huggingface.co provides the effect of dhd-demo install, users can directly use dhd-demo installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

dhd-demo install url in huggingface.co:

https://huggingface.co/davanstrien/dhd-demo

Url of dhd-demo

Provider of dhd-demo huggingface.co

davanstrien
ORGANIZATIONS

Other API from davanstrien

huggingface.co

Total runs: 13
Run Growth: 4
Growth Rate: 33.33%
Updated:September 24 2024
huggingface.co

Total runs: 12
Run Growth: 8
Growth Rate: 66.67%
Updated:April 11 2024
huggingface.co

Total runs: 9
Run Growth: -3
Growth Rate: -33.33%
Updated:September 07 2023