English a2t_roberta_smfa_wikievents_arg RoBertaForZeroShotClassification from HiTZ

Description

Pretrained RoBertaForZeroShotClassification model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP.a2t_roberta_smfa_wikievents_arg is a English model originally trained by HiTZ.

Download Copy S3 URI

How to use

     
documentAssembler = DocumentAssembler() \
    .setInputCol('text') \
    .setOutputCol('document')
    
tokenizer = Tokenizer() \
    .setInputCols(['document']) \
    .setOutputCol('token')

zeroShotClassifier  = RoBertaForZeroShotClassification.pretrained("a2t_roberta_smfa_wikievents_arg","en") \
     .setInputCols(["document","token"]) \
     .setOutputCol("class")

pipeline = Pipeline().setStages([documentAssembler, tokenizer, zeroShotClassifier])
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("document")
    .setOutputCol("token")

val zeroShotClassifier  = RoBertaForZeroShotClassification.pretrained("a2t_roberta_smfa_wikievents_arg", "en")
    .setInputCols(Array("documents","token")) 
    .setOutputCol("class") 
    
val pipeline = new Pipeline().setStages(Array(documentAssembler, tokenizer, zeroShotClassifier))
val data = Seq("I love spark-nlp").toDS.toDF("text")
val pipelineModel = pipeline.fit(data)
val pipelineDF = pipelineModel.transform(data)

Model Information

Model Name: a2t_roberta_smfa_wikievents_arg
Compatibility: Spark NLP 5.5.1+
License: Open Source
Edition: Official
Input Labels: [document, token]
Output Labels: [class]
Language: en
Size: 1.3 GB

References

https://huggingface.co/HiTZ/A2T_RoBERTa_SMFA_WikiEvents-arg