Indonesian T5ForConditionalGeneration Cased model (from muchad)

Description

Pretrained T5ForConditionalGeneration model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP. idt5-qa-qg is a Indonesian model originally trained by muchad.

Download Copy S3 URI

How to use

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

t5 = T5Transformer.pretrained("t5_idt5_qa_qg","id") \
    .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_idt5_qa_qg","id") 
    .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_idt5_qa_qg
Compatibility: Spark NLP 4.3.0+
License: Open Source
Edition: Official
Input Labels: [documents]
Output Labels: [t5]
Language: id
Size: 981.3 MB

References

  • https://huggingface.co/muchad/idt5-qa-qg
  • https://github.com/Wikidepia/indonesian_datasets/tree/master/question-answering/squad
  • https://ai.muchad.com/qg/
  • https://t.me/caritahubot
  • https://colab.research.google.com/github/muchad/qaqg/blob/main/idT5_Question_Generation.ipynb
  • https://colab.research.google.com/github/muchad/qaqg/blob/main/idT5_Question_Answering.ipynb