Views
No views yet
KoELECTRA-base를 기반으로 파인튜닝 했으며, 라벨은 NEGATIVE(0) / NEUTRAL(1) / POSITIVE(2) 입니다.1from transformers import pipeline
2
3repo_id = "solbi12/ecommers_fasion_fine_tuned_3class_model"
4clf = pipeline("text-classification", model=repo_id, truncation=True)
5
6clf("배송이 빠르고 품질도 좋아요")
7# [{'label': 'POSITIVE', 'score': 0.98}]
8
9---
10
11
12## 📜 README.md (마크다운 형식)
13
14### 💻 모델 사용 방법: PyTorch 직접 사용
15
16이 모델은 한국어 패션 리뷰의 감정을 긍정(POSITIVE), 부정(NEGATIVE), 중립(NEUTRAL) 3가지로 분류하도록 파인튜닝되었습니다. `transformers` 라이브러리를 사용하여 쉽게 로드하고 추론할 수 있습니다.
17
18```python
19import torch
20from transformers import AutoTokenizer, AutoModelForSequenceClassification
21
22# 모델 ID
23repo_id = "solbi12/ecommers_fasion_fine_tuned_3class_model"
24
25# 모델 및 토크나이저 로드 (Hugging Face Hub에서 자동 다운로드)
26tokenizer = AutoTokenizer.from_pretrained(repo_id)
27model = AutoModelForSequenceClassification.from_pretrained(repo_id).eval()
28
29# 테스트 텍스트
30text = "원단이 얇고 마감이 별로네요"
31inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
32
33# 추론
34with torch.no_grad():
35 logits = model(**inputs).logits
36 pred = int(logits.argmax(dim=-1))
37
38# 라벨 출력
39label_map = {0: "NEGATIVE", 1: "NEUTRAL", 2: "POSITIVE"}
40print(f"입력 텍스트: '{text}'")
41print(f"분류 결과: {label_map[pred]}")| 라벨 ID | 라벨명 |
|---|---|
| 0 | NEGATIVE (부정) |
| 1 | NEUTRAL (중립) |
| 2 | POSITIVE (긍정) |
id2label및label2id가 모델 설정(config.json)에 저장되어 있어 Hugging Facepipeline사용 시에도 라벨명이 자동으로 출력됩니다.
| 지표 | 점수 |
|---|---|
| Accuracy | 0.91 |
| F1-score | 0.90 |
데이터: "AI HUB 데이터셋"
jaehyeong/koelectra-base-v3-generalized-sentiment-analysiswarmup 10%)weight decay 0.01)Weighted CrossEntropy)config.json : 모델 구조 및 학습 설정model.safetensors : 파인튜닝된 모델 가중치tokenizer.jsontokenizer_config.jsonvocab.txtspecial_tokens_map.json@article{lee2025ecommers,
title={eCommerce Fashion Korean Sentiment (3-Class)},
author={Lee, Solbi},
year={2025},
note={https://huggingface.co/solbi12/ecommers_fasion_fine_tuned_3class_model}
}