Enable whisper encoder to accept any chunk length
Author: MahmoudAshraf97
Pull request: yes
Labels: name: Audio

# What does this PR do?

<!--
Congratulations! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.

Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.

Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->

<!-- Remove if not applicable -->

Enables Whisper model and encoder to run using any chunk length <= 30s, as for now, the only method to change the chunk length is to use a pipeline which might not be suitable if running a custom generation loop is needed ( continuous batching for example)


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

@sanchit-gandhi 

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- text models: @ArthurZucker
- vision models: @amyeroberts
- speech models: @sanchit-gandhi
- graph models: @clefourrier

Library:

- flax: @sanchit-gandhi
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Narsil
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @muellerzr and @SunMarc

Integrations:

- deepspeed: HF Trainer/Accelerate: @muellerzr
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc 

Documentation: @stevhliu and @MKhalusova

HF projects:

- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Maintained examples (not research project or legacy):

- Flax: @sanchit-gandhi
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1

 -->


Comments:
cc @kamilakesbi 

Hi @MahmoudAshraf97, 

Thanks for working on this. 

We haven't received any other requests to add this feature at the moment. We prefer not to add it at this time because: 

1. It will probably break compatibility with torch.compile. 
2. We haven't studied the effect of shorter chunks on whisper performance.  

@kamilakesbi 
1. As for torch compile, the behavior before and after is identical and I tested that
2. the effect of shorter chunks on whisper performance is thoroughly studied in [Distil-Whisper-Large-V2](https://huggingface.co/distil-whisper/distil-large-v2) and [Distil-Whisper-Large-V3](https://huggingface.co/distil-whisper/distil-large-v3) model cards and the paper, which use 15s and 25s respectively instead of 30s

The chunk size can already be changed when using whisper through a pipeline, and the way that works is that the features are padded with zeros  to reach 30s and this is very inefficient given that there's no need for that if the encoder can accept inputs less than 30s which is tested in other frameworks such as `tensorrt_llm` and `faster-whisper`

Merging this PR will enable us to use a pipeline without padding, speeding up the inference of the encoder part and using less memory, and also use the model directly without needing to use a pipeline just to change the chunk length


@MahmoudAshraf97 thanks for explaining the benefits of using shorter chunk length! :) 

It seems you've already studied how adding this feature would affect compatibility with `torch.compile` and Whisper's performance! 

Could you please add a test to make sure the model gives the same output for audios <30 sec with and without padding (if you could add a test with batched audios that would be great). 

cc @ylacombe I would like your opinion on this feature request / PR

Please note that this PR doesn't remove padding, it just gives the ability to do so without having to use a pipeline. 
I experimented with removing the padding from the pipeline but it wasn't as trivial as I expected, as the chunking algorithm used just divides the audio with overlapping strides and that is known to cause hallucinations with whisper, when a vad chunking algoritm is used, the output is almost identical to the padded input.
I tested that by chunking the audio without relying on the current chunking algorithm, then using the feature extractor to generate the input mels, then use `.generate` method and the results were good with speedups gained from the faster encoder inference.
My experiments with removing pipeline padding included evaluating `librispeech_asr` validation set with 15s, 25s and 30s chunk lengths
15s: 8.7 WER
25s: 3.61 WER
30s: 3.61 WER

in this particular test case, 15s performed much worse because most audios are slightly longer than 15s so the second window performs badly, with longer files (>60s), I experienced no performance degradation

TLDR:  this PR is backwards compatible, no behavior changes are expected for all usecases except when using `WhisperModel.encoder.forward`  or `WhisperModel.generate` directly which isn't a popular use case, but I need it for a tutorial that I'm making that explains how to implement continuous batching using HF transformers (2x speedup!, advice is appreciated on where it should be placed in the examples folder)


<details>
  <summary>Testing Code</summary>

