File size: 1,353 Bytes
4ab8293
8d53ce8
 
 
 
 
 
 
 
 
 
 
 
4ab8293
e0300fe
 
4ab8293
e0300fe
 
 
 
 
 
94d8dbe
e0300fe
 
 
 
 
 
a26b5b7
e0300fe
4ab8293
8d53ce8
 
e0300fe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4ab8293
e0300fe
 
8d53ce8
4ab8293
8d53ce8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
license: mit
base_model: klue/bert-base
tags:
- bert
- lora
- korean
- text-classification
- sentiment-analysis
language:
- ko
datasets:
- nsmc
---
# NSMC 감정분석 LoRA 모델
NSMC 데이터셋으로 파인튜닝된 한국어 감정 분석 모델입니다.

## 모델 설명
- **베이스 모델**: klue/bert_base
- **파인 튜닝 방법**: LoRA
- **언어**: 한국어

## 성능
- **최종 성능**: 85%

## 학습정보
### 데이터셋
- **이름**: NSMC
- **학습 데이터**: 10000

## 학습 설정
- **에폭**: 3

## 사용 방법
```python
from peft import PeftModel

# 베이스 모델 로드 (분류용)
print("베이스 모델 로딩")
base_model_reload = AutoModelForSequenceClassification.from_pretrained(
    "klue/bert-base",
    num_labels=2
)

# 업로드한 LoRA 어댑터 로드
print(f"LoRA 어댑터 로딩: seul214/nsmc-sentiment-lora")
model_reload = PeftModel.from_pretrained(base_model_reload, model_name_upload)
tokenizer_reload = AutoTokenizer.from_pretrained(model_name_upload)

# GPU로 이동
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model_reload = model_reload.to(device)
model_reload.eval()

print("모델 로드 완료!")
print("이제 이 코드로 어디서든 내 모델을 사용할 수 있습니다!")
```

**Note**: 이 모델은 교육 목적으로 만들어졌습니다.