Welcome to skeval
skeval is a lightweight PyTorch-powered library for classifying and evaluating the semantic type of sentences — facts, emotions, opinions, and instructions.
It fills the gap that standard LLM benchmarks leave open: not how fluent the output is, but what kind of language it uses.
Contents
Quickstart
Install the package:
pip install skeval
Train a classifier and evaluate it in a few lines:
from skeval.classifier import SentenceClassifier
from skeval.evaluator import Evaluator
classifier = SentenceClassifier(embed_dim=64, epochs=20)
sentences = [
"Water boils at 100 degrees Celsius",
"I feel happy today",
"I think pizza is the best food",
"Please close the door",
]
labels = ["fact", "emotion", "opinion", "instruction"]
classifier.fit(sentences, labels)
predictions = classifier.predict(["The sky is blue", "I am sad"])
print(predictions) # e.g. ['fact', 'emotion']
evaluator = Evaluator()
results = evaluator.evaluate(predictions, ["fact", "emotion"])
print(results["accuracy"])
Key Features
Four semantic categories out of the box:
fact,emotion,opinion,instructionCustom labels — bring any label taxonomy you need
sklearn-compatible — works with
GridSearchCV,Pipeline, andcross_val_scoreSave / load trained models to disk
Evaluation metrics — accuracy, per-class precision / recall / F1, confusion matrix
Probability outputs —
predict_proba()for LIME, SHAP, and ONNX compatibilityModel selection —
train_test_splitandcross_val_scoreinskeval.model_selectionDataset utilities — load from CSV or JSON Lines files
Training scripts — CLI scripts for training and evaluation without writing Python