```python
import argparse
import json
import os

import transformers

from datasets import load_dataset
from evaluate import load
from tqdm import tqdm
from transformers.models.whisper.english_normalizer import EnglishTextNormalizer

parser = argparse.ArgumentParser(description="WER benchmark")
parser.add_argument(
    "--audio_numb",
    type=int,
    default=None,
    help="Specify the number of validation audio files in the dataset."
    " Set to None to retrieve all audio files.",
)
args = parser.parse_args()

model = transformers.WhisperForConditionalGeneration.from_pretrained(
    "distil-whisper/distil-medium.en",
    device_map="auto",
    attn_implementation="sdpa",
)
processor = transformers.AutoProcessor.from_pretrained("distil-whisper/distil-medium.en")

# load the dataset with streaming mode
dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True)

# define the evaluation metric
wer_metric = load("wer")

with open(os.path.join(os.path.dirname(__file__), "normalizer.json"), "r") as f:
    normalizer = EnglishTextNormalizer(json.load(f))

pipe = transformers.pipeline(
    "automatic-speech-recognition",
    model=model,
    tokenizer=processor.tokenizer,
    feature_extractor=processor.feature_extractor,
    max_new_tokens=128,
    chunk_length_s=25,
    batch_size=16,
)

def inference(batch):
    raw = []
    for sample in batch["audio"]:
        raw.append(sample["array"])
    batch["transcriptions"] = [result["text"] for result in pipe(raw)]
    return batch



dataset = dataset.map(function=inference, batched=True, batch_size=16)

all_transcriptions = []
all_references = []

# iterate over the dataset and run inference
for i, result in tqdm(enumerate(dataset), desc="Evaluating..."):
    all_transcriptions.append(result["transcriptions"])
    all_references.append(result["text"])
    if args.audio_numb and i == (args.audio_numb - 1):
        break

# normalize predictions and references
all_transcriptions = [normalizer(transcription) for transcription in all_transcriptions]
all_references = [normalizer(reference) for reference in all_references]

# compute the WER metric
wer = 100 * wer_metric.compute(
    predictions=all_transcriptions, references=all_references
)
print("WER: %.3f" % wer)
```
`normalizer.json`
```json
{
  "accessorise": "accessorize",
  "accessorised": "accessorized",
  "accessorises": "accessorizes",
  "accessorising": "accessorizing",
  "acclimatisation": "acclimatization",
  "acclimatise": "acclimatize",
  "acclimatised": "acclimatized",
  "acclimatises": "acclimatizes",
  "acclimatising": "acclimatizing",
  "accoutrements": "accouterments",
  "aeon": "eon",
  "aeons": "eons",
  "aerogramme": "aerogram",
  "aerogrammes": "aerograms",
  "aeroplane": "airplane",
  "aeroplanes": "airplanes",
  "aesthete": "esthete",
  "aesthetes": "esthetes",
  "aesthetic": "esthetic",
  "aesthetically": "esthetically",
  "aesthetics": "esthetics",
  "aetiology": "etiology",
  "ageing": "aging",
  "aggrandisement": "aggrandizement",
  "agonise": "agonize",
  "agonised": "agonized",
  "agonises": "agonizes",
  "agonising": "agonizing",
  "agonisingly": "agonizingly",
  "almanack": "almanac",
  "almanacks": "almanacs",
  "aluminium": "aluminum",
  "amortisable": "amortizable",
  "amortisation": "amortization",
  "amortisations": "amortizations",
  "amortise": "amortize",
  "amortised": "amortized",
  "amortises": "amortizes",
  "amortising": "amortizing",
  "amphitheatre": "amphitheater",
  "amphitheatres": "amphitheaters",
  "anaemia": "anemia",
  "anaemic": "anemic",
  "anaesthesia": "anesthesia",
  "anaesthetic": "anesthetic",
  "anaesthetics": "anesthetics",
  "anaesthetise": "anesthetize",
  "anaesthetised": "anesthetized",
  "anaesthetises": "anesthetizes",
  "anaesthetising": "anesthetizing",
  "anaesthetist": "anesthetist",
  "anaesthetists": "anesthetists",
  "anaesthetize": "anesthetize",
  "anaesthetized": "anesthetized",
  "anaesthetizes": "anesthetizes",
  "anaesthetizing": "anesthetizing",
  "analogue": "analog",
  "analogues": "analogs",
  "analyse": "analyze",
  "analysed": "analyzed",
  "analyses": "analyzes",
  "analysing": "analyzing",
  "anglicise": "anglicize",
  "anglicised": "anglicized",
  "anglicises": "anglicizes",
  "anglicising": "anglicizing",
  "annualised": "annualized",
  "antagonise": "antagonize",
  "antagonised": "antagonized",
  "antagonises": "antagonizes",
  "antagonising": "antagonizing",
  "apologise": "apologize",
  "apologised": "apologized",
  "apologises": "apologizes",
  "apologising": "apologizing",
  "appal": "appall",
  "appals": "appalls",
  "appetiser": "appetizer",
  "appetisers": "appetizers",
  "appetising": "appetizing",
  "appetisingly": "appetizingly",
  "arbour": "arbor",
  "arbours": "arbors",
  "archaeologically": "archeologically",
  "archaeologist": "archeologist",
  "archaeologists": "archeologists",
  "archaeology": "archeology</span>",
  "archeological": "archaeological",
  "ardour": "ardor",
  "armour": "armor",
  "armoured": "armored",
  "armourer": "armorer",
  "armourers": "armorers",
  "armouries": "armories",
  "armoury": "armory",
  "artefact": "artifact",
  "artefacts": "artifacts",
  "authorise": "authorize",
  "authorised": "authorized",
  "authorises": "authorizes",
  "authorising": "authorizing",
  "axe": "ax",
  "backpedalled": "backpedaled",
  "backpedalling": "backpedaling",
  "bannister": "banister",
  "bannisters": "banisters",
  "baptise": "baptize",
  "baptised": "baptized",
  "baptises": "baptizes",
  "baptising": "baptizing",
  "bastardise": "bastardize",
  "bastardised": "bastardized",
  "bastardises": "bastardizes",
  "bastardising": "bastardizing",
  "battleax": "battleaxe",
  "baulk": "balk",
  "baulked": "balked",
  "baulking": "balking",
  "baulks": "balks",
  "bedevilled": "bedeviled",
  "bedevilling": "bedeviling",
  "behaviour": "behavior",
  "behavioural": "behavioral",
  "behaviourism": "behaviorism",
  "behaviourist": "behaviorist",
  "behaviourists": "behaviorists",
  "behaviours": "behaviors",
  "behove": "behoove",
  "behoved": "behooved",
  "behoves": "behooves",
  "bejewelled": "bejeweled",
  "belabour": "belabor",
  "belaboured": "belabored",
  "belabouring": "belaboring",
  "belabours": "belabors",
  "bevelled": "beveled",
  "bevvies": "bevies",
  "bevvy": "bevy",
  "biassed": "biased",
  "biassing": "biasing",
  "bingeing": "binging",
  "bougainvillaea": "bougainvillea",
  "bougainvillaeas": "bougainvilleas",
  "bowdlerise": "bowdlerize",
  "bowdlerised": "bowdlerized",
  "bowdlerises": "bowdlerizes",
  "bowdlerising": "bowdlerizing",
  "breathalyse": "breathalyze",
  "breathalysed": "breathalyzed",
  "breathalyser": "breathalyzer",
  "breathalysers": "breathalyzers",
  "breathalyses": "breathalyzes",
  "breathalysing": "breathalyzing",
  "brutalise": "brutalize",
  "brutalised": "brutalized",
  "brutalises": "brutalizes",
  "brutalising": "brutalizing",
  "busses": "buses",
  "bussing": "busing",
  "caesarean": "cesarean",
  "caesareans": "cesareans",
  "calibre": "caliber",
  "calibres": "calibers",
  "calliper": "caliper",
  "callipers": "calipers",
  "callisthenics": "calisthenics",
  "canalise": "canalize",
  "canalised": "canalized",
  "canalises": "canalizes",
  "canalising": "canalizing",
  "cancelation": "cancellation",
  "cancelations": "cancellations",
  "cancelled": "canceled",
  "cancelling": "canceling",
  "candour": "candor",
  "cannibalise": "cannibalize",
  "cannibalised": "cannibalized",
  "cannibalises": "cannibalizes",
  "cannibalising": "cannibalizing",
  "canonise": "canonize",
  "canonised": "canonized",
  "canonises": "canonizes",
  "canonising": "canonizing",
  "capitalise": "capitalize",
  "capitalised": "capitalized",
  "capitalises": "capitalizes",
  "capitalising": "capitalizing",
  "caramelise": "caramelize",
  "caramelised": "caramelized",
  "caramelises": "caramelizes",
  "caramelising": "caramelizing",
  "carbonise": "carbonize",
  "carbonised": "carbonized",
  "carbonises": "carbonizes",
  "carbonising": "carbonizing",
  "carolled": "caroled",
  "carolling": "caroling",
  "catalogue": "catalog",
  "catalogued": "cataloged",
  "catalogues": "catalogs",
  "cataloguing": "cataloging",
  "catalyse": "catalyze",
  "catalysed": "catalyzed",
  "catalyses": "catalyzes",
  "catalysing": "catalyzing",
  "categorise": "categorize",
  "categorised": "categorized",
  "categorises": "categorizes",
  "categorising": "categorizing",
  "cauterise": "cauterize",
  "cauterised": "cauterized",
  "cauterises": "cauterizes",
  "cauterising": "cauterizing",
  "cavilled": "caviled",
  "cavilling": "caviling",
  "centigramme": "centigram",
  "centigrammes": "centigrams",
  "centilitre": "centiliter",
  "centilitres": "centiliters",
  "centimetre": "centimeter",
  "centimetres": "centimeters",
  "centralise": "centralize",
  "centralised": "centralized",
  "centralises": "centralizes",
  "centralising": "centralizing",
  "centre": "center",
  "centred": "centered",
  "centrefold": "centerfold",
  "centrefolds": "centerfolds",
  "centrepiece": "centerpiece",
  "centrepieces": "centerpieces",
  "centres": "centers",
  "channelled": "channeled",
  "channelling": "channeling",
  "characterise": "characterize",
  "characterised": "characterized",
  "characterises": "characterizes",
  "characterising": "characterizing",
  "cheque": "check",
  "chequebook": "checkbook",
  "chequebooks": "checkbooks",
  "chequered": "checkered",
  "cheques": "checks",
  "chilli": "chili",
  "chimaera": "chimera",
  "chimaeras": "chimeras",
  "chiselled": "chiseled",
  "chiselling": "chiseling",
  "circularise": "circularize",
  "circularised": "circularized",
  "circularises": "circularizes",
  "circularising": "circularizing",
  "civilise": "civilize",
  "civilised": "civilized",
  "civilises": "civilizes",
  "civilising": "civilizing",
  "clamour": "clamor",
  "clamoured": "clamored",
  "clamouring": "clamoring",
  "clamours": "clamors",
  "clangour": "clangor",
  "clarinettist": "clarinetist",
  "clarinettists": "clarinetists",
  "collectivise": "collectivize",
  "collectivised": "collectivized",
  "collectivises": "collectivizes",
  "collectivising": "collectivizing",
  "colonisation": "colonization",
  "colonise": "colonize",
  "colonised": "colonized",
  "coloniser": "colonizer",
  "colonisers": "colonizers",
  "colonises": "colonizes",
  "colonising": "colonizing",
  "colour": "color",
  "colourant": "colorant",
  "colourants": "colorants",
  "coloured": "colored",
  "coloureds": "coloreds",
  "colourful": "colorful",
  "colourfully": "colorfully",
  "colouring": "coloring",
  "colourize": "colorize",
  "colourized": "colorized",
  "colourizes": "colorizes",
  "colourizing": "colorizing",
  "colourless": "colorless",
  "colours": "colors",
  "commercialise": "commercialize",
  "commercialised": "commercialized",
  "commercialises": "commercializes",
  "commercialising": "commercializing",
  "compartmentalise": "compartmentalize",
  "compartmentalised": "compartmentalized",
  "compartmentalises": "compartmentalizes",
  "compartmentalising": "compartmentalizing",
  "computerise": "computerize",
  "computerised": "computerized",
  "computerises": "computerizes",
  "computerising": "computerizing",
  "conceptualise": "conceptualize",
  "conceptualised": "conceptualized",
  "conceptualises": "conceptualizes",
  "conceptualising": "conceptualizing",
  "connexion": "connection",
  "connexions": "connections",
  "contextualise": "contextualize",
  "contextualised": "contextualized",
  "contextualises": "contextualizes",
  "contextualising": "contextualizing",
  "cosier": "cozier",
  "cosies": "cozies",
  "cosiest": "coziest",
  "cosily": "cozily",
  "cosiness": "coziness",
  "cosy": "cozy",
  "councillor": "councilor",
  "councillors": "councilors",
  "counselled": "counseled",
  "counselling": "counseling",
  "counsellor": "counselor",
  "counsellors": "counselors",
  "crenelated": "crenellated",
  "criminalise": "criminalize",
  "criminalised": "criminalized",
  "criminalises": "criminalizes",
  "criminalising": "criminalizing",
  "criticise": "criticize",
  "criticised": "criticized",
  "criticises": "criticizes",
  "criticising": "criticizing",
  "crueller": "crueler",
  "cruellest": "cruelest",
  "crystallisation": "crystallization",
  "crystallise": "crystallize",
  "crystallised": "crystallized",
  "crystallises": "crystallizes",
  "crystallising": "crystallizing",
  "cudgelled": "cudgeled",
  "cudgelling": "cudgeling",
  "customise": "customize",
  "customised": "customized",
  "customises": "customizes",
  "customising": "customizing",
  "cypher": "cipher",
  "cyphers": "ciphers",
  "decentralisation": "decentralization",
  "decentralise": "decentralize",
  "decentralised": "decentralized",
  "decentralises": "decentralizes",
  "decentralising": "decentralizing",
  "decriminalisation": "decriminalization",
  "decriminalise": "decriminalize",
  "decriminalised": "decriminalized",
  "decriminalises": "decriminalizes",
  "decriminalising": "decriminalizing",
  "defence": "defense",
  "defenceless": "defenseless",
  "defences": "defenses",
  "dehumanisation": "dehumanization",
  "dehumanise": "dehumanize",
  "dehumanised": "dehumanized",
  "dehumanises": "dehumanizes",
  "dehumanising": "dehumanizing",
  "demeanour": "demeanor",
  "demilitarisation": "demilitarization",
  "demilitarise": "demilitarize",
  "demilitarised": "demilitarized",
  "demilitarises": "demilitarizes",
  "demilitarising": "demilitarizing",
  "demobilisation": "demobilization",
  "demobilise": "demobilize",
  "demobilised": "demobilized",
  "demobilises": "demobilizes",
  "demobilising": "demobilizing",
  "democratisation": "democratization",
  "democratise": "democratize",
  "democratised": "democratized",
  "democratises": "democratizes",
  "democratising": "democratizing",
  "demonise": "demonize",
  "demonised": "demonized",
  "demonises": "demonizes",
  "demonising": "demonizing",
  "demoralisation": "demoralization",
  "demoralise": "demoralize",
  "demoralised": "demoralized",
  "demoralises": "demoralizes",
  "demoralising": "demoralizing",
  "denationalisation": "denationalization",
  "denationalise": "denationalize",
  "denationalised": "denationalized",
  "denationalises": "denationalizes",
  "denationalising": "denationalizing",
  "deodorise": "deodorize",
  "deodorised": "deodorized",
  "deodorises": "deodorizes",
  "deodorising": "deodorizing",
  "depersonalise": "depersonalize",
  "depersonalised": "depersonalized",
  "depersonalises": "depersonalizes",
  "depersonalising": "depersonalizing",
  "deputise": "deputize",
  "deputised": "deputized",
  "deputises": "deputizes",
  "deputising": "deputizing",
  "desensitisation": "desensitization",
  "desensitise": "desensitize",
  "desensitised": "desensitized",
  "desensitises": "desensitizes",
  "desensitising": "desensitizing",
  "destabilisation": "destabilization",
  "destabilise": "destabilize",
  "destabilised": "destabilized",
  "destabilises": "destabilizes",
  "destabilising": "destabilizing",
  "dialled": "dialed",
  "dialling": "dialing",
  "dialogue": "dialog",
  "dialogues": "dialogs",
  "diarrhoea": "diarrhea",
  "digitise": "digitize",
  "digitised": "digitized",
  "digitises": "digitizes",
  "digitising": "digitizing",
  "disc": "disk",
  "discolour": "discolor",
  "discoloured": "discolored",
  "discolouring": "discoloring",
  "discolours": "discolors",
  "discs": "disks",
  "disembowelled": "disemboweled",
  "disembowelling": "disemboweling",
  "disfavour": "disfavor",
  "dishevelled": "disheveled",
  "dishonour": "dishonor",
  "dishonourable": "dishonorable",
  "dishonourably": "dishonorably",
  "dishonoured": "dishonored",
  "dishonouring": "dishonoring",
  "dishonours": "dishonors",
  "disorganisation": "disorganization",
  "disorganised": "disorganized",
  "distil": "distill",
  "distils": "distills",
  "dramatisation": "dramatization",
  "dramatisations": "dramatizations",
  "dramatise": "dramatize",
  "dramatised": "dramatized",
  "dramatises": "dramatizes",
  "dramatising": "dramatizing",
  "draught": "draft",
  "draughtboard": "draftboard",
  "draughtboards": "draftboards",
  "draughtier": "draftier",
  "draughtiest": "draftiest",
  "draughts": "drafts",
  "draughtsman": "draftsman",
  "draughtsmanship": "draftsmanship",
  "draughtsmen": "draftsmen",
  "draughtswoman": "draftswoman",
  "draughtswomen": "draftswomen",
  "draughty": "drafty",
  "drivelled": "driveled",
  "drivelling": "driveling",
  "duelled": "dueled",
  "duelling": "dueling",
  "economise": "economize",
  "economised": "economized",
  "economises": "economizes",
  "economising": "economizing",
  "editorialise": "editorialize",
  "editorialised": "editorialized",
  "editorialises": "editorializes",
  "editorialising": "editorializing",
  "edoema": "edema",
  "empathise": "empathize",
  "empathised": "empathized",
  "empathises": "empathizes",
  "empathising": "empathizing",
  "emphasise": "emphasize",
  "emphasised": "emphasized",
  "emphasises": "emphasizes",
  "emphasising": "emphasizing",
  "enamelled": "enameled",
  "enamelling": "enameling",
  "enamoured": "enamored",
  "encyclopaedia": "encyclopedia",
  "encyclopaedias": "encyclopedias",
  "encyclopaedic": "encyclopedic",
  "endeavour": "endeavor",
  "endeavoured": "endeavored",
  "endeavouring": "endeavoring",
  "endeavours": "endeavors",
  "energise": "energize",
  "energised": "energized",
  "energises": "energizes",
  "energising": "energizing",
  "enrol": "enroll",
  "enrols": "enrolls",
  "enthral": "enthrall",
  "enthrals": "enthralls",
  "epaulette": "epaulet",
  "epaulettes": "epaulets",
  "epicentre": "epicenter",
  "epicentres": "epicenters",
  "epilogue": "epilog",
  "epilogues": "epilogs",
  "epitomise": "epitomize",
  "epitomised": "epitomized",
  "epitomises": "epitomizes",
  "epitomising": "epitomizing",
  "equalisation": "equalization",
  "equalise": "equalize",
  "equalised": "equalized",
  "equaliser": "equalizer",
  "equalisers": "equalizers",
  "equalises": "equalizes",
  "equalising": "equalizing",
  "eulogise": "eulogize",
  "eulogised": "eulogized",
  "eulogises": "eulogizes",
  "eulogising": "eulogizing",
  "evangelise": "evangelize",
  "evangelised": "evangelized",
  "evangelises": "evangelizes",
  "evangelising": "evangelizing",
  "exorcise": "exorcize",
  "exorcised": "exorcized",
  "exorcises": "exorcizes",
  "exorcising": "exorcizing",
  "extemporisation": "extemporization",
  "extemporise": "extemporize",
  "extemporised": "extemporized",
  "extemporises": "extemporizes",
  "extemporising": "extemporizing",
  "externalisation": "externalization",
  "externalisations": "externalizations",
  "externalise": "externalize",
  "externalised": "externalized",
  "externalises": "externalizes",
  "externalising": "externalizing",
  "factorise": "factorize",
  "factorised": "factorized",
  "factorises": "factorizes",
  "factorising": "factorizing",
  "faecal": "fecal",
  "faeces": "feces",
  "familiarisation": "familiarization",
  "familiarise": "familiarize",
  "familiarised": "familiarized",
  "familiarises": "familiarizes",
  "familiarising": "familiarizing",
  "fantasise": "fantasize",
  "fantasised": "fantasized",
  "fantasises": "fantasizes",
  "fantasising": "fantasizing",
  "favour": "favor",
  "favourable": "favorable",
  "favourably": "favorably",
  "favoured": "favored",
  "favouring": "favoring",
  "favourite": "favorite",
  "favourites": "favorites",
  "favouritism": "favoritism",
  "favours": "favors",
  "feminise": "feminize",
  "feminised": "feminized",
  "feminises": "feminizes",
  "feminising": "feminizing",
  "fertilisation": "fertilization",
  "fertilise": "fertilize",
  "fertilised": "fertilized",
  "fertiliser": "fertilizer",
  "fertilisers": "fertilizers",
  "fertilises": "fertilizes",
  "fertilising": "fertilizing",
  "fervour": "fervor",
  "fibre": "fiber",
  "fibreglass": "fiberglass",
  "fibres": "fibers",
  "fictionalisation": "fictionalization",
  "fictionalisations": "fictionalizations",
  "fictionalise": "fictionalize",
  "fictionalised": "fictionalized",
  "fictionalises": "fictionalizes",
  "fictionalising": "fictionalizing",
  "fillet": "filet",
  "filleted": "fileted",
  "filleting": "fileting",
  "fillets": "filets",
  "finalisation": "finalization",
  "finalise": "finalize",
  "finalised": "finalized",
  "finalises": "finalizes",
  "finalising": "finalizing",
  "flautist": "flutist",
  "flautists": "flutists",
  "flavour": "flavor",
  "flavoured": "flavored",
  "flavouring": "flavoring",
  "flavourings": "flavorings",
  "flavourless": "flavorless",
  "flavours": "flavors",
  "flavoursome": "flavorsome",
  "flyer / flier": "flier / flyer",
  "foetal": "fetal",
  "foetid": "fetid",
  "foetus": "fetus",
  "foetuses": "fetuses",
  "formalisation": "formalization",
  "formalise": "formalize",
  "formalised": "formalized",
  "formalises": "formalizes",
  "formalising": "formalizing",
  "fossilisation": "fossilization",
  "fossilise": "fossilize",
  "fossilised": "fossilized",
  "fossilises": "fossilizes",
  "fossilising": "fossilizing",
  "fraternisation": "fraternization",
  "fraternise": "fraternize",
  "fraternised": "fraternized",
  "fraternises": "fraternizes",
  "fraternising": "fraternizing",
  "fulfil": "fulfill",
  "fulfilment": "fulfillment",
  "fulfils": "fulfills",
  "funnelled": "funneled",
  "funnelling": "funneling",
  "gage": "gauge",
  "gaged": "gauged",
  "gages": "gauges",
  "gaging": "gauging",
  "galvanise": "galvanize",
  "galvanised": "galvanized",
  "galvanises": "galvanizes",
  "galvanising": "galvanizing",
  "gambolled": "gamboled",
  "gambolling": "gamboling",
  "gaol": "jail",
  "gaolbird": "jailbird",
  "gaolbirds": "jailbirds",
  "gaolbreak": "jailbreak",
  "gaolbreaks": "jailbreaks",
  "gaoled": "jailed",
  "gaoler": "jailer",
  "gaolers": "jailers",
  "gaoling": "jailing",
  "gaols": "jails",
  "gasses": "gases",
  "generalisation": "generalization",
  "generalisations": "generalizations",
  "generalise": "generalize",
  "generalised": "generalized",
  "generalises": "generalizes",
  "generalising": "generalizing",
  "ghettoise": "ghettoize",
  "ghettoised": "ghettoized",
  "ghettoises": "ghettoizes",
  "ghettoising": "ghettoizing",
  "gipsies": "gypsies",
  "glamor": "glamour",
  "glamorise": "glamorize",
  "glamorised": "glamorized",
  "glamorises": "glamorizes",
  "glamorising": "glamorizing",
  "globalisation": "globalization",
  "globalise": "globalize",
  "globalised": "globalized",
  "globalises": "globalizes",
  "globalising": "globalizing",
  "glueing": "gluing",
  "goitre": "goiter",
  "goitres": "goiters",
  "gonorrhoea": "gonorrhea",
  "gramme": "gram",
  "grammes": "grams",
  "gravelled": "graveled",
  "grey": "gray",
  "greyed": "grayed",
  "greying": "graying",
  "greyish": "grayish",
  "greyness": "grayness",
  "greys": "grays",
  "grovelled": "groveled",
  "grovelling": "groveling",
  "groyne": "groin",
  "groynes": "groins",
  "gruelling": "grueling",
  "gruellingly": "gruelingly",
  "gryphon": "griffin",
  "gryphons": "griffins",
  "gynaecological": "gynecological",
  "gynaecologist": "gynecologist",
  "gynaecologists": "gynecologists",
  "gynaecology": "gynecology",
  "haematological": "hematological",
  "haematologist": "hematologist",
  "haematologists": "hematologists",
  "haematology": "hematology",
  "haemoglobin": "hemoglobin",
  "haemophilia": "hemophilia",
  "haemophiliac": "hemophiliac",
  "haemophiliacs": "hemophiliacs",
  "haemorrhage": "hemorrhage",
  "haemorrhaged": "hemorrhaged",
  "haemorrhages": "hemorrhages",
  "haemorrhaging": "hemorrhaging",
  "haemorrhoids": "hemorrhoids",
  "harbour": "harbor",
  "harboured": "harbored",
  "harbouring": "harboring",
  "harbours": "harbors",
  "harmonisation": "harmonization",
  "harmonise": "harmonize",
  "harmonised": "harmonized",
  "harmonises": "harmonizes",
  "harmonising": "harmonizing",
  "homoeopath": "homeopath",
  "homoeopathic": "homeopathic",
  "homoeopaths": "homeopaths",
  "homoeopathy": "homeopathy",
  "homogenise": "homogenize",
  "homogenised": "homogenized",
  "homogenises": "homogenizes",
  "homogenising": "homogenizing",
  "honour": "honor",
  "honourable": "honorable",
  "honourably": "honorably",
  "honoured": "honored",
  "honouring": "honoring",
  "honours": "honors",
  "hospitalisation": "hospitalization",
  "hospitalise": "hospitalize",
  "hospitalised": "hospitalized",
  "hospitalises": "hospitalizes",
  "hospitalising": "hospitalizing",
  "humanise": "humanize",
  "humanised": "humanized",
  "humanises": "humanizes",
  "humanising": "humanizing",
  "humour": "humor",
  "humoured": "humored",
  "humouring": "humoring",
  "humourless": "humorless",
  "humours": "humors",
  "hybridise": "hybridize",
  "hybridised": "hybridized",
  "hybridises": "hybridizes",
  "hybridising": "hybridizing",
  "hypnotise": "hypnotize",
  "hypnotised": "hypnotized",
  "hypnotises": "hypnotizes",
  "hypnotising": "hypnotizing",
  "hypothesise": "hypothesize",
  "hypothesised": "hypothesized",
  "hypothesises": "hypothesizes",
  "hypothesising": "hypothesizing",
  "idealisation": "idealization",
  "idealise": "idealize",
  "idealised": "idealized",
  "idealises": "idealizes",
  "idealising": "idealizing",
  "idolise": "idolize",
  "idolised": "idolized",
  "idolises": "idolizes",
  "idolising": "idolizing",
  "immobilisation": "immobilization",
  "immobilise": "immobilize",
  "immobilised": "immobilized",
  "immobiliser": "immobilizer",
  "immobilisers": "immobilizers",
  "immobilises": "immobilizes",
  "immobilising": "immobilizing",
  "immortalise": "immortalize",
  "immortalised": "immortalized",
  "immortalises": "immortalizes",
  "immortalising": "immortalizing",
  "immunisation": "immunization",
  "immunise": "immunize",
  "immunised": "immunized",
  "immunises": "immunizes",
  "immunising": "immunizing",
  "impanelled": "impaneled",
  "impanelling": "impaneling",
  "imperilled": "imperiled",
  "imperilling": "imperiling",
  "individualise": "individualize",
  "individualised": "individualized",
  "individualises": "individualizes",
  "individualising": "individualizing",
  "industrialise": "industrialize",
  "industrialised": "industrialized",
  "industrialises": "industrializes",
  "industrialising": "industrializing",
  "inflexion": "inflection",
  "inflexions": "inflections",
  "initialise": "initialize",
  "initialised": "initialized",
  "initialises": "initializes",
  "initialising": "initializing",
  "initialled": "initialed",
  "initialling": "initialing",
  "instal": "install",
  "instalment": "installment",
  "instalments": "installments",
  "instals": "installs",
  "instil": "instill",
  "instils": "instills",
  "institutionalisation": "institutionalization",
  "institutionalise": "institutionalize",
  "institutionalised": "institutionalized",
  "institutionalises": "institutionalizes",
  "institutionalising": "institutionalizing",
  "intellectualise": "intellectualize",
  "intellectualised": "intellectualized",
  "intellectualises": "intellectualizes",
  "intellectualising": "intellectualizing",
  "internalisation": "internalization",
  "internalise": "internalize",
  "internalised": "internalized",
  "internalises": "internalizes",
  "internalising": "internalizing",
  "internationalisation": "internationalization",
  "internationalise": "internationalize",
  "internationalised": "internationalized",
  "internationalises": "internationalizes",
  "internationalising": "internationalizing",
  "ionisation": "ionization",
  "ionise": "ionize",
  "ionised": "ionized",
  "ioniser": "ionizer",
  "ionisers": "ionizers",
  "ionises": "ionizes",
  "ionising": "ionizing",
  "italicise": "italicize",
  "italicised": "italicized",
  "italicises": "italicizes",
  "italicising": "italicizing",
  "itemise": "itemize",
  "itemised": "itemized",
  "itemises": "itemizes",
  "itemising": "itemizing",
  "jeopardise": "jeopardize",
  "jeopardised": "jeopardized",
  "jeopardises": "jeopardizes",
  "jeopardising": "jeopardizing",
  "jewelled": "jeweled",
  "jeweller": "jeweler",
  "jewellers": "jewelers",
  "jewellery": "jewelry",
  "judgement": "judgment",
  "kilogramme": "kilogram",
  "kilogrammes": "kilograms",
  "kilometre": "kilometer",
  "kilometres": "kilometers",
  "labelled": "labeled",
  "labelling": "labeling",
  "labour": "labor",
  "laboured": "labored",
  "labourer": "laborer",
  "labourers": "laborers",
  "labouring": "laboring",
  "labours": "labors",
  "lacklustre": "lackluster",
  "legalisation": "legalization",
  "legalise": "legalize",
  "legalised": "legalized",
  "legalises": "legalizes",
  "legalising": "legalizing",
  "legitimise": "legitimize",
  "legitimised": "legitimized",
  "legitimises": "legitimizes",
  "legitimising": "legitimizing",
  "leukaemia": "leukemia",
  "levelled": "leveled",
  "leveller": "leveler",
  "levellers": "levelers",
  "levelling": "leveling",
  "libelled": "libeled",
  "libelling": "libeling",
  "libellous": "libelous",
  "liberalisation": "liberalization",
  "liberalise": "liberalize",
  "liberalised": "liberalized",
  "liberalises": "liberalizes",
  "liberalising": "liberalizing",
  "licence": "license",
  "licenced": "licensed",
  "licences": "licenses",
  "licencing": "licensing",
  "likeable": "likable",
  "lionisation": "lionization",
  "lionise": "lionize",
  "lionised": "lionized",
  "lionises": "lionizes",
  "lionising": "lionizing",
  "liquidise": "liquidize",
  "liquidised": "liquidized",
  "liquidiser": "liquidizer",
  "liquidisers": "liquidizers",
  "liquidises": "liquidizes",
  "liquidising": "liquidizing",
  "litre": "liter",
  "litres": "liters",
  "localise": "localize",
  "localised": "localized",
  "localises": "localizes",
  "localising": "localizing",
  "louvre": "louver",
  "louvred": "louvered",
  "louvres": "louvers",
  "lustre": "luster",
  "magnetise": "magnetize",
  "magnetised": "magnetized",
  "magnetises": "magnetizes",
  "magnetising": "magnetizing",
  "manoeuvrability": "maneuverability",
  "manoeuvrable": "maneuverable",
  "manoeuvre": "maneuver",
  "manoeuvred": "maneuvered",
  "manoeuvres": "maneuvers",
  "manoeuvring": "maneuvering",
  "manoeuvrings": "maneuverings",
  "marginalisation": "marginalization",
  "marginalise": "marginalize",
  "marginalised": "marginalized",
  "marginalises": "marginalizes",
  "marginalising": "marginalizing",
  "marshalled": "marshaled",
  "marshalling": "marshaling",
  "marvelled": "marveled",
  "marvelling": "marveling",
  "marvellous": "marvelous",
  "marvellously": "marvelously",
  "materialisation": "materialization",
  "materialise": "materialize",
  "materialised": "materialized",
  "materialises": "materializes",
  "materialising": "materializing",
  "maximisation": "maximization",
  "maximise": "maximize",
  "maximised": "maximized",
  "maximises": "maximizes",
  "maximising": "maximizing",
  "meagre": "meager",
  "mechanisation": "mechanization",
  "mechanise": "mechanize",
  "mechanised": "mechanized",
  "mechanises": "mechanizes",
  "mechanising": "mechanizing",
  "mediaeval": "medieval",
  "memorialise": "memorialize",
  "memorialised": "memorialized",
  "memorialises": "memorializes",
  "memorialising": "memorializing",
  "memorise": "memorize",
  "memorised": "memorized",
  "memorises": "memorizes",
  "memorising": "memorizing",
  "mesmerise": "mesmerize",
  "mesmerised": "mesmerized",
  "mesmerises": "mesmerizes",
  "mesmerising": "mesmerizing",
  "metabolise": "metabolize",
  "metabolised": "metabolized",
  "metabolises": "metabolizes",
  "metabolising": "metabolizing",
  "metre": "meter",
  "metres": "meters",
  "mhm": "hmm",
  "micrometre": "micrometer",
  "micrometres": "micrometers",
  "militarise": "militarize",
  "militarised": "militarized",
  "militarises": "militarizes",
  "militarising": "militarizing",
  "milligramme": "milligram",
  "milligrammes": "milligrams",
  "millilitre": "milliliter",
  "millilitres": "milliliters",
  "millimetre": "millimeter",
  "millimetres": "millimeters",
  "miniaturisation": "miniaturization",
  "miniaturise": "miniaturize",
  "miniaturised": "miniaturized",
  "miniaturises": "miniaturizes",
  "miniaturising": "miniaturizing",
  "minibusses": "minibuses",
  "minimise": "minimize",
  "minimised": "minimized",
  "minimises": "minimizes",
  "minimising": "minimizing",
  "misbehaviour": "misbehavior",
  "misdemeanour": "misdemeanor",
  "misdemeanours": "misdemeanors",
  "misspelt": "misspelled",
  "mitre": "miter",
  "mitres": "miters",
  "mm": "hmm",
  "mmm": "hmm",
  "mobilisation": "mobilization",
  "mobilise": "mobilize",
  "mobilised": "mobilized",
  "mobilises": "mobilizes",
  "mobilising": "mobilizing",
  "modelled": "modeled",
  "modeller": "modeler",
  "modellers": "modelers",
  "modelling": "modeling",
  "modernise": "modernize",
  "modernised": "modernized",
  "modernises": "modernizes",
  "modernising": "modernizing",
  "moisturise": "moisturize",
  "moisturised": "moisturized",
  "moisturiser": "moisturizer",
  "moisturisers": "moisturizers",
  "moisturises": "moisturizes",
  "moisturising": "moisturizing",
  "monologue": "monolog",
  "monologues": "monologs",
  "monopolisation": "monopolization",
  "monopolise": "monopolize",
  "monopolised": "monopolized",
  "monopolises": "monopolizes",
  "monopolising": "monopolizing",
  "moralise": "moralize",
  "moralised": "moralized",
  "moralises": "moralizes",
  "moralising": "moralizing",
  "motorised": "motorized",
  "mould": "mold",
  "moulded": "molded",
  "moulder": "molder",
  "mouldered": "moldered",
  "mouldering": "moldering",
  "moulders": "molders",
  "mouldier": "moldier",
  "mouldiest": "moldiest",
  "moulding": "molding",
  "mouldings": "moldings",
  "moulds": "molds",
  "mouldy": "moldy",
  "moult": "molt",
  "moulted": "molted",
  "moulting": "molting",
  "moults": "molts",
  "moustache": "mustache",
  "moustached": "mustached",
  "moustaches": "mustaches",
  "moustachioed": "mustachioed",
  "multicoloured": "multicolored",
  "nationalisation": "nationalization",
  "nationalisations": "nationalizations",
  "nationalise": "nationalize",
  "nationalised": "nationalized",
  "nationalises": "nationalizes",
  "nationalising": "nationalizing",
  "naturalisation": "naturalization",
  "naturalise": "naturalize",
  "naturalised": "naturalized",
  "naturalises": "naturalizes",
  "naturalising": "naturalizing",
  "neighbour": "neighbor",
  "neighbourhood": "neighborhood",
  "neighbourhoods": "neighborhoods",
  "neighbouring": "neighboring",
  "neighbourliness": "neighborliness",
  "neighbourly": "neighborly",
  "neighbours": "neighbors",
  "neutralisation": "neutralization",
  "neutralise": "neutralize",
  "neutralised": "neutralized",
  "neutralises": "neutralizes",
  "neutralising": "neutralizing",
  "normalisation": "normalization",
  "normalise": "normalize",
  "normalised": "normalized",
  "normalises": "normalizes",
  "normalising": "normalizing",
  "odour": "odor",
  "odourless": "odorless",
  "odours": "odors",
  "oesophagus": "esophagus",
  "oesophaguses": "esophaguses",
  "oestrogen": "estrogen",
  "offence": "offense",
  "offences": "offenses",
  "omelette": "omelet",
  "omelettes": "omelets",
  "optimise": "optimize",
  "optimised": "optimized",
  "optimises": "optimizes",
  "optimising": "optimizing",
  "organisation": "organization",
  "organisational": "organizational",
  "organisations": "organizations",
  "organise": "organize",
  "organised": "organized",
  "organiser": "organizer",
  "organisers": "organizers",
  "organises": "organizes",
  "organising": "organizing",
  "orthopaedic": "orthopedic",
  "orthopaedics": "orthopedics",
  "ostracise": "ostracize",
  "ostracised": "ostracized",
  "ostracises": "ostracizes",
  "ostracising": "ostracizing",
  "outmanoeuvre": "outmaneuver",
  "outmanoeuvred": "outmaneuvered",
  "outmanoeuvres": "outmaneuvers",
  "outmanoeuvring": "outmaneuvering",
  "overemphasise": "overemphasize",
  "overemphasised": "overemphasized",
  "overemphasises": "overemphasizes",
  "overemphasising": "overemphasizing",
  "oxidisation": "oxidization",
  "oxidise": "oxidize",
  "oxidised": "oxidized",
  "oxidises": "oxidizes",
  "oxidising": "oxidizing",
  "paederast": "pederast",
  "paederasts": "pederasts",
  "paediatric": "pediatric",
  "paediatrician": "pediatrician",
  "paediatricians": "pediatricians",
  "paediatrics": "pediatrics",
  "paedophile": "pedophile",
  "paedophiles": "pedophiles",
  "paedophilia": "pedophilia",
  "palaeolithic": "paleolithic",
  "palaeontologist": "paleontologist",
  "palaeontologists": "paleontologists",
  "palaeontology": "paleontology",
  "panelled": "paneled",
  "panelling": "paneling",
  "panellist": "panelist",
  "panellists": "panelists",
  "paralyse": "paralyze",
  "paralysed": "paralyzed",
  "paralyses": "paralyzes",
  "paralysing": "paralyzing",
  "parcelled": "parceled",
  "parcelling": "parceling",
  "parlour": "parlor",
  "parlours": "parlors",
  "particularise": "particularize",
  "particularised": "particularized",
  "particularises": "particularizes",
  "particularising": "particularizing",
  "passivisation": "passivization",
  "passivise": "passivize",
  "passivised": "passivized",
  "passivises": "passivizes",
  "passivising": "passivizing",
  "pasteurisation": "pasteurization",
  "pasteurise": "pasteurize",
  "pasteurised": "pasteurized",
  "pasteurises": "pasteurizes",
  "pasteurising": "pasteurizing",
  "patronise": "patronize",
  "patronised": "patronized",
  "patronises": "patronizes",
  "patronising": "patronizing",
  "patronisingly": "patronizingly",
  "pedalled": "pedaled",
  "pedalling": "pedaling",
  "pedestrianisation": "pedestrianization",
  "pedestrianise": "pedestrianize",
  "pedestrianised": "pedestrianized",
  "pedestrianises": "pedestrianizes",
  "pedestrianising": "pedestrianizing",
  "penalise": "penalize",
  "penalised": "penalized",
  "penalises": "penalizes",
  "penalising": "penalizing",
  "pencilled": "penciled",
  "pencilling": "penciling",
  "personalise": "personalize",
  "personalised": "personalized",
  "personalises": "personalizes",
  "personalising": "personalizing",
  "pharmacopoeia": "pharmacopeia",
  "pharmacopoeias": "pharmacopeias",
  "philosophise": "philosophize",
  "philosophised": "philosophized",
  "philosophises": "philosophizes",
  "philosophising": "philosophizing",
  "philtre": "filter",
  "philtres": "filters",
  "phoney": "phony",
  "plagiarise": "plagiarize",
  "plagiarised": "plagiarized",
  "plagiarises": "plagiarizes",
  "plagiarising": "plagiarizing",
  "plough": "plow",
  "ploughed": "plowed",
  "ploughing": "plowing",
  "ploughman": "plowman",
  "ploughmen": "plowmen",
  "ploughs": "plows",
  "ploughshare": "plowshare",
  "ploughshares": "plowshares",
  "polarisation": "polarization",
  "polarise": "polarize",
  "polarised": "polarized",
  "polarises": "polarizes",
  "polarising": "polarizing",
  "politicisation": "politicization",
  "politicise": "politicize",
  "politicised": "politicized",
  "politicises": "politicizes",
  "politicising": "politicizing",
  "popularisation": "popularization",
  "popularise": "popularize",
  "popularised": "popularized",
  "popularises": "popularizes",
  "popularising": "popularizing",
  "pouffe": "pouf",
  "pouffes": "poufs",
  "practise": "practice",
  "practised": "practiced",
  "practises": "practices",
  "practising": "practicing",
  "praesidium": "presidium",
  "praesidiums": "presidiums",
  "pressurisation": "pressurization",
  "pressurise": "pressurize",
  "pressurised": "pressurized",
  "pressurises": "pressurizes",
  "pressurising": "pressurizing",
  "pretence": "pretense",
  "pretences": "pretenses",
  "primaeval": "primeval",
  "prioritisation": "prioritization",
  "prioritise": "prioritize",
  "prioritised": "prioritized",
  "prioritises": "prioritizes",
  "prioritising": "prioritizing",
  "privatisation": "privatization",
  "privatisations": "privatizations",
  "privatise": "privatize",
  "privatised": "privatized",
  "privatises": "privatizes",
  "privatising": "privatizing",
  "professionalisation": "professionalization",
  "professionalise": "professionalize",
  "professionalised": "professionalized",
  "professionalises": "professionalizes",
  "professionalising": "professionalizing",
  "programme": "program",
  "programmes": "programs",
  "prologue": "prolog",
  "prologues": "prologs",
  "propagandise": "propagandize",
  "propagandised": "propagandized",
  "propagandises": "propagandizes",
  "propagandising": "propagandizing",
  "proselytise": "proselytize",
  "proselytised": "proselytized",
  "proselytiser": "proselytizer",
  "proselytisers": "proselytizers",
  "proselytises": "proselytizes",
  "proselytising": "proselytizing",
  "psychoanalyse": "psychoanalyze",
  "psychoanalysed": "psychoanalyzed",
  "psychoanalyses": "psychoanalyzes",
  "psychoanalysing": "psychoanalyzing",
  "publicise": "publicize",
  "publicised": "publicized",
  "publicises": "publicizes",
  "publicising": "publicizing",
  "pulverisation": "pulverization",
  "pulverise": "pulverize",
  "pulverised": "pulverized",
  "pulverises": "pulverizes",
  "pulverising": "pulverizing",
  "pummelled": "pummel",
  "pummelling": "pummeled",
  "pyjama": "pajama",
  "pyjamas": "pajamas",
  "pzazz": "pizzazz",
  "quarrelled": "quarreled",
  "quarrelling": "quarreling",
  "radicalise": "radicalize",
  "radicalised": "radicalized",
  "radicalises": "radicalizes",
  "radicalising": "radicalizing",
  "rancour": "rancor",
  "randomise": "randomize",
  "randomised": "randomized",
  "randomises": "randomizes",
  "randomising": "randomizing",
  "rationalisation": "rationalization",
  "rationalisations": "rationalizations",
  "rationalise": "rationalize",
  "rationalised": "rationalized",
  "rationalises": "rationalizes",
  "rationalising": "rationalizing",
  "ravelled": "raveled",
  "ravelling": "raveling",
  "realisable": "realizable",
  "realisation": "realization",
  "realisations": "realizations",
  "realise": "realize",
  "realised": "realized",
  "realises": "realizes",
  "realising": "realizing",
  "recognisable": "recognizable",
  "recognisably": "recognizably",
  "recognisance": "recognizance",
  "recognise": "recognize",
  "recognised": "recognized",
  "recognises": "recognizes",
  "recognising": "recognizing",
  "reconnoitre": "reconnoiter",
  "reconnoitred": "reconnoitered",
  "reconnoitres": "reconnoiters",
  "reconnoitring": "reconnoitering",
  "refuelled": "refueled",
  "refuelling": "refueling",
  "regularisation": "regularization",
  "regularise": "regularize",
  "regularised": "regularized",
  "regularises": "regularizes",
  "regularising": "regularizing",
  "remodelled": "remodeled",
  "remodelling": "remodeling",
  "remould": "remold",
  "remoulded": "remolded",
  "remoulding": "remolding",
  "remoulds": "remolds",
  "reorganisation": "reorganization",
  "reorganisations": "reorganizations",
  "reorganise": "reorganize",
  "reorganised": "reorganized",
  "reorganises": "reorganizes",
  "reorganising": "reorganizing",
  "revelled": "reveled",
  "reveller": "reveler",
  "revellers": "revelers",
  "revelling": "reveling",
  "revitalise": "revitalize",
  "revitalised": "revitalized",
  "revitalises": "revitalizes",
  "revitalising": "revitalizing",
  "revolutionise": "revolutionize",
  "revolutionised": "revolutionized",
  "revolutionises": "revolutionizes",
  "revolutionising": "revolutionizing",
  "rhapsodise": "rhapsodize",
  "rhapsodised": "rhapsodized",
  "rhapsodises": "rhapsodizes",
  "rhapsodising": "rhapsodizing",
  "rigour": "rigor",
  "rigours": "rigors",
  "ritualised": "ritualized",
  "rivalled": "rivaled",
  "rivalling": "rivaling",
  "romanticise": "romanticize",
  "romanticised": "romanticized",
  "romanticises": "romanticizes",
  "romanticising": "romanticizing",
  "rumour": "rumor",
  "rumoured": "rumored",
  "rumours": "rumors",
  "sabre": "saber",
  "sabres": "sabers",
  "saltpetre": "saltpeter",
  "sanitise": "sanitize",
  "sanitised": "sanitized",
  "sanitises": "sanitizes",
  "sanitising": "sanitizing",
  "satirise": "satirize",
  "satirised": "satirized",
  "satirises": "satirizes",
  "satirising": "satirizing",
  "saviour": "savior",
  "saviours": "saviors",
  "savour": "savor",
  "savoured": "savored",
  "savouries": "savories",
  "savouring": "savoring",
  "savours": "savors",
  "savoury": "savory",
  "scandalise": "scandalize",
  "scandalised": "scandalized",
  "scandalises": "scandalizes",
  "scandalising": "scandalizing",
  "sceptic": "skeptic",
  "sceptical": "skeptical",
  "sceptically": "skeptically",
  "scepticism": "skepticism",
  "sceptics": "skeptics",
  "sceptre": "scepter",
  "sceptres": "scepters",
  "scrutinise": "scrutinize",
  "scrutinised": "scrutinized",
  "scrutinises": "scrutinizes",
  "scrutinising": "scrutinizing",
  "secularisation": "secularization",
  "secularise": "secularize",
  "secularised": "secularized",
  "secularises": "secularizes",
  "secularising": "secularizing",
  "sensationalise": "sensationalize",
  "sensationalised": "sensationalized",
  "sensationalises": "sensationalizes",
  "sensationalising": "sensationalizing",
  "sensitise": "sensitize",
  "sensitised": "sensitized",
  "sensitises": "sensitizes",
  "sensitising": "sensitizing",
  "sentimentalise": "sentimentalize",
  "sentimentalised": "sentimentalized",
  "sentimentalises": "sentimentalizes",
  "sentimentalising": "sentimentalizing",
  "sepulchre": "sepulcher",
  "sepulchres": "sepulchers",
  "serialisation": "serialization",
  "serialisations": "serializations",
  "serialise": "serialize",
  "serialised": "serialized",
  "serialises": "serializes",
  "serialising": "serializing",
  "sermonise": "sermonize",
  "sermonised": "sermonized",
  "sermonises": "sermonizes",
  "sermonising": "sermonizing",
  "sheikh": "sheik",
  "shovelled": "shoveled",
  "shovelling": "shoveling",
  "shrivelled": "shriveled",
  "shrivelling": "shriveling",
  "signalise": "signalize",
  "signalised": "signalized",
  "signalises": "signalizes",
  "signalising": "signalizing",
  "signalled": "signaled",
  "signalling": "signaling",
  "smoulder": "smolder",
  "smouldered": "smoldered",
  "smouldering": "smoldering",
  "smoulders": "smolders",
  "snivelled": "sniveled",
  "snivelling": "sniveling",
  "snorkelled": "snorkeled",
  "snorkelling": "snorkeling",
  "snowplough": "snowplow",
  "snowploughs": "snowplow",
  "socialisation": "socialization",
  "socialise": "socialize",
  "socialised": "socialized",
  "socialises": "socializes",
  "socialising": "socializing",
  "sodomise": "sodomize",
  "sodomised": "sodomized",
  "sodomises": "sodomizes",
  "sodomising": "sodomizing",
  "solemnise": "solemnize",
  "solemnised": "solemnized",
  "solemnises": "solemnizes",
  "solemnising": "solemnizing",
  "sombre": "somber",
  "specialisation": "specialization",
  "specialisations": "specializations",
  "specialise": "specialize",
  "specialised": "specialized",
  "specialises": "specializes",
  "specialising": "specializing",
  "spectre": "specter",
  "spectres": "specters",
  "spiralled": "spiraled",
  "spiralling": "spiraling",
  "splendour": "splendor",
  "splendours": "splendors",
  "squirrelled": "squirreled",
  "squirrelling": "squirreling",
  "stabilisation": "stabilization",
  "stabilise": "stabilize",
  "stabilised": "stabilized",
  "stabiliser": "stabilizer",
  "stabilisers": "stabilizers",
  "stabilises": "stabilizes",
  "stabilising": "stabilizing",
  "standardisation": "standardization",
  "standardise": "standardize",
  "standardised": "standardized",
  "standardises": "standardizes",
  "standardising": "standardizing",
  "stencilled": "stenciled",
  "stencilling": "stenciling",
  "sterilisation": "sterilization",
  "sterilisations": "sterilizations",
  "sterilise": "sterilize",
  "sterilised": "sterilized",
  "steriliser": "sterilizer",
  "sterilisers": "sterilizers",
  "sterilises": "sterilizes",
  "sterilising": "sterilizing",
  "stigmatisation": "stigmatization",
  "stigmatise": "stigmatize",
  "stigmatised": "stigmatized",
  "stigmatises": "stigmatizes",
  "stigmatising": "stigmatizing",
  "storey": "story",
  "storeys": "stories",
  "subsidisation": "subsidization",
  "subsidise": "subsidize",
  "subsidised": "subsidized",
  "subsidiser": "subsidizer",
  "subsidisers": "subsidizers",
  "subsidises": "subsidizes",
  "subsidising": "subsidizing",
  "succour": "succor",
  "succoured": "succored",
  "succouring": "succoring",
  "succours": "succors",
  "sulphate": "sulfate",
  "sulphates": "sulfates",
  "sulphide": "sulfide",
  "sulphides": "sulfides",
  "sulphur": "sulfur",
  "sulphurous": "sulfurous",
  "summarise": "summarize",
  "summarised": "summarized",
  "summarises": "summarizes",
  "summarising": "summarizing",
  "swivelled": "swiveled",
  "swivelling": "swiveling",
  "symbolise": "symbolize",
  "symbolised": "symbolized",
  "symbolises": "symbolizes",
  "symbolising": "symbolizing",
  "sympathise": "sympathize",
  "sympathised": "sympathized",
  "sympathiser": "sympathizer",
  "sympathisers": "sympathizers",
  "sympathises": "sympathizes",
  "sympathising": "sympathizing",
  "synchronisation": "synchronization",
  "synchronise": "synchronize",
  "synchronised": "synchronized",
  "synchronises": "synchronizes",
  "synchronising": "synchronizing",
  "synthesise": "synthesize",
  "synthesised": "synthesized",
  "synthesiser": "synthesizer",
  "synthesisers": "synthesizers",
  "synthesises": "synthesizes",
  "synthesising": "synthesizing",
  "syphon": "siphon",
  "syphoned": "siphoned",
  "syphoning": "siphoning",
  "syphons": "siphons",
  "systematisation": "systematization",
  "systematise": "systematize",
  "systematised": "systematized",
  "systematises": "systematizes",
  "systematising": "systematizing",
  "tantalise": "tantalize",
  "tantalised": "tantalized",
  "tantalises": "tantalizes",
  "tantalising": "tantalizing",
  "tantalisingly": "tantalizingly",
  "tasselled": "tasseled",
  "technicolour": "technicolor",
  "temporise": "temporize",
  "temporised": "temporized",
  "temporises": "temporizes",
  "temporising": "temporizing",
  "tenderise": "tenderize",
  "tenderised": "tenderized",
  "tenderises": "tenderizes",
  "tenderising": "tenderizing",
  "terrorise": "terrorize",
  "terrorised": "terrorized",
  "terrorises": "terrorizes",
  "terrorising": "terrorizing",
  "theatre": "theater",
  "theatregoer": "theatergoer",
  "theatregoers": "theatergoers",
  "theatres": "theaters",
  "theorise": "theorize",
  "theorised": "theorized",
  "theorises": "theorizes",
  "theorising": "theorizing",
  "tonne": "ton",
  "tonnes": "tons",
  "towelled": "toweled",
  "towelling": "toweling",
  "toxaemia": "toxemia",
  "tranquillise": "tranquilize",
  "tranquillised": "tranquilized",
  "tranquilliser": "tranquilizer",
  "tranquillisers": "tranquilizers",
  "tranquillises": "tranquilizes",
  "tranquillising": "tranquilizing",
  "tranquillity": "tranquility",
  "tranquillize": "tranquilize",
  "tranquillized": "tranquilized",
  "tranquillizer": "tranquilizer",
  "tranquillizers": "tranquilizers",
  "tranquillizes": "tranquilizes",
  "tranquillizing": "tranquilizing",
  "tranquilly": "tranquility",
  "transistorised": "transistorized",
  "traumatise": "traumatize",
  "traumatised": "traumatized",
  "traumatises": "traumatizes",
  "traumatising": "traumatizing",
  "travelled": "traveled",
  "traveller": "traveler",
  "travellers": "travelers",
  "travelling": "traveling",
  "travelog": "travelogue",
  "travelogs": "travelogues",
  "trialled": "trialed",
  "trialling": "trialing",
  "tricolour": "tricolor",
  "tricolours": "tricolors",
  "trivialise": "trivialize",
  "trivialised": "trivialized",
  "trivialises": "trivializes",
  "trivialising": "trivializing",
  "tumour": "tumor",
  "tumours": "tumors",
  "tunnelled": "tunneled",
  "tunnelling": "tunneling",
  "tyrannise": "tyrannize",
  "tyrannised": "tyrannized",
  "tyrannises": "tyrannizes",
  "tyrannising": "tyrannizing",
  "tyre": "tire",
  "tyres": "tires",
  "unauthorised": "unauthorized",
  "uncivilised": "uncivilized",
  "underutilised": "underutilized",
  "unequalled": "unequaled",
  "unfavourable": "unfavorable",
  "unfavourably": "unfavorably",
  "unionisation": "unionization",
  "unionise": "unionize",
  "unionised": "unionized",
  "unionises": "unionizes",
  "unionising": "unionizing",
  "unorganised": "unorganized",
  "unravelled": "unraveled",
  "unravelling": "unraveling",
  "unrecognisable": "unrecognizable",
  "unrecognised": "unrecognized",
  "unrivalled": "unrivaled",
  "unsavoury": "unsavory",
  "untrammelled": "untrammeled",
  "urbanisation": "urbanization",
  "urbanise": "urbanize",
  "urbanised": "urbanized",
  "urbanises": "urbanizes",
  "urbanising": "urbanizing",
  "utilisable": "utilizable",
  "utilisation": "utilization",
  "utilise": "utilize",
  "utilised": "utilized",
  "utilises": "utilizes",
  "utilising": "utilizing",
  "valour": "valor",
  "vandalise": "vandalize",
  "vandalised": "vandalized",
  "vandalises": "vandalizes",
  "vandalising": "vandalizing",
  "vaporisation": "vaporization",
  "vaporise": "vaporize",
  "vaporised": "vaporized",
  "vaporises": "vaporizes",
  "vaporising": "vaporizing",
  "vapour": "vapor",
  "vapours": "vapors",
  "verbalise": "verbalize",
  "verbalised": "verbalized",
  "verbalises": "verbalizes",
  "verbalising": "verbalizing",
  "victimisation": "victimization",
  "victimise": "victimize",
  "victimised": "victimized",
  "victimises": "victimizes",
  "victimising": "victimizing",
  "videodisc": "videodisk",
  "videodiscs": "videodisks",
  "vigour": "vigor",
  "visualisation": "visualization",
  "visualisations": "visualizations",
  "visualise": "visualize",
  "visualised": "visualized",
  "visualises": "visualizes",
  "visualising": "visualizing",
  "vocalisation": "vocalization",
  "vocalisations": "vocalizations",
  "vocalise": "vocalize",
  "vocalised": "vocalized",
  "vocalises": "vocalizes",
  "vocalising": "vocalizing",
  "vulcanised": "vulcanized",
  "vulgarisation": "vulgarization",
  "vulgarise": "vulgarize",
  "vulgarised": "vulgarized",
  "vulgarises": "vulgarizes",
  "vulgarising": "vulgarizing",
  "waggon": "wagon",
  "waggons": "wagons",
  "watercolour": "watercolor",
  "watercolours": "watercolors",
  "weaselled": "weaseled",
  "weaselling": "weaseling",
  "westernisation": "westernization",
  "westernise": "westernize",
  "westernised": "westernized",
  "westernises": "westernizes",
  "westernising": "westernizing",
  "womanise": "womanize",
  "womanised": "womanized",
  "womaniser": "womanizer",
  "womanisers": "womanizers",
  "womanises": "womanizes",
  "womanising": "womanizing",
  "woollen": "woolen",
  "woollens": "woolens",
  "woollies": "woolies",
  "woolly": "wooly",
  "worshipped": "worshiped",
  "worshipper": "worshiper",
  "worshipping": "worshiping",
  "yodelled": "yodeled",
  "yodelling": "yodeling",
  "yoghourt": "yogurt",
  "yoghourts": "yogurts",
  "yoghurt": "yogurt",
  "yoghurts": "yogurts"
}
```
</details>

