Rausda6 commited on
Commit
9e53d7b
·
verified ·
1 Parent(s): 5c706fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -193,14 +193,15 @@ class PodcastGenerator:
193
  add_log("⚠️ No valid JSON found, creating fallback")
194
  return self.create_fallback_podcast(text)
195
 
196
- def conversation_to_json(self,text: str) -> Dict:
197
  """Convert speaker-formatted text to podcast JSON structure"""
198
- lines = re.findall(r'[Ss]peaker\s*([12])\s*:\s*(.+)', text)
199
- podcast = [{"speaker": int(s), "line": l.strip()} for s, l in lines]
200
- return {
201
- "topic": "Generated from Input",
202
- "podcast": podcast
203
- }
 
204
 
205
  def validate_podcast_structure(self, data: Dict) -> bool:
206
  """Validate podcast JSON structure"""
 
193
  add_log("⚠️ No valid JSON found, creating fallback")
194
  return self.create_fallback_podcast(text)
195
 
196
+ def conversation_to_json(self, text: str) -> Dict:
197
  """Convert speaker-formatted text to podcast JSON structure"""
198
+ lines = re.findall(r'[Ss]peaker\s*([12])\s*:\s*(.*)', text)
199
+ podcast = [{"speaker": int(s), "line": l.strip()} for s, l in lines]
200
+ return {
201
+ "topic": "Generated from Input",
202
+ "podcast": podcast
203
+ }
204
+
205
 
206
  def validate_podcast_structure(self, data: Dict) -> bool:
207
  """Validate podcast JSON structure"""