模型:

migueladarlo/distilbert-depression-base

英文

distilbert-depression-base

此模型是在CLPsych 2015上进行微调的版本,评估了从Twitter上获取的数据集,以检测潜在的抑郁症用户。它在评估集上实现以下结果:

  • 评估损失:0.64
  • 准确率:0.65
  • F1分数:0.70
  • 精确度:0.61
  • 召回率:0.83
  • AUC:0.65

使用目的和限制

将推文语料库输入该模型,生成指示用户是否抑郁的标签。标签1表示抑郁,标签0表示非抑郁。

限制:所有长度超过512的标记序列将自动截断。此外,训练和测试数据可能混有错误标记的用户。

使用方法

您可以直接使用该模型进行情感分析管道:

>>> from transformers import DistilBertTokenizerFast, AutoTokenizer
>>> tokenizer = AutoTokenizer.from_pretrained('distilbert-base-uncased')
>>> from transformers import DistilBertForSequenceClassification
>>> model = DistilBertForSequenceClassification.from_pretrained(r"distilbert-depression-base")
>>> from transformers import pipeline
>>> classifier = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
>>> tokenizer_kwargs = {'padding':True,'truncation':True,'max_length':512}
>>> result=classifier('pain peko',**tokenizer_kwargs) #For truncation to apply in the pipeline. 
>>> #Should note that the string passed as the input can be a corpus of tweets concatenated together into one document.

[{'label': 'LABEL_1', 'score': 0.5048992037773132}]

否则,下载文件并在管道中指定包含config.json、pytorch_model.bin和training_args.bin的文件夹的路径

训练超参数

训练过程中使用了以下超参数:

  • 学习率:3.39e-05
  • 训练批次大小:16
  • 评估批次大小:16
  • 权重衰减:0.13
  • 迭代次数:3.0

训练结果

Epoch Training Loss Validation Loss Accuracy F1 Precision Recall AUC
1.0 0.68 0.66 0.59 0.63 0.56 0.73 0.59
2.0 0.60 0.68 0.63 0.69 0.59 0.83 0.63
3.0 0.52 0.67 0.64 0.66 0.62 0.72 0.65