visolex/bartpho-hsd-span
053
1---2license: apache-2.03base_model: bartpho4tags:5- vietnamese6- hate-speech7- span-detection8- token-classification9- nlp10datasets:11- visolex/ViHOS12model-index:13- name: bartpho-hsd-span14 results:15 - task:16 type: token-classification17 name: Hate Speech Span Detection18 dataset:19 name: visolex/ViHOS20 type: visolex/ViHOS21 metrics:22 - type: f123 value: 0.336124 - type: precision25 value: 0.552126 - type: recall27 value: 0.509528 - type: exact_match29 value: 0.022630---31 32# bartpho-hsd-span: Hate Speech Span Detection (Vietnamese)33 34This model is a fine-tuned version of [bartpho](https://huggingface.co/bartpho) for Vietnamese **Hate Speech Span Detection**.35 36## Model Details37 38- Base Model: `bartpho`39- Description: Vietnamese Hate Speech Span Detection40- Framework: HuggingFace Transformers41- Task: Hate Speech Span Detection (token/char-level spans)42 43### Hyperparameters44 45- Max sequence length: `64`46- Learning rate: `5e-6`47- Batch size: `32`48- Epochs: `100`49- Early stopping patience: `5`50 51## Results52 53- F1: `0.3361`54- Precision: `0.5521`55- Recall: `0.5095`56- Exact Match: `0.0226`57 58## Usage59 60```python61from transformers import AutoTokenizer, AutoModelForTokenClassification62import torch63 64model_name = "visolex/bartpho-hsd-span"65tok = AutoTokenizer.from_pretrained(model_name)66model = AutoModelForTokenClassification.from_pretrained(model_name)67text = "Ví dụ câu tiếng Việt có nội dung thù ghét ..."68enc = tok(text, return_tensors="pt", truncation=True, max_length=256, is_split_into_words=False)69with torch.no_grad():70 logits = model(**enc).logits71 pred_ids = logits.argmax(-1)[0].tolist()72# TODO: chuyển pred_ids -> spans theo scheme nhãn của bạn (BIO/BILOU/char-offset)73```74 75## License76 77Apache-2.078 79## Acknowledgments80 81- Base model: [bartpho](https://huggingface.co/bartpho)82 