def dict_eval(lst,embeddings_dict): dicts={} for i in lst: try: dicts.update({i:embeddings_dict[i].tolist()}) except: dicts={} return dicts