Skip to content
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

Custom model #26

Open
miguelwon opened this issue Mar 17, 2019 · 2 comments
Open

Custom model #26

miguelwon opened this issue Mar 17, 2019 · 2 comments
Labels
question Further information is requested

Comments

@miguelwon
Copy link

I just found this library which seems really nice! Thanks for make it available. One quick question: is there a simple way to use delft with a custom model? I want to try a keras model and use delft because of the already implemented disk space efficient pipeline and the use of elmo.

@kermitt2
Copy link
Owner

Thank you for you interest @miguelwon !

You can implement your own keras model in the files delft/sequenceLabelling/models.py for tagging tasks and delft/textClassification/models.py for text classification respectively, taking advantage of the existing pipeline.

For the Sequence Labelling, a new model is via a class (see the existing ones in models.py), and it should work directly by specifying the parameter architecture when creating a model (or --architecture ARCHITECTURE in the command line). You have to ensure that the input to the model is consistent with the existing input which is generated via Keras DataGenerator.

For text classification, a new model is done via a function as visible with the existing ones. Default parameters of the model has defined in a python dictionary object.

@de-code
Copy link
Contributor

de-code commented Jul 8, 2019

As a library it would really be good to be able to use a custom model without changing the existing code. What do you think about registering a model via name. Or maybe pass a factory in.

In case it's of any use, I hacked my way in: elifesciences/sciencebeam-trainer-delft#13

@lfoppiano lfoppiano added the question Further information is requested label Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants