--- license: apache-2.0 language: - en library_name: transformers pipeline_tag: text-classification --- # Distil BERT Base Uncased Text Classification Model This repository contains a Distil BERT Base Uncased model that has been fine-tuned for a custom text classification use case. The model is designed to classify text into nine different classes based on the following categories: 1. **Neutral**: This class is for any other sort of sentences that do not fall into the specific categories below. 2. **Play**: Use this class to classify the intent of the user to listen to music or audio. 3. **Visit**: This class is intended for classifying the user's intent to visit or open a website in a web browser. 4. **ImgReco**: Use this class to make the bot process an image for image-to-text conversion or any image recognition tasks. 5. **Close**: For classifying sentences that indicate the user's intent to close a specific application or software. 6. **Web Search**: This class is designed to identify the user's intent to search the internet for information. 7. **Open**: Use this class for classifying the intent of opening a specific app or software. 8. **ImgGen**: This class is for sentences related to text-to-image processing or image generation tasks. 9. **Math**: Classify sentences that include mathematical equations or expressions using this category. ## Model Details - **Model Architecture**: Distil BERT Base Uncased - **Number of Classes**: 9 - **Training Data**: The model was trained on a custom dataset for text classification tasks related to the mentioned categories. ## Usage You can use this fine-tuned Distil BERT model for text classification in your own applications or projects. Here's a simple example of how to use the model in Python: ```python from transformers import DistilBertTokenizer, DistilBertForSequenceClassification import torch # Load the pre-trained model and tokenizer tokenizer = DistilBertTokenizer.from_pretrained("distilbert-base-uncased") model = DistilBertForSequenceClassification.from_pretrained("your_model_directory_path") # Prepare the input text text = "Your input text goes here." # Tokenize the text and classify it input_ids = tokenizer.encode(text, truncation=True, padding=True, return_tensors="pt") output = model(input_ids) logits = output.logits probabilities = logits.softmax(dim=1) # Get the class with the highest probability predicted_class = torch.argmax(probabilities) # The predicted_class variable will contain the predicted class index. ``` Remember to replace `"your_model_directory_path"` with the actual path to the fine-tuned model on your system. ## Training To fine-tune this model for your own custom use case, you can use the Hugging Face Transformers library along with your custom dataset. Refer to the [Hugging Face Transformers documentation](https://huggingface.co/transformers/main_classes/configuration.html) for more details on training and fine-tuning. ## License Please refer to the licenses associated with the Distil BERT Base Uncased model and any other relevant libraries or datasets you used during fine-tuning. If you have any questions or need further assistance, please feel free to reach out.