Instructions to use LDKSolutions/Ko-Wiki-ChatGPT-Detector-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LDKSolutions/Ko-Wiki-ChatGPT-Detector-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="LDKSolutions/Ko-Wiki-ChatGPT-Detector-v1")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("LDKSolutions/Ko-Wiki-ChatGPT-Detector-v1") model = AutoModelForMaskedLM.from_pretrained("LDKSolutions/Ko-Wiki-ChatGPT-Detector-v1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
ChatGPT μ λ³΄μ± (Wikipedia) κΈ νμ§κΈ°
Description
Model that detects if a Korean wikipedia-style text is written by ChatGPT.
KoBigBird model fine-tuned with approximately 30,000 data of human written wikipedia summaries and ChatGPT generated wikipedia summaries.
Our classifier based on this checkpoint reached a validation accuracy of 99.2% after 10 epochs of training.
Example Usage
from transformers import *
import torch
import torch.nn as nn
model = AutoModelForSequenceClassification.from_pretrained("LDKSolutions/Ko-Wiki-ChatGPT-Detector-v1", num_labels=2)
model.eval()
tokenizer = AutoTokenizer.from_pretrained("LDKSolutions/Ko-Wiki-ChatGPT-Detector-v1")
# this is text generated by ChatGPT (GPT 3.5)
text = '''μ€λ§νΈ 컨νΈλνΈλ λΈλ‘μ²΄μΈ κΈ°μ μμ μ¬μ©λλ νλ‘κ·Έλ¨ μ½λμ μΌμ’
μΌλ‘, κ³μ½ 쑰건μ μλμΌλ‘ κ²μ¦νκ³ μ€ννλ νλ‘κ·Έλ¨μ
λλ€. μ€λ§νΈ 컨νΈλνΈλ λΈλ‘μ²΄μΈ λ€νΈμν¬ μμμ μ€νλλ©°, λΈλ‘체μΈμμ λ°μνλ λͺ¨λ νΈλμμ
μ μ€λ§νΈ 컨νΈλνΈλ₯Ό ν΅ν΄ μ²λ¦¬λ©λλ€.
μ€λ§νΈ 컨νΈλνΈλ 쑰건과 μ€ν μ½λλ‘ μ΄λ£¨μ΄μ Έ μμ΅λλ€. μλ₯Ό λ€μ΄, Aκ° Bμκ² 1,000λ¬λ¬λ₯Ό μ§λΆν΄μΌνλ κ³μ½μ΄ μλ€λ©΄, μ΄ κ³μ½μ 쑰건μ μ€λ§νΈ 컨νΈλνΈλ‘ μμ±νμ¬ κ³μ½μ΄ μλμΌλ‘ μ€νλλλ‘ ν μ μμ΅λλ€. μ΄λ¬ν μ€λ§νΈ 컨νΈλνΈλ μλμΌλ‘ 쑰건μ κ²μ¦νκ³ , μ§μ λ μ‘°κ±΄μ΄ μΆ©μ‘±λμμ λ κ³μ½μ μ€ν μ½λλ₯Ό μ€ννμ¬ κ³μ½μ μ΄νν©λλ€. μ΄λ₯Ό ν΅ν΄ κ³μ½ λΉμ¬μλ μλ‘λ₯Ό μ λ’°νμ§ μμλ μμ νκ² κ±°λλ₯Ό μ§νν μ μμ΅λλ€.
μ€λ§νΈ 컨νΈλνΈλ λΈλ‘체μΈμμ μ€νλκΈ° λλ¬Έμ λͺ¨λ κ±°λ λ΄μμ΄ ν¬λͺ
νκ² κΈ°λ‘λλ©°, μ€κ°μΈμ΄λ μ€μ κΈ°κ΄μ κ°μ
μ΄ μκΈ° λλ¬Έμ κ±°λ λΉμ©μ΄ μ€μ΄λλλ€. λν μ€λ§νΈ 컨νΈλνΈλ μ½λλ‘ μμ±λκΈ° λλ¬Έμ μλνκ° κ°λ₯νλ©°, νλ‘κ·Έλ¨μ λ°λ₯Έ λΉμ¦λμ€ λ‘μ§μ μ€ννλ κ²μ΄ κ°λ₯ν©λλ€. λ°λΌμ μ€λ§νΈ 컨νΈλνΈλ λΈλ‘μ²΄μΈ κΈ°μ μ ν΅μ¬ κΈ°λ₯ μ€ νλλ‘, λΆμ°ν μ ν리μΌμ΄μ
(DApp) κ°λ° λ±μ νμ©λκ³ μμ΅λλ€.'''
encoded_inputs = tokenizer(text, max_length=512, truncation=True, padding="max_length", return_tensors="pt")
with torch.no_grad():
outputs = model(**encoded_inputs).logits
probability = nn.Softmax()(outputs)
predicted_class = torch.argmax(probability).item()
if predicted_class == 1:
print("ChatGPTκ° μμ±νμ νλ₯ μ΄ λμ΅λλ€!")
else:
print("μΈκ°μ΄ μμ±νμ νλ₯ μ΄ λμ΅λλ€!")
- Downloads last month
- 96