English T5ForConditionalGeneration Small Cased model (from mrm8488)

Description

Pretrained T5ForConditionalGeneration model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP. t5-small-finetuned-imdb-sentiment is a English model originally trained by mrm8488.

Download Copy S3 URI

How to use

documentAssembler = DocumentAssembler() \
    .setInputCols("text") \
    .setOutputCols("document")

t5 = T5Transformer.pretrained("t5_small_finetuned_imdb_sentiment","en") \
    .setInputCols("document") \
    .setOutputCol("answers")
    
pipeline = Pipeline(stages=[documentAssembler, t5])

data = spark.createDataFrame([["PUT YOUR STRING HERE"]]).toDF("text")

result = pipeline.fit(data).transform(data)
val documentAssembler = new DocumentAssembler() 
      .setInputCols("text")
      .setOutputCols("document")
       
val t5 = T5Transformer.pretrained("t5_small_finetuned_imdb_sentiment","en") 
    .setInputCols("document")
    .setOutputCol("answers")
   
val pipeline = new Pipeline().setStages(Array(documentAssembler, t5))

val data = Seq("PUT YOUR STRING HERE").toDS.toDF("text")

val result = pipeline.fit(data).transform(data)

Model Information

Model Name: t5_small_finetuned_imdb_sentiment
Compatibility: Spark NLP 4.3.0+
License: Open Source
Edition: Official
Input Labels: [documents]
Output Labels: [t5]
Language: en
Size: 267.7 MB

References

  • https://huggingface.co/mrm8488/t5-small-finetuned-imdb-sentiment
  • https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html
  • https://arxiv.org/pdf/1910.10683.pdf
  • https://camo.githubusercontent.com/623b4dea0b653f2ad3f36c71ebfe749a677ac0a1/68747470733a2f2f6d69726f2e6d656469756d2e636f6d2f6d61782f343030362f312a44304a31674e51663876727255704b657944387750412e706e67
  • https://github.com/patil-suraj/exploring-T5/blob/master/t5_fine_tuning.ipynb
  • https://github.com/patil-suraj
  • https://twitter.com/mrm8488
  • https://www.linkedin.com/in/manuel-romero-cs/