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