Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LangDetectException - 'Need to load profiles.' #65

Open
edsvisinditus opened this issue Nov 14, 2019 · 8 comments
Open

LangDetectException - 'Need to load profiles.' #65

edsvisinditus opened this issue Nov 14, 2019 · 8 comments

Comments

@edsvisinditus
Copy link

Hi,

I sometimes get a LangDetectException which tells me: 'Need to load profiles.'

Is there a way to check if all languages have been loaded before calling the detect method?

Thank you in advance.

@jinalpanchall
Copy link

I ma having the same issue. Let me know how you resolve it

@CodeMazeSolver
Copy link

Hi there,
seems to be an issue still. I'm also running into the same problem. Is there already a solution to check if the profiles have been loaded before calling the detect method?

Bild_2022-12-15_092316571

@Guust-Franssens
Copy link

same issue, any updates?

@mherkhachatryan
Copy link

Same issue here, any update?

@dongZheX
Copy link

For me, this issue may be caused by the use of a multi-process program.
If "detect" function is executed in multiple threads before _factory is properly initialized, it will cause _factory to not be properly initialized.

The solution is to execute a detect operation during the formal multi-threaded request.

Alternatively, add a thread lock in init_factory to ensure that only one thread is executing init_factory.

@anjifenjou
Copy link

@dongZheX can you show a code snippet of your proposed solution please?

@dongZheX
Copy link

dongZheX commented Dec 7, 2023 via email

@anjifenjou
Copy link

My solution was to move to lingua-py which is most faster, more accurate on some languages (cf #51 #109 #9) and offer built-in parallel alternatives

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants