Description
Pretrained T5ForConditionalGeneration model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP. mengzi-t5-base-chinese-correction
is a Chinese model originally trained by shibing624
.
How to use
documentAssembler = DocumentAssembler() \
.setInputCols("text") \
.setOutputCols("document")
t5 = T5Transformer.pretrained("t5_mengzi_base_chinese_correction","zh") \
.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_mengzi_base_chinese_correction","zh")
.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_mengzi_base_chinese_correction |
Compatibility: | Spark NLP 4.3.0+ |
License: | Open Source |
Edition: | Official |
Input Labels: | [documents] |
Output Labels: | [t5] |
Language: | zh |
Size: | 1.0 GB |
References
- https://huggingface.co/shibing624/mengzi-t5-base-chinese-correction
- https://github.com/shibing624/pycorrector
- https://github.com/shibing624/pycorrector/tree/master/pycorrector/t5
- https://pan.baidu.com/s/1BV5tr9eONZCI0wERFvr0gQ
- http://nlp.ee.ncu.edu.tw/resource/csc.html
- https://github.com/wdimmy/Automatic-Corpus-Generation/blob/master/corpus/train.sgml