Bert Base Therapist Topic Classification Eng
模型简介
该模型专门用于分析心理治疗会话中治疗师的言论主题,能够将治疗师的陈述分类到37个不同的心理治疗相关主题类别中。
模型特点
专业心理治疗主题分类
专门针对心理治疗场景优化的37个主题分类能力
高精度分类
在测试集上达到0.74的宏观F1分数,部分类别F1超过0.85
广泛主题覆盖
覆盖从情感表达、人际关系到工作焦虑等多种心理治疗常见主题
模型能力
心理治疗对话分析
治疗师言论分类
多类别文本分类
情感主题识别
使用案例
心理健康分析
治疗会话主题分析
自动分析心理治疗会话记录,识别讨论的主要主题
帮助研究人员快速了解治疗焦点
治疗质量评估
通过主题分布分析治疗师的干预方式
评估治疗策略的有效性
人类沟通研究
对话模式分析
研究专业治疗对话中的沟通模式
理解有效治疗沟通的特征
🚀 基于Bert-base-uncased的心理治疗话题分类模型
这是一个基于Bert-base-uncased
微调的模型,用于对心理治疗场景中治疗师言论进行话题分类。该模型能够处理多分类任务,为心理治疗中的言论提供精准的话题标签。
🚀 快速开始
安装依赖
确保你已经安装了transformers
库,如果没有安装,可以使用以下命令进行安装:
pip install transformers
模型调用示例
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import numpy as np
tokenizer = AutoTokenizer.from_pretrained("AIPsy/bert-base-therapist-topic-classification-eng")
model = AutoModelForSequenceClassification.from_pretrained("AIPsy/bert-base-therapist-topic-classification-eng")
text = "You know, I mean, it seems like you could just go to work and feel so much better."
encoding = tokenizer(
text,
truncation=True,
padding="max_length",
return_tensors="pt"
)
output = model(encoding['input_ids'], encoding['attention_mask']).logits
result = np.argmax(output.detach().numpy(), axis=-1)
print(id2label[result[0]])
'Job Anxiety and Self-Reflection'
✨ 主要特性
- 多分类任务支持:该模型能够处理37个不同的话题分类,涵盖了心理治疗中常见的各种话题,如情感表达、人际关系、个人成长等。
- 基于预训练模型:基于
Bert-base-uncased
进行微调,充分利用了预训练模型的强大语义理解能力。
📦 安装指南
使用pip
安装transformers
库:
pip install transformers
💻 使用示例
基础用法
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import numpy as np
# 加载分词器和模型
tokenizer = AutoTokenizer.from_pretrained("AIPsy/bert-base-therapist-topic-classification-eng")
model = AutoModelForSequenceClassification.from_pretrained("AIPsy/bert-base-therapist-topic-classification-eng")
# 待分类的文本
text = "You know, I mean, it seems like you could just go to work and feel so much better."
# 对文本进行编码
encoding = tokenizer(
text,
truncation=True,
padding="max_length",
return_tensors="pt"
)
# 模型推理
output = model(encoding['input_ids'], encoding['attention_mask']).logits
# 获取分类结果
result = np.argmax(output.detach().numpy(), axis=-1)
# 打印分类结果
id2label = {0: 'Time Up and Future Meetings',
1: 'Complex Emotions Toward Him',
2: 'Desires and Disappointments',
3: 'Personal Growth and Decision-Making',
4: 'Self-Acceptance and Relationships',
5: 'Understanding and Confronting Fear',
6: 'See and Understanding Conversations',
7: 'Clarifying Meaning and Intent',
8: 'Desire to Escape and Leave',
9: 'Uncertainty and Understanding Issues',
10: 'Open Conversation and Sharing',
11: 'Exploring Emotional Hurt and Bitterness',
12: 'Guilt and Self-Blame Dynamics',
13: 'Dynamics of Meaningful Relationships',
14: 'Struggles and Desires in Learning',
15: 'Gender Roles and Relationships',
16: 'Struggles with Personal Change',
17: 'Complex Mother-Sibling Relationships',
18: 'Voices and Perception of Sound',
19: 'Difficulties and Emotional Burdens',
20: 'Fear and Reflection on Aging',
21: 'Emotions of Crying and Tears',
22: 'Father-Child Relationships and Authority',
23: 'Possibilities and Potential Outcomes',
24: 'Inner Struggle and Helplessness',
25: 'Pursuing Meaningful Personal Goals',
26: 'Job Anxiety and Self-Reflection',
27: 'Marriage Anxiety and Dependence',
28: 'Expressions of Anger and Frustration',
29: 'Nurturing the inner child',
30: 'Therapy and Father Relationships',
31: 'Expressions of Happiness and Joy',
32: 'Revisiting the Past Together',
33: 'Drinking Habits and Concerns',
34: 'Managing and Increasing Energy Levels',
35: 'Understanding Depression and Its Roots',
36: 'Nervous System and Stress Response'}
print(id2label[result[0]])
📚 详细文档
数据集
本模型的训练数据来源于YouTube上公开的心理治疗会话录音。经过说话人分割和转录后,共获得了15324个句子。
推荐使用场景
鉴于心理治疗会话中讨论问题的广泛背景,作者认为该模型可用于一般的人类交流分析。
评估指标
训练模型的得分指标
样本集 | F1宏平均 |
---|---|
测试集 | 0.74 |
验证集 | 0.77 |
训练集 | 0.97 |
测试样本在各个类别上的F1得分指标
ID | 话题 | 精确率 | 召回率 | F1值 |
---|---|---|---|---|
0 | Time Up and Future Meetings | 0.81 | 0.80 | 0.80 |
1 | Complex Emotions Toward Him | 0.86 | 0.88 | 0.87 |
2 | Desires and Disappointments | 0.71 | 0.73 | 0.72 |
3 | Personal Growth and Decision-Making | 0.64 | 0.77 | 0.70 |
4 | Self-Acceptance and Relationships | 0.69 | 0.82 | 0.75 |
5 | Understanding and Confronting Fear | 0.93 | 0.76 | 0.84 |
6 | See and Understanding Conversations | 0.77 | 0.85 | 0.81 |
7 | Clarifying Meaning and Intent | 0.81 | 0.76 | 0.79 |
8 | Desire to Escape and Leave | 0.68 | 0.60 | 0.64 |
9 | Uncertainty and Understanding Issues | 0.81 | 0.81 | 0.81 |
10 | Open Conversation and Sharing | 0.79 | 0.77 | 0.78 |
11 | Exploring Emotional Hurt and Bitterness | 0.74 | 0.70 | 0.72 |
12 | Guilt and Self-Blame Dynamics | 0.80 | 0.69 | 0.74 |
13 | Dynamics of Meaningful Relationships | 0.75 | 0.75 | 0.75 |
14 | Struggles and Desires in Learning | 0.82 | 0.72 | 0.77 |
15 | Gender Roles and Relationships | 0.83 | 0.83 | 0.83 |
16 | Struggles with Personal Change | 0.76 | 0.60 | 0.67 |
17 | Complex Mother-Sibling Relationships | 0.60 | 0.74 | 0.67 |
18 | Voices and Perception of Sound | 0.74 | 0.78 | 0.76 |
19 | Difficulties and Emotional Burdens | 0.75 | 0.67 | 0.71 |
20 | Fear and Reflection on Aging | 0.62 | 0.64 | 0.63 |
21 | Emotions of Crying and Tears | 0.65 | 0.76 | 0.70 |
22 | Father-Child Relationships and Authority | 0.93 | 0.80 | 0.86 |
23 | Possibilities and Potential Outcomes | 0.72 | 0.64 | 0.68 |
24 | Inner Struggle and Helplessness | 0.68 | 0.71 | 0.69 |
25 | Pursuing Meaningful Personal Goals | 0.58 | 0.65 | 0.61 |
26 | Job Anxiety and Self-Reflection | 0.70 | 0.73 | 0.71 |
27 | Marriage Anxiety and Dependence | 0.82 | 0.82 | 0.82 |
28 | Expressions of Anger and Frustration | 0.73 | 0.76 | 0.75 |
29 | Nurturing the inner child | 0.74 | 0.70 | 0.72 |
30 | Therapy and Father Relationships | 0.80 | 0.82 | 0.81 |
31 | Expressions of Happiness and Joy | 0.78 | 0.79 | 0.78 |
32 | Revisiting the Past Together | 0.78 | 0.60 | 0.68 |
33 | Drinking Habits and Concerns | 0.69 | 0.79 | 0.73 |
34 | Managing and Increasing Energy Levels | 0.54 | 0.62 | 0.58 |
35 | Understanding Depression and Its Roots | 0.65 | 0.85 | 0.73 |
36 | Nervous System and Stress Response | 0.61 | 0.67 | 0.64 |
引用信息
- 论文:Vanin, A., Bolshev, V., & Panfilova, A. (2024). Applying LLM and Topic Modelling in Psychotherapeutic Contexts. ArXiv, abs/2412.17449. https://arxiv.org/abs/2412.17449
- 开发者:@myentity, @VadZhen, @Alek123
- 许可证:MIT
BibTeX:
@misc{vanin2024applyingllmtopicmodelling,
title={Applying LLM and Topic Modelling in Psychotherapeutic Contexts},
author={Alexander Vanin and Vadim Bolshev and Anastasia Panfilova},
year={2024},
eprint={2412.17449},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2412.17449},
}
📄 许可证
本项目采用MIT许可证。
Distilbert Base Uncased Finetuned Sst 2 English
Apache-2.0
基于DistilBERT-base-uncased在SST-2情感分析数据集上微调的文本分类模型,准确率91.3%
文本分类 英语
D
distilbert
5.2M
746
Xlm Roberta Base Language Detection
MIT
基于XLM-RoBERTa的多语言检测模型,支持20种语言的文本分类
文本分类
Transformers 支持多种语言

