Financial News Summarization (X-Small)

Description

This model is a Financial news Summarizer, finetuned with a extra-small financial dataset. (about 4K news).

Predicted Entities

Copy S3 URI

How to use

document_assembler = nlp.DocumentAssembler() \
    .setInputCol("text") \
    .setOutputCol("documents")

t5 = nlp.T5Transformer() \
    .pretrained("finsum_news_xs" ,"en", "finance/models") \
    .setTask("summarize:")\ # or 'summarization'
    .setMaxOutputLength(512)\
    .setInputCols(["documents"]) \
    .setOutputCol("summaries")

data_df = spark.createDataFrame([["Deere Grows Sales 37% as Shipments Rise. Farm equipment supplier forecasts higher sales in year ahead, lifted by price increases and infrastructure investments. Deere & Co. said its fiscal fourth-quarter sales surged 37% as supply constraints eased and the company shipped more of its farm and construction equipment. The Moline, Ill.-based company, the largest supplier of farm equipment in the U.S., said demand held up as it raised prices on farm equipment, and forecast sales gains in the year ahead. Chief Executive John May cited strong demand and increased investment in infrastructure projects as the Biden administration ramps up spending. Elevated crop prices have kept farmers interested in new machinery even as their own production expenses increase."]]).toDF("text")

pipeline = nlp.Pipeline().setStages([document_assembler, t5])
results = pipeline.fit(data_df).transform(data_df)
results.select("summaries.result").show(truncate=False)

Results

Deere & Co. said its fiscal fourth-quarter sales surged 37% as supply constraints eased and the company shipped more farm and construction equipment. Deere & Co. said its fiscal fourth-quarter sales surged 37% as supply constraints eased and the company shipped more farm and construction equipment.

Model Information

Model Name: finsum_news_xs
Compatibility: Finance NLP 1.0.0+
License: Licensed
Edition: Official
Input Labels: [documents]
Output Labels: [summaries]
Language: en
Size: 923.2 MB

Benchmarking

John Snow Labs in-house summarized articles.