lore-ai 0.1.2__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.
Files changed (42) hide show
  1. lore_ai-0.1.2/LICENSE +21 -0
  2. lore_ai-0.1.2/PKG-INFO +150 -0
  3. lore_ai-0.1.2/README.md +108 -0
  4. lore_ai-0.1.2/pyproject.toml +70 -0
  5. lore_ai-0.1.2/setup.cfg +4 -0
  6. lore_ai-0.1.2/src/__init__.py +0 -0
  7. lore_ai-0.1.2/src/audio/normalise.py +45 -0
  8. lore_ai-0.1.2/src/audio/player.py +49 -0
  9. lore_ai-0.1.2/src/lore_ai.egg-info/PKG-INFO +150 -0
  10. lore_ai-0.1.2/src/lore_ai.egg-info/SOURCES.txt +40 -0
  11. lore_ai-0.1.2/src/lore_ai.egg-info/dependency_links.txt +1 -0
  12. lore_ai-0.1.2/src/lore_ai.egg-info/entry_points.txt +2 -0
  13. lore_ai-0.1.2/src/lore_ai.egg-info/requires.txt +18 -0
  14. lore_ai-0.1.2/src/lore_ai.egg-info/top_level.txt +7 -0
  15. lore_ai-0.1.2/src/lore_core/__init__.py +0 -0
  16. lore_ai-0.1.2/src/lore_core/audio_classifier.py +126 -0
  17. lore_ai-0.1.2/src/lore_core/bagit_exporter.py +88 -0
  18. lore_ai-0.1.2/src/lore_core/diarization.py +130 -0
  19. lore_ai-0.1.2/src/lore_core/engine.py +69 -0
  20. lore_ai-0.1.2/src/lore_core/exporters/__init__.py +0 -0
  21. lore_ai-0.1.2/src/lore_core/global_search.py +197 -0
  22. lore_ai-0.1.2/src/lore_core/languages.py +32 -0
  23. lore_ai-0.1.2/src/lore_core/llm_worker.py +84 -0
  24. lore_ai-0.1.2/src/lore_core/ner_worker.py +80 -0
  25. lore_ai-0.1.2/src/lore_core/ohms_exporter.py +162 -0
  26. lore_ai-0.1.2/src/lore_core/rag_worker.py +84 -0
  27. lore_ai-0.1.2/src/lore_core/taxonomy_manager.py +152 -0
  28. lore_ai-0.1.2/src/lore_core/translation_worker.py +113 -0
  29. lore_ai-0.1.2/src/main.py +25 -0
  30. lore_ai-0.1.2/src/transcription/worker.py +95 -0
  31. lore_ai-0.1.2/src/ui/file_picker.py +101 -0
  32. lore_ai-0.1.2/src/ui/global_search_dialog.py +157 -0
  33. lore_ai-0.1.2/src/ui/main_window.py +465 -0
  34. lore_ai-0.1.2/src/ui/metadata_widget.py +136 -0
  35. lore_ai-0.1.2/src/ui/settings_dialog.py +134 -0
  36. lore_ai-0.1.2/src/ui/transcript_widget.py +252 -0
  37. lore_ai-0.1.2/src/ui/waveform_widget.py +139 -0
  38. lore_ai-0.1.2/src/utils/model_manager.py +113 -0
  39. lore_ai-0.1.2/src/utils/token_vault.py +55 -0
  40. lore_ai-0.1.2/tests/test_bagit.py +38 -0
  41. lore_ai-0.1.2/tests/test_e2e_workflow.py +98 -0
  42. lore_ai-0.1.2/tests/test_global_search.py +70 -0
