add “list” to map,eg:

return list(map(apply_filters_to_token, sentences))

eg2:

In Python 3 map returns a generator. Try creating a list from it first.

with open("/bin/ls", "rb") as fin: #rb as text file and location
buf = fin.read()
bytes = list(map(ord, buf))
print (bytes[:10])
saveFile = open('exampleFile.txt', 'w')
saveFile.write(bytes)
saveFile.close()