Run this model inference on single tenant GPU with unmatched speed and reliability at scale.
Run this model inference with full control and performance in your environment.
Get help setting up a custom Dedicated Endpoints.
Talk with our engineer to get a quote for reserved GPU instances with discounts.
README
License: mitModel Description
QLoRA adapter (LoRA fine-tune on 4-bit quantized base model) for multi-label intent classification of Russian therapist messages.
- Base model: Qwen/Qwen3-8B
- Adapter type: LoRA (via PEFT)
- Quantization: 4-bit NF4 (QLoRA) with double quantization, compute dtype bfloat16
- Task: Multi-label sequence classification
- Language: Russian
- Number of labels: 7
Usage
python
import torchfrom transformers import AutoTokenizer, AutoModelForSequenceClassification, BitsAndBytesConfigfrom peft import PeftModel, PeftConfigpath = 'AIPsy/qwen3-8b-therapist-intent-classification-ru-9'config = PeftConfig.from_pretrained(path)# tokenizertokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)tokenizer.pad_token = tokenizer.eos_token# qunatization configquantization_config = BitsAndBytesConfig(load_in_4bit = True,bnb_4bit_quant_type = 'nf4',bnb_4bit_use_double_quant = True,bnb_4bit_compute_dtype = torch.bfloat16)model_therapist = AutoModelForSequenceClassification.from_pretrained(config.base_model_name_or_path,device_map="cuda:0",quantization_config=quantization_config,num_labels=9,use_cache = True,)model_therapist = PeftModel.from_pretrained(model_therapist, path)model_therapist.config.pad_token_id = tokenizer.pad_token_idtext = '''Клиент: Я считаю, что эта обида переросла в ненависть. Знаешь, такую прям вот, как раньше, кровная какая-то ненависть. То есть у меня к человеку настолько сильная неприязнь, что я вообще не хочу ничего не знать о нём, не слышать. У меня прям даже уже не боль, а как бы презрение.Я уже ненавижу его. Вот такое осталось состояние.Терапевт: Хорошо, я тебя поняла. Вот так, давай сначала, знаешь как, определимся, вот у нас с тобой есть почти час, да, вот чего бы ты хотела от сегодняшней встречи? Какой бы вот итог, результат тебя бы удовлетворил? Скажи, пожалуйста.Клиент: По факту мне хочется завершиться с этим ощущением ненависти, потому что никакого, никакой пользы я этого не вижу для себя, да, никаких у нас с ним не может быть. Я всё хочу оставить и этот вопрос закрыть, потому что, как показывает жизненный опыт на сегодняшний день, все эти эмоции ещё негативно отражаются в настоящих моих отношениях.'''inputs = tokenizer(str(text), padding=True, truncation=True, return_tensors="pt")with torch.no_grad():outputs = model_therapist(**inputs.to(model_therapist.device))binary_tensor = (outputs.logits > 0).int()print(binary_tensor)#[1, 1, 1, 0, 0, 0, 1, 0, 0]list_categories = [catfor label, cat in zip(binary_tensor.squeeze(), therapist_categories_list)if label.item()]print(list_categories)#['Информирование', 'Запрос информации', 'Общая эмоциональная поддержка', 'Запрос на простраивание связей']
Dataset
The source material was the recordings of psychotherapeutic sessions posted on YouTube in the public domain. After conducting speaker diarization and transcription of the recordings 2,391 therapist utterances were annotated by six experts working in two teams of three. Annotation was performed using detailed guidelines comprising the intention taxonomy, definitions of each category, and illustrative examples.
Training Details
- Quantization: QLoRA (NF4, double quant, bfloat16)
- Framework: PEFT + BitsAndBytes + Transformers
Metrics
F1 score metrics for test sample across categories
| Intentions | Precision | Recall | F1-score |
|---|---|---|---|
| 1. Providing Information | 0.83 | 0.92 | 0.88 |
| 2. Request for Information | 0.93 | 0.88 | 0.90 |
| 3. General Emotional Support | 0.68 | 0.81 | 0.74 |
| 4. Maintaining Positive Dynamics | 0.90 | 0.65 | 0.76 |
| 5. Negative Evaluation | 0.86 | 0.80 | 0.83 |
| 6. Self-Disclosure | 0.77 | 0.74 | 0.76 |
| 7. Request for Making Connections | 0.77 | 0.72 | 0.75 |
| 8. Interpretation | 0.80 | 0.74 | 0.77 |
| 9. Guidance | 0.82 | 0.71 | 0.76 |
| weighted average | 0.83 | 0.79 | 0.80 |
| F1-Macro | 0.79 | ||
| F1-Micro | 0.8 |
Model provider
AIPsy
Model tree
Base
Qwen/Qwen3-8B
Adapter
this model
Modalities
Input
Text
Output
Text
Pricing
Dedicated Endpoints
View detailsSupported Functionality
Model APIs
Dedicated Endpoints
Container
More information