SHARE
TWEET

Untitled

a guest Jun 16th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. docs = ['Well done!',
  2.         'Good work',
  3.         'Great effort',
  4.         'nice work',
  5.         'Excellent!',
  6.         'Weak',
  7.         'Poor effort!',
  8.         'not good',
  9.         'poor work',
  10.         'Could have done better.']
  11. # define class labels
  12. labels = np.array([1,1,1,1,1,0,0,0,0,0])
  13. from keras import backend as K
  14.  
  15.  
  16. # integer encode the documents
  17. vocab_size = 50
  18. encoded_docs = [K.one_hot(d, vocab_size) for d in docs]
  19. print(encoded_docs)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top