PirateXX commited on
Commit
4bc60b3
1 Parent(s): 5674750

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -17,8 +17,8 @@ def text_to_sentences(text):
17
  re.sub(r'(?<=[.!?])(?=[^\s])', r' ', text)
18
  return re.split(r'[.!?]', text)
19
 
20
- # function to concatenate sentences into chunks of size 600 or less
21
- def chunks_of_600(text, chunk_size=600):
22
  sentences = text_to_sentences(text)
23
  chunks = []
24
  current_chunk = ""
@@ -47,7 +47,7 @@ def predict(query, device="cpu"):
47
  return real
48
 
49
  def findRealProb(text):
50
- chunksOfText = (chunks_of_600(text))
51
  results = []
52
  for chunk in chunksOfText:
53
  output = predict(chunk)
 
17
  re.sub(r'(?<=[.!?])(?=[^\s])', r' ', text)
18
  return re.split(r'[.!?]', text)
19
 
20
+ # function to concatenate sentences into chunks of size 900 or less
21
+ def chunks_of_900(text, chunk_size=900):
22
  sentences = text_to_sentences(text)
23
  chunks = []
24
  current_chunk = ""
 
47
  return real
48
 
49
  def findRealProb(text):
50
+ chunksOfText = (chunks_of_900(text))
51
  results = []
52
  for chunk in chunksOfText:
53
  output = predict(chunk)