Skip to content

About

Qev sentiment and calibrated decision experiments

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jev-sentiment

One model for yes/no sentiment judgments, emotion choices, and ordered review ratings. Give it a text, a question, and the allowed answers. It returns a probability for each answer. The benchmark covers Chinese and English reviews and social posts, with 24,709 test questions across 15 source groups.

What the model does

Question type Example Output
Noul Does the reviewer recommend the film? Probabilities for false and true
Choice Which emotion is most evident: joy, anger, or sadness? Probabilities over the options in the request
Score What star rating best matches this review? A distribution over ordered levels and an expected level on a zero-based scale

The model reads the text and question as a shared prefix. Qev represents each supplied answer on its own candidate branch. A decision head scores the candidates together and normalizes the scores within that question. This lets the same model answer questions with different candidate sets without generating an answer string. The underlying scorer and inference code come from QiqianFu/Qev. This project applies that design to sentiment tasks and compares it with two classifiers on the same test split.

Results

Each column below gives equal weight to each of the 15 source groups. Accuracy measures the top choice. Brier score measures squared error across the full candidate distribution. ECE-10 measures how closely top-choice confidence matches accuracy across 10 confidence bins. Lower is better for Brier and ECE.

Model Test accuracy, source macro Brier, source macro ECE-10, source macro
jev-sentiment-4b 0.8017 0.2722 0.0383
jev-sentiment-0.8b 0.7909 0.2857 0.0235
XLM-R 0.7599 0.3156 0.0354
Qev-4B (zero-shot) 0.7006 0.3998 0.0706
TF-IDF + logistic regression 0.5707 0.5023 0.0457
  • Fine-tuned 4B improves accuracy by 10.11 percentage points over zero-shot Qev-4B and lowers Brier from 0.3998 to 0.2722. The largest accuracy gain by question type is on Choice, from 62.83% to 77.33%.
  • The 0.8B model is 1.08 percentage points behind 4B on accuracy. It has lower ECE (0.0235 vs. 0.0383), while 4B has lower Brier (0.2722 vs. 0.2857). The two probability metrics measure different properties.
  • Exact rating prediction remains the hardest task in this split. The 4B model gets 59.36% of Score questions exactly right, compared with 77.33% on Choice and 89.45% on Noul.
Test results by question type and source

By Decision Primitive

Scores are pooled within each question type. Each cell shows accuracy / Brier / ECE-10.

Model Noul (7,982) Choice (12,728) Score (3,999)
jev-sentiment-4b 0.8945 / 0.1527 / 0.0265 0.7733 / 0.3146 / 0.0301 0.5936 / 0.5108 / 0.0203
jev-sentiment-0.8b 0.8836 / 0.1666 / 0.0128 0.7661 / 0.3235 / 0.0112 0.5831 / 0.5303 / 0.0300
XLM-R 0.8444 / 0.2039 / 0.0271 0.7525 / 0.3417 / 0.0196 0.5659 / 0.5420 / 0.0183
Qev-4B (zero-shot) 0.8558 / 0.2148 / 0.0142 0.6283 / 0.4943 / 0.0551 0.5119 / 0.6049 / 0.0292
TF-IDF + logistic regression 0.4970 / 0.5000 / 0.0062 0.6559 / 0.4683 / 0.0706 0.4776 / 0.6396 / 0.0438

By Source (Acc / Brier)

