-
Notifications
You must be signed in to change notification settings - Fork 63
Add initial support for SpaCy and SudachiPy parsers. #193
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
base: master
Are you sure you want to change the base?
Conversation
So I am nearly finished on a separate anki plugin that will install and manage spacy and its models for you. You won't need to have a python installed on your computer. Additionally, I have made changes to morphman that will listen to events from this spacy plugin and will register morpemizers for all installed language models. |
That's great, I won't land this then. What's your timeline for the new plugin? |
@rteabeault how's it going with the SpaCy installer? |
@ianki I thought I was almost done, but I just ran into a significant problem with the package installation. My goal was to allow people to install all needed packages without having a separate python installed. I thought I had this working but what I didn't realize is that pip is (in some cases) forking a subprocess and calling python directly on |
@rteabeault interesting. Did you have that pip code in a repo? |
@ianki The code is in a private repo but I will put the pip code here:
Because pip is calling python in a subprocess and because anki does not ship with a "real" python this will not work as is. Now my addon does two things.
I could force the user to install python on their system to use the addon. This is unfortunate in my opinion as it creates a complexity with the addon that I had preferred not pass onto the user. At this point I am not sure of how else to get around this. Another option is to ditch the UI altogether and just keep the hook passing part. Make the user's just pip install spacy and its models. When anki starts up it could look in the user's python site-packages and send the appropriate hooks to Morphman for what is installed. That would still be a decent experience I think. |
@rteabeault thanks, I see the issue. I was able to get Spacy's modules installed after changing these subprocess calls to exec(). .\pip_internal\operations\build\metadata_legacy.py
.\pip_internal\operations\install\legacy.py
I've actually gotten the modules to install without an external Python. Are you interested in experimenting further? |
@rteabeault here's the modified pip.zip. |
I definitely am interested in experimenting further. I will take a look at this tomorrow. Thanks so much for looking at this! |
Cool. I have been testing this and it seems to work well, but we should test on multiple platforms. A few questions on my mind -
|
Hi @ianki. Your patch seems to be working for me on OS X. What OS were you testing on? Once I realized that we couldn't package Morphman with spacy I decided to create the package manager. I thought installing spacy and its models and then adding the spacy package to the sys path may be useful to other addon developers so I decided to make it a separate addon. Now with that said I could be convinced to make it part of Morphman but I wanted to give it maximum usability. And in its current state we could expand what I have to handle other NLP packages. What do you think? In the meantime I am going to continue "finishing" this addon. We can decide to roll it into Morphman later and/or add support other packages. |
I've tested this on Windows and Mac and it seems to be working with the 'spacy' models. No objection on my side to finishing the add-on. I also tried it with 'fugashi', and though the package gets installed it ends up missing the necessary mecab.dll, but I haven't debugged it further. |
No description provided.