Text Generation
Transformers
Safetensors
English
modernbert
fill-mask
sentiment-control
continuous-control
controllable-text-generation
encoder-generation
non-autoregressive
masked-language-model
text-style-transfer
data-augmentation
emnlp2026
Run this model with HF Jobs
Run shawhed/SenseShift-large on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/shawhed/SenseShift-large. Ask me which dataset to train on, then push the LoRA adapter to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs and Transformers to run batch inference with https://huggingface.co/shawhed/SenseShift-large on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the predictions back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs and Lighteval to evaluate https://huggingface.co/shawhed/SenseShift-large. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/shawhed/SenseShift-large with Transformers and bitsandbytes. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use shawhed/SenseShift-large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shawhed/SenseShift-large with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="shawhed/SenseShift-large")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("shawhed/SenseShift-large") model = AutoModelForMaskedLM.from_pretrained("shawhed/SenseShift-large", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use shawhed/SenseShift-large with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shawhed/SenseShift-large" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shawhed/SenseShift-large", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/shawhed/SenseShift-large
- SGLang
How to use shawhed/SenseShift-large with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "shawhed/SenseShift-large" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shawhed/SenseShift-large", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "shawhed/SenseShift-large" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shawhed/SenseShift-large", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use shawhed/SenseShift-large with Docker Model Runner:
docker model run hf.co/shawhed/SenseShift-large
Emphasise encoder generation and continuous control; add measured sweep
Browse files1 unmodified line23456789101112131415161718192021222388 unmodified lines1121131141151161171181191201 unmodified linelicense: apache-2.0base_model: answerdotai/ModernBERT-largelibrary_name: transformerspipeline_tag: fill-masktags:- sentiment-control- controllable-text-generation- text-rewriting- modernbertlanguage:- en---# SenseShift-largeSenseShift rewrites a sentence β or writes a new one β at **any sentiment you askfor on a continuous β1.0 to +1.0 scale**, while keeping it consistent with thesurrounding text.It is a masked language model fine-tuned from ModernBERT-large with an explicit**control vocabulary**: 21 special tokens `[-1.0] β¦ [1.0]` on a 0.1 grid. Attraining time every sentence is prefixed with its own VADER sentiment token and88 unmodified lines- English only; trained on short narrative and review-style text.- VADER supplies the sentiment labels, so the model inherits its lexicon-basedview of sentiment. `achieved_sentiment` typically lands within ~0.2 of thetarget rather than hitting it exactly.- The rewrite is length-bounded by `num_masks`, so very long sentences areusually replaced by something shorter.- Because the whole passage is re-encoded per mask fill, generation cost growswith `num_masks Γ beam_size`.1 unmodified line234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636488 unmodified lines1531541551561571581591601611621631641651661671 unmodified linelicense: apache-2.0base_model: answerdotai/ModernBERT-largelibrary_name: transformerspipeline_tag: text2text-generationinference: falsetags:- sentiment-control- continuous-control- controllable-text-generation- encoder-generation- non-autoregressive- masked-language-model- text-style-transfer- sentiment-transfer- text-rewriting- modernbert- emnlp2026language:- en---# SenseShift-large> **Generation from an encoder, with continuous control.**> An accepted EMNLP 2026 paper. Not a classifier, not a decoder β a masked LM> that *writes* text at a sentiment you dial in.SenseShift rewrites a sentence β or writes a new one β at **any sentiment you askfor on a continuous β1.0 to +1.0 scale**, while keeping it consistent with thesurrounding text.Two things make it unusual:- **Continuous, not categorical.** Most sentiment-controlled generation offersyou `positive` / `negative` / `neutral`. SenseShift takes a *number* β 21points on a 0.1 grid from β1.0 to +1.0. Sweeping the target over one sentenceof the example below, holding everything else fixed:| target | achieved | rewritten sentence || ---: | ---: | --- || β1.0 | +0.0 | He said hello and took our order. || β0.9 | β0.8 | He looked sad and we felt bad. || β0.6 | β0.6 | He was very tired from working hard. || β0.3 | +0.0 | He said hello and took our order. || +0.0 | +0.0 | He served us some food and drinks. || +0.3 | +0.3 | We ordered a salad and shared it. || +0.6 | +0.5 | He smiled and gave us our drinks. || +0.9 | +0.8 | He smiled and thanked us for coming. || +1.0 | +0.8 | He smiled and thanked us for coming. |The trend is monotone and most targets land within 0.1β0.2, but the control isnot exact: `β1.0` and `β0.3` both missed here, and the saturated ends (`Β±1.0`)tend to collapse onto their `Β±0.9` neighbours. Treat the dial as a strongsteer, not a guarantee β and check `out.achieved_sentiment` if you need one.- **The generator is an encoder.** Text generation is nearly alwaysautoregressive decoding. SenseShift generates by iteratively filling maskedpositions in a bidirectional ModernBERT, so every token it writes isconditioned on the text on *both* sides. That is what lets it drop areplacement sentence into the middle of a passage and have it fit.It is a masked language model fine-tuned from ModernBERT-large with an explicit**control vocabulary**: 21 special tokens `[-1.0] β¦ [1.0]` on a 0.1 grid. Attraining time every sentence is prefixed with its own VADER sentiment token and88 unmodified lines- English only; trained on short narrative and review-style text.- VADER supplies the sentiment labels, so the model inherits its lexicon-basedview of sentiment. `achieved_sentiment` usually lands within 0.1β0.2 of thetarget, but individual targets can miss outright β see the sweep above. Thesaturated ends (`Β±1.0`) are the least reliable.- The rewrite is length-bounded by `num_masks`, so very long sentences areusually replaced by something shorter.- Because the whole passage is re-encoded per mask fill, generation cost growswith `num_masks Γ beam_size`.## CitationAccepted to **EMNLP 2026**. A preprint and the full BibTeX entry will be linkedhere once they are public.
README.md+50-3