English BertForSequenceClassification Cased model (from Smone55)

Description

Pretrained BertForSequenceClassification model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP. autonlp-au_topics-452311620 is a English model originally trained by Smone55.

Predicted Entities

113, 112, 24, 98, 54, 62, 114, 69, 68, 15, 47, 45, 107, 34, 14, 37, 96, 9, 81, 51, 83, 79, 111, 27, 50, 4, 95, 101, 61, 56, 64, 104, 10, 78, 41, 55, 103, 87, 124, 120, 80, 25, 53, 22, 90, 1, 5, 29, 20, 97, 86, 32, 16, 85, 94, 105, 91, 93, 88, 48, 102, 13, 35, 40, 121, 49, 23, 63, 72, 39, 2, 109, 122, 125, 12, 21, 66, 11, 67, 30, 0, 43, 74, 58, 73, 75, 108, 38, 116, 6, 33, 123, 100, 65, 77, 19, 106, 117, 44, 8, 46, 92, 57, 115, 118, 70, 31, 17, 7, 60, 82, 110, 26, 28, 71, 59, 42, 119, 99, 18, 3, -1, 84, 36, 76, 89, 52

Download Copy S3 URI

How to use

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

tokenizer = Tokenizer() \
    .setInputCols("document") \
    .setOutputCol("token")

sequenceClassifier = BertForSequenceClassification.pretrained("bert_sequence_classifier_autonlp_au_topics_452311620","en") \
    .setInputCols(["document", "token"]) \
    .setOutputCol("class")

pipeline = Pipeline(stages=[documentAssembler, tokenizer, sequenceClassifier])

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

result = pipeline.fit(data).transform(data)
val documentAssembler = new DocumentAssembler()
    .setInputCol("text")
    .setOutputCol("document")

val tokenizer = new Tokenizer()
    .setInputCols("document")
    .setOutputCol("token")

val sequenceClassifier = BertForSequenceClassification.pretrained("bert_sequence_classifier_autonlp_au_topics_452311620","en")
    .setInputCols(Array("document", "token"))
    .setOutputCol("ner")

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: bert_sequence_classifier_autonlp_au_topics_452311620
Compatibility: Spark NLP 5.1.4+
License: Open Source
Edition: Official
Input Labels: [document, token]
Output Labels: [ner]
Language: en
Size: 1.3 GB
Case sensitive: true
Max sentence length: 128

References

References

  • https://huggingface.co/Smone55/autonlp-au_topics-452311620