mashironotdev commited on
Commit
f852f16
·
verified ·
1 Parent(s): 6eed8a0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +31 -1
README.md CHANGED
@@ -105,4 +105,34 @@ Typical preprocessing steps:
105
 
106
  ## Training Configuration
107
 
108
- Example configuration:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
 
106
  ## Training Configuration
107
 
108
+ Example configuration:
109
+
110
+ ## Quick Usage
111
+
112
+ ```python
113
+ # install dependencies
114
+ # pip install transformers torch
115
+
116
+ from transformers import pipeline
117
+
118
+ # load model from Hugging Face
119
+ classifier = pipeline(
120
+ "text-classification",
121
+ model="mashironotdev/thai-toxic-classifier"
122
+ )
123
+
124
+ # example inputs
125
+ texts = [
126
+ "สวัสดีครับ",
127
+ "ขอบคุณมากครับ",
128
+ "มึงโง่หรือไง",
129
+ "ไอ้ควาย"
130
+ ]
131
+
132
+ # run inference
133
+ results = classifier(texts)
134
+
135
+ # print results
136
+ for text, result in zip(texts, results):
137
+ print(text, "->", result)
138
+ ```