Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: ko
|
| 3 |
+
license: mit
|
| 4 |
+
library_name: transformers
|
| 5 |
+
tags:
|
| 6 |
+
- text-classification
|
| 7 |
+
- korean
|
| 8 |
+
- mental-health
|
| 9 |
+
- depression-detection
|
| 10 |
+
- bert
|
| 11 |
+
pipeline_tag: text-classification
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# Korean Depression/Anxiety Detection Model
|
| 15 |
+
|
| 16 |
+
ํ๊ตญ์ด ํ
์คํธ ๊ธฐ๋ฐ ์ฐ์ธ/๋ถ์ ๊ฐ์ง ๋ชจ๋ธ์
๋๋ค.
|
| 17 |
+
|
| 18 |
+
## Model Description
|
| 19 |
+
|
| 20 |
+
- **Model Type:** BERT for Sequence Classification
|
| 21 |
+
- **Language:** Korean (ko)
|
| 22 |
+
- **Task:** Binary Classification (์ ์ vs ์ฐ์ธ/๋ถ์)
|
| 23 |
+
- **Base Model:** BERT (Korean)
|
| 24 |
+
|
| 25 |
+
## Labels
|
| 26 |
+
|
| 27 |
+
| Label | Description |
|
| 28 |
+
|-------|-------------|
|
| 29 |
+
| 0 | ์ ์ (Normal) |
|
| 30 |
+
| 1 | ์ฐ์ธ/๋ถ์ (Depression/Anxiety) |
|
| 31 |
+
|
| 32 |
+
## Usage
|
| 33 |
+
|
| 34 |
+
```python
|
| 35 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 36 |
+
import torch
|
| 37 |
+
|
| 38 |
+
# ๋ชจ๋ธ ๋ก๋
|
| 39 |
+
tokenizer = AutoTokenizer.from_pretrained("YOUR_USERNAME/final_depression_model")
|
| 40 |
+
model = AutoModelForSequenceClassification.from_pretrained("YOUR_USERNAME/final_depression_model")
|
| 41 |
+
model.eval()
|
| 42 |
+
|
| 43 |
+
# ์์ธก
|
| 44 |
+
def predict(text):
|
| 45 |
+
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True)
|
| 46 |
+
with torch.no_grad():
|
| 47 |
+
outputs = model(**inputs)
|
| 48 |
+
probs = torch.softmax(outputs.logits, dim=-1)
|
| 49 |
+
prediction = torch.argmax(probs, dim=-1).item()
|
| 50 |
+
return {
|
| 51 |
+
"label": prediction, # 0=์ ์, 1=์ฐ์ธ/๋ถ์
|
| 52 |
+
"confidence": probs[0][prediction].item()
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
# ์ฌ์ฉ ์์
|
| 56 |
+
result = predict("์์ฆ ๋๋ฌด ํ๋ค๊ณ ์๋ฌด๊ฒ๋ ํ๊ธฐ ์ซ์ด์")
|
| 57 |
+
print(result)
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
## Model Details
|
| 61 |
+
|
| 62 |
+
- **Architecture:** BertForSequenceClassification
|
| 63 |
+
- **Hidden Size:** 768
|
| 64 |
+
- **Attention Heads:** 12
|
| 65 |
+
- **Hidden Layers:** 12
|
| 66 |
+
- **Vocab Size:** 30,000
|
| 67 |
+
- **Max Position Embeddings:** 300
|
| 68 |
+
|
| 69 |
+
## Intended Use
|
| 70 |
+
|
| 71 |
+
์ด ๋ชจ๋ธ์ ์ ์ ๊ฑด๊ฐ ๊ด๋ จ ์ฐ๊ตฌ ๋ฐ ์ฑ๋ด ์๋น์ค์์ ์ฌ์ฉ์์ ๊ฐ์ ์ํ๋ฅผ ํ์
ํ๊ธฐ ์ํ ๋ชฉ์ ์ผ๋ก ๊ฐ๋ฐ๋์์ต๋๋ค.
|
| 72 |
+
|
| 73 |
+
## Limitations
|
| 74 |
+
|
| 75 |
+
- ์ด ๋ชจ๋ธ์ ์ ๋ฌธ์ ์ธ ์๋ฃ ์ง๋จ ๋๊ตฌ๊ฐ ์๋๋๋ค.
|
| 76 |
+
- ์ค์ ์ฐ์ธ์ฆ/๋ถ์์ฅ์ ์ง๋จ์ ๋ฐ๋์ ์ ๋ฌธ ์๋ฃ์ง๊ณผ ์๋ดํ์ธ์.
|
| 77 |
+
- ๋ชจ๋ธ์ ์์ธก ๊ฒฐ๊ณผ๋ ์ฐธ๊ณ ์ฉ์ผ๋ก๋ง ์ฌ์ฉํด์ผ ํฉ๋๋ค.
|
| 78 |
+
|
| 79 |
+
## License
|
| 80 |
+
|
| 81 |
+
MIT License
|