T5 Time Period Extractor
This model extracts time periods from financial queries.
Usage
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}
Training
This model was fine-tuned to extract time periods from financial queries in a structured JSON format.
Output Format
The model outputs JSON with:
period
: "quarter" or "annual"year
: The year (e.g., 2023)quarter
: Quarter number (1-4) if applicable
Known Issue
The model sometimes outputs JSON without proper braces. You may need to add them:
output = result[0]['generated_text']
if not output.startswith('{'):
output = '{' + output + '}'
- Downloads last month
- 20
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
๐
Ask for provider support