def construct_captions(d, ids):
    """
    Construct captions for entries in ids
    """
    X = []
    for x in ids:
        captions = d[x]
        for s in captions[:5]:
            X.append(s)
    return X