fix this code : '''

import os
import pandas as pd 
import spacy # for tokenizer
import torch
from torch.nn.utilis.rnn import pad_sequence # NAME_1
from torch.utilis.data import DataLoader, Dataset
from PIL import Image #Load img
import torchvision.transforms as transform


spacy_eng = spacy.load("en")
class Vocabulary:
    def __init__(self, freq_threshold):
        self.itos = {0 : "<PAD>", 1:"<SOS>" , 2:"<EOS>", 3: "<UNK>"}
        self.stoi = {"<PAD>":0 , "<SOS>" : 1, "<EOS>": 2, "<UNK>": 3}
        self.freq_threshold = freq_threshold

    def __len__(self):
        return len(self.itos)
    
    @staticmethod
    def tokenizer_eng(text):
        return[tok.text.lower() for tok in spacy_eng.tokenizer(text)]
    
    # I love peanuts -> ["i", "love", "peanuts"]

    def build_vocabulary(sef,sentence_list): 
        frequencies = {}
        idx = 4

        for sentence in sentence_list:
            for word in self.tokenizer_eng(sentence):
                if word not in frequencies: 
                    frequencies[word] = 1

                else: 
                    frequencies[word] += 1
                
                if frequencies[word] == self.freq_threshold:
                    self.stoi[word] = idx
                    self.itos[idx] = word
                    idx += 1
    def numericalize(self, text):
        tokenized_text = self.tokenizer_eng(text)

        return [
            self.stoi[token] if token in self.stoi else self.stoi["<UNK>"]
            for token in tokenized_text
        ]
    
class MyCollate:
    def __init__(self, pad_idx):
        self.pad_idx = pad_idx
    
    def __call__(self, batch):
        imgs = [item[0].unsqueeze(0) for item in batch]
        imgs = torch.cat(imgs, dim = 0)
        targets = [item[1] for item in batch]
        targets = pad_sequence(targets, batch_first = False, padding_value = self.pad_idx)

        return imgs, targets
    
def get_loader(
        root_folder,
        annotation_file,
        transform,
        batch_size = 32,
        num_workers = 8,
        shuffle = True
        pin_memory = True,
)

dataset = FlickrDataset(root,folder, annotation_file, transform = transform)
pad_idx = dataset.vocab.stoi["<PAD>"]

loader = DataLoader(
    dataset = dataset,
    batch_size = batch_size,
    num_workers = num_workers,
    shuffle = shuffle
    pin_memory = pin_memory,
    collate_fn = MyCollate(pad_idx = pad_idx)
)
return loader 

def main():
    transform = transforms.Compose(
        [transforms.resize((224,224)),
         transforms.ToTensor()] Provide the entire answer in JSON format.
user