agentlans/text-stats
Viewer • Updated • 1.97M • 25
How to use agentlans/deberta-v3-base-zyda-2-sentiment with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="agentlans/deberta-v3-base-zyda-2-sentiment") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("agentlans/deberta-v3-base-zyda-2-sentiment")
model = AutoModelForSequenceClassification.from_pretrained("agentlans/deberta-v3-base-zyda-2-sentiment")This model is a fine-tuned version of agentlans/deberta-v3-base-zyda-2 on an unknown dataset. It achieves the following results on the evaluation set:
More information needed
Example use:
import torch
import numpy as np
from transformers import AutoModelForSequenceClassification, AutoTokenizer
# Load model and tokenizer
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model_name = "agentlans/deberta-v3-base-zyda-2-sentiment"
model = AutoModelForSequenceClassification.from_pretrained(model_name, num_labels=1).to(device)
tokenizer = AutoTokenizer.from_pretrained(model_name)
# Function to perform inference
def predict_score(text):
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True).to(device)
with torch.no_grad():
logits = model(**inputs).logits
return logits.item()
# Example usage
input_text = "I accidentally the whole thing. Is that bad?"
score = predict_score(input_text)
print(f"Predicted score: {score}")
Example output:
| Text | Sentiment |
|---|---|
| Nothing seems to go right, and I'm constantly frustrated. | -2.27 |
| Everything is falling apart, and I can't see any way out. | -2.11 |
| I feel completely overwhelmed by the challenges I face. | -1.43 |
| There are some minor improvements, but overall, things are still tough. | -0.76 |
| I can see a glimmer of hope amidst the difficulties I encounter. | 0.65 |
| Things are starting to look up, and I’m cautiously optimistic. | 1.65 |
| There are many good things happening, and I appreciate them. | 2.24 |
| Every day brings new joy and possibilities; I feel truly blessed. | 2.31 |
| I’m feeling more positive about my situation than I have in a while. | 2.38 |
| Life is full of opportunities, and I'm excited about the future. | 2.55 |
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Mse |
|---|---|---|---|---|
| 0.0449 | 1.0 | 3143 | 0.0538 | 0.0538 |
| 0.0244 | 2.0 | 6286 | 0.0408 | 0.0408 |
| 0.016 | 3.0 | 9429 | 0.0426 | 0.0426 |
Base model
microsoft/deberta-v3-base