Juner commited on
Commit
3a4b891
·
verified ·
1 Parent(s): f9257a8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -1
README.md CHANGED
@@ -70,8 +70,20 @@ This model is an artificial intelligence generated text detection model trained
70
  Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
71
 
72
  ## How to Get Started with the Model
 
 
 
73
 
74
- Use the code below to get started with the model.
 
 
 
 
 
 
 
 
 
75
 
76
  [More Information Needed]
77
 
 
70
  Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
71
 
72
  ## How to Get Started with the Model
73
+ You could implement the model with the sample if you want to classify between AI-generated text and real-text.
74
+ ```python
75
+ from transformers import AutoTokenizer,AutoModelForSequenceClassification
76
 
77
+ tokenizer = AutoTokenizer.from_pretrained("Juner/AI-generated-text-detection-pair")
78
+ model = AutoModelForSequenceClassification.from_pretrained("Juner/AI-generated-text-detection-pair")
79
+
80
+ # 对输入进行编码并获取模型输出
81
+ question = "你喜欢我吗?"
82
+ answer = "是的!我喜欢你!"
83
+ inputs = tokenizer(question+answer,padding =True,truncation=True,return_tensors="pt",max_length=512)
84
+ outputs = model(**inputs)
85
+
86
+ ```
87
 
88
  [More Information Needed]
89