Dmitry Kirsanov commited on
Commit
c7fdb95
·
1 Parent(s): 8579920
Files changed (1) hide show
  1. understand.py +2 -2
understand.py CHANGED
@@ -176,13 +176,13 @@ Output the line "ACTORS:" followed by your list of actors, one per line.
176
 
177
  def split_sentences(self, src="document", dst="document"):
178
  newfad = self.values.get(src)
179
- plaintext = fad.get_plaintext(newfad)
180
  sents = nltk.tokenize.sent_tokenize(plaintext)
181
  if "".join(sents) != plaintext:
182
  print("ERROR:nltk.tokenize.sent_tokenize output does not cleanly match source")
183
  i = 0
184
  for sent in sents:
185
- newfad = fad.add_span_mark(newfad, "sentence", i, i+len(sent) - 1)
186
  self.values.put(dst, newfad)
187
  print(f"=== Sentence-split FAD : {newfad}")
188
  # todo: pass this through LLM to verify and correct sentence splittings
 
176
 
177
  def split_sentences(self, src="document", dst="document"):
178
  newfad = self.values.get(src)
179
+ plaintext = self.fad.get_plaintext(newfad)
180
  sents = nltk.tokenize.sent_tokenize(plaintext)
181
  if "".join(sents) != plaintext:
182
  print("ERROR:nltk.tokenize.sent_tokenize output does not cleanly match source")
183
  i = 0
184
  for sent in sents:
185
+ newfad = self.fad.add_span_mark(newfad, "sentence", i, i+len(sent) - 1)
186
  self.values.put(dst, newfad)
187
  print(f"=== Sentence-split FAD : {newfad}")
188
  # todo: pass this through LLM to verify and correct sentence splittings