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.
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.
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:
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.