Description
Pretrained T5ForConditionalGeneration model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP. flan-t5-small
is a Multilingual model originally trained by google
.
How to use
documentAssembler = DocumentAssembler() \
.setInputCols("text") \
.setOutputCols("document")
t5 = T5Transformer.pretrained("t5_flan_small","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_flan_small","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_flan_small |
Compatibility: | Spark NLP 4.3.0+ |
License: | Open Source |
Edition: | Official |
Input Labels: | [documents] |
Output Labels: | [t5] |
Language: | xx |
Size: | 349.5 MB |
References
- https://huggingface.co/google/flan-t5-small
- https://s3.amazonaws.com/moonup/production/uploads/1666363435475-62441d1d9fdefb55a0b7d12c.png
- https://github.com/google-research/t5x/blob/main/docs/models.md#flan-t5-checkpoints
- https://arxiv.org/pdf/2210.11416.pdf
- https://github.com/google-research/t5x
- https://arxiv.org/pdf/2210.11416.pdf
- https://arxiv.org/pdf/2210.11416.pdf
- https://arxiv.org/pdf/2210.11416.pdf
- https://s3.amazonaws.com/moonup/production/uploads/1666363265279-62441d1d9fdefb55a0b7d12c.png
- https://arxiv.org/pdf/2210.11416.pdf
- https://github.com/google-research/t5x
- https://github.com/google/jax
- https://s3.amazonaws.com/moonup/production/uploads/1668072995230-62441d1d9fdefb55a0b7d12c.png
- https://arxiv.org/pdf/2210.11416.pdf
- https://arxiv.org/pdf/2210.11416.pdf
- https://mlco2.github.io/impact#compute
- https://arxiv.org/abs/1910.09700