This project aims to build a spam filter using a fine-tuned ALBERT (A Lite BERT) Transformer model. The ALBERT model, pre-trained on a large corpus of text, is fine-tuned on a spam detection dataset to create an efficient and accurate spam filter.
A transformers based deep learning for binary text classification. There are 2 classes "Spam" and "Not spam". Model and dataset is deployed on HuggingFace.
- Model: https://huggingface.co/NotShrirang/albert-spam-filter
- Dataset: https://huggingface.co/datasets/NotShrirang/email-spam-filter
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
tokenizer = AutoTokenizer.from_pretrained("NotShrirang/albert-spam-filter")
model = AutoModelForSequenceClassification.from_pretrained("NotShrirang/albert-spam-filter")
classifier = pipeline('text-classification',
model=model,
tokenizer=tokenizer
)
prediction = classifier("<Your Text>")[0]
To run this project, you will need Python and Streamlit installed on your system. You can install the required packages using the provided requirements.txt
file.
- Clone Repo:
git clone https://github.com/NotShrirang/Spam-Filter-using-ALBERT.git
- Change project directory:
cd Spam-Filter-using-ALBERT
- Get requirements:
pip install -r requirements.txt
streamlit run app.py