bert tiny finetuned sms spam detection

mrm8488

Introduction

The BERT-TINY-FINETUNED-SMS-SPAM-DETECTION model is designed for text classification, specifically to detect spam in SMS messages. It has been fine-tuned on the sms_spam dataset and achieves a validation accuracy of 0.98. This model utilizes the BERT architecture and is compatible with both PyTorch and JAX frameworks.

Architecture

This model is based on the BERT architecture, which is a transformer model known for its effectiveness in various natural language processing tasks. It has been adapted to a smaller, more efficient version known as BERT-TINY, making it suitable for deployment in environments with limited computational resources.

Training

The model has been fine-tuned on the sms_spam dataset, which consists of labeled SMS messages categorized as either spam or not spam. The fine-tuning process adapted the pre-trained BERT-TINY model to effectively classify SMS messages with high accuracy.

Guide: Running Locally

  1. Set up the Environment:

    • Ensure you have Python installed.
    • Install the Hugging Face Transformers library:
      pip install transformers
      
  2. Download the Model:

    • Use the Transformers library to load the model:
      from transformers import AutoModelForSequenceClassification, AutoTokenizer
      
      model = AutoModelForSequenceClassification.from_pretrained("mrm8488/bert-tiny-finetuned-sms-spam-detection")
      tokenizer = AutoTokenizer.from_pretrained("mrm8488/bert-tiny-finetuned-sms-spam-detection")
      
  3. Inference:

    • Tokenize your SMS message and run it through the model to get predictions:
      inputs = tokenizer("Your message here", return_tensors="pt")
      outputs = model(**inputs)
      
  4. Cloud GPU Suggestion:

    • For more efficient processing, consider running the model on cloud services that provide GPU resources, such as AWS, Google Cloud, or Azure.

License

The model and its usage are subject to the license provided by the author or hosting platform. Ensure to review the license terms on the Hugging Face model page before use.

More Related APIs in Text Classification