trankit
trankit copied to clipboard
Single shared configuration for all Pipeline instances
Hi, What I did:
- create two Pipeline instances for processing two languages (file global_config_demo.py, attached as text file because of github limitations global_config_demo.py.txt)
- try to split sentence with one instance
What I get: Error with the language from another instance (file console.log)
What I expected to get: Split sentence without error.
Root of the problem All instances share the same configuration so the only usage scenario is single threaded processing requests one by one: https://github.com/nlp-uoregon/trankit/blob/master/trankit/pipeline.py#L166
How to fix do not mix global and instance options and handle them in code separately
Working solution Make an isolated copy of config for each Pipeline instance (global_config_demo_fixed.py.txt)
Is there any reason for global singleton Pipeline instance configuration? Thank you.