Source Qev-4B zero-shot jev-sentiment-tfidf jev-sentiment-xlm-r jev-sentiment-0.8b jev-sentiment-4b
asap 0.6310 / 0.4811 0.6635 / 0.4599 0.6990 / 0.4012 0.6850 / 0.4167 0.6845 / 0.4193
chinese_logic 0.9062 / 0.1430 0.5115 / 0.4998 0.9594 / 0.0620 0.9656 / 0.0519 0.9823 / 0.0336
chnsenticorp 0.8916 / 0.1687 0.5043 / 0.5000 0.9283 / 0.1164 0.9300 / 0.1183 0.9334 / 0.1081
douban_243k 0.4875 / 0.6250 0.4795 / 0.6288 0.6270 / 0.4715 0.6340 / 0.4735 0.6485 / 0.4356
douban_dmsc 0.5225 / 0.5984 0.4950 / 0.6195 0.5740 / 0.5261 0.5830 / 0.5174 0.6240 / 0.4765
go_emotions 0.5890 / 0.5749 0.5480 / 0.6430 0.6320 / 0.4995 0.6840 / 0.4420 0.6735 / 0.4598
imdb 0.9555 / 0.0761 0.4880 / 0.5002 0.9305 / 0.1037 0.9635 / 0.0564 0.9710 / 0.0442
nlpcc2014 0.5062 / 0.6096 0.6933 / 0.4322 0.7840 / 0.3074 0.8212 / 0.2584 0.8349 / 0.2414
rotten_tomatoes 0.9015 / 0.1633 0.4916 / 0.5001 0.8874 / 0.1663 0.8987 / 0.1545 0.9212 / 0.1151
smp2020_usual 0.6805 / 0.4395 0.7690 / 0.3491 0.8355 / 0.2413 0.8375 / 0.2261 0.8530 / 0.2080
smp2020_virus 0.4660 / 0.6731 0.7485 / 0.3507 0.8010 / 0.2851 0.8135 / 0.2610 0.8255 / 0.2468
tweeteval_irony 0.8023 / 0.2906 0.4962 / 0.5001 0.5128 / 0.5062 0.7653 / 0.3116 0.8048 / 0.2980
tweeteval_sentiment 0.7085 / 0.3967 0.5555 / 0.5719 0.7230 / 0.3795 0.7335 / 0.3690 0.7060 / 0.3937
weibo 0.7075 / 0.4126 0.4980 / 0.5000 0.7610 / 0.3252 0.7755 / 0.3097 0.7740 / 0.3074
yelp 0.7530 / 0.3448 0.6180 / 0.4790 0.7440 / 0.3421 0.7725 / 0.3197 0.7895 / 0.2960

Macro-F1 is omitted from the comparison because the Qev evaluator uses candidate positions while the baseline evaluators use semantic label IDs. The 4B results refer to the supervised checkpoint. The model repository also includes a checkpoint trained with a calibration reward, whose test metrics are not reported here.

Try it on your own text

From a clone of this repository, use Python 3.10+ and a CUDA device for this example. The loader downloads the 0.8B checkpoint and its Qwen3.5 base on first use.

python -m pip install -e ./Qev
cat > review.jsonl <<'EOF'
{"id":"review-1","state":"The cinematography was beautiful, but the story felt flat and I wouldn't recommend it.","questions":{"recommend":{"type":"noul","instructions":"Does the reviewer recommend the film?"},"sentiment":{"type":"choice","instructions":"What is the overall sentiment?","criteria":{"positive":"Mostly favorable","mixed":"A balance of praise and criticism","negative":"Mostly unfavorable"}},"rating":{"type":"score","instructions":"Which star rating best matches the review?","criteria":["1 star","2 stars","3 stars","4 stars","5 stars"]}}}
EOF
qev-predict --checkpoint Lensarism/jev-sentiment-0.8b \
  --input review.jsonl --out predictions.jsonl

The output JSONL contains a predicted candidate ID and a probability for each supplied candidate. Use a new output filename when rerunning the example. For 4B, download the model repository and pass its sft/ or rlcr/ directory as --checkpoint. The corresponding base model is recorded in each checkpoint. 4B loading instructions

Data, training, and evaluation

The historical benchmark has 269,271 train, 6,750 dev, and 24,709 test questions. Source groups include IMDb, Douban, Yelp, Weibo, GoEmotions, and TweetEval. The original manifest lists the sample counts by split and source.

To build a fresh dataset from local source files, run the command below after setting up the source layout and dependencies. It runs the source converters, deduplicates text, groups the two Douban sources by film, and writes the final splits. Evaluate the rebuilt splits separately from the historical benchmark.

python scripts/build_sentiment_dataset.py --out data/prepared/sentiment-rebuilt

The Qev training configs adapt LoRA weights and the decision head using labeled answers. Score adds a ranked probability loss on the cumulative distribution, so errors farther from the reference rating are penalized more. XLM-R uses a multilingual encoder with a head per question type. The statistical baseline uses character TF-IDF with logistic regression per question type. Qev configurations · XLM-R training · TF-IDF training

For a prepared Qev split, put manifest.json and the canonical JSONL files together in one directory. The evaluator checks the requested split against the manifest and reports metrics by question type and source.

python scripts/eval_qev.py \
  --checkpoint Lensarism/jev-sentiment-0.8b \
  --base Qwen/Qwen3.5-0.8B-Base \
  --data path/to/prepared-data \
  --split test

These comparisons describe this benchmark and these model configurations. The backbones, input limits, and heads vary across models, so the results cannot isolate the effect of candidate branching. Apache-2.0 attribution for the adapted Qev code is in Qev/NOTICE.

About

Qev sentiment and calibrated decision experiments

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages