keras-nlp icon indicating copy to clipboard operation
keras-nlp copied to clipboard

Add Notebooks for Examples

Open abheesht17 opened this issue 3 years ago • 6 comments

We can add notebooks (or share Colab notebooks) for existing examples in the library (with instructive text and explanation).

abheesht17 avatar Mar 20 '22 16:03 abheesht17

@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.

chenmoneygithub avatar Mar 21 '22 18:03 chenmoneygithub

Ohh, I see. How about BERT finetuning on GLUE?

abheesht17 avatar Mar 21 '22 18:03 abheesht17

Yea, that one would be nice to add!

[Edited] We need pre-trained models before we write colabs for finetuning.

chenmoneygithub avatar Mar 21 '22 18:03 chenmoneygithub

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.

mattdangerw avatar Mar 21 '22 18:03 mattdangerw

Sure 👍🏼

abheesht17 avatar Mar 21 '22 18:03 abheesht17

@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 avatar Jun 18 '22 11:06 abheesht17

@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

kanpuriyanawab avatar Feb 25 '23 19:02 kanpuriyanawab

@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.

giuliocn avatar Mar 20 '23 17:03 giuliocn

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.

kanpuriyanawab avatar Mar 20 '23 18:03 kanpuriyanawab

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.

TheAthleticCoder avatar Mar 20 '23 18:03 TheAthleticCoder

Please take a look at my visual abstract for a better communication of scientific materials: proposal

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.

giuliocn avatar Mar 22 '23 18:03 giuliocn