to filter out the noise for training, we've had to implement a strict n-gram entropy check combined with fastText LID on our scraping pipelines
yeah, the entropy filter saved us a ton of garbage when ingesting user submissions, but watch out for timeouts if you're running it synchronously over massive payloads. we had our FastAPI workers locking up during peak scraping hours because an async httpx client was waiting on a heavy regex check inside the main thread loop.
make sure you offload that kind of text preprocessing to a background worker or process pool, otherwise your event loop will choke the second a crawler dumps a few thousand generated markdown files at once.