English all_roberta_large_v1_credit_cards_1000_16_5_oos RoBertaForSequenceClassification from fathyshalab

Description

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

Download Copy S3 URI

How to use


document_assembler = DocumentAssembler()\
    .setInputCol("text")\
    .setOutputCol("document")

tokenizer = Tokenizer()\
    .setInputCols("document")\
    .setOutputCol("token")  
    
sequenceClassifier = RoBertaForSequenceClassification.pretrained("all_roberta_large_v1_credit_cards_1000_16_5_oos","en")\
            .setInputCols(["document","token"])\
            .setOutputCol("class")

pipeline = Pipeline().setStages([document_assembler, tokenizer, sequenceClassifier])

data = spark.createDataFrame([["PUT YOUR STRING HERE"]]).toDF("text")

result = pipeline.fit(data).transform(data)


val document_assembler = new DocumentAssembler()
    .setInputCol("text")
    .setOutputCol("document")

val tokenizer = new Tokenizer()
    .setInputCols("document") 
    .setOutputCol("token")  
    
val sequenceClassifier = RoBertaForSequenceClassification.pretrained("all_roberta_large_v1_credit_cards_1000_16_5_oos","en")
            .setInputCols(Array("document","token"))
            .setOutputCol("class")

val pipeline = new Pipeline().setStages(Array(documentAssembler, tokenizer, sequenceClassifier))

val data = Seq("PUT YOUR STRING HERE").toDS.toDF("text")

val result = pipeline.fit(data).transform(data)


Model Information

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

References

https://huggingface.co/fathyshalab/all-roberta-large-v1-credit_cards-1000-16-5-oos