RobPruzan commited on
Commit
b549318
1 Parent(s): 76717c7

Updating max length to adjust for new model

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -237,11 +237,11 @@ def reading_difficulty(excerpt):
237
  windows = []
238
  words = tokenizer.tokenize(excerpt)
239
 
240
- if len(words) > 301:
241
  for idx, text in enumerate(words):
242
- if idx % 300 == 0:
243
- if idx <= len(words) - 301:
244
- x = ' '.join(words[idx: idx + 299])
245
  windows.append(x)
246
 
247
  win_preds = []
 
237
  windows = []
238
  words = tokenizer.tokenize(excerpt)
239
 
240
+ if len(words) > 500:
241
  for idx, text in enumerate(words):
242
+ if idx % 500 == 0:
243
+ if idx <= len(words) - 501:
244
+ x = ' '.join(words[idx: idx + 499])
245
  windows.append(x)
246
 
247
  win_preds = []