Description
Pretrained T5ForConditionalGeneration model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP. t5-small is a English model originally trained by khanglam7012.
How to use
documentAssembler = DocumentAssembler() \
    .setInputCols("text") \
    .setOutputCols("document")
t5 = T5Transformer.pretrained("t5_small","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","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)
import nlu
nlu.load("en.t5.small").predict("""text|||"document|||"t5_small|||"en|||"document|||"answers|||"PUT YOUR STRING HERE|||"text""")
Model Information
| Model Name: | t5_small | 
| Compatibility: | Spark NLP 4.3.0+ | 
| License: | Open Source | 
| Edition: | Official | 
| Input Labels: | [documents] | 
| Output Labels: | [t5] | 
| Language: | en | 
| Size: | 253.6 MB | 
References
- https://huggingface.co/khanglam7012/t5-small
- https://user-images.githubusercontent.com/49101362/116334480-f5e57a00-a7dd-11eb-987c-186477f94b6e.png
- https://pypi.org/project/keytotext/
- https://pepy.tech/project/keytotext
- https://colab.research.google.com/github/gagan3012/keytotext/blob/master/Examples/K2T.ipynb
- https://share.streamlit.io/gagan3012/keytotext/UI/app.py
- https://github.com/gagan3012/keytotext/tree/master/Training%20Notebooks
- https://colab.research.google.com/github/gagan3012/keytotext/blob/master/Examples/K2T.ipynb
- https://github.com/gagan3012/keytotext/tree/master/Examples
- https://user-images.githubusercontent.com/49101362/116220679-90e64180-a755-11eb-9246-82d93d924a6c.png
- https://share.streamlit.io/gagan3012/keytotext/UI/app.py
- https://github.com/gagan3012/streamlit-tags
- https://user-images.githubusercontent.com/49101362/116162205-fc042980-a6fd-11eb-892e-8f6902f193f4.png