How Hugging Face Accelerated Development of Witty Works Writing Assistant
Witty Works' inclusive-language writing assistant began with spaCy-based linguistic feature matching, which handled about 85% of its ~2,300-word vocabulary but failed on context-dependent words like "fossil" or "flexible." On Hugging Face experts' advice, the team switched from contextualized word embeddings to Sentence Transformers sentence embeddings and used SetFit few-shot fine-tuning, feeding mpnet-base-v2 embeddings into logistic regression and KNN classifiers. Labeled data needs dropped from 100-200 to 15-20 sentences per word, and the model reached 0.92 accuracy. It was deployed on Azure without further optimization because latency was already acceptable.
Related posts
- Fine-Tune Wav2Vec2 for English ASR in Hugging Face with 🤗 Transformers
Hugging Face mediumAdeptWav2Vec2, pretrained with a contrastive masked objective on 50k+ hours of unlabeled speech, can be fine-tuned with CTC on small labeled datasets for end-to-end English ASR without a language model. The walkthrough fine-tunes the base checkpoint on the 5-hour Timit corpus using 🤗 Transformers and Datasets. It covers building a character-level CTC vocabulary (lowercasing, stripping punctuation, keeping apostrophes, mapping space to a word delimiter, and adding UNK and PAD/blank tokens), and configuring the feature extractor with a matching 16kHz sampling rate and normalization. It also explains why the base checkpoint works better without an attention mask, and evaluates with WER via jiwer while pushing checkpoints to the Hub.
- SetFit: Efficient Few-Shot Learning Without Prompts
Hugging Face mediumAdeptSetFit is a prompt-free few-shot text classification framework that first fine-tunes a Sentence Transformer contrastively on in-class/out-of-class sentence pairs built from a handful of labeled examples, then trains a classifier head on the resulting embeddings. With 8 examples per class it matches RoBERTa Large fine-tuned on 3k examples on Customer Reviews, beats GPT-3 and PET on the RAFT benchmark with a 355M-parameter model, and rivals T-Few 3B while being 27x smaller. Training takes about 30 seconds on a V100 ($0.025) versus 11 minutes on an A100 for T-Few, and the setfit library trains a model in a few lines of Python; swapping in a multilingual checkpoint extends it to other languages.
- Blazingly fast whisper transcriptions with Inference Endpoints
Hugging Face easyNoviceHugging Face Inference Endpoints now offers a Whisper deployment built on vLLM that delivers up to roughly 8x higher real-time factor (RTFx) than the Transformers implementation, with comparable word error rate. It targets NVIDIA Ada Lovelace GPUs (L4, L40s) and gets its speedup from torch.compile JIT kernels, CUDA graphs that batch GPU kernel launches, and a float8 KV cache that halves cache memory versus bfloat16. Whisper Large V3, V3-Turbo and Distil-Whisper V3.5 were benchmarked for WER on 8 Open ASR Leaderboard datasets and for RTFx on 45+ minute rev16 audio using a single L4. Deployment is one click, and the endpoint is called through an OpenAI-style /audio/transcriptions HTTP API; a FastRTC demo shows real-time transcription.
- SetFitABSA: Few-Shot Aspect Based Sentiment Analysis using SetFit
Hugging Face mediumAdeptSetFitABSA performs few-shot aspect-based sentiment analysis in three stages: spaCy extracts noun and noun-compound aspect candidates, one SetFit model classifies each candidate as aspect or non-aspect, and a second SetFit model assigns a sentiment polarity to each aspect. Both classifiers turn token-level labeling into sentence classification by prefixing the candidate to the full sentence ("aspect_candidate:sentence"), so no prompts are needed. On SemEval-2014 Laptop and Restaurant data, the two 110M-parameter MPNet models beat fine-tuned T5 and GPT2 when training data is scarce and match or beat 7B Llama-2-chat with in-context learning. A full model trains in about 10 minutes on a free Colab T4 through the setfit library's AbsaTrainer and AbsaModel APIs.
- Training and Finetuning Embedding Models with Sentence Transformers
Hugging Face mediumAdeptSentence Transformers v3 trains and finetunes embedding models through a SentenceTransformerTrainer that combines Hugging Face datasets, a loss function, optional training arguments and evaluators. Finetuning matters because each task needs its own notion of similarity. Dataset column order must match the chosen loss's inputs, with an optional "label" or "score" column, and extraneous columns must be removed. A worked example finetunes MPNet on AllNLI triplets with MultipleNegativesRankingLoss and a no-duplicates batch sampler, and evaluates with TripletEvaluator and EmbeddingSimilarityEvaluator on STSb.