ierhon commited on
Commit
9e71d11
1 Parent(s): 86c785e

Remove shifting

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -12,8 +12,6 @@ import keras
12
 
13
  os.mkdir("cache")
14
 
15
- maxshift = 4
16
-
17
  def hash_str(data: str):
18
  return hashlib.md5(data.encode('utf-8')).hexdigest()
19
 
@@ -57,10 +55,9 @@ def train(message: str, epochs: int, learning_rate: float, emb_size: int, inp_le
57
  y = []
58
 
59
  for key in dset:
60
- for p in range(maxshift):
61
- tokens = tokenizer.texts_to_sequences([key,])[0]
62
- X.append(np.array(([0,]*p+list(tokens)+[0,]*inp_len)[:inp_len]))
63
- y.append(dset[key])
64
 
65
  X = np.array(X)
66
  y = np.array(y)
 
12
 
13
  os.mkdir("cache")
14
 
 
 
15
  def hash_str(data: str):
16
  return hashlib.md5(data.encode('utf-8')).hexdigest()
17
 
 
55
  y = []
56
 
57
  for key in dset:
58
+ tokens = tokenizer.texts_to_sequences([key,])[0]
59
+ X.append(np.array((list(tokens)+[0,]*inp_len)[:inp_len]))
60
+ y.append(dset[key])
 
61
 
62
  X = np.array(X)
63
  y = np.array(y)