playlist-admin 2.15.25 → 2.15.27
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.
- package/package.json +1 -1
- package/rag/build_db.py +9 -1
- package/rag/study_build.py +2 -2
package/package.json
CHANGED
package/rag/build_db.py
CHANGED
|
@@ -284,7 +284,15 @@ def _main_build(client, args) -> None:
|
|
|
284
284
|
return bool(make_chunks(split_sentences(read_text_file(path))))
|
|
285
285
|
|
|
286
286
|
# 過濾非 podcast 的 .txt:目錄黑名單 + 檔名/大小門檻
|
|
287
|
-
_SKIP_DIRS = {
|
|
287
|
+
_SKIP_DIRS = {
|
|
288
|
+
'podcast_rag', '__pycache__', 'chroma_db', 'node_modules', '.git',
|
|
289
|
+
# 課程逐字稿已移到 study collection,不該出現在 podcast DB
|
|
290
|
+
'T夜工智CoCo英文S', 'T夜工智張瑀國文S', 'T夜工智胡傑數學S',
|
|
291
|
+
'機械群劉徹機械力學', '機械群劉徹機械力學S',
|
|
292
|
+
'機械群許凱機件原理', '機械群許凱機件原理S',
|
|
293
|
+
'機械群陳海程機械製圖', '機械群陳海程機械製圖S',
|
|
294
|
+
'機械群陳海程機械製造與實習', '機械群陳海程機械製造與實習S',
|
|
295
|
+
}
|
|
288
296
|
_SKIP_STEMS = {'README', 'changelog', 'license', 'requirements', 'setup', 'config'}
|
|
289
297
|
_MIN_TXT_BYTES = 100 # podcast 逐字稿至少 ~100 bytes
|
|
290
298
|
|
package/rag/study_build.py
CHANGED
|
@@ -241,10 +241,10 @@ def main():
|
|
|
241
241
|
continue
|
|
242
242
|
text = extract_pdf_text(fpath)
|
|
243
243
|
else:
|
|
244
|
-
|
|
244
|
+
text = fpath.read_text(encoding="utf-8-sig", errors="replace")
|
|
245
|
+
sig = content_sig(text[:4096])
|
|
245
246
|
if sig in done_sigs:
|
|
246
247
|
continue
|
|
247
|
-
text = fpath.read_text(encoding="utf-8-sig", errors="replace")
|
|
248
248
|
|
|
249
249
|
if not text or len(text.strip()) < 20:
|
|
250
250
|
continue
|