language: en
license: mit
library_name: transformers
base_model: marcmaxmeister/bert-base-uncased-ntee-classifier-v9
tags:
- text-classification
- nonprofit
- ntee
- cause-area
- multilabel-classification
- bert
datasets:
- givingtuesday/ntee-training-data
metrics:
- f1
model-index:
- name: marcmaxmeister/bert-base-uncased-ntee-classifier-v9
results:
- task:
   type: text-classification
   name: Multi-Label Text Classification

# NTEE Cause Area Classifier

This model classifies nonprofit organization mission statements and activity 
descriptions into one or more NTEE (National Taxonomy of Exempt Entities) major 
category codes. It was developed by GivingTuesday for the Gates Foundation 
nonprofit sector mapping project.

## Model Details

- **Base model:** `marcmaxmeister/bert-base-uncased-ntee-classifier-v9`
- **Version:** `9`
- **Problem type:** Multi-label classification
- **Number of labels:** 28
- **Input:** Nonprofit mission statement + activity description (concatenated)
- **Output:** Primary, secondary, and optional tertiary NTEE major code

## Label Space

The model predicts across 28 NTEE major codes, including two custom splits:

| Code | Category |
| --- | --- |
| BO | Education & Youth Development | 

| E | Health Clinics & Services | | X | Religion | | S | Community Improvement | | Z | Unknown | | J | Employment | | A | Arts & Culture | | K | Food & Agriculture | | R | Civil Rights & Advocacy | | D | Animal-Related | | V | Social Science | | G | Voluntary Health Associations | | T | Philanthropy & Foundations | | PK | Community Services โ€” Crisis & Vulnerable Populations | | L | Housing & Shelter | | C | Environment | | EE | Hospitals | | PG | Community Services โ€” General & Multi-Service | | BB | Universities & Colleges | | U | Science & Technology | | N | Recreation & Sports | | PC | Community Services โ€” Children & Families | | F | Mental Health | | H | Medical Research | | Q | International Affairs | | IM | Crime, Legal & Public Safety | | Y | Mutual & Membership Benefit |

## Training Data

- **Training rows:** 28584
- **Validation rows:** 15840
- **Source:** Combination of real IRS Form 990/990-EZ filings and 
synthetically generated examples produced using Claude (Anthropic)
- **Label encoding:** Multi-hot binary vectors of length 28, derived from 
NTEE primary, secondary, and tertiary codes per organization

## Training Configuration

- **Epochs:** 4
- **Learning rate:** 1e-05
- **Batch size (train):** 32
- **Weight decay:** 0.01
- **Mixed precision:** fp16
- **Framework:** Hugging Face Transformers + PyTorch

## Evaluation Results
Epoch Eval F1 EvalLoss EvalRuntime
1 0.4127 1.6562 52.4802
2 0.5056 1.4611 52.3406
3 0.5262 1.4053 52.4735
4 0.5367 1.3865 52.4096
## Final results
[{'train_runtime': 1359.0428, 'train_samples_per_second': 84.13, 'train_steps_per_second': 1.316, 'total_flos': 1.4574254183940096e+16, 'train_loss': 1.6346719515670332, 'epoch': 4.0, 'step': 1788}]

## Usage

```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from sklearn.preprocessing import MultiLabelBinarizer
import torch

model_id = "givingtuesday/ntee-cause-area-classifier"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)

def predict_ntee(mission, activities, threshold=0.4, max_labels=3):
    text = f"{mission} {activities}"
    inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
    with torch.no_grad():
        logits = model(**inputs).logits
    probs = torch.sigmoid(logits[0]).cpu().numpy()
    ranked = sorted(zip(model.config.id2label.values(), probs), key=lambda x: -x[1])
    selected = [(label, float(p)) for label, p in ranked if p >= threshold][:max_labels]
    if not selected:
        selected = [ranked[0]]
    return {
        "primary":   selected[0] if len(selected) > 0 else None,
        "secondary": selected[1] if len(selected) > 1 else None,
        "tertiary":  selected[2] if len(selected) > 2 else None,
    }
```

## Intended Use

- Classifying IRS Form 990 and 990-EZ filers by mission area
- Nonprofit sector research and analysis
- Philanthropic portfolio mapping

## Limitations

- Trained primarily on English-language mission statements
- Performance is lower on categories with fewer training examples 
(e.g. Mutual Benefit, Social Science, Unknown/Unclassified)
- The BB/EE custom splits (universities vs. general education; hospitals 
vs. general health) are the hardest boundaries for the model to learn
- Not suitable for classifying organizations outside the U.S. nonprofit sector

## Citation

```bibtex
@misc{givingtuesday2025ntee,
author    = {GivingTuesday},
title     = {NTEE Cause Area Classifier for IRS 990 Data},
year      = {2026},
publisher = {GivingTuesday, HuggingFace},
url       = {https://huggingface.co/marcmaxmeister/bert-base-uncased-ntee-classifier-v6}
}
```
Downloads last month
54
Safetensors
Model size
0.1B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support