polytext 0.2.8b2__tar.gz → 0.2.8b3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {polytext-0.2.8b2 → polytext-0.2.8b3}/PKG-INFO +1 -1
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/converter/audio_to_text.py +9 -4
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext.egg-info/PKG-INFO +1 -1
- {polytext-0.2.8b2 → polytext-0.2.8b3}/setup.py +1 -1
- {polytext-0.2.8b2 → polytext-0.2.8b3}/LICENSE +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/README.md +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/__init__.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/converter/__init__.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/converter/base.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/converter/beautiful_text.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/converter/document_ocr_to_text.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/converter/document_ocr_to_text_azure_oai.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/converter/gemini_quality_guards.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/converter/html_to_md.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/converter/md_to_text.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/converter/ocr_to_text.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/converter/ocr_to_text_azure_oai.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/converter/pdf.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/converter/text_to_md.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/converter/video_to_audio.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/exceptions/__init__.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/exceptions/base.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/generator/__init__.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/generator/pdf.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/loader/__init__.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/loader/audio.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/loader/aws_auth.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/loader/base.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/loader/document.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/loader/document_ocr.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/loader/downloader/__init__.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/loader/downloader/downloader.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/loader/html.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/loader/markdown.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/loader/notebook.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/loader/ocr.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/loader/plain_text.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/loader/video.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/loader/xml_xbrl.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/loader/youtube.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/loader/youtube_llm.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/processor/__init__.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/processor/audio_chunker.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/processor/text_merger.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/processor/transcript_chunker.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/prompts/__init__.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/prompts/beautiful_text.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/prompts/ocr.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/prompts/text_merging.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/prompts/text_to_md.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/prompts/transcription.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/utils/__init__.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext/utils/utils.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext.egg-info/SOURCES.txt +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext.egg-info/dependency_links.txt +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext.egg-info/not-zip-safe +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext.egg-info/requires.txt +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/polytext.egg-info/top_level.txt +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/pyproject.toml +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/setup.cfg +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_audio_chunker.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_audio_comparison_helpers.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_audio_transcription_model_migration.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_aws_auth.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_base_loader_error_mapping.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_beautiful_text_manual.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_compare_audio_models.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_compare_document_ocr_to_text_models.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_compare_ocr_to_text_models.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_compare_youtube_models.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_dowload_audio_from_youtube.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_dowload_audio_from_youtube_helpers.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_extracted_text_whitespace.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_gemini_quality_guards.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_get_audio_transcript_from_gcs.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_get_customized_pdf_from_markdown.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_get_document_ocr.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_get_document_ocr_azure_oai.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_get_document_text.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_get_document_text_from_gcs.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_get_ocr_from_image.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_get_text_from_markdown.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_get_video_transcript_from_gcs.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_library.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_markdown_loader_gzip.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_markitdown_html.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_notebook_loader.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_ocr_fallbacks.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_ocr_image_descriptions.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_pain_text.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_pdf_conversion_error.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_python_version_metadata.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_split_audio_with_llm.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_transcribe_s3_images_from_csv.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_transcribe_s3_images_from_csv_script.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_xml_xbrl_loader.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_youtube_gemini_minimal_check.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_youtube_llm_fallbacks.py +0 -0
- {polytext-0.2.8b2 → polytext-0.2.8b3}/tests/test_youtube_transcript.py +0 -0
|
@@ -80,23 +80,30 @@ def add_line_break_after_each_sentence(text: str) -> str:
|
|
|
80
80
|
if not text:
|
|
81
81
|
return text
|
|
82
82
|
|
|
83
|
+
line_feed = chr(10)
|
|
83
84
|
lines = text.splitlines()
|
|
84
85
|
formatted_lines = []
|
|
85
86
|
|
|
86
87
|
for line in lines:
|
|
87
88
|
stripped_line = line.strip()
|
|
89
|
+
|
|
88
90
|
if not stripped_line:
|
|
89
91
|
formatted_lines.append("")
|
|
90
92
|
continue
|
|
93
|
+
|
|
91
94
|
if re.match(r"^#{1,6}\s+", stripped_line):
|
|
92
95
|
formatted_lines.append(stripped_line)
|
|
93
96
|
continue
|
|
94
97
|
|
|
95
98
|
normalized_line = re.sub(r"\s+", " ", stripped_line)
|
|
96
|
-
normalized_line = re.sub(
|
|
99
|
+
normalized_line = re.sub(
|
|
100
|
+
r"([.!?])\s+",
|
|
101
|
+
lambda match: f"{match.group(1)}{line_feed} ",
|
|
102
|
+
normalized_line,
|
|
103
|
+
)
|
|
97
104
|
formatted_lines.append(normalized_line)
|
|
98
105
|
|
|
99
|
-
return
|
|
106
|
+
return line_feed.join(formatted_lines).strip()
|
|
100
107
|
|
|
101
108
|
|
|
102
109
|
def create_ascii_safe_upload_copy(audio_file: str) -> tuple[str, str | None]:
|
|
@@ -537,8 +544,6 @@ class AudioToTextConverter:
|
|
|
537
544
|
)
|
|
538
545
|
|
|
539
546
|
response_text, marker_only = normalize_no_human_speech_marker(response_text)
|
|
540
|
-
if not marker_only:
|
|
541
|
-
response_text = self.format_audio_output_text(response_text)
|
|
542
547
|
|
|
543
548
|
response_dict = {
|
|
544
549
|
"transcript": "" if marker_only else response_text,
|
|
@@ -51,7 +51,7 @@ def get_requirements(*requirements_file):
|
|
|
51
51
|
|
|
52
52
|
setup(
|
|
53
53
|
name='polytext',
|
|
54
|
-
version='0.2.
|
|
54
|
+
version='0.2.8b3',
|
|
55
55
|
url='https://github.com/docsity/polytext',
|
|
56
56
|
# download_url='https://github.com/pualien/py-polytext/archive/0.1.23.tar.gz',
|
|
57
57
|
license='MIT',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|