Description
FLAN-T5 is a state-of-the-art language model developed by Facebook AI that utilizes the T5 architecture for text summarization tasks. It is trained on a large dataset of diverse texts and can generate high-quality summaries of articles, documents, and other text-based inputs.
Predicted Entities
How to use
document_assembler = nlp.DocumentAssembler()\
.setInputCol("text")\
.setOutputCol("documents")
flant5 = legal.Summarizer().pretrained('legsum_flant5_base','en','legal/models')\
.setInputCols(["documents"])\
.setOutputCol("summary")
pipeline = nlp.Pipeline(stages=[document_assembler, flant5])
data = spark.createDataFrame([
[1, "The defendant was found guilty of first-degree murder and sentenced to life in prison without the possibility of parole."]
]).toDF('id', 'text')
results = pipeline.fit(data).transform(data)
results.select("summary.result").show(truncate=False)
Results
+------------------------------------------------------------------------------------------------------------+
|result |
+------------------------------------------------------------------------------------------------------------+
|[A man has been sentenced to life in prison without parole after being found guilty of first-degree murder.]|
+------------------------------------------------------------------------------------------------------------+
Model Information
Model Name: | legsum_flant5_base |
Compatibility: | Legal NLP 1.0.0+ |
License: | Licensed |
Edition: | Official |
Language: | en |
Size: | 920.9 MB |