FritzStack commited on
Commit
ab4ccb1
·
verified ·
1 Parent(s): 6f4a0e1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +83 -7
README.md CHANGED
@@ -1,5 +1,4 @@
1
  ---
2
- base_model: unsloth/qwen3-0.6b-unsloth-bnb-4bit
3
  tags:
4
  - text-generation-inference
5
  - transformers
@@ -9,13 +8,90 @@ license: apache-2.0
9
  language:
10
  - en
11
  ---
 
12
 
13
- # Uploaded finetuned model
14
 
15
- - **Developed by:** FritzStack
16
- - **License:** apache-2.0
17
- - **Finetuned from model :** unsloth/qwen3-0.6b-unsloth-bnb-4bit
18
 
19
- This qwen3 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
20
 
21
- [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
 
2
  tags:
3
  - text-generation-inference
4
  - transformers
 
8
  language:
9
  - en
10
  ---
11
+ ## Model Description
12
 
13
+ This is a **lightweight model** designed for **multi-class, multi-label classification** of sentences based on the dimensional traits of the **Hierarchical Taxonomy of Psychopathology (HiTOP)**.
14
 
15
+ HiTOP is an empirically derived framework that organizes psychopathology into continuously distributed dimensions arranged hierarchically, representing a paradigmatic shift from traditional categorical diagnostic systems. The model conceptualizes mental health conditions along spectra including **internalizing** (e.g., depression, anxiety), **thought disorder**, **detachment**, **disinhibited externalizing**, and **antagonistic externalizing**.
 
 
16
 
17
+ ### Architecture
18
 
19
+ This model adapts sentence transformer architectures for multi-label text classification, enabling the simultaneous prediction of multiple HiTOP dimensional traits from individual sentences. The lightweight design makes it suitable for deployment in resource-constrained environments while maintaining strong classification performance.
20
+
21
+ ### Classification Task
22
+
23
+ Unlike traditional categorical diagnosis, this model predicts the **degree** to which a sentence reflects various HiTOP dimensions, acknowledging that psychopathological features exist on continua rather than as discrete categories. Each input sentence can be assigned multiple labels corresponding to different HiTOP traits, capturing the co-occurrence and overlap of psychological symptoms that characterize real-world clinical presentations.
24
+
25
+ ### Applications
26
+
27
+ - **Dimensional assessment**: Evaluating multiple psychopathology dimensions simultaneously from text
28
+ - **Clinical screening**: Identifying patterns of mental health concerns in social media or clinical notes
29
+ - **Research**: Studying the hierarchical structure of psychopathology in naturalistic language data
30
+ - **Symptom tracking**: Monitoring changes across multiple psychological dimensions over time
31
+
32
+ This approach aligns with contemporary evidence-based frameworks for understanding mental health, offering improved reliability and coverage compared to traditional categorical classification systems.
33
+
34
+
35
+
36
+
37
+ ```{python}
38
+ from transformers import AutoModelForCausalLM, AutoTokenizer
39
+ import torch
40
+
41
+
42
+ class HiTOPTraitsPredictor:
43
+ def __init__(self, model_name="FritzStack/HiTOP-QWEN-4bit"):
44
+ self.model_name = model_name
45
+ self.tokenizer = None
46
+ self.model = None
47
+
48
+ def _load_model(self):
49
+ if self.tokenizer is None:
50
+ self.tokenizer = AutoTokenizer.from_pretrained(
51
+ self.model_name,
52
+ trust_remote_code=True
53
+ )
54
+ if self.model is None:
55
+ self.model = AutoModelForCausalLM.from_pretrained(
56
+ self.model_name,
57
+ torch_dtype=torch.float16,
58
+ device_map="auto",
59
+ trust_remote_code=True
60
+ )
61
+
62
+ def batch_predict(self, texts, max_new_tokens=50, do_sample=False, top_k=10):
63
+ self._load_model()
64
+ prompts = [f"{text}. HiTOP Traits: " for text in texts]
65
+ inputs = self.tokenizer(prompts, return_tensors="pt", padding=True, truncation=True).to(self.model.device)
66
+
67
+ with torch.no_grad():
68
+ outputs = self.model.generate(
69
+ **inputs,
70
+ max_new_tokens=max_new_tokens,
71
+ do_sample=do_sample,
72
+ top_k=top_k,
73
+ pad_token_id=self.tokenizer.eos_token_id
74
+ )
75
+
76
+ results = []
77
+ for i, output in enumerate(outputs):
78
+ generated_text = self.tokenizer.decode(
79
+ output[len(inputs.input_ids[i]):],
80
+ skip_special_tokens=False
81
+ ).strip()
82
+ results.append(generated_text.replace('<|im_end|>', ''))
83
+
84
+ return results
85
+
86
+ predictor = HiTOPTraitsPredictor()
87
+
88
+ texts = [
89
+ "I feel sad and unmotivated most days",
90
+ "I get very angry and irritable with people",
91
+ "I have trouble concentrating and staying focused"
92
+ ]
93
+ results = predictor.batch_predict(texts, max_new_tokens=50)
94
+ for text, result in zip(texts, results):
95
+ print(f"Input: {text}")
96
+ print(f"HiTOP Traits: {result}\n")
97
+ ```