feat: Add smart paragraph merging mode with AI grouping
Some checks failed
Deploy Documentation / deploy (push) Has been cancelled
Some checks failed
Deploy Documentation / deploy (push) Has been cancelled
- Add "smart" split mode that uses LLM to intelligently merge related paragraphs - Implement two-step approach: analyze text structure, then group by semantic relevance - Add paragraph_merging.py with analysis and grouping prompts - Update UI to support smart mode selection with auto-detect hint - Add i18n translations for smart mode (en_US, zh_CN) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -65,6 +65,7 @@ def render_content_input():
|
||||
"paragraph": tr("split.mode_paragraph"),
|
||||
"line": tr("split.mode_line"),
|
||||
"sentence": tr("split.mode_sentence"),
|
||||
"smart": tr("split.mode_smart"),
|
||||
}
|
||||
split_mode = st.selectbox(
|
||||
tr("split.mode_label"),
|
||||
@@ -73,8 +74,16 @@ def render_content_input():
|
||||
index=0, # Default to paragraph mode
|
||||
help=tr("split.mode_help")
|
||||
)
|
||||
|
||||
# Show info for smart mode (auto-detect segment count)
|
||||
if split_mode == "smart":
|
||||
st.info(tr("split.smart_auto_hint"))
|
||||
target_segments = None # Auto-detect
|
||||
else:
|
||||
target_segments = None # Not used for other modes
|
||||
else:
|
||||
split_mode = "paragraph" # Default for generate mode (not used)
|
||||
target_segments = None
|
||||
|
||||
# Title input (optional for both modes)
|
||||
title = st.text_input(
|
||||
@@ -105,7 +114,8 @@ def render_content_input():
|
||||
"text": text,
|
||||
"title": title,
|
||||
"n_scenes": n_scenes,
|
||||
"split_mode": split_mode
|
||||
"split_mode": split_mode,
|
||||
"target_segments": target_segments
|
||||
}
|
||||
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user