ingerid commited on
Commit
52c1eb7
1 Parent(s): e2235e2

add columns for different transcription config options

Browse files
data/test_metadata.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/train_metadata.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/validation_metadata.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
preprocess_transcriptions.py CHANGED
@@ -23,7 +23,7 @@ def bracket_metatags(text):
23
 
24
  def remove_metatags(text):
25
  """Remove metatags for hesitations, laughter, paralinguistic sounds etc."""
26
- return re.sub(r"%\w\s", "", text)
27
 
28
  def remove_percentage_sign(text):
29
  """Remove percentage sign."""
@@ -58,7 +58,7 @@ def normalize_transcription(transcription: str, config="annotations"):
58
  """Normalize transcriptions according to orthographic standards, or verbatim."""
59
  t = transcription
60
  if config == "annotations":
61
- # Nothing do, return as is
62
  return t
63
  if config == "orthographic":
64
  t = remove_metatags(t)
@@ -70,9 +70,9 @@ def normalize_transcription(transcription: str, config="annotations"):
70
  t = bracket_metatags(t)
71
  t = remove_percentage_sign(t)
72
  t = remove_pound_sign(t)
73
- t = re.sub(r"C_O-to", "C O to", t)
 
74
  t = filter_backslash(t, left=True)
75
  t = remove_punctuation(t)
76
- # For both, at the end:
77
  t = replace_underscore(t)
78
  return t
 
23
 
24
  def remove_metatags(text):
25
  """Remove metatags for hesitations, laughter, paralinguistic sounds etc."""
26
+ return re.sub(r"%\w+\s", "", text)
27
 
28
  def remove_percentage_sign(text):
29
  """Remove percentage sign."""
 
58
  """Normalize transcriptions according to orthographic standards, or verbatim."""
59
  t = transcription
60
  if config == "annotations":
61
+ # Nothing to do, return as is
62
  return t
63
  if config == "orthographic":
64
  t = remove_metatags(t)
 
70
  t = bracket_metatags(t)
71
  t = remove_percentage_sign(t)
72
  t = remove_pound_sign(t)
73
+ t = re.sub(r"C_O-to", "C O to", t) ## NB! "dette C_O-to-pro..." becomes "dette C O topros..."
74
+ # TODO: handle hyphens instead of removing them?
75
  t = filter_backslash(t, left=True)
76
  t = remove_punctuation(t)
 
77
  t = replace_underscore(t)
78
  return t