Hi @MahmoudAshraf97, thanks for opening this PR!

I'm not sure to follow where you removed padding in the code you've shared for benchmark tbh, could you elaborate?
Also, using the pipeline here adds an additional complexity to what you're doing. Could you possibly do a benchmark on audio degradation using the processor and the model (without using the pipeline)?
 

Note that I'm not against making Whisper accept any chunk length, as long as we thoroughly verify that it's backward compatible, that the usage is justified and that the original behavior is enabled by default! Let's make sure we verify all previous conditions 

Sorry for the confusion, this PR doesn't remove padding, to do so, add `max_length=chunk_len` to this feature extractor call
https://github.com/huggingface/transformers/blob/01be5b48790f113b7d71943b580c842e3e097988/src/transformers/pipelines/automatic_speech_recognition.py#L66

The use of pipeline was intended because it was the only way to change chunk length available currently in `transformers`
As for the other concerns

Backward compatibility is confirmed because it still allows the old behavior and the test suite pass 100%, as for whether it's justified or not, IMO I see no reason for that restriction in the first place as it doesn't exist in either the original whisper implementation neither other custom implementations, so it makes using the whisper model directly without a pipeline more constrained, and as you said, using a pipeline adds an additional complexity

Hey @MahmoudAshraf97! Thanks for opening this PR and for the justifications on why it should be added. Note that we're mixing two definitions here, which is potentially causing confusion:
1. **Context window:** this refers to the receptive field of the Whisper encoder, i.e. the length of the audios it can process at once. In both the original and Transformers implementations, this is fixed to 30-seconds. Any audios less than 30-seconds are padded to 30-seconds and passed through the encoder. Any audios longer than 30-seconds need to be truncated, or passed sequentially through the encoder for sequential long-form generation. Why do we this at inference time? Simply because this is how it's done at training time: audios are padded/truncated as described above, so the model learns to operate with a 30-second context window. While it is possible to reduce the context window dynamically during inference time, e.g. by slicing the encoder positional embeddings to the length of the audio inputs, this leads to a degradation in performance compared to a fixed 30-second context window. You can read the results in [this repo](https://github.com/futo-org/whisper-acft#results) for details.
2. **Chunk length:** this refers to our strategy for dividing up a long audio file into smaller segments, and passing the segments in parallel through the model. Each segment is still padded/truncated to the model's context window before being passed through the encoder.