lore_ai-0.1.2/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lore Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
lore_ai-0.1.2/PKG-INFO ADDED
@@ -0,0 +1,150 @@
1
+ Metadata-Version: 2.4
2
+ Name: lore-ai
3
+ Version: 0.1.2
4
+ Summary: Privacy-first, local-only oral history transcription.
5
+ Author: Digital Heritage Lab
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/mabo-du/lore
8
+ Project-URL: Documentation, https://github.com/mabo-du/lore/blob/main/USER_GUIDE.md
9
+ Project-URL: Repository, https://github.com/mabo-du/lore.git
10
+ Project-URL: Issue Tracker, https://github.com/mabo-du/lore/issues
11
+ Keywords: oral-history,transcription,whisper,archival,offline
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Education
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Requires-Python: >=3.12
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: faster-whisper
25
+ Requires-Dist: PyQt6
26
+ Requires-Dist: imageio-ffmpeg
27
+ Requires-Dist: platformdirs
28
+ Requires-Dist: lxml
29
+ Requires-Dist: numpy
30
+ Requires-Dist: tsdownsample
31
+ Requires-Dist: pyannote-audio==3.3.2
32
+ Requires-Dist: resemblyzer>=0.1.4
33
+ Requires-Dist: gliner2-onnx>=0.1.1
34
+ Requires-Dist: llama-cpp-python>=0.3.25
35
+ Requires-Dist: sqlite-vec>=0.1.9
36
+ Requires-Dist: fastembed>=0.8.0
37
+ Requires-Dist: cryptography>=42.0
38
+ Provides-Extra: diarization
39
+ Requires-Dist: pyannote-audio; extra == "diarization"
40
+ Requires-Dist: Resemblyzer; extra == "diarization"
41
+ Dynamic: license-file
42
+
43
+ <div align="center">
44
+ <img src="https://img.shields.io/badge/Local_First-100%25-brightgreen.svg?style=for-the-badge" alt="Local First">
45
+ <img src="https://img.shields.io/badge/Python-3.12+-blue.svg?style=for-the-badge&logo=python" alt="Python 3.12+">
46
+ <img src="https://img.shields.io/badge/PyQt6-UI-blueviolet.svg?style=for-the-badge" alt="PyQt6">
47
+ <img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge" alt="MIT License">
48
+ <img src="https://img.shields.io/github/actions/workflow/status/mabo-du/lore/ci.yml?branch=main&style=for-the-badge" alt="CI">
49
+ <img src="https://img.shields.io/pypi/v/lore-ai.svg?style=for-the-badge" alt="PyPI">
50
+
51
+ <h1>Lore 🎙️</h1>
52
+
53
+ <p><strong>Privacy-First, Local-Only Oral History Transcription & Archiving</strong></p>
54
+ </div>
55
+
56
+ ---
57
+
58
+ **Lore** is a desktop application designed for historians, archivists, and researchers. It provides state-of-the-art AI transcription, speaker diarization, named entity recognition, and translation—**100% offline, on your own hardware.**
59
+
60
+ No data leaves your computer. No cloud subscriptions. Just powerful, open-source AI packaged into a clean, intuitive PyQt6 interface.
61
+
62
+ <img src="https://raw.githubusercontent.com/mabo-du/lore/main/docs/images/lore_main.png" alt="Lore Main Window" width="800">
63
+
64
+ ## ✨ Features
65
+
66
+ - 🎧 **Offline Transcription:** Powered by `faster-whisper`, optimized for CPU inference with low memory overhead (< 8GB RAM).
67
+ - 🗣️ **Speaker Diarization:** Automatically identifies and labels different speakers using `pyannote.audio`.
68
+ - 🔍 **Word-Level Confidence:** Low-confidence words are visually highlighted so you can quickly spot potential hallucinations.
69
+ - 🌍 **Local Translation:** Translate transcripts to over 200 languages completely offline using Meta's `NLLB-200` model.
70
+ - 📖 **Custom Vocabulary:** Provide local jargon, proper nouns, and historical terms to guide Whisper's decoding graph for maximum accuracy.
71
+ - 🏷️ **Named Entity Recognition:** Uses `GLiNER` to automatically extract people, organizations, dates, and locations.
72
+ - 📦 **Archival Exporting:** Export your work to the **OHMS XML** format or create an **RFC 8493 BagIt** archival package with SHA-256 checksum verification.
73
+ - 🔎 **Global Archive Search:** A unified SQLite database (`FTS5` + `sqlite-vec`) lets you instantly search across all your past projects using keyword or semantic/conceptual search.
74
+
75
+ ## 🚀 Installation
76
+
77
+ ### Option 1: Pre-built Installers (Recommended)
78
+
79
+ Download the installer for your platform from the [latest release](https://github.com/mabo-du/lore/releases/latest):
80
+
81
+ | Platform | Installer |
82
+ |----------|-----------|
83
+ | 🪟 **Windows** | `lore-windows-x86_64.zip` — Extract and run `lore.exe` |
84
+ | 🍎 **macOS** | `lore-macos-arm64.tar.gz` — Extract and run `lore` |
85
+ | 🐧 **Linux** | `lore-linux-x86_64.tar.gz` — Extract and run `lore` |
86
+
87
+ ### Option 2: Install from PyPI
88
+
89
+ ```bash
90
+ pip install lore-ai
91
+ lore
92
+ ```
93
+
94
+ ### Option 3: Install from Source
95
+
96
+ Lore requires **Python 3.12+** and is cross-platform (Windows, macOS, Linux).
97
+
98
+ 1. **Clone the repository:**
99
+ ```bash
100
+ git clone https://github.com/mabo-du/lore.git
101
+ cd lore
102
+ ```
103
+
104
+ 2. **Set up a virtual environment:**
105
+ ```bash
106
+ python -m venv .venv
107
+ source .venv/bin/activate # On Windows: .venv\Scripts\activate
108
+ ```
109
+
110
+ 3. **Install the application:**
111
+ ```bash
112
+ pip install -e .
113
+ ```
114
+
115
+ ## 🎮 Usage
116
+
117
+ Start the Lore application:
118
+
119
+ ```bash
120
+ lore
121
+ ```
122
+
123
+ Or launch from your system's application menu if installed via the pre-built installer.
124
+
125
+ 1. **Select an Audio File:** Click "Browse" to select any standard audio format (WAV, MP3, M4A, OGG, FLAC).
126
+ 2. **Configure Settings:** Click the ⚙️ Settings icon to set your Custom Vocabulary and speaker diarization preferences.
127
+
128
+ <img src="https://raw.githubusercontent.com/mabo-du/lore/main/docs/images/lore_settings.png" alt="Lore Settings" width="400">
129
+
130
+ 3. **Transcribe & Diarize:** Click "Transcribe" on the toolbar. If recording has multiple speakers, check the "Enable Speaker Diarization" box.
131
+ 4. **Edit & Review:** Play the audio, click on segments to edit them, and review any low-confidence words highlighted in red.
132
+ 5. **Translate:** Select a target language from the dropdown and click "Translate" for fully offline translation.
133
+ 6. **Export:** Fill out the Metadata panel and export to **OHMS XML** or an Archival **BagIt Package**.
134
+
135
+ For detailed instructions, see the [User Guide](USER_GUIDE.md).
136
+
137
+ ## 🏗️ Architecture
138
+
139
+ Lore is designed with strict sequential memory management to run on older hardware.
140
+ - Models are loaded into memory one at a time (e.g., Whisper loads, transcribes, unloads → NLLB loads, translates, unloads).
141
+ - Heavy use of CTranslate2 (INT8 quantization) ensures models run blazingly fast without needing a dedicated GPU.
142
+ - The UI runs asynchronously using PyQt6's `QThread` and Signals, keeping the interface completely responsive during heavy AI workloads.
143
+
144
+ ## 🤝 Contributing
145
+
146
+ Lore is an open-source project. We welcome pull requests, bug reports, and feature requests. Please see our [User Guide](USER_GUIDE.md) for more detailed workflows and documentation on the codebase.
147
+
148
+ ## 📜 License
149
+
150
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,108 @@
1
+ <div align="center">
2
+ <img src="https://img.shields.io/badge/Local_First-100%25-brightgreen.svg?style=for-the-badge" alt="Local First">
3
+ <img src="https://img.shields.io/badge/Python-3.12+-blue.svg?style=for-the-badge&logo=python" alt="Python 3.12+">
4
+ <img src="https://img.shields.io/badge/PyQt6-UI-blueviolet.svg?style=for-the-badge" alt="PyQt6">
5
+ <img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge" alt="MIT License">
6
+ <img src="https://img.shields.io/github/actions/workflow/status/mabo-du/lore/ci.yml?branch=main&style=for-the-badge" alt="CI">
7
+ <img src="https://img.shields.io/pypi/v/lore-ai.svg?style=for-the-badge" alt="PyPI">
8
+
9
+ <h1>Lore 🎙️</h1>
10
+
11
+ <p><strong>Privacy-First, Local-Only Oral History Transcription & Archiving</strong></p>
12
+ </div>
13
+
14
+ ---
15
+
16
+ **Lore** is a desktop application designed for historians, archivists, and researchers. It provides state-of-the-art AI transcription, speaker diarization, named entity recognition, and translation—**100% offline, on your own hardware.**
17
+
18
+ No data leaves your computer. No cloud subscriptions. Just powerful, open-source AI packaged into a clean, intuitive PyQt6 interface.
19
+
20
+ <img src="https://raw.githubusercontent.com/mabo-du/lore/main/docs/images/lore_main.png" alt="Lore Main Window" width="800">
21
+
22
+ ## ✨ Features
23
+
24
+ - 🎧 **Offline Transcription:** Powered by `faster-whisper`, optimized for CPU inference with low memory overhead (< 8GB RAM).
25
+ - 🗣️ **Speaker Diarization:** Automatically identifies and labels different speakers using `pyannote.audio`.
26
+ - 🔍 **Word-Level Confidence:** Low-confidence words are visually highlighted so you can quickly spot potential hallucinations.
27
+ - 🌍 **Local Translation:** Translate transcripts to over 200 languages completely offline using Meta's `NLLB-200` model.
28
+ - 📖 **Custom Vocabulary:** Provide local jargon, proper nouns, and historical terms to guide Whisper's decoding graph for maximum accuracy.
29
+ - 🏷️ **Named Entity Recognition:** Uses `GLiNER` to automatically extract people, organizations, dates, and locations.
30
+ - 📦 **Archival Exporting:** Export your work to the **OHMS XML** format or create an **RFC 8493 BagIt** archival package with SHA-256 checksum verification.
31
+ - 🔎 **Global Archive Search:** A unified SQLite database (`FTS5` + `sqlite-vec`) lets you instantly search across all your past projects using keyword or semantic/conceptual search.
32
+
33
+ ## 🚀 Installation
34
+
35
+ ### Option 1: Pre-built Installers (Recommended)
36
+
37
+ Download the installer for your platform from the [latest release](https://github.com/mabo-du/lore/releases/latest):
38
+
39
+ | Platform | Installer |
40
+ |----------|-----------|
41
+ | 🪟 **Windows** | `lore-windows-x86_64.zip` — Extract and run `lore.exe` |
42
+ | 🍎 **macOS** | `lore-macos-arm64.tar.gz` — Extract and run `lore` |
43
+ | 🐧 **Linux** | `lore-linux-x86_64.tar.gz` — Extract and run `lore` |
44
+
45
+ ### Option 2: Install from PyPI
46
+
47
+ ```bash
48
+ pip install lore-ai
49
+ lore
50
+ ```
51
+
52
+ ### Option 3: Install from Source
53
+
54
+ Lore requires **Python 3.12+** and is cross-platform (Windows, macOS, Linux).
55
+
56
+ 1. **Clone the repository:**
57
+ ```bash
58
+ git clone https://github.com/mabo-du/lore.git
59
+ cd lore
60
+ ```
61
+
62
+ 2. **Set up a virtual environment:**
63
+ ```bash
64
+ python -m venv .venv
65
+ source .venv/bin/activate # On Windows: .venv\Scripts\activate
66
+ ```
67
+
68
+ 3. **Install the application:**
69
+ ```bash
70
+ pip install -e .
71
+ ```
72
+
73
+ ## 🎮 Usage
74
+
75
+ Start the Lore application:
76
+
77
+ ```bash
78
+ lore
79
+ ```
80
+
81
+ Or launch from your system's application menu if installed via the pre-built installer.
82
+
83
+ 1. **Select an Audio File:** Click "Browse" to select any standard audio format (WAV, MP3, M4A, OGG, FLAC).
84
+ 2. **Configure Settings:** Click the ⚙️ Settings icon to set your Custom Vocabulary and speaker diarization preferences.
85
+
86
+ <img src="https://raw.githubusercontent.com/mabo-du/lore/main/docs/images/lore_settings.png" alt="Lore Settings" width="400">
87
+
88
+ 3. **Transcribe & Diarize:** Click "Transcribe" on the toolbar. If recording has multiple speakers, check the "Enable Speaker Diarization" box.
89
+ 4. **Edit & Review:** Play the audio, click on segments to edit them, and review any low-confidence words highlighted in red.
90
+ 5. **Translate:** Select a target language from the dropdown and click "Translate" for fully offline translation.
91
+ 6. **Export:** Fill out the Metadata panel and export to **OHMS XML** or an Archival **BagIt Package**.
92
+
93
+ For detailed instructions, see the [User Guide](USER_GUIDE.md).
94
+
95
+ ## 🏗️ Architecture
96
+
97
+ Lore is designed with strict sequential memory management to run on older hardware.
98
+ - Models are loaded into memory one at a time (e.g., Whisper loads, transcribes, unloads → NLLB loads, translates, unloads).
99
+ - Heavy use of CTranslate2 (INT8 quantization) ensures models run blazingly fast without needing a dedicated GPU.
100
+ - The UI runs asynchronously using PyQt6's `QThread` and Signals, keeping the interface completely responsive during heavy AI workloads.
101
+
102
+ ## 🤝 Contributing
103
+
104
+ Lore is an open-source project. We welcome pull requests, bug reports, and feature requests. Please see our [User Guide](USER_GUIDE.md) for more detailed workflows and documentation on the codebase.
105
+
106
+ ## 📜 License
107
+
108
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,70 @@
1
+ [project]
2
+ name = "lore-ai"
3
+ version = "0.1.2"
4
+ description = "Privacy-first, local-only oral history transcription."
5
+ readme = "README.md"
6
+ requires-python = ">=3.12"
7
+ license = { text = "MIT" }
8
+ authors = [
9
+ { name = "Digital Heritage Lab" }
10
+ ]
11
+ keywords = ["oral-history", "transcription", "whisper", "archival", "offline"]
12
+ classifiers = [
13
+ "Development Status :: 4 - Beta",
14
+ "Intended Audience :: Education",
15
+ "Intended Audience :: Science/Research",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Operating System :: OS Independent",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Programming Language :: Python :: 3.13",
20
+ "Topic :: Multimedia :: Sound/Audio :: Speech",
21
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
22
+ ]
23
+ dependencies = [
24
+ "faster-whisper",
25
+ "PyQt6",
26
+ "imageio-ffmpeg",
27
+ "platformdirs",
28
+ "lxml",
29
+ "numpy",
30
+ "tsdownsample",
31
+ "pyannote-audio==3.3.2",
32
+ "resemblyzer>=0.1.4",
33
+ "gliner2-onnx>=0.1.1",
34
+ "llama-cpp-python>=0.3.25",
35
+ "sqlite-vec>=0.1.9",
36
+ "fastembed>=0.8.0",
37
+ "cryptography>=42.0",
38
+ ]
39
+
40
+ [project.urls]
41
+ Homepage = "https://github.com/mabo-du/lore"
42
+ Documentation = "https://github.com/mabo-du/lore/blob/main/USER_GUIDE.md"
43
+ Repository = "https://github.com/mabo-du/lore.git"
44
+ "Issue Tracker" = "https://github.com/mabo-du/lore/issues"
45
+
46
+ [project.optional-dependencies]
47
+ diarization = [
48
+ "pyannote-audio",
49
+ "Resemblyzer",
50
+ ]
51
+
52
+ [project.scripts]
53
+ lore = "src.main:main"
54
+
55
+ [build-system]
56
+ requires = ["setuptools>=61.0.0", "wheel"]
57
+ build-backend = "setuptools.build_meta"
58
+
59
+ [tool.pytest.ini_options]
60
+ testpaths = ["tests"]
61
+ pythonpath = ["."]
62
+
63
+ [tool.ruff]
64
+ line-length = 88
65
+ target-version = "py312"
66
+
67
+ [dependency-groups]
68
+ dev = [
69
+ "pyinstaller>=6.20.0",
70
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
File without changes
@@ -0,0 +1,45 @@
1
+ import subprocess
2
+ from pathlib import Path
3
+ import imageio_ffmpeg
4
+
5
+
6
+ class AudioNormaliseError(Exception):
7
+ """Raised when audio normalization fails."""
8
+
9
+ pass
10
+
11
+
12
+ def normalise(input_path: Path, output_path: Path) -> None:
13
+ """
14
+ Normalise audio to 16kHz mono PCM with EBU R128 loudness normalisation.
15
+ This is required for optimal faster-whisper transcription of archival audio.
16
+ """
17
+ ffmpeg_exe = imageio_ffmpeg.get_ffmpeg_exe()
18
+
19
+ cmd = [
20
+ ffmpeg_exe,
21
+ "-y", # Overwrite output files
22
+ "-i",
23
+ str(input_path),
24
+ "-af",
25
+ "loudnorm", # EBU R128 loudness normalization
26
+ "-ar",
27
+ "16000", # 16 kHz sample rate
28
+ "-ac",
29
+ "1", # Mono (1 channel)
30
+ "-acodec",
31
+ "pcm_s16le", # 16-bit PCM
32
+ str(output_path),
33
+ ]
34
+
35
+ try:
36
+ # Run ffmpeg subprocess, capturing output for error reporting
37
+ subprocess.run(
38
+ cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
39
+ )
40
+ except subprocess.CalledProcessError as e:
41
+ raise AudioNormaliseError(
42
+ f"FFmpeg failed with exit code {e.returncode}:\n{e.stderr}"
43
+ )
44
+ except Exception as e:
45
+ raise AudioNormaliseError(f"Failed to execute FFmpeg: {str(e)}")
@@ -0,0 +1,49 @@
1
+ from PyQt6.QtCore import QObject, pyqtSignal, QUrl
2
+ from PyQt6.QtMultimedia import QMediaPlayer, QAudioOutput
3
+
4
+
5
+ class AudioPlayer(QObject):
6
+ """
7
+ AudioPlayer wraps QMediaPlayer to provide precise playback control
8
+ and frequent position updates for UI syncing.
9
+ """
10
+
11
+ position_changed = pyqtSignal(int)
12
+ duration_changed = pyqtSignal(int)
13
+ state_changed = pyqtSignal(QMediaPlayer.PlaybackState)
14
+
15
+ def __init__(self, parent=None):
16
+ super().__init__(parent)
17
+ self._player = QMediaPlayer(self)
18
+ self._audio_output = QAudioOutput(self)
19
+ self._player.setAudioOutput(self._audio_output)
20
+
21
+ # Fire position_changed every 50ms for tight waveform/transcript sync
22
+ self._player.positionChanged.connect(self.position_changed.emit)
23
+ self._player.durationChanged.connect(self.duration_changed.emit)
24
+ self._player.playbackStateChanged.connect(self.state_changed.emit)
25
+
26
+ # In PyQt6, notify interval can be set via QTimer, but QMediaPlayer handles it intrinsically or via positionChanged
27
+ # Actually QMediaPlayer in Qt6 emits positionChanged rapidly during playback.
28
+
29
+ def load(self, file_path: str):
30
+ self._player.setSource(QUrl.fromLocalFile(file_path))
31
+
32
+ def play(self):
33
+ self._player.play()
34
+
35
+ def pause(self):
36
+ self._player.pause()
37
+
38
+ def seek(self, ms: int):
39
+ self._player.setPosition(ms)
40
+
41
+ def position_ms(self) -> int:
42
+ return self._player.position()
43
+
44
+ def duration_ms(self) -> int:
45
+ return self._player.duration()
46
+
47
+ def set_volume(self, volume: float):
48
+ """Volume between 0.0 and 1.0"""
49
+ self._audio_output.setVolume(volume)
@@ -0,0 +1,150 @@
1
+ Metadata-Version: 2.4
2
+ Name: lore-ai
3
+ Version: 0.1.2
4
+ Summary: Privacy-first, local-only oral history transcription.
5
+ Author: Digital Heritage Lab
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/mabo-du/lore
8
+ Project-URL: Documentation, https://github.com/mabo-du/lore/blob/main/USER_GUIDE.md
9
+ Project-URL: Repository, https://github.com/mabo-du/lore.git
10
+ Project-URL: Issue Tracker, https://github.com/mabo-du/lore/issues
11
+ Keywords: oral-history,transcription,whisper,archival,offline
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Education
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Requires-Python: >=3.12
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: faster-whisper
25
+ Requires-Dist: PyQt6
26
+ Requires-Dist: imageio-ffmpeg
27
+ Requires-Dist: platformdirs
28
+ Requires-Dist: lxml
29
+ Requires-Dist: numpy
30
+ Requires-Dist: tsdownsample
31
+ Requires-Dist: pyannote-audio==3.3.2
32
+ Requires-Dist: resemblyzer>=0.1.4
33
+ Requires-Dist: gliner2-onnx>=0.1.1
34
+ Requires-Dist: llama-cpp-python>=0.3.25
35
+ Requires-Dist: sqlite-vec>=0.1.9
36
+ Requires-Dist: fastembed>=0.8.0
37
+ Requires-Dist: cryptography>=42.0
38
+ Provides-Extra: diarization
39
+ Requires-Dist: pyannote-audio; extra == "diarization"
40
+ Requires-Dist: Resemblyzer; extra == "diarization"
41
+ Dynamic: license-file
42
+
43
+ <div align="center">
44
+ <img src="https://img.shields.io/badge/Local_First-100%25-brightgreen.svg?style=for-the-badge" alt="Local First">
45
+ <img src="https://img.shields.io/badge/Python-3.12+-blue.svg?style=for-the-badge&logo=python" alt="Python 3.12+">
46
+ <img src="https://img.shields.io/badge/PyQt6-UI-blueviolet.svg?style=for-the-badge" alt="PyQt6">
47
+ <img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge" alt="MIT License">
48
+ <img src="https://img.shields.io/github/actions/workflow/status/mabo-du/lore/ci.yml?branch=main&style=for-the-badge" alt="CI">
49
+ <img src="https://img.shields.io/pypi/v/lore-ai.svg?style=for-the-badge" alt="PyPI">
50
+
51
+ <h1>Lore 🎙️</h1>
52
+
53
+ <p><strong>Privacy-First, Local-Only Oral History Transcription & Archiving</strong></p>
54
+ </div>
55
+
56
+ ---
57
+
58
+ **Lore** is a desktop application designed for historians, archivists, and researchers. It provides state-of-the-art AI transcription, speaker diarization, named entity recognition, and translation—**100% offline, on your own hardware.**
59
+
60
+ No data leaves your computer. No cloud subscriptions. Just powerful, open-source AI packaged into a clean, intuitive PyQt6 interface.
61
+
62
+ <img src="https://raw.githubusercontent.com/mabo-du/lore/main/docs/images/lore_main.png" alt="Lore Main Window" width="800">
63
+
64
+ ## ✨ Features
65
+
66
+ - 🎧 **Offline Transcription:** Powered by `faster-whisper`, optimized for CPU inference with low memory overhead (< 8GB RAM).
67
+ - 🗣️ **Speaker Diarization:** Automatically identifies and labels different speakers using `pyannote.audio`.
68
+ - 🔍 **Word-Level Confidence:** Low-confidence words are visually highlighted so you can quickly spot potential hallucinations.
69
+ - 🌍 **Local Translation:** Translate transcripts to over 200 languages completely offline using Meta's `NLLB-200` model.
70
+ - 📖 **Custom Vocabulary:** Provide local jargon, proper nouns, and historical terms to guide Whisper's decoding graph for maximum accuracy.
71
+ - 🏷️ **Named Entity Recognition:** Uses `GLiNER` to automatically extract people, organizations, dates, and locations.
72
+ - 📦 **Archival Exporting:** Export your work to the **OHMS XML** format or create an **RFC 8493 BagIt** archival package with SHA-256 checksum verification.
73
+ - 🔎 **Global Archive Search:** A unified SQLite database (`FTS5` + `sqlite-vec`) lets you instantly search across all your past projects using keyword or semantic/conceptual search.
74
+
75
+ ## 🚀 Installation
76
+
77
+ ### Option 1: Pre-built Installers (Recommended)
78
+
79
+ Download the installer for your platform from the [latest release](https://github.com/mabo-du/lore/releases/latest):
80
+
81
+ | Platform | Installer |
82
+ |----------|-----------|
83
+ | 🪟 **Windows** | `lore-windows-x86_64.zip` — Extract and run `lore.exe` |
84
+ | 🍎 **macOS** | `lore-macos-arm64.tar.gz` — Extract and run `lore` |
85
+ | 🐧 **Linux** | `lore-linux-x86_64.tar.gz` — Extract and run `lore` |
86
+
87
+ ### Option 2: Install from PyPI
88
+
89
+ ```bash
90
+ pip install lore-ai
91
+ lore
92
+ ```
93
+
94
+ ### Option 3: Install from Source
95
+
96
+ Lore requires **Python 3.12+** and is cross-platform (Windows, macOS, Linux).
97
+
98
+ 1. **Clone the repository:**
99
+ ```bash
100
+ git clone https://github.com/mabo-du/lore.git
101
+ cd lore
102
+ ```
103
+
104
+ 2. **Set up a virtual environment:**
105
+ ```bash
106
+ python -m venv .venv
107
+ source .venv/bin/activate # On Windows: .venv\Scripts\activate
108
+ ```
109
+
110
+ 3. **Install the application:**
111
+ ```bash
112
+ pip install -e .
113
+ ```
114
+
115
+ ## 🎮 Usage
116
+
117
+ Start the Lore application:
118
+
119
+ ```bash
120
+ lore
121
+ ```
122
+
123
+ Or launch from your system's application menu if installed via the pre-built installer.
124
+
125
+ 1. **Select an Audio File:** Click "Browse" to select any standard audio format (WAV, MP3, M4A, OGG, FLAC).
126
+ 2. **Configure Settings:** Click the ⚙️ Settings icon to set your Custom Vocabulary and speaker diarization preferences.
127
+
128
+ <img src="https://raw.githubusercontent.com/mabo-du/lore/main/docs/images/lore_settings.png" alt="Lore Settings" width="400">
129
+
130
+ 3. **Transcribe & Diarize:** Click "Transcribe" on the toolbar. If recording has multiple speakers, check the "Enable Speaker Diarization" box.
131
+ 4. **Edit & Review:** Play the audio, click on segments to edit them, and review any low-confidence words highlighted in red.
132
+ 5. **Translate:** Select a target language from the dropdown and click "Translate" for fully offline translation.
133
+ 6. **Export:** Fill out the Metadata panel and export to **OHMS XML** or an Archival **BagIt Package**.
134
+
135
+ For detailed instructions, see the [User Guide](USER_GUIDE.md).
136
+
137
+ ## 🏗️ Architecture
138
+
139
+ Lore is designed with strict sequential memory management to run on older hardware.
140
+ - Models are loaded into memory one at a time (e.g., Whisper loads, transcribes, unloads → NLLB loads, translates, unloads).
141
+ - Heavy use of CTranslate2 (INT8 quantization) ensures models run blazingly fast without needing a dedicated GPU.
142
+ - The UI runs asynchronously using PyQt6's `QThread` and Signals, keeping the interface completely responsive during heavy AI workloads.
143
+
144
+ ## 🤝 Contributing
145
+
146
+ Lore is an open-source project. We welcome pull requests, bug reports, and feature requests. Please see our [User Guide](USER_GUIDE.md) for more detailed workflows and documentation on the codebase.
147
+
148
+ ## 📜 License
149
+
150
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,40 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/__init__.py
5
+ src/main.py
6
+ src/audio/normalise.py
7
+ src/audio/player.py
8
+ src/lore_ai.egg-info/PKG-INFO
9
+ src/lore_ai.egg-info/SOURCES.txt
10
+ src/lore_ai.egg-info/dependency_links.txt
11
+ src/lore_ai.egg-info/entry_points.txt
12
+ src/lore_ai.egg-info/requires.txt
13
+ src/lore_ai.egg-info/top_level.txt
14
+ src/lore_core/__init__.py
15
+ src/lore_core/audio_classifier.py
16
+ src/lore_core/bagit_exporter.py
17
+ src/lore_core/diarization.py
18
+ src/lore_core/engine.py
19
+ src/lore_core/global_search.py
20
+ src/lore_core/languages.py
21
+ src/lore_core/llm_worker.py
22
+ src/lore_core/ner_worker.py
23
+ src/lore_core/ohms_exporter.py
24
+ src/lore_core/rag_worker.py
25
+ src/lore_core/taxonomy_manager.py
26
+ src/lore_core/translation_worker.py
27
+ src/lore_core/exporters/__init__.py
28
+ src/transcription/worker.py
29
+ src/ui/file_picker.py
30
+ src/ui/global_search_dialog.py
31
+ src/ui/main_window.py
32
+ src/ui/metadata_widget.py
33
+ src/ui/settings_dialog.py
34
+ src/ui/transcript_widget.py
35
+ src/ui/waveform_widget.py
36
+ src/utils/model_manager.py
37
+ src/utils/token_vault.py
38
+ tests/test_bagit.py
39
+ tests/test_e2e_workflow.py
40
+ tests/test_global_search.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ lore = src.main:main
@@ -0,0 +1,18 @@
1
+ faster-whisper
2
+ PyQt6
3
+ imageio-ffmpeg
4
+ platformdirs
5
+ lxml
6
+ numpy
7
+ tsdownsample
8
+ pyannote-audio==3.3.2
9
+ resemblyzer>=0.1.4
10
+ gliner2-onnx>=0.1.1
11
+ llama-cpp-python>=0.3.25
12
+ sqlite-vec>=0.1.9
13
+ fastembed>=0.8.0
14
+ cryptography>=42.0
15
+
16
+ [diarization]
17
+ pyannote-audio
18
+ Resemblyzer