Instructions to use Hugfree12/my-finetuned-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Hugfree12/my-finetuned-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Hugfree12/my-finetuned-model")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Hugfree12/my-finetuned-model") model = AutoModelForSequenceClassification.from_pretrained("Hugfree12/my-finetuned-model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Fine-Tuned DistilBERT Text Classification Model
Model Description
This repository contains a fine-tuned DistilBERT model for binary text classification.
The model was fine-tuned using a labeled text dataset and can be used to classify new text into one of two classes.
The model was developed using the Hugging Face Transformers library and PyTorch.
Model Details
- Model architecture: DistilBERT
- Task: Binary Text Classification
- Framework: PyTorch
- Library: Hugging Face Transformers
- Model format: Safetensors
- Number of parameters: Approximately 67 million
- Maximum sequence length: Depends on the preprocessing configuration
- Output: Two classification classes
Intended Use
This model is intended for:
- Text classification experiments
- Academic and research purposes
- Demonstration of Transformer fine-tuning
- Natural Language Processing (NLP) experiments
- Classification of text into two predefined categories
The model should be used only within the context of the dataset and task on which it was trained.
Not Intended For
This model should not be used:
- As a replacement for professional judgment
- For high-stakes automated decisions without human review
- Outside the domain represented by the training data without additional validation
- As a general-purpose language model
- As evidence that the model will perform equally well on unseen populations or different datasets
Training
Base Model
The model is based on the DistilBERT Transformer architecture.
DistilBERT is a smaller and faster version of BERT designed to retain much of BERT's language understanding capability while reducing computational requirements.
The pretrained model was further trained (fine-tuned) on a labeled text classification dataset.
Fine-Tuning Process
The general workflow used for this project was:
- Load the text dataset.
- Prepare the text and labels.
- Split the data into training, validation, and test sets.
- Tokenize the text using the DistilBERT tokenizer.
- Load a pretrained DistilBERT model for sequence classification.
- Fine-tune the model using the training dataset.
- Evaluate the model using the validation dataset during the training process.
- Evaluate the final model on the held-out test dataset.
- Calculate classification metrics.
- Generate a confusion matrix.
- Save the trained model and tokenizer.
- Upload the fine-tuned model to Hugging Face.
- Load the uploaded model again from Hugging Face.
- Test the loaded model on new text.
Dataset
The model was trained using a labeled text classification dataset.
The dataset contains:
- A text input
- A corresponding binary class label
The exact dataset source and dataset-specific description should be added here if required by the project.
Dataset Split
The data was divided into:
- Training set
- Validation set
- Test set
The final test set contained:
200 samples
with the following class distribution:
| Class | Number of Samples |
|---|---|
| Class 0 | 100 |
| Class 1 | 100 |
| Total | 200 |
The test set was therefore balanced between the two classes.
Labels
The model performs binary classification.
The output classes are:
| Label | Meaning |
|---|---|
| 0 | Class 0 |
| 1 | Class 1 |
Note: Replace "Class 0" and "Class 1" with the actual meaning of your labels if your project defines them differently.
For example, if your dataset defines:
0 = Negative
1 = Positive
- Downloads last month
- 21