Downloads · 30 days
10
5% of all-time downloads
Akshay-Sai/roberta-style-classifier
roberta-style-classifier is a machine learning model from Akshay-Sai. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is a fine-tuned roberta-base model for writing style classification.
Downloads · 30 days
10
5% of all-time downloads
All-time downloads
206
Public
Parameters
125M
997 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors499 MB · 100%
From the Hugging Face model README
This is a fine-tuned roberta-base model for writing style classification.
Given an input sentence, the model predicts the most appropriate writing style such as:
roberta-basefrom 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))