File size: 1,059 Bytes
1524eca 2ff327f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
---
title: TextPeriod Summarization
emoji: 📉
colorFrom: green
colorTo: purple
sdk: gradio
sdk_version: 5.46.1
app_file: app.py
pinned: false
short_description: 'Model summarizes the time period the given text is about '
---
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
Task: text → time period buckets
Buckets: list the 8 labels
Training: SetFit on paraphrase-mpnet-base-v2, epochs/iterations, seed
Data: short note (tiny curated set; add examples per bucket)
Metrics: paste metrics.json
Limitations: relies on English cues & named events; may be uncertain on very short/ambiguous text
Usage snippet:
from setfit import SetFitModel
import numpy as np
m = SetFitModel.from_pretrained("DelaliScratchwerk/text-period-setfit")
labels = ["pre-1900","1900–1945","1946–1990","1991–2008","2009–2015","2016–2018","2019–2022","2023–present"]
x = "Schools went remote during the pandemic; everyone wore N95s and used Zoom."
p = np.asarray(m.predict_proba([x])[0])
print(labels[p.argmax()])
|