Dmitry Kirsanov commited on
Commit
62825e9
·
1 Parent(s): 3bfd8ed
Files changed (1) hide show
  1. understand.py +3 -3
understand.py CHANGED
@@ -206,7 +206,7 @@ Output the line "ACTORS:" followed by your list of actors, one per line.
206
  def create_spans_in_fad(self, llmtext, span):
207
  pattern = ""
208
  for p in [f'</?{span}>', f'\n?</?{span}>\n?', f'\n*</?{span}>\n*']:
209
- clean = re.sub(p, llmtext)
210
  if len(clean) <= len(self.fad.get_plaintext()):
211
  pattern = p
212
  break
@@ -217,8 +217,8 @@ Output the line "ACTORS:" followed by your list of actors, one per line.
217
  t = 0
218
  for i, chunk in enumerate(chunks):
219
  if f"{span}>" in chunk:
220
- text = re.sub(pattern_o, chunk)
221
- text = re.sub(pattern_c, text)
222
  self.fad.add_span_mark(span, t, t + len(text))
223
  else:
224
  text = chunk
 
206
  def create_spans_in_fad(self, llmtext, span):
207
  pattern = ""
208
  for p in [f'</?{span}>', f'\n?</?{span}>\n?', f'\n*</?{span}>\n*']:
209
+ clean = re.sub(p, '', llmtext)
210
  if len(clean) <= len(self.fad.get_plaintext()):
211
  pattern = p
212
  break
 
217
  t = 0
218
  for i, chunk in enumerate(chunks):
219
  if f"{span}>" in chunk:
220
+ text = re.sub(pattern_o, '', chunk)
221
+ text = re.sub(pattern_c, '', text)
222
  self.fad.add_span_mark(span, t, t + len(text))
223
  else:
224
  text = chunk