|
Download README.md from nuguri01/pgos-behavior-agent: direct link, hf CLI and curl.
- Browser
- Download file 3.52 kB
-
https://huggingface.co/nuguri01/pgos-behavior-agent/resolve/main/README.md
- Command line
-
hf download hf://nuguri01/pgos-behavior-agent/README.md
-
curl -L -o README.md https://huggingface.co/nuguri01/pgos-behavior-agent/resolve/main/README.md
3.52 kB
| language: ko | |
| license: mit | |
| tags: | |
| - korean | |
| - psychology | |
| - behavior-classification | |
| - counseling | |
| - kcelectra | |
| metrics: | |
| - f1 | |
| # PGOS Behavior Agent | |
| **Psychological Growth OS(PGOS)** νλ‘μ νΈμ νλ ν¨ν΄ λΆλ₯ λͺ¨λΈμ λλ€. | |
| ## λͺ¨λΈ κ°μ | |
| μ¬λ¦¬μλ΄ λνμμ λ΄λ΄μμ νλ ν¨ν΄μ 5κ°μ§λ‘ λΆλ₯ν©λλ€. | |
| | ν΄λμ€ | μ€λͺ | μμ | | |
| |---|---|---| | |
| | μ κ·Ό (Approach) | λ¬Έμ /κ°μ μ λ₯λμ μΌλ‘ νμ | "νλ² λ§ν΄λ΄€μ΄μ", "μ§μ λ¬Όμ΄λ΄€μ΄μ" | | |
| | ννΌ (Avoidance) | λΆνΈν μν©/κ°μ μ νΌν¨ | "κ·Έλ₯ μ κ²½ μ μ¨μ", "μ΄μ°¨νΌ" | | |
| | μμΆ (Withdrawal) | κ΄κ³/νλμμ μ¬νμ μ² μ | "μμ¦ μ무λ μ λ§λμ", "νΌμ μκ³ μΆμ΄μ" | | |
| | μ§μ (Persistence) | λΉν¨κ³Όμ ν¨ν΄μ μλ©΄μ λ°λ³΅ | "λ μ΄λ¬κ³ μμ΄μ", "λ§€λ² μ΄λ κ² λΌμ" | | |
| | μ€λ¦½ (Neutral) | μ ν¨ν΄μ΄ λλ ·νμ§ μμ μΌλ° λν | μΌμ μμ , μ 보 μ λ¬ | | |
| ## μ±λ₯ | |
| | μ§ν | κ° | | |
| |---|---| | |
| | Top-1 Macro F1 | **0.754** | | |
| | Top-2 Hit Rate | **0.899** | | |
| | Top-3 Hit Rate | **0.985** | | |
| ### ν΄λμ€λ³ F1 | |
| | ν΄λμ€ | F1 | | |
| |---|---| | |
| | μμΆ | 0.976 | | |
| | μ§μ | 0.956 | | |
| | μ€λ¦½ | 0.657 | | |
| | ννΌ | 0.617 | | |
| | μ κ·Ό | 0.567 | | |
| ## νμ΅ λ°μ΄ν° | |
| - **μμ² λ°μ΄ν°**: AI Hub μ¬λ¦¬μλ΄ λ°μ΄ν° (μ°μΈμ¦/λΆμμ₯μ /μ€λ /μΌλ°κ΅°, 75κ° νκΈ°) | |
| - **μ λ ₯ λ¨μ**: μ°μ 3ν΄ μ¬λΌμ΄λ© μλμ° | |
| - **GPT μ¦κ°**: μμΆ/μ§μ ν΄λμ€ λΆμ‘±λΆ GPT-4o-miniλ‘ λ³΄κ° | |
| - **μ΅μ’ νμ΅ λ°μ΄ν°**: ν΄λμ€λΉ 750κ° κ· λ± (μ΄ 3,750κ°) | |
| ## λ² μ΄μ€ λͺ¨λΈ | |
| [beomi/KcELECTRA-base-v2022](https://huggingface.co/beomi/KcELECTRA-base-v2022) | |
| ## νμ΅ μ€μ | |
| ```python | |
| TrainingArguments( | |
| num_train_epochs=6, | |
| per_device_train_batch_size=32, | |
| learning_rate=2e-5, | |
| weight_decay=0.03, | |
| loss="CrossEntropy" # νλ λΌλ²¨ | |
| ) | |
| ``` | |
| ## μ¬μ© λ°©λ² | |
| ```python | |
| from transformers import AutoTokenizer, AutoModelForSequenceClassification | |
| import torch | |
| model_name = "nuguri01/pgos-behavior-agent" | |
| tokenizer = AutoTokenizer.from_pretrained(model_name) | |
| model = AutoModelForSequenceClassification.from_pretrained(model_name) | |
| # μ λ ₯: 3ν΄ λν (μ¬λΌμ΄λ© μλμ°) | |
| text = "[λ΄λ΄μ] μμ¦ μΉκ΅¬λ€ μ°λ½μ΄ μλ λ΅μ₯μ μ νκ² λΌμ. | [μλ΄μ¬] μ΄λ€ λ§μμΈ κ² κ°μμ? | [λ΄λ΄μ] κ·Έλ₯ νΌμ μκ³ μΆμ΄μ." | |
| inputs = tokenizer(text, return_tensors="pt", max_length=256, truncation=True) | |
| with torch.no_grad(): | |
| logits = model(**inputs).logits | |
| probs = torch.softmax(logits, dim=-1) | |
| labels = ["μ κ·Ό", "ννΌ", "μμΆ", "μ§μ", "μ€λ¦½"] | |
| top1_idx = probs.argmax().item() | |
| top2_idx = probs.topk(2).indices[0][1].item() | |
| print(f"μ£Όν¨ν΄: {labels[top1_idx]} ({probs[0][top1_idx]:.3f})") | |
| print(f"보쑰ν¨ν΄: {labels[top2_idx]} ({probs[0][top2_idx]:.3f})") | |
| # λ³΅ν© ν¨ν΄ νλκ·Έ (보쑰ν¨ν΄ 25% μ΄μ) | |
| if probs[0][top2_idx] >= 0.25: | |
| print(f"λ³΅ν© ν¨ν΄: {labels[top1_idx]}+{labels[top2_idx]}") | |
| ``` | |
| ## PGOS μν€ν μ²μμμ μν | |
| μ¬μ©μ λ°ν β Behavior Agent (μ΄ λͺ¨λΈ) | |
| { | |
| "primary_behavior": "μμΆ", | |
| "primary_score": 0.87, | |
| "secondary_behavior": "ννΌ", | |
| "secondary_score": 0.09, | |
| "is_complex": false | |
| } | |
| β Coordinator β λν μ λ΅ κ²°μ | |
| ## νλ‘μ νΈ | |
| - **μλΉμ€**: Psychological Growth OS (PGOS) | |
| - **μ² ν**: Carl Rogers μΈκ°μ€μ¬μΉλ£ + ACT Hexaflex | |
| - **Emotion Agent**: [nuguri01/pgos-emotion-stage1-major](https://huggingface.co/nuguri01/pgos-emotion-stage1-major) | |