r/learnpython • • 6d ago

Variability in langdetect output

Hi all,
I’m using Python to filter out rows that contains non-English text from a noisy 10,000-row Excel dataset, and the final count varies slightly between runs (for example, keeping 7,522 vs. 7,508 cells—a difference of less than 0.001% of total cells). Is that normal for noisy data, and is that level of variance acceptable for research?

Thanks all!

3 Upvotes

8 comments sorted by

View all comments

1

u/egotherapy 6d ago

In my experience, when strings are really short, langdetect has problems detecting languages correctly. I'd expect that you've filtered out really short/long/nonsense/corrupt text, but if not, that may account for some of the variability.

1

u/AR3126 6d ago

Thank you so much! This is helpful to know!