keras-nlp
keras-nlp copied to clipboard
Add Notebooks for Examples
We can add notebooks (or share Colab notebooks) for existing examples in the library (with instructive text and explanation).
@abheesht17 Thanks for reporting the issue!
For BERT example it is a bit hard to write the colab for the full pretraining due to the size and complexity of data preprocessing. The machine translation example is basically following this Keras tutorial, so we may not want a duplicated colab tutorial.
But yes, generally if it is doable, we will write colab for our example.
Ohh, I see. How about BERT finetuning on GLUE?
Yea, that one would be nice to add!
[Edited] We need pre-trained models before we write colabs for finetuning.
For BERT finetuning with pretrained weights, we still need a story for downloading those pretrained weights (this is actively under discussion).
Let's hold off on rewriting any existing examples as colabs. New examples could definitely contributed as colab notebooks, and if they are small enough to run as a colab I think that would be preferred over a python script directory.
Sure 👍🏼
@mattdangerw, I reckon this issue can be closed since we have examples on keras.io; I guess we don't really need notebooks here?
@abheesht17, I think this issue should be converted to Kaggle wishlist. While keras-io can still be the place for it, I think it's much more meaningful to add examples to Kaggle !
#726
@mattdangerw, @abheesht17 and @shivance. As a new Keras user, I have found difficult to find complete examples which could be easily reproduced in a virtual environment such as on https://www.tensorflow.org/tutorials. This slowed me down when I first approached the library.
Hi @giuliocn, I can totally understand the position you are in. We are working on a lot of Task specific tutorials, let's hope they get merged soon 🤞🏻 .
You can check Semantic Similarity Tutorial which I created on Kaggle. This will probably help you a lot.
Secondly, a tip which I have personally found always useful, if you want to understand how a particular functionality is to be used, if you are unable to find any tutorial, see Unit Tests. Tests are mostly found in a seperate test folder or within the same folder as the feature file, with a test prefix or suffix to file name.
Good luck !
[Edit] : I almost forgot to mention it. You should first of all checkout KerasNLP's Getting started guide and a guide on Pretraining Transformer from scratch. @jbischof and @mattdangerw have, respectively authored these amazing tutorials.
Furthermore, we can perhaps also work towards publishing articles, explanations and tutorials on Medium or other commonly clicked websites for learning NLP and more. This can allow us to even put the colab notebooks to good use since we can display them there for people to see.
Please take a look at my visual abstract for a better communication of scientific materials:

In my opinion this could be applied to Keras examples as well. Let me explain:
A single document should cover all aspects of a specific task despite the user’s level of experience. Then I have split all users into three sub-categories which are new user, expert and other. Each of these sub-types correspond to a different use case that is supplied by a proper communication tool, such as Colab Notebook. In the end, the resulting document, which might be a Medium post, should incorporate three use cases in a composite format.
@mattdangerw @abheesht17 @TheAthleticCoder @shivance Let me know your thoughts.
PS: Thanks @shivance for linking your tutorial and the getting started guide.