{"id":13426972,"url":"https://github.com/deepklarity/jupyter-text2code","last_synced_at":"2025-05-15T10:06:35.253Z","repository":{"id":45321171,"uuid":"293338246","full_name":"deepklarity/jupyter-text2code","owner":"deepklarity","description":"A proof-of-concept jupyter extension which converts english queries into relevant python code","archived":false,"fork":false,"pushed_at":"2024-04-14T15:51:48.000Z","size":98298,"stargazers_count":2091,"open_issues_count":10,"forks_count":360,"subscribers_count":79,"default_branch":"master","last_synced_at":"2025-04-14T16:56:10.800Z","etag":null,"topics":["jupyter-notebook","machine-learning","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepklarity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-06T18:29:02.000Z","updated_at":"2025-03-10T11:46:11.000Z","dependencies_parsed_at":"2024-11-29T17:16:27.634Z","dependency_job_id":null,"html_url":"https://github.com/deepklarity/jupyter-text2code","commit_stats":{"total_commits":20,"total_committers":6,"mean_commits":"3.3333333333333335","dds":0.4,"last_synced_commit":"f8f01f4ed3eee935f3ebbd696c9fdbd743cbecc1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepklarity%2Fjupyter-text2code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepklarity%2Fjupyter-text2code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepklarity%2Fjupyter-text2code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepklarity%2Fjupyter-text2code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepklarity","download_url":"https://codeload.github.com/deepklarity/jupyter-text2code/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254319719,"owners_count":22051073,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jupyter-notebook","machine-learning","python"],"created_at":"2024-07-31T00:01:49.831Z","updated_at":"2025-05-15T10:06:30.219Z","avatar_url":"https://github.com/deepklarity.png","language":"Jupyter Notebook","readme":"# Text2Code for Jupyter notebook\n### A proof-of-concept jupyter extension which converts english queries into relevant python code. \n\n\n![](jupyter-text2code-demo.gif)\n\n### Blog post with more details:\n#### [Data analysis made easy: Text2Code for Jupyter notebook](https://towardsdatascience.com/data-analysis-made-easy-text2code-for-jupyter-notebook-5380e89bb493?source=friends_link\u0026sk=2c46fff2c31f7fe59b667350e4596b18)\n\n### Demo Video:\n#### [Text2Code for Jupyter notebook](https://www.youtube.com/watch?v=3gZ7_9W-TJs)\n\n## Supported Operating Systems:\n- Ubuntu\n- macOS\n\n## Installation\n\n### NOTE: We have renamed the plugin from mopp to jupyter-text2code. Uninstall mopp before installing new jupyter-text2code version.\n```\npip uninstall mopp\n```\n\n#### CPU-only install:\nFor Mac and other Ubuntu installations not having a nvidia GPU, we need to explicitly set an environment variable at time of install.\n```\nexport JUPYTER_TEXT2CODE_MODE=\"cpu\"\n\n```\n\n#### GPU install dependencies:\n```\nsudo apt-get install libopenblas-dev libomp-dev\n```\n\n#### Installation commands:\n\n```\ngit clone https://github.com/deepklarity/jupyter-text2code.git\ncd jupyter-text2code\npip install .\njupyter nbextension enable jupyter-text2code/main\n\n```\n\n## Uninstallation:\n```\npip uninstall jupyter-text2code\n```\n\n## Usage Instructions:\n\n- Start Jupyter notebook server by running the following command: ``` jupyter notebook ```\n- If you don't see ``` Nbextensions```  tab in Jupyter notebook run the following command:``` jupyter contrib nbextension install --user ```\n- You can open the sample ``` notebooks/ctds.ipynb```  notebook for testing\n- If installation happened successfully, then for the first time, Universal Sentence Encoder model will be downloaded from `tensorflow_hub`\n- Click on the `Terminal` Icon which appears on the menu (to activate the extension)\n- Type \"help\" to see a list of currently supported commands in the repo\n- Watch [Demo video](https://www.youtube.com/watch?v=3gZ7_9W-TJs) for some examples\n\n## Docker containers for jupyter-text2code (old version)\n\nWe have published CPU and GPU images to docker hub with all dependencies pre-installed.\n##### Visit https://hub.docker.com/r/deepklarity/jupyter-text2code/ to download the images and usage instructions.\n\n##### CPU image size: ``` 1.51 GB ``` \n##### GPU image size: ``` 2.56 GB ```\n\n## Model training:\nThe plugin now supports pandas commands + quick snippet insertion of available snippets from [awesome-notebooks](https://github.com/jupyter-naas/awesome-notebooks). With this change, we can now get snippets for most popular integrations from within the jupyter tab. eg:\n- Get followers count from twitter\n- Get stats about a story from instagram\nThe detailed training steps are available in [scripts README](scripts/README.md) where we also evaluated performance of different models and ended up selecting SentenceTransformers `paraphrase-MiniLM-L6-v2` \n\n\n### Steps to add more intents:\n- Add more templates in `ner_templates` with a new intent_id\n- Generate training data. Modify `generate_training_data.py` if different generation techniques are needed or if introducing a new entity.\n- Train intent index\n- Train NER model\n- modify `jupyter_text2code/jupyter_text2code_serverextension/__init__.py` with new intent's condition and add actual code for the intent\n- Reinstall plugin by running: `pip install .`\n\n### TODO:\n- [] Add Ollama support to work with local LLMs\n- [x] Publish Docker image\n- [X] Refactor code and make it mode modular, remove duplicate code, etc\n- [X] Add support for more commands\n- [X] Improve intent detection and NER\n- [ ] Add support for Windows\n- [ ] Explore sentence Paraphrasing to generate higher-quality training data\n- [ ] Gather real-world variable names, library names as opposed to randomly generating them\n- [ ] Try NER with a transformer-based model\n- [ ] With enough data, train a language model to directly do English-\u003ecode like GPT-3 does, instead of having separate stages in the pipeline\n- [ ] Create a survey to collect linguistic data\n- [ ] Add Speech2Code support\n\n#### Authored By:\n\n- [Deepak Rawat](https://twitter.com/dsr_ai)\n- [Kartik Godawat](https://twitter.com/kartik_godawat)\n- [Abdullah Meda](https://www.linkedin.com/in/abdmeda/)\n","funding_links":[],"categories":["Jupyter Notebook"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepklarity%2Fjupyter-text2code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepklarity%2Fjupyter-text2code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepklarity%2Fjupyter-text2code/lists"}