Instructions to use joshswift/phobihsd-proposed with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use joshswift/phobihsd-proposed with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="joshswift/phobihsd-proposed")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("joshswift/phobihsd-proposed", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| library_name: transformers | |
| license: apache-2.0 | |
| tags: | |
| - vietnamese | |
| - hate-speech-detection | |
| - phobert | |
| - bilstm | |
| - text-classification | |
| pipeline_tag: text-classification | |
| # joshswift/phobihsd-proposed | |
| PhoBiHSD proposed checkpoint (PhoBERT-BiLSTM) for Vietnamese hate speech detection on ViHSD. | |
| ## Files | |
| - `phobihsd_proposed.pt`: PyTorch checkpoint (`state_dict` + optional thresholds). | |
| - `phobihsd_proposed.meta.json`: model metadata. | |
| - `model_comparison.yaml`: training/inference config used by this repository. | |
| ## Label Mapping | |
| - `0`: Clean | |
| - `1`: Offensive | |
| - `2`: Hate | |
| ## Metadata (from checkpoint sidecar) | |
| ```json | |
| { | |
| "model_name": "vinai/phobert-base-v2", | |
| "head_type": "cls_mlp", | |
| "hidden_dim": 256, | |
| "dropout": 0.5, | |
| "freeze_encoder": false, | |
| "max_len": 100, | |
| "thresholds": [ | |
| 0.4, | |
| 0.4, | |
| 0.6 | |
| ], | |
| "seed": 4 | |
| } | |
| ``` | |
| ## Inference (from this repo) | |
| ```bash | |
| export PHOBIHSD_PROPOSED_CKPT=phobihsd_proposed.pt | |
| export PHOBIHSD_CONFIG=config/experiments/model_comparison.yaml | |
| python -m app.gradio_app | |
| ``` | |