Generating image captions with external encyclopedic knowledge