TLDRocket
Sign in

Tools & Coding

975 summarised stories in Tools & Coding, each linking back to the original source. Browse all topics →

Friday, 11 March 2022

Guiding Text Generation with Constrained Beam Search in 🤗 Transformers

Hugging Face 4 years ago 15

Hugging Face's Transformers library now supports constrained beam search, which allows users to force specific words or phrases into generated text outputs during the decoding process. The feature uses a "bank" system that organizes candidate sequences by their progress toward fulfilling constraints, then selects from these banks in round-robin fashion to balance constraint satisfaction with output quality. This enables applications like machine translation where certain words must appear in the output, or where users can specify alternative word forms that should appear at least once.

The daily briefing

Every AI story that matters, in your inbox by 8am.

TLDRocket reads all relevant sources, removes duplicate coverage, and summarises the day in two minutes. Follow companies and topics for alerts, or get the briefing in Slack. Free, no spam, unsubscribe anytime.