Update README.md
Browse files
README.md
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
# π§ BERT Classifier for Black Article Detection
|
2 |
|
3 |
## π Model Overview
|
4 |
-
This repository hosts a fine-tuned BERT model (`bert-base-uncased`) for classifying newspaper articles based on
|
5 |
|
6 |
## π Description
|
7 |
-
|
|
|
8 |
- **Inputs:** `sentence` *(string)*
|
9 |
- **Outputs:** `black_story` *(0 or 1)*
|
10 |
|
@@ -15,13 +16,39 @@ The model was trained on 2,000 manually labeled sentences from historical newspa
|
|
15 |
- **Recall:** 92.1%
|
16 |
|
17 |
## π Usage Instructions
|
18 |
-
To use this model via Hugging Face Transformers:
|
19 |
```python
|
20 |
from transformers import pipeline
|
21 |
classifier = pipeline("text-classification", model="mikemcrae/black-article-classifier")
|
22 |
result = classifier("Black activists led a peaceful protest downtown.")
|
23 |
print(result)
|
|
|
24 |
|
|
|
|
|
|
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
MIT License Β© 2025 Mike McRae
|
27 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# π§ BERT Classifier for Black Article Detection
|
2 |
|
3 |
## π Model Overview
|
4 |
+
This repository hosts a fine-tuned BERT model (`bert-base-uncased`) for classifying newspaper articles based on their focus on Black people. The training dataset is also provided for reproducibility.
|
5 |
|
6 |
## π Description
|
7 |
+
- **Model:** Fine-tuned `bert-base-uncased`
|
8 |
+
- **Training Data:** 2,000 manually labeled sentences from historical newspaper articles (1960β1973)
|
9 |
- **Inputs:** `sentence` *(string)*
|
10 |
- **Outputs:** `black_story` *(0 or 1)*
|
11 |
|
|
|
16 |
- **Recall:** 92.1%
|
17 |
|
18 |
## π Usage Instructions
|
|
|
19 |
```python
|
20 |
from transformers import pipeline
|
21 |
classifier = pipeline("text-classification", model="mikemcrae/black-article-classifier")
|
22 |
result = classifier("Black activists led a peaceful protest downtown.")
|
23 |
print(result)
|
24 |
+
```
|
25 |
|
26 |
+
## πΎ Training Dataset
|
27 |
+
- Hugging Face Dataset: [mikemcrae/black-article-training-data](https://huggingface.co/datasets/mikemcrae/black-article-training-data)
|
28 |
+
- CSV Columns: `sentence`, `black_story`
|
29 |
|
30 |
+
## βοΈ Reproduction Instructions
|
31 |
+
```python
|
32 |
+
from datasets import load_dataset
|
33 |
+
from transformers import BertForSequenceClassification, Trainer, TrainingArguments
|
34 |
+
|
35 |
+
dataset = load_dataset("mikemcrae/black-article-training-data")
|
36 |
+
model = BertForSequenceClassification.from_pretrained("bert-base-uncased", num_labels=2)
|
37 |
+
```
|
38 |
+
|
39 |
+
## π License
|
40 |
+
**MIT License**: Free to use with attribution.
|
41 |
+
```
|
42 |
MIT License Β© 2025 Mike McRae
|
43 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
|
44 |
+
```
|
45 |
+
|
46 |
+
## β€οΈ Citation
|
47 |
+
```
|
48 |
+
@inproceedings{mcrae2025blackbert,
|
49 |
+
title={BERT Classifier for Black Article Detection},
|
50 |
+
author={Mike McRae},
|
51 |
+
year={2025},
|
52 |
+
url={https://huggingface.co/mikemcrae/black-article-classifier}
|
53 |
+
}
|
54 |
+
```
|