CoolFace
Modelpublic

nexageapps/EthicsBERT

sourceHugging Faceapache-2.0updated 3mo agoView on Hugging Face
1likes10downloads
Model Card

EthicsBERT

EthicsBERT is a fine-tuned DistilBERT model for classifying AI ethics course content into nine topic areas. It is designed to support educators, researchers, and curriculum designers working in AI ethics.

Labels

IDLabelDescription
0AgencyHuman control, override rights, autonomy-preserving design, and delegated authority.
1AI GovernanceRegulation, accountability, audits, policy frameworks, and existential risk oversight.
2BiasSystematic errors, skewed training data, unfair representations, and proxy discrimination.
3ConsciousnessMachine sentience, subjective experience, philosophical debates, and moral patienthood.
4Ethical ReasoningMoral frameworks (utilitarian, deontological, virtue), dilemmas, and applied ethics.
5ExplainabilityInterpretability, SHAP/LIME, attention visualization, and model transparency.
6FairnessEquitable outcomes, anti-discrimination, group/individual fairness metrics.
7IntelligenceCognitive capabilities, reasoning, transfer learning, AGI, and benchmarks.
8PrivacyData protection, consent, PII handling, differential privacy, and encryption.

Model Details

PropertyValue
Base modeldistilbert-base-uncased
ArchitectureDistilBERT + classification head
TaskMulti-class text classification (9 classes)
Max sequence length128 tokens
Training epochs5 (with early stopping)
OptimizerAdamW
Learning rate2e-5
Weight decay0.01
Warmup ratio0.1

Usage

With the pipeline API (simplest)

python
from transformers import pipeline

classifier = pipeline(
    "text-classification",
    model="nexageapps/EthicsBERT",
    top_k=3,
)

result = classifier("The hiring algorithm must produce equal outcomes across demographic groups.")
# [{'label': 'Fairness', 'score': 0.92}, ...]
print(result)

Direct usage

python
import torch
import torch.nn.functional as F
from transformers import DistilBertForSequenceClassification, DistilBertTokenizerFast

model_id = "nexageapps/EthicsBERT"
tokenizer = DistilBertTokenizerFast.from_pretrained(model_id)
model = DistilBertForSequenceClassification.from_pretrained(model_id)
model.eval()

text = "SHAP values quantify each feature's contribution to a specific model prediction."
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)

with torch.no_grad():
    logits = model(**inputs).logits
    probs = F.softmax(logits, dim=-1)

id2label = model.config.id2label
predicted_label = id2label[int(probs.argmax())]
print(f"Predicted: {predicted_label} ({probs.max().item():.2%})")

Training Data

The model was fine-tuned on a curated dataset of approximately 200 sentences covering all nine AI ethics topic areas. Sentences were authored to reflect the vocabulary, framing, and conceptual depth typical of AI ethics course materials.

Label distribution: roughly balanced, ~20–25 examples per class.

Limitations

  • The training dataset is small (~200 examples). Performance may degrade on highly technical or domain-specific text not represented in training.
  • The model was trained on English only.
  • Boundary cases between semantically similar labels (e.g., Fairness vs Bias, or AI Governance vs Ethical Reasoning) may be misclassified.
  • The model should not be used as the sole arbiter in automated grading or gatekeeping systems.

Ethical Considerations

This model is intended for research and educational purposes. Automated topic classification of ethics content should always be reviewed by a human expert before consequential use.

Citation

If you use EthicsBERT in your research or course materials, please cite:

bibtex
@misc{ethicsbert2024,
  title   = {EthicsBERT: A DistilBERT Model for AI Ethics Topic Classification},
  author  = {nexageapps},
  year    = {2024},
  url     = {https://huggingface.co/nexageapps/EthicsBERT}
}

License

Apache 2.0 — see LICENSE for details.