from typing import List
from typing import Dict


def idx(words: List[str]) -> Dict:
    """Create a mapping from words to indexes
    Args:
        words: List of words
    Returns:
        w2i: Dict mapping words from their index
    Raises:

    """
    w2i = {}
    for i, w in enumerate(words):
        if w not in w2i:
            w2i[w] = i
    return w2i