Open edsvisinditus opened 4 years ago
I ma having the same issue. Let me know how you resolve it
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?
same issue, any updates?
Same issue here, any update?
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.
@dongZheX can you show a code snippet of your proposed solution please?
"If you are experiencing initialization failure due to multiprocessing, the simplest solution is to run langtect.detect(xxx) once before running the multiprocessing program."
---- Replied Message ---- | From | Ahmed @.> | | Date | 12/07/2023 18:12 | | To | Mimino666/langdetect @.> | | Cc | dongZheX @.>, Mention @.> | | Subject | Re: [Mimino666/langdetect] LangDetectException - 'Need to load profiles.' (#65) |
@dongZheX can you show a code snippet of your proposed solution please?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
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
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.