| # RoBERTa Style Classifier | |
| This is a fine-tuned [`roberta-base`](https://huggingface.co/roberta-base) model for **writing style classification**. | |
| ## ๐ Task | |
| Given an input sentence, the model predicts the most appropriate **writing style** such as: | |
| - Empathetic | |
| - Formal | |
| - Casual | |
| - Persuasive | |
| - Technical | |
| - ... and more | |
| ## ๐ง Model Details | |
| - Base model: `roberta-base` | |
| - Max length: 256 tokens | |
| - Trained using PyTorch and Hugging Face Transformers | |
| - Dataset: Custom curated and balanced dataset with 10+ writing styles | |
| ## ๐ Usage | |
| ```python | |
| from transformers import AutoTokenizer, AutoModelForSequenceClassification | |
| import torch | |
| model = AutoModelForSequenceClassification.from_pretrained("Akshay-Sai/roberta-style-classifier") | |
| tokenizer = AutoTokenizer.from_pretrained("Akshay-Sai/roberta-style-classifier") | |
| def predict_style(text): | |
| inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=256) | |
| with torch.no_grad(): | |
| outputs = model(**inputs) | |
| pred = torch.argmax(outputs.logits, dim=1) | |
| return model.config.id2label[pred.item()] | |
| # Example | |
| text = "I understand how tough this must be for you. Stay strong." | |
| print("Predicted Style:", predict_style(text)) | |