Update README.md
Browse files
README.md
CHANGED
|
@@ -1,6 +1,33 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
```python
|
| 5 |
# Import necessary libraries
|
| 6 |
import torch
|
|
@@ -64,4 +91,4 @@ def infer(model, tokenizer, text):
|
|
| 64 |
# Example usage
|
| 65 |
text = "NASA announces new mission to study asteroids"
|
| 66 |
result = infer(model, tokenizer, text)
|
| 67 |
-
print(f"Predicted category: {result}")
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
datasets:
|
| 4 |
+
- fancyzhx/ag_news
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
metrics:
|
| 8 |
+
- accuracy
|
| 9 |
+
base_model:
|
| 10 |
+
- google-t5/t5-large
|
| 11 |
+
pipeline_tag: text-classification
|
| 12 |
+
tags:
|
| 13 |
+
- ag
|
| 14 |
+
- news
|
| 15 |
+
- document
|
| 16 |
+
- classification
|
| 17 |
---
|
| 18 |
+
|
| 19 |
+
Epoch 1/2 - Training Loss: 0.2126
|
| 20 |
+
Epoch 1/2 - Validation Loss: 0.1566
|
| 21 |
+
Best model saved with validation loss: 0.1566
|
| 22 |
+
Epoch 2/2 - Training Loss: 0.1205
|
| 23 |
+
Epoch 2/2 - Validation Loss: 0.1590
|
| 24 |
+
Test Loss: 0.1629
|
| 25 |
+
Accuracy: 0.9521
|
| 26 |
+
F1 Score: 0.9521
|
| 27 |
+
Precision: 0.9522
|
| 28 |
+
Recall: 0.952
|
| 29 |
+
|
| 30 |
+
|
| 31 |
```python
|
| 32 |
# Import necessary libraries
|
| 33 |
import torch
|
|
|
|
| 91 |
# Example usage
|
| 92 |
text = "NASA announces new mission to study asteroids"
|
| 93 |
result = infer(model, tokenizer, text)
|
| 94 |
+
print(f"Predicted category: {result}")
|