English google_t5_efficient_mini_n12_newssummary T5Transformer from shorecode

Description

Pretrained T5Transformer model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP.google_t5_efficient_mini_n12_newssummary is a English model originally trained by shorecode.

Download Copy S3 URI

How to use

     
documentAssembler = DocumentAssembler() \
    .setInputCol('text') \
    .setOutputCol('document')

t5  = T5Transformer.pretrained("google_t5_efficient_mini_n12_newssummary","en") \
     .setInputCols(["document"]) \
     .setOutputCol("output")

pipeline = Pipeline().setStages([documentAssembler, t5])
data = spark.createDataFrame([["I love spark-nlp"]]).toDF("text")
pipelineModel = pipeline.fit(data)
pipelineDF = pipelineModel.transform(data)


val documentAssembler = new DocumentAssembler()
    .setInputCols("text")
    .setOutputCols("document")

val t5 = T5Transformer.pretrained("google_t5_efficient_mini_n12_newssummary", "en")
    .setInputCols(Array("documents")) 
    .setOutputCol("output") 
    
val pipeline = new Pipeline().setStages(Array(documentAssembler, t5))
val data = Seq("I love spark-nlp").toDS.toDF("text")
val pipelineModel = pipeline.fit(data)
val pipelineDF = pipelineModel.transform(data)

Model Information

Model Name: google_t5_efficient_mini_n12_newssummary
Compatibility: Spark NLP 5.5.1+
License: Open Source
Edition: Official
Input Labels: [document]
Output Labels: [output]
Language: en
Size: 102.8 MB

References

https://huggingface.co/shorecode/google-t5-efficient-mini-n12-newssummary