[Bug]: SEOFilter drops keywords and weights in dump()/load()
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 38/100
Direzione di ricerca
Start with SEOFilter in crawl4ai/deep_crawling/filters.py and compare its serialization with the deep-crawl filters fixed in #2425. Reproduce the loss using the snippet in the issue, then check to_serializable_dict() and CrawlerRunConfig.dump()/load(). Done means keywords and custom weights survive a round trip and the loaded filter scores pages with them.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
crawl4ai version
0.9.5 (also on develop)
Expected Behavior
SEOFilter keeps keywords and weights through to_serializable_dict() / CrawlerRunConfig.dump() and load(), like the other deep-crawl filters after #2425.
Current Behavior
SEOFilter compiles its keywords into a regex and keeps only the pattern (_kw_patterns), and keeps weights in a private slot, so both are dropped when serialized:
SEOFilter(threshold=0.5, keywords=["python"], weights={"title_kw": 1.0})
-> {'type': 'SEOFilter', 'params': {'threshold': 0.5}}
A loaded filter then scores pages with no keywords and the default weights.
Is this reproducible?
Yes
Inputs Causing the Bug
Any SEOFilter with keywords or weights.
Steps to Reproduce
Run the snippet below.
Code snippets
from crawl4ai.async_configs import to_serializable_dict
from crawl4ai.deep_crawling.filters import SEOFilter
print(to_serializable_dict(SEOFilter(threshold=0.5, keywords=["python"], weights={"title_kw": 1.0})))
# {'type': 'SEOFilter', 'params': {'threshold': 0.5}}
OS
Windows 11 (platform-independent)
Python version
3.13
Browser
Not involved
Error logs & Screenshots (if applicable)
None; no error is raised.
Found by @SohamKukreti in the review of #2425. Unlike the classes fixed there, the raw keyword list has to be stored, not only exposed, because only the compiled pattern was kept. I'll open a PR.
- Lingua principale
- Python
- Stelle
- 87.2k
- Fork
- 9.1k
- Merge medio
- 1g 6h
- PR unite (30g)
- 25
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di unclecode/crawl4ai
-
BUG: UserAgentGenerator.generate ignores browser_type and returns a random browser stackForse già presa @HhH666-ux l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Hardened docker-compose (read_only) keeps full Chromium from starting: crashpad needs a writable ~/.configForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta🐞 Bug 📌 Root caused
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
unclecode/crawl4ai#2494 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Crawl4aiDockerClient has no public option for the API token the 0.9 server requiresAperta⚙ Done ✨ Enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
⚙ Done 🐞 Bug 📌 Root caused
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: PDF images saved with save_images_locally=True come back with an empty src in result.mediaAperta⚙ Done 🐞 Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
unclecode/crawl4ai#2469 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di unclecode/crawl4ai
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
521xueweihan/HelloGitHub#4385 ·
-
🐛 bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pdm-project/pdm#4012 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
pollen-robotics/reachy_mini_conversation_app#611 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 91/100
aws-samples/sample-per-model-bedrock#913 ·
I maintainer di solito rispondono entro 1 giorno
-
lesson-submission pending-review
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
Ikalus1988/MisakaNet#5115 ·
I maintainer di solito rispondono entro 1 giorno