NYXAR RoBERTa Sentiment Model
Model Description
A transformer-based sentiment classification model developed for the NYXAR AI Intelligence & Observability Platform. The model leverages a fine-tuned RoBERTa architecture optimized for customer feedback intelligence and predicts sentiment across three classes: Positive, Neutral, and Negative.
Framework: Hugging Face Transformers, ONNX Runtime, RoBERTa
Language: English
License: MIT
Base Model: roberta-base
Training Data
The model was trained on SetFit/amazon_reviews_multi_en, an English Amazon reviews dataset commonly used for sentiment classification tasks.
Intended Use
This model is designed for customer feedback analysis, product review monitoring, support ticket intelligence, sentiment trend analysis, and enterprise AI intelligence workflows.
Limitations
The model may struggle with sarcasm, irony, ambiguous sentiment expressions, domain-specific terminology not represented in the training data, and highly subjective reviews. Predictions should be used as supporting signals rather than business-critical decisions.
Performance
| Metric | Score |
|---|
| Accuracy | 77.56% |
| Precision | 77.99% |
| Recall | 77.56% |
| F1 Score | 77.76% |
Usage
Assumes tokenizer and model_quantized.onnx are in ./onnx/
1import numpy as np
2import onnxruntime as ort
3from transformers import AutoTokenizer
4from scipy.special import softmax
5
6model_path = "./onnx"
7
8# Load tokenizer
9tokenizer = AutoTokenizer.from_pretrained(model_path)
10
11# Load ONNX model
12session = ort.InferenceSession(
13 f"{model_path}/model_quantized.onnx"
14)
15
16text = "The product exceeded expectations."
17
18# Tokenize
19inputs = tokenizer(
20 text,
21 return_tensors="np",
22 truncation=True,
23 padding=True
24)
25
26# Convert tokenizer outputs to ONNX inputs
27ort_inputs = {
28 k: v.astype(np.int64)
29 for k, v in inputs.items()
30}
31
32# Run inference
33outputs = session.run(None, ort_inputs)
34
35# Get logits
36logits = outputs[0]
37
38# Compute probabilities
39probs = softmax(logits, axis=-1)
40
41prediction = int(np.argmax(probs, axis=-1)[0])
42confidence = float(np.max(probs))
43
44print(prediction, confidence)