Markk commited on
Commit
58ebaff
1 Parent(s): 22f267e

Upload v2.1 Dataset Tool

Browse files
Files changed (1) hide show
  1. dataset_tool.py +16 -8
dataset_tool.py CHANGED
@@ -30,12 +30,12 @@ print()
30
 
31
 
32
  # list of known speakers
33
- known_speakers = (["All", "Anchovy", "BarnacleBoy", "Both", "BubbleBass", "ClamHeadCandyCad", "Crowd",
34
- "Customer", "Fred", "Fireman", "Gary", "guy", "Karen", "Krabs", "Larry", "Loser", "MermaidMan",
35
- "Montage", "MrsSquarePants", "MrSquarePants", "Morty", "NematodeOne", "Nematodes", "Narrator",
36
- "OrangeCafeteriaWorker", "Pants", "Patrick", "PatrickBubble", "Phil", "Plankton", "Pearl",
37
- "Puff", "Sandy", "Scooter", "ShadyShoalsCaretaker", "SpongeBob", "SpongeBobBubble",
38
- "Squidward", "SquidwardBubble", "SwordfishTrucker", "TVAnnouncer", "UnknownElderlyFish"]
39
  )
40
  ep_id = "x"
41
 
@@ -101,7 +101,7 @@ while True:
101
  if match:
102
  speaker = match.group(1)
103
  replica = match.group(2)
104
- if speaker not in known_speakers or speaker is None:
105
  speaker = "{system}"
106
  if speaker == "Krabs":
107
  speaker = "Mr. Krabs"
@@ -119,9 +119,13 @@ while True:
119
  speaker = "Sports guy"
120
  else:
121
  match = re.search(r"I(\d+):\s*(.*)", line)
 
122
  if match:
123
  speaker = f"Incidental {match.group(1)}"
124
  replica = match.group(2)
 
 
 
125
  elif line.startswith("["):
126
  speaker = "{system}"
127
  replica = line
@@ -150,7 +154,7 @@ while True:
150
  if match:
151
  speaker = match.group(1)
152
  replica = match.group(2)
153
- if speaker not in known_speakers or speaker is None:
154
  speaker = "{system}"
155
  if speaker == "Krabs":
156
  speaker = "Mr. Krabs"
@@ -164,9 +168,13 @@ while True:
164
  speaker = "Sports guy"
165
  else:
166
  match = re.search(r"I(\d+):\s*(.*)", input_string)
 
167
  if match:
168
  speaker = f"Incidental {match.group(1)}"
169
  replica = match.group(2)
 
 
 
170
  elif input_string.startswith("["):
171
  speaker = "{system}"
172
  replica = input_string
 
30
 
31
 
32
  # list of known speakers
33
+ known_speakers = (["All", "AngryCrowd", "Anchovy", "BarnacleBoy", "Both", "BubbleBass", "ClamHeadCandyCad", "Crowd", "Cowboy", "Clams",
34
+ "Customer", "Fred", "FlyingDutchman", "Fireman", "Gary", "Group", "guy", "Karen", "Kid", "Kids", "King", "Krabs", "Larry", "Loser", "MermaidMan",
35
+ "Montage", "MrsSquarePants", "MrSquarePants", "Morty", "MovieWoman", "Measurer", "Mother", "NematodeOne", "Nematodes", "NormanRockbass", "Narrator",
36
+ "OrangeCafeteriaWorker", "Octavius", "Pants", "Patrick", "PatTron", "PatrickBubble", "Phil", "Plankton", "Pearl",
37
+ "Puff", "Sandy", "Scooter", "ShadyShoalsCaretaker", "SpongeBob", "SpongeTron", "SpongeTrons", "SpongeBobBubble", "Voice", "Voices", "VolcanoSauceDrop",
38
+ "Squidward", "SquidwardBubble", "SwordfishTrucker", "TVAnnouncer", "TV", "TimeMachine", "UnknownElderlyFish"]
39
  )
40
  ep_id = "x"
41
 
 
101
  if match:
102
  speaker = match.group(1)
103
  replica = match.group(2)
104
+ if speaker is None:
105
  speaker = "{system}"
106
  if speaker == "Krabs":
107
  speaker = "Mr. Krabs"
 
119
  speaker = "Sports guy"
120
  else:
121
  match = re.search(r"I(\d+):\s*(.*)", line)
122
+ match2 = re.search(r"T(\d+):\s*(.*)", line)
123
  if match:
124
  speaker = f"Incidental {match.group(1)}"
125
  replica = match.group(2)
126
+ elif match2:
127
+ speaker = f"Teen {match2.group(1)}"
128
+ replica = match2.group(2)
129
  elif line.startswith("["):
130
  speaker = "{system}"
131
  replica = line
 
154
  if match:
155
  speaker = match.group(1)
156
  replica = match.group(2)
157
+ if speaker is None:
158
  speaker = "{system}"
159
  if speaker == "Krabs":
160
  speaker = "Mr. Krabs"
 
168
  speaker = "Sports guy"
169
  else:
170
  match = re.search(r"I(\d+):\s*(.*)", input_string)
171
+ match2 = re.search(r"T(\d+):\s*(.*)", input_string)
172
  if match:
173
  speaker = f"Incidental {match.group(1)}"
174
  replica = match.group(2)
175
+ elif match2:
176
+ speaker = f"Teen {match2.group(1)}"
177
+ replica = match2.group(2)
178
  elif input_string.startswith("["):
179
  speaker = "{system}"
180
  replica = input_string