DelaliScratchwerk's picture
Update README.md
2ff327f verified
---
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()])