Keras one_hot encoding - what's the point when unicity not guaranteed?
It seems to be bad choice of function names since the one_hot function actually is using hashing and is equivalent to hashing_trick (with standard settings).

See this issue: https://github.com/keras-team/keras/pull/6887

When I do:

from keras.preprocessing.text import one_hot
from keras.preprocessing.text import hashing_trick

text = 'The quick brown fox jumped over the lazy dog.'
print(one_hot(text, n=9))
print(hashing_trick(text, n=9))


I get identical results:

[5, 6, 2, 6, 5, 8, 5, 4, 1]
[5, 6, 2, 6, 5, 8, 5, 4, 1]


So in case you want to have "real" (unique) one-hot encoded results, you need to resort to some other solution (there is no Keras built-in solution for this in the moment as I believe).