ak837's picture
Upload folder using huggingface_hub
29a2cce verified
|
raw
history blame
1.31 kB
metadata
tags:
  - text2text-generation
  - financial-nlp
  - t5
language: en
license: apache-2.0
widget:
  - text: 'extract metrics: Show me Apple''s revenue and gross margin'
    example_title: Revenue and Margin
  - text: 'extract metrics: What''s the P/E ratio and market cap for MSFT?'
    example_title: Ratios and Market Cap
  - text: 'extract metrics: Get Tesla''s free cash flow and debt to equity'
    example_title: Cash Flow and Leverage

T5 Financial Metrics Extractor

This model extracts financial metrics from natural language queries.

Usage

from transformers import pipeline

pipe = pipeline("text2text-generation", model="ak837/t5-financial-metrics-extractor")

# Important: Always prefix with "extract metrics: "
result = pipe("extract metrics: Show me Apple's revenue and gross margin")
print(result[0]['generated_text'])
# Output: ["revenue", "grossMargin"]

Training

This model was fine-tuned on financial queries to extract relevant metrics in JSON array format.

Metrics Supported

The model can extract various financial metrics including:

  • Revenue, gross profit, net income
  • Margins (gross, operating, net)
  • Cash flow metrics
  • Balance sheet items
  • Financial ratios
  • Growth rates

Note

Always use the prefix "extract metrics: " before your query for best results.