|
|
--- |
|
|
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()]) |
|
|
|
|
|
|