Description
Pretrained RoBertaForSequenceClassification model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP.cold_fusion_itr9_seed3
is a English model originally trained by ibm.
How to use
documentAssembler = DocumentAssembler() \
.setInputCol('text') \
.setOutputCol('document')
tokenizer = Tokenizer() \
.setInputCols(['document']) \
.setOutputCol('token')
sequenceClassifier = RoBertaForSequenceClassification.pretrained("cold_fusion_itr9_seed3","en") \
.setInputCols(["documents","token"]) \
.setOutputCol("class")
pipeline = Pipeline().setStages([documentAssembler, tokenizer, sequenceClassifier])
data = spark.createDataFrame([["I love spark-nlp"]]).toDF("text")
pipelineModel = pipeline.fit(data)
pipelineDF = pipelineModel.transform(data)
val documentAssembler = new DocumentAssembler()
.setInputCols("text")
.setOutputCols("document")
val tokenizer = new Tokenizer()
.setInputCols(Array("document"))
.setOutputCol("token")
val sequenceClassifier = RoBertaForSequenceClassification.pretrained("cold_fusion_itr9_seed3", "en")
.setInputCols(Array("documents","token"))
.setOutputCol("class")
val pipeline = new Pipeline().setStages(Array(documentAssembler, tokenizer, sequenceClassifier))
val data = Seq("I love spark-nlp").toDS.toDF("text")
val pipelineModel = pipeline.fit(data)
val pipelineDF = pipelineModel.transform(data)
Model Information
Model Name: | cold_fusion_itr9_seed3 |
Compatibility: | Spark NLP 5.5.0+ |
License: | Open Source |
Edition: | Official |
Input Labels: | [document, token] |
Output Labels: | [class] |
Language: | en |
Size: | 467.9 MB |
References
https://huggingface.co/ibm/ColD-Fusion-itr9-seed3