Description
Pretrained T5ForConditionalGeneration model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP. t5-small-finetuned-emotion
is a English model originally trained by mrm8488
.
How to use
documentAssembler = DocumentAssembler() \
.setInputCols("text") \
.setOutputCols("document")
t5 = T5Transformer.pretrained("t5_small_finetuned_emotion","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_emotion","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_emotion |
Compatibility: | Spark NLP 4.3.0+ |
License: | Open Source |
Edition: | Official |
Input Labels: | [documents] |
Output Labels: | [t5] |
Language: | en |
Size: | 263.3 MB |
References
- https://huggingface.co/mrm8488/t5-small-finetuned-emotion
- https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html
- https://github.com/dair-ai/emotion_dataset
- https://arxiv.org/pdf/1910.10683.pdf
- https://i.imgur.com/jVFMMWR.png
- https://twitter.com/omarsar0
- https://github.com/dair-ai/emotion_dataset
- https://github.com/patil-suraj/exploring-T5/blob/master/t5_fine_tuning.ipynb
- https://github.com/patil-suraj
- https://i.imgur.com/JBtAwPx.png
- https://twitter.com/mrm8488
- https://www.linkedin.com/in/manuel-romero-cs/