X
papluca
2.7M
333
Roberta Hate Speech Dynabench R4 Target
该模型通过动态生成数据集来改进在线仇恨检测,专注于从最差案例中学习以提高检测效果。
文本分类
Transformers 英语

R
facebook
2.0M
80
Bert Base Multilingual Uncased Sentiment
MIT
基于bert-base-multilingual-uncased微调的多语言情感分析模型,支持6种语言的商品评论情感分析
文本分类 支持多种语言
B
nlptown
1.8M
371
Emotion English Distilroberta Base
基于DistilRoBERTa-base微调的英文文本情感分类模型,可预测埃克曼六种基本情绪及中性类别。
文本分类
Transformers 英语

E
j-hartmann
1.1M
402
Robertuito Sentiment Analysis
基于RoBERTuito的西班牙语推文情感分析模型,支持POS(积极)/NEG(消极)/NEU(中性)三类情感分类
文本分类 西班牙语
R
pysentimiento
1.0M
88
Finbert Tone
FinBERT是一款基于金融通讯文本预训练的BERT模型,专注于金融自然语言处理领域。finbert-tone是其微调版本,用于金融情感分析任务。
文本分类
Transformers 英语

F
yiyanghkust
998.46k
178
Roberta Base Go Emotions
MIT
基于RoBERTa-base的多标签情感分类模型,在go_emotions数据集上训练,支持28种情感标签识别。
文本分类
Transformers 英语

R
SamLowe
848.12k
565
Xlm Emo T
XLM-EMO是一个基于XLM-T模型微调的多语言情感分析模型,支持19种语言,专门针对社交媒体文本的情感预测。
文本分类
Transformers 其他

X
MilaNLProc
692.30k
7
Deberta V3 Base Mnli Fever Anli
MIT
基于MultiNLI、Fever-NLI和ANLI数据集训练的DeBERTa-v3模型,擅长零样本分类和自然语言推理任务
文本分类
Transformers 英语

D
MoritzLaurer
613.93k
204
精选推荐AI模型
Llama 3 Typhoon V1.5x 8b Instruct
专为泰语设计的80亿参数指令模型,性能媲美GPT-3.5-turbo,优化了应用场景、检索增强生成、受限生成和推理任务
大型语言模型
Transformers 支持多种语言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一个基于SODA数据集训练的超小型对话模型,专为边缘设备推理设计,体积仅为Cosmo-3B模型的2%左右。
对话系统
Transformers 英语

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基于RoBERTa架构的中文抽取式问答模型,适用于从给定文本中提取答案的任务。
问答系统 中文
R
uer
2,694
98