Multilingual T5ForConditionalGeneration Small Cased model (from north)

Description

Pretrained T5ForConditionalGeneration model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP. t5_small_NCC_lm is a Multilingual model originally trained by north.

Download Copy S3 URI

How to use

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

t5 = T5Transformer.pretrained("t5_small_ncc_lm","xx") \
    .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_ncc_lm","xx") 
    .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_ncc_lm
Compatibility: Spark NLP 4.3.0+
License: Open Source
Edition: Official
Input Labels: [documents]
Output Labels: [t5]
Language: xx
Size: 1.6 GB

References

  • https://huggingface.co/north/t5_small_NCC_lm
  • https://github.com/google-research/text-to-text-transfer-transformer
  • https://github.com/google-research/t5x
  • https://arxiv.org/abs/2104.09617
  • https://arxiv.org/abs/2104.09617
  • https://arxiv.org/pdf/1910.10683.pdf
  • https://sites.research.google/trc/about/