Hyperparameter tuning of a spaCy NER model, with Vertex AI #11126
-
Hello everyone, I want to perform some hyperparameter tuning of an spaCy model, but using Vertex AI: Hyperparameter Tuning (I have seen that there is a way to do this exact task using W&B, but I can’t use it, as my company already uses Google Cloud Platform due to info safety reasons, and probably won't be very happy about me moving customer data to some other platform 😅). I will use a deductive approach of this problem, so I have the following questions:
I think after getting a bit clearer with these preliminary questions, I’ll be able to come up with some code (and some derived, additional questions 😁...) Thanks a lot, and sorry for gathering so much questions in a single post, but I felt like they should be treated as a single one, since all of them aim to solve a bigger problem. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey @dave-espinosa - thanks for the question. This is super interesting and I think will be useful for others looking to do the same thing.
|
Beta Was this translation helpful? Give feedback.
-
Hello @pmbaumgartner, Sorry about the delay, got busy implementing your suggestions, as well as running some Q&A and troubleshooting on the Vertex AI side. Happily however, I think I have managed to implement a functional code for hyperparameter tuning of a spaCy NER model, using Vertex AI. To any future reader, this implementation can be considered as some sort of "version 0.1" and therefore, could be subject of improvement (i.e. "use it at your own risk").
Spoiler alert: Did not do that, but ended up using 1. Disclaimers
2. Project structureThe project structure I used, was:
Asterisc
3. General approachAs seen before in the "Vertex AI: Hyperparameter Tuning" Codelab, Vertex AI needs a Docker image, where your training code exists. The hyperparameters will be entered as CLI commands (easily achievable through the argparse library); Vertex Ai will do it automatically for you. In the Codelab (4. Containerize your training application code), building the Docker image is relatively easy, as they use a dataset already available in tfds; however in spaCy, you must access a
4. Files, quick explanations, hints and templatesAs mentioned early, the exact code for my use case cannot be released publicly, however I will try to leave functional code, so you can depart from it, and adapt / improve it, to match your needs. 4.1.
|
Beta Was this translation helpful? Give feedback.
Hello @pmbaumgartner,
Sorry about the delay, got busy implementing your suggestions, as well as running some Q&A and troubleshooting on the Vertex AI side. Happily however, I think I have managed to implement a functional code for hyperparameter tuning of a spaCy NER model, using Vertex AI. To any future reader, this implementation can be considered as some sort of "version 0.1" and therefore, could be subject of improvement (i.e. "use it at your own risk").
Spoiler alert: Did not do that, but ended up using
subprocess
Python library in…