Instructions to use quest-lab/oss-toxicity-roberta with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use quest-lab/oss-toxicity-roberta with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-classification', 'quest-lab/oss-toxicity-roberta');
|
Download README.md from quest-lab/oss-toxicity-roberta: direct link, hf CLI and curl.
- Browser
- Download file 1.11 kB
-
https://huggingface.co/quest-lab/oss-toxicity-roberta/resolve/main/README.md
- Command line
-
hf download hf://quest-lab/oss-toxicity-roberta/README.md
-
curl -L -o README.md https://huggingface.co/quest-lab/oss-toxicity-roberta/resolve/main/README.md
1.11 kB
| library_name: transformers.js | |
| pipeline_tag: text-classification | |
| tags: [toxicity, open-source-software, github, onnx] | |
| # Toxic-language classifier for GitHub discussion comments | |
| Fine-tuned RoBERTa-base that scores whether an issue or pull-request discussion comment contains toxic language | |
| (label 1 = `toxic`). Trained on manually annotated GitHub comments plus one active-learning round, from the study | |
| *Toxicity in Open Source: Does It Hit Gaming Projects Differently?*. This repository holds an 8-bit quantized ONNX | |
| export for in-browser use with transformers.js. | |
| **Input:** comment text cleaned as in the study (quoted text, code, and URLs removed; @-mentions and emails replaced | |
| with `<USER>`), truncated to 256 tokens. **Decision threshold:** 0.35. | |
| | Held-out test set (988 comments) | Precision | Recall | F1 | | |
| |---|---|---|---| | |
| | Original PyTorch model | 0.840 | 0.582 | 0.688 | | |
| | This quantized ONNX model (transformers.js) | 0.838 | 0.585 | 0.689 | | |
| Use it to raise awareness, not to make automatic moderation decisions: some toxic comments are missed and some | |
| non-toxic comments are flagged. | |