i got a large textfile (https://int-emb-word2vec-de-wiki.s3.eu-central-1.amazonaws.com/vectors.txt) and put the file into a dictionary:
word2vec = "./vectors.txt"
with open(word2vec, 'r') as f:
file = csv.reader(f, delimiter=' ')
model = {k: np.array(list(map(float, v))) for k, *v in file}
So i got this dictionary: {Word: Embedding vectors}
.
Now I want to convert my key from: b'Word'
to: Word
(so that I got for example UNK
instead of b'UNK'
).
Does anyone know how I can remove the b'...'
for every instance?
Or is it easier if i first remove all the b'...'
in the textfile before I put the file into a dictionary?