Marroco93 commited on
Commit
669af95
1 Parent(s): 76264cd

no message

Browse files
Files changed (1) hide show
  1. main.py +4 -1
main.py CHANGED
@@ -103,7 +103,10 @@ def reduce_tokens(text: str) -> str:
103
  for sent in doc.sents:
104
  if any(tok.dep_ == 'ROOT' for tok in sent):
105
  important_sentences.append(sent.text)
106
- # Join selected sentences to form the reduced text
 
 
 
107
  token_count = len(reduced_doc)
108
  return reduced_text, token_count
109
 
 
103
  for sent in doc.sents:
104
  if any(tok.dep_ == 'ROOT' for tok in sent):
105
  important_sentences.append(sent.text)
106
+ # Join selected sentences to form the reduced text
107
+ reduced_text = ' '.join(important_sentences)
108
+ # Tokenize the reduced text to count the tokens
109
+ reduced_doc = nlp(reduced_text)
110
  token_count = len(reduced_doc)
111
  return reduced_text, token_count
112