English albert_base_v2_rotten_tomatoes AlbertForSequenceClassification from textattack

Description

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

Predicted Entities

Download Copy S3 URI

How to use

document_assembler = DocumentAssembler() \
    .setInputCol("text") \
    .setOutputCol("documents")
    
    
sequenceClassifier = AlbertForSequenceClassification.pretrained("albert_base_v2_rotten_tomatoes","en") \
            .setInputCols(["documents","token"]) \
            .setOutputCol("class")

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

pipelineModel = pipeline.fit(data)

pipelineDF = pipelineModel.transform(data)
val document_assembler = new DocumentAssembler()
    .setInputCol("text") 
    .setOutputCol("embeddings")
    
val sequenceClassifier = AlbertForSequenceClassification  
    .pretrained("albert_base_v2_rotten_tomatoes", "en")
    .setInputCols(Array("documents","token")) 
    .setOutputCol("class") 

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

val pipelineModel = pipeline.fit(data)

val pipelineDF = pipelineModel.transform(data)

Model Information

Model Name: albert_base_v2_rotten_tomatoes
Compatibility: Spark NLP 5.5.0+
License: Open Source
Edition: Official
Input Labels: [sentence, token]
Output Labels: [albert]
Language: en
Size: 42.0 MB

References

References

https://huggingface.co/textattack/albert-base-v2-rotten-tomatoes