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

Consolidate Translated Notebooks into Single Notebook Series (Multi-Language) #2917

Closed
iamtrask opened this issue Jan 17, 2020 · 9 comments
Closed
Labels
Good first issue 🎓 Perfect for beginners, welcome to OpenMined! Help Wanted 👋 Status: Stale 🍞 Been open for a while with no activity Type: New Feature ➕ Introduction of a completely new addition to the codebase

Comments

@iamtrask
Copy link
Member

Is your feature request related to a problem? Please describe.
At present, we have 8 different languages represented in our Jupyter notebook tutorial series. While this is absolutely epic, it's leading to two problems:

  1. if we change one notebook because PySyft's API changes, we also have to change 8 other notebooks. This is going to become prohibitively difficult past 10 languages.
  2. We unit test the tutorial notebooks, which means that we're having to test the same code 8 times, which is slowing down our unit testing suite.

Describe the solution you'd like
Jupyter notebook has the ability to offer multiple languages in the same notebook (where you can "Select which language you would like" using a button or a tab). Figure out how to do this and consolidate all of our translated tutorials into a single notebook series which allows you to select which language you want to read it in.

Describe alternatives you've considered

  • If Jupyter doesn't support this well, we could implement some HTML or Javascript which does the same thing and run that in-line in the notebooks.

Additional context
Sooner the better because the longer we wait the bigger a job this becomes.

@iamtrask iamtrask added the Type: New Feature ➕ Introduction of a completely new addition to the codebase label Jan 17, 2020
@iamtrask iamtrask changed the title Consolidate Translated Notebooks into Single Notebook (Multi-Language) Consolidate Translated Notebooks into Single Notebook Series (Multi-Language) Jan 17, 2020
@iamtrask iamtrask added Good first issue 🎓 Perfect for beginners, welcome to OpenMined! Help Wanted 👋 labels Jan 17, 2020
@JulianSprung
Copy link

@karlhigley
Copy link
Contributor

Yeah, that might be viable! Direct link to the i18n README linked in the SO thread above: https://github.com/jupyter/notebook/tree/master/notebook/i18n

@santteegt
Copy link

Hi guys,

I'm new to PySyft and right now I'm going through all notebook tutorials. If you want I can give this a try and add multilingual support to each of them

@iamtrask
Copy link
Member Author

iamtrask commented Jan 28, 2020 via email

@santteegt
Copy link

Hi,

I've found this nbextension called nbTranslate where you can tag cells by languages and then use the menu to display the info in the language of preference. It has support for automatic translation using google translate and also allows you to export a notebook in a specific language so, e.g. there could be a script that generates multilingual notebooks e.b. during installation. What do you think about this approach?

lang

@iamtrask
Copy link
Member Author

iamtrask commented Jan 29, 2020 via email

@santteegt
Copy link

Hi,

I'm currently working on the translated notebooks. I wanna ask you a couple of questions:

  1. It is ok if I start a PR with the translated notebook for two languages (Spanish & Chinese), and later other people can help to incorporate the others?
  2. There are some code cells with comments that also require to be translated. However, the plugin I'm using has only support for markdown cells. Would it be okay if those comments are put into a separate markdown cell?

@Yugandhartripathi
Copy link
Member

Yugandhartripathi commented Feb 21, 2020

Since slack removes chat after a while backing up this discussion here.
@iamtrask @cereallarceny
trask:anchor: [2:09 AM]
#2917 <- solving this issue is becoming quite urgently needed. Several folks have talked about solving it - but as far as I know it's still up for grabs.
👍4

George Christopoulos  [2:18 AM]
check this
https://github.com/WittmannF/jupyter-translate

Yugandhar:openmined:  [3:38 AM]
George Christopoulos that's a nice script for automating translation work it seems it takes care of things like preserving markdown link syntax etc too.

But, in the end it creates a new file which is not the desired outcome here. It is to make a single notebook series with multilingual support(using community's translations) (as google translate is not good enough to be trusted blindly yet)

Yugandhar:openmined:  [3:42 AM]
The closest thing that I have found till date is nbExtension(also demonstrated with gif by santteegt in issue comments) but that will require user to set the extension in their local environment moreover it is not viable in my opinion as github doesn't support preview of notebook with nbExtension so only english one will be available for reading online and one would have to perform a ton of steps to setup everything locally to see any other languages present in the notebook.
👍1

George Christopoulos  [3:46 PM]
yeah I know nbExtension is good option, but it needs a local setup, so we need to consider the experience of each user...

George Christopoulos  [3:49 PM]
to prevent this we need to write the steps for the local setup on the readme

Yugandhar:openmined:  [3:51 PM]
I believe requirement to do local setup for just viewing notebooks in other languages is not a good option even after providing steps. Compared to that current approach of keeping it all in separate folders on github itself though with several potential issues of keeping things in sync is better in terms of accessibility. (edited) 
👍1

Yugandhar:openmined:  [4:04 PM]
I am no expert at cloud but in my opinion a good solution can be making a cloud VM(I used to do it using GCP free credits for compute engine GPU) doing all the setup for nbextension there once then host all MultiLanguage notebooks there(and automate sync with github) and provide a link on top of english version that can be used to access hosted jupyter notebook environment to view the languages in any preferred language available.
It solves in browser accessibility.
Keeps repo clean as there will be only one set on github.
To edit one has to make local setup and follow standard git procedure or we can even make it possible in hosted notebook itself based on some auth idk.

What do you think? (edited) 

cereallarceny:openmined:  [5:00 PM]
jupyter-translate could work, but from my experience using google translate for translation of complex materials is usually pretty terrible…

cereallarceny:openmined:  [5:00 PM]
To me - I’d want to use something like this: https://crowdin.com/

cereallarceny:openmined:  [5:00 PM]
Here’s an example of what it may look like for us: https://crowdin.com/project/all-contributors
👍1

Yugandhar:openmined:  [5:02 PM]
That looks good gives us option to translate setup instructions etc too literally making the entire project multilingual. With nice coverage report and progress tracking. (edited) 

cereallarceny:openmined:  [5:18 PM]
I agree. I haven’t found anyone willing to set this up for us. I’d be happy to sign up and apply for a free open-source license if I had someone interested in taking charge of setting it up. I just don’t have the time. 🙂

@github-actions
Copy link

This issue has been marked stale because it has been open 30 days with no activity. Leave a comment or remove the stale label to unmark it. Otherwise, this will be closed in 7 days.

@github-actions github-actions bot added the Status: Stale 🍞 Been open for a while with no activity label May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good first issue 🎓 Perfect for beginners, welcome to OpenMined! Help Wanted 👋 Status: Stale 🍞 Been open for a while with no activity Type: New Feature ➕ Introduction of a completely new addition to the codebase
Projects
None yet
Development

No branches or pull requests

5 participants