Downloads · 30 days
14
48% of all-time downloads
ak837/t5-time-period-extractor
t5-time-period-extractor is a machine learning model from ak837. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This model extracts time periods from financial queries.
Downloads · 30 days
14
48% of all-time downloads
All-time downloads
29
Public
Parameters
223M
892 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors892 MB · 100%
From the Hugging Face model README
This model extracts time periods from financial queries.
from transformers import pipeline
pipe = pipeline("text2text-generation", model="ak837/t5-time-period-extractor")
# Important: Always prefix with "extract time: "
result = pipe("extract time: What was Apple's revenue for Q3 2023?")
print(result[0]['generated_text'])
# Output should be JSON like: {"period":"quarter","year":2023,"quarter":3}
This model was fine-tuned to extract time periods from financial queries in a structured JSON format.
The model outputs JSON with:
period: "quarter" or "annual"year: The year (e.g., 2023)quarter: Quarter number (1-4) if applicableThe model sometimes outputs JSON without proper braces. You may need to add them:
output = result[0]['generated_text']
if not output.startswith('{'):
output = '{' + output + '}'