CoolFace
Modelpublic

vibhorag101/roberta-base-suicide-prediction-phr-v2

sourceHugging Facemitupdated 3y agoView on Hugging Face
1likes127downloads
Model Card

<!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. -->

vibhorag101/roberta-base-suicide-prediction-phr-v2

This model is a fine-tuned version of roberta-base on Suicide Prediction Dataset, sourced from Reddit. It achieves the following results on the evaluation set:

  • —Loss: 0.0553
  • —Accuracy: 0.9869
  • —Recall: 0.9846
  • —Precision: 0.9904
  • —F1: 0.9875

Model description

This model is a finetune of roberta-base to detect suicidal tendencies in a given text.

Training and evaluation data

  • —The dataset is sourced from Reddit and is available on Kaggle.
  • —The dataset contains text with binary labels for suicide or non-suicide.
  • —The dataset was cleaned minimally, as BERT depends on contextually sensitive information, which can worsely effect its performance.
  • —Removed numbers
  • —Removed URLs, Emojis, and accented characters.
  • —Remove any extra white spaces and any extra spaces after a single space.
  • —Removed any consecutive characters repeated more than 3 times.
  • —The rows with more than 512 BERT Tokens were removed, as they exceeded BERT's max token.
  • —The cleaned dataset can be found here
  • —The evaluation set had ~33k samples, while the training set had ~153k samples, i.e., a 70:15:15 (train:test:val) split.

Training procedure

  • —The model was trained on an RTXA5000 GPU.

Training hyperparameters

The following hyperparameters were used during training:

  • —learning_rate: 2e-05
  • —trainbatchsize: 16
  • —evalbatchsize: 32
  • —seed: 42
  • —optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • —lrschedulertype: linear
  • —weight_decay=0.1
  • —warmup_ratio: 0.06
  • —num_epochs: 3
  • —eval_steps: 500
  • —save_steps: 500
  • —Early Stopping:
  • —earlystoppingpatience: 5
  • —earlystoppingthreshold: 0.001
  • —parameter: F1 Score

Training results

Training LossEpochStepValidation LossAccuracyRecallPrecisionF1
0.19280.055000.22890.93400.90620.96600.9352
0.08330.110000.11200.97520.96370.98880.9761
0.03660.1615000.11650.97530.96130.99150.9762
0.0710.2120000.09730.97090.95020.99400.9716
0.04650.2625000.06800.98290.99790.97030.9839
0.03870.3130000.15830.97050.94900.99450.9712
0.10610.3735000.06850.98480.98020.99070.9854
0.05930.4240000.05500.98720.99470.98130.9879
0.03820.4745000.05510.98710.99120.98420.9877
0.08310.5250000.05020.98400.97680.99270.9847
0.03760.5855000.06540.98650.98520.98890.9871
0.06340.6360000.04220.98770.98970.98700.9883
0.02350.6865000.05530.98690.98460.99040.9875

Framework versions

  • —Transformers 4.38.2
  • —Pytorch 2.1.0+cu121
  • —Datasets 2.18.0
  • —Tokenizers 0.15.0