import json


def load_word_mappings() -> tuple:
    """ Load word mappings into memory.
    
    Load the word to index and index to word mappings from the JSON files
    containing the vocabulary.
    
    Returns:
        The word to index mapping and the index to word mapping
    """
    word2index = json.loads(open("./resources/word2index.json", "r").read())
    index2word = json.loads(open("./resources/index2word.json", "r").read())
    return word2index, index2word