Update README.md
Browse files
README.md
CHANGED
|
@@ -11,3 +11,25 @@ short_description: 'Model summarizes the time period the given text is about '
|
|
| 11 |
---
|
| 12 |
|
| 13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 14 |
+
|
| 15 |
+
Task: text → time period buckets
|
| 16 |
+
|
| 17 |
+
Buckets: list the 8 labels
|
| 18 |
+
|
| 19 |
+
Training: SetFit on paraphrase-mpnet-base-v2, epochs/iterations, seed
|
| 20 |
+
|
| 21 |
+
Data: short note (tiny curated set; add examples per bucket)
|
| 22 |
+
|
| 23 |
+
Metrics: paste metrics.json
|
| 24 |
+
|
| 25 |
+
Limitations: relies on English cues & named events; may be uncertain on very short/ambiguous text
|
| 26 |
+
|
| 27 |
+
Usage snippet:
|
| 28 |
+
from setfit import SetFitModel
|
| 29 |
+
import numpy as np
|
| 30 |
+
m = SetFitModel.from_pretrained("DelaliScratchwerk/text-period-setfit")
|
| 31 |
+
labels = ["pre-1900","1900–1945","1946–1990","1991–2008","2009–2015","2016–2018","2019–2022","2023–present"]
|
| 32 |
+
x = "Schools went remote during the pandemic; everyone wore N95s and used Zoom."
|
| 33 |
+
p = np.asarray(m.predict_proba([x])[0])
|
| 34 |
+
print(labels[p.argmax()])
|
| 35 |
+
|