deberta-v3-small-sp500-edgar-10k
20
license:mit
by
pszemraj
Other
OTHER
New
20 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary
AI model with specialized capabilities.
Code Examples
pszemraj/deberta-v3-small-sp500-edgar-10kpythontransformers
import json
from transformers import pipeline
from huggingface_hub import hf_hub_download
model_repo_name = "pszemraj/deberta-v3-small-sp500-edgar-10k"
pipe = pipeline("text-classification", model=model_repo_name)
pipe.tokenizer.model_max_length = 1024
# Download the regression_config.json file
regression_config_path = hf_hub_download(
repo_id=model_repo_name, filename="regression_config.json"
)
with open(regression_config_path, "r") as f:
regression_config = json.load(f)
def inverse_scale(prediction, config):
"""apply inverse scaling to a prediction"""
min_value, max_value = config["min_value"], config["max_value"]
return prediction * (max_value - min_value) + min_value
def predict_with_pipeline(text, pipe, config, ndigits=5):
result = pipe(text, truncation=True)[0]
scaled_score = inverse_scale(result['score'], config)
return round(scaled_score, ndigits)
text = "This is an example text for regression prediction."
# Get predictions
predictions = predict_with_pipeline(text, pipe, regression_config)
print("Predicted Value:", predictions)Deploy This Model
Production-ready deployment in minutes
Together.ai
Instant API access to this model
Production-ready inference API. Start free, scale to millions.
Try Free APIReplicate
One-click model deployment
Run models in the cloud with simple API. No DevOps required.
Deploy NowDisclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.