Views
No views yet
1from transformers import pipeline
2
3# Buat pipeline klasifikasi menggunakan model dari Hugging Face Hub
4model_name = "ragilbuaj/sentiment-analysis-TWS-reviews"
5classifier = pipeline("sentiment-analysis", model=model_name, tokenizer=model_name)
6
7# Gunakan pipeline untuk mengklasifikasikan teks
8result = classifier("I love using Hugging Face models!")
9print(result)| Training Loss | Epoch | Step | Validation Loss | Accuracy | Precision | Recall | F1 |
|---|---|---|---|---|---|---|---|
| 0.2786 | 0.9992 | 589 | 0.2370 | 0.9109 | 0.9053 | 0.9109 | 0.9060 |
| 0.2205 | 2.0 | 1179 | 0.2626 | 0.9143 | 0.9175 | 0.9143 | 0.9154 |
| 0.1252 | 2.9992 | 1768 | 0.3468 | 0.9169 | 0.9160 | 0.9169 | 0.9164 |
| 0.0869 | 4.0 | 2358 | 0.4000 | 0.9220 | 0.9200 | 0.9220 | 0.9208 |
| 0.0147 | 4.9958 | 2945 | 0.4424 | 0.9220 | 0.9180 | 0.9220 | 0.9194 |