-
Notifications
You must be signed in to change notification settings - Fork 18
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
[FEAT] implement spacy models #143
Conversation
~~at this state: figuring out how to handle non-serializable data types. this is implementing an interface to the
Spacy can be pickled! Updated from |
|
||
input_data = api_data_to_frame(input_data) | ||
|
||
for doc in self.model.pipe(input_data.iloc[:, 0]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prototype will enforce 1 column, and this will select that column (regardless of name)
Docs on using spacy's pipe functionality on batch prediction https://spacy.io/api/language#pipe
): # is dict, more than one key | ||
raise ValueError("Spacy prototype data must dictionary with 1 key") | ||
|
||
prototype = vetiver_create_prototype(self.prototype_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will allow for no-prototype deployments. The column of text will come in as a list, and api_data_to_frame
will transform to a DataFrame for predictions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This worked well for me and looks good! 👍 I have two additional thoughts:
- (do now in this PR) can you update the README to include spaCy now?
- (let's think on this for future) how should we surface some model-specific documentation now that the number of supported models is growing?
Added!
That sounds like a great idea. Off the bat, the model handlers are shown in the docs. It might be advantageous to add examples of each model in the |
closes #121