(fields)
return vocab
Save Vocab objects in Field objects to `vocab.pt` file.
Save Vocab objects in Field objects to `vocab.pt` file.
Save Vocab objects in Field objects to vocab . pt file .
def save_fields_to_vocab(fields):
    """
    Save Vocab objects in Field objects to `vocab.pt` file.
    """
    vocab = []
    for k, f in fields.items():
        if f is not None and 'vocab' in f.__dict__:
            f.vocab.stoi = f.vocab.stoi
            vocab.append((k, f.vocab))
    return vocab
def save_fields_to_vocab ( fields ) : vocab = [ ] for k , f in fields . items ( ) : if f is not None and 'vocab' in f . __dict__ : f . vocab . stoi = f . vocab . stoi vocab . append ( ( k , f . vocab ) ) return vocab