Downloads · 30 days
0
heloolkjdasklfjlasdf/kobart_swear_change
kobart_swear_change is a translation model from heloolkjdasklfjlasdf. Use it when you need text moved from one language to another. It is set up for transformers. The card lists the license as mit.
이 모델은 KoBART를 파인튜닝하여 한국어 비속어를 표준어로 번역해주는 번역기입니다.
Downloads · 30 days
0
Access
Public
Updated Aug 3, 2025
Repo size
496 MB
Likes
0
Public
Click a slice to open those files.
.pt496 MB · 100%
From the Hugging Face model README
이 모델은 KoBART를 파인튜닝하여 한국어 비속어를 표준어로 번역해주는 번역기입니다.
AI Hub의 텍스트 윤리검증 데이터를 사용하였습니다.
Input Text: 야이 미친놈아 꺼져
Generated Text: 이런, 제발 그만 좀 해줘.
training_args = TrainingArguments(
)
• GPU: NVIDIA RTX A5000
• 학습 시간: 약 3시간
| Step | Training Loss | Validation Loss |
|---|---|---|
| 0 | 0. | 0.0 |
모델은 입력 문장의 앞에 반드시
[순화]토큰을 붙여야 올바르게 작동합니다.
import torch
from transformers import BartForConditionalGeneration, PreTrainedTokenizerFast
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = BartForConditionalGeneration.from_pretrained("heloolkjdasklfjlasdf/slang-kobart").to(device)
tokenizer = PreTrainedTokenizerFast.from_pretrained("heloolkjdasklfjlasdf/slang-kobart")
model.eval()
def refine_text(text):
input_text = "[순화] " + text
input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to(device)
with torch.no_grad():
output = model.generate(
input_ids=input_ids,
max_length=128,
num_beams=5,
early_stopping=True
)
return tokenizer.decode(output[0], skip_special_tokens=True)
# ✅ 테스트 예시
print("🧨 원문:", "야이 미친놈아 꺼져")
print("✅ 순화:", refine_text("야이 미친놈아 꺼져"))