To understand how to set the context window and chunk length, we can take the examples of the Whisper model and Distil-Whisper models:
1. Whisper: the model was trained with a fixed 30-second context window, and the average audio length during training was likely close to 30-seconds. This means at inference time, we use a fixed context window of 30-seconds and a chunk length of 30-seconds, matching the distribution of audios in the training data.
2. Distil-Whisper large-v2: trained with a fixed 30-second context window (same as Whisper), but the average audio length was 7.1-seconds (see Table 13 of the [paper](https://arxiv.org/pdf/2311.00430)). At inference time, we use a fixed context window of 30-seconds, but a chunk length of 15-seconds (an interpolation between the 30-second audios used to pre-train Whisper, and the 7-second audios used to distill it)[^1]
3. Distil-Whisper large-v3: trained with a fixed 30-second context window (same as Whisper), but the average audio length during training was much closer to 30-seconds. At inference time, we use a fixed context window of 30-seconds, but a chunk length of 25-seconds.

=> you can see that in all cases, the models were trained on fixed 30-second context windows, so the best performance is obtained by using these fixed window sizes. However, the chunk length is dependent on the distribution of audio data used during training, and set to match this at inference time.

In relation to this PR: we're changing the context window, but not the chunk length (which is controlled by the pipeline parameter `chunk_length_s`). Given this typically leads to a performance degradation using the pre-trained models, I would be in favour of not adding it to the main codebase, but you're free to experiment with these changes in a fork and benchmark performance!

Related:
1. #25744
2. #26214

----
[^1]You're probably wondering: why did you use a 30-second context window if your audios were on average 7.1-seconds in duration? We tried distilling using a smaller 15-second context window, but similar to dynamically changing the window, this hurt performance. The best performance was always obtained by copying the Whisper encoder exactly from the original OpenAI implementation.



Thanks for the insightful comment @sanchit-gandhi , I just verified by evaluating `distil-large-v2` with `chunk_length=15` on [this dataset](https://huggingface.co/datasets/mobiuslabsgmbh/youtube-commons-asr-eval) which is mostly longform audio.
With padding: WER: 13.433
Without padding: WER: 19.435