Dmitry Kirsanov commited on
Commit
d26894c
·
1 Parent(s): 500b077
Files changed (1) hide show
  1. understand.py +2 -5
understand.py CHANGED
@@ -210,12 +210,10 @@ Output the line "ACTORS:" followed by your list of actors, one per line.
210
  if len(clean) <= len(self.fad.get_plaintext()):
211
  pattern = p
212
  break
213
- print(f"pattern /{pattern}/")
214
  pattern_c = pattern
215
  pattern_o = pattern.replace('/?', '')
216
  pattern_c_o = pattern_c + pattern_o
217
  chunks = re.split(pattern_c_o, llmtext)
218
- print(f"pattern_c_o /{pattern_c_o}/")
219
  t = 0
220
  for i, chunk in enumerate(chunks):
221
  if f"{span}>" in chunk:
@@ -225,7 +223,6 @@ Output the line "ACTORS:" followed by your list of actors, one per line.
225
  text = chunk
226
  self.fad.add_span_mark(span, t, t + len(text) + 1)
227
  t += len(text) + 1
228
- print(f"text /{text}/")
229
 
230
  def annotate_sentences_with_actors(self, src="document", dst="document with actors"):
231
  markup = self.fad.get_plaintext_with_markup(self.values.get(src), "sentence")
@@ -495,7 +492,7 @@ Here's the derivative document:
495
  src="document",
496
  selectors="sentence-all",
497
  target="actor",
498
- outputformat="sentences"
499
  )
500
 
501
  print(self.fad.get_plaintext_with_markup("sentence", show_properties=True, properties_to_show="actors"))
@@ -580,4 +577,4 @@ The publication process extends beyond the journal's platform, as the paper may
580
 
581
  d.create_spans_in_fad(val, "section")
582
 
583
- print(d.fad.get_plaintext_with_markup('section'))
 
210
  if len(clean) <= len(self.fad.get_plaintext()):
211
  pattern = p
212
  break
 
213
  pattern_c = pattern
214
  pattern_o = pattern.replace('/?', '')
215
  pattern_c_o = pattern_c + pattern_o
216
  chunks = re.split(pattern_c_o, llmtext)
 
217
  t = 0
218
  for i, chunk in enumerate(chunks):
219
  if f"{span}>" in chunk:
 
223
  text = chunk
224
  self.fad.add_span_mark(span, t, t + len(text) + 1)
225
  t += len(text) + 1
 
226
 
227
  def annotate_sentences_with_actors(self, src="document", dst="document with actors"):
228
  markup = self.fad.get_plaintext_with_markup(self.values.get(src), "sentence")
 
492
  src="document",
493
  selectors="sentence-all",
494
  target="actor",
495
+ outputformat="sentence"
496
  )
497
 
498
  print(self.fad.get_plaintext_with_markup("sentence", show_properties=True, properties_to_show="actors"))
 
577
 
578
  d.create_spans_in_fad(val, "section")
579
 
580
+ print(d.fad.get_plaintext_with_markup('section'))