{"id":18754039,"url":"https://github.com/dcavar/python-tutorial-notebooks","last_synced_at":"2025-04-04T13:06:28.345Z","repository":{"id":150221128,"uuid":"71844937","full_name":"dcavar/python-tutorial-notebooks","owner":"dcavar","description":"Python tutorials as Jupyter Notebooks for NLP, ML, AI","archived":false,"fork":false,"pushed_at":"2024-11-20T16:19:48.000Z","size":68064,"stargazers_count":136,"open_issues_count":2,"forks_count":89,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-28T12:03:43.989Z","etag":null,"topics":["computational-linguistics","deep-learning","deeplearning","flair","framenet","hidden-markov-model","natural-language-processing","natural-language-understanding","neural-network","nltk","parsing","part-of-speech-tagger","propbank","python","spacy-nlp","verbnet","wordnet"],"latest_commit_sha":null,"homepage":"http://damir.cavar.me/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcavar.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":"2016-10-25T00:46:44.000Z","updated_at":"2025-02-21T14:59:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"f407df81-4003-411a-8171-b53a5dc33a05","html_url":"https://github.com/dcavar/python-tutorial-notebooks","commit_stats":{"total_commits":252,"total_committers":2,"mean_commits":126.0,"dds":"0.38095238095238093","last_synced_commit":"d5866150724e5a4caaf603ad2cb83727e34e108f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcavar%2Fpython-tutorial-notebooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcavar%2Fpython-tutorial-notebooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcavar%2Fpython-tutorial-notebooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcavar%2Fpython-tutorial-notebooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcavar","download_url":"https://codeload.github.com/dcavar/python-tutorial-notebooks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247176686,"owners_count":20896511,"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":["computational-linguistics","deep-learning","deeplearning","flair","framenet","hidden-markov-model","natural-language-processing","natural-language-understanding","neural-network","nltk","parsing","part-of-speech-tagger","propbank","python","spacy-nlp","verbnet","wordnet"],"created_at":"2024-11-07T17:27:54.011Z","updated_at":"2025-04-04T13:06:28.325Z","avatar_url":"https://github.com/dcavar.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Tutorials for NLP, ML, AI\n\n(C) 2016-2024 by [Damir Cavar]\n\n[NLP-Lab](https://nlp-lab.org/) at [Indiana University].\n\n\n## Notebooks\n\n- [Anthropic / VoyageAI Embeddings](notebooks/anthropic_vectors.ipynb)\n- [OpenAI Embeddings](notebooks/openai_vectors.ipynb)\n- [BERT Embeddings](notebooks/BERT_vectors.ipynb)\n- [Claude 3 Interaction using the Anthropic API](notebooks/claude3_test.ipynb)\n- [GPT-4 interaction using the OpenAI API](notebooks/gpt4_test.ipynb)\n- [Neo4j interaction](notebooks/neo4j_query.ipynb)\n- [Simple Transformer-based Text Classification](notebooks/Transformers_example_simple_text_classification.ipynb)\n- [Stanza Tutorial](notebooks/Stanza_tutorial.ipynb)\n- [Converting SEC CIKs to a Knowledge Graph](notebooks/CIK_to_Graph.ipynb)\n- [Allegro Graph example](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/AllegroGraph_example.ipynb)\n- [Extracting Abbreviations](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Abbreviations_extraction.ipynb)\n- [Bayesian Classification for Machine Learning for Computational Linguistics](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Bayesian%20Classifier.ipynb)\n- [Python Tutorial 1: Part-of-Speech Tagging 1](notebooks/Python%20Tutorial%20PoS%20Tagging.ipynb)\n- [Lexical Clustering](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Lexical%20Clustering.ipynb)\n- [Linear Algebra](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Linear%20Algebra.ipynb)\n- [Neural Network Example with Keras](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Neural%20Network%20Example%20with%20Keras.ipynb)\n- [Computing Finite State Automata](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Non-Deterministic%20Automaton%20Computing.ipynb)\n- [Parallel Processing on Multiple Threads](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Parallelization_Example.ipynb)\n- [Perceptron Learning in Python](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Perceptron%20Learning%20in%20Python.ipynb)\n- [Clustering with Scikit-learn](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Python%20Clustering%20with%20Scikit-learn.ipynb)\n- [Simple Language ID with N-grams](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Python%20Language%20ID.ipynb)\n- [Support Vector Machine (SVM) Classifier Example](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Python%20SVM%20Classifier%20Example.ipynb)\n- [Scikit-Learn for Computational Linguists](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Python%20Scikit-Learn%20for%20Computational%20Linguists.ipynb)\n- [Tutorial: Tokens and N-grams](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Python%20Tokens%20and%20N-grams.ipynb)\n- [Tutorial 1: Part-of-Speech Tagging 1](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Python%20Tutorial%20PoS%20Tagging.ipynb)\n- [Tutorial 2: Hidden Markov Models](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Python%20Tutorial%20HMM.ipynb)\n- [Word Sense Disambiguation](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Python%20Word%20Sense%20Disambiguation.ipynb)\n- [Python examples and notes for Machine Learning for Computational Linguistics](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Python%20examples%20and%20notes%20for%20Machine%20Learning%20for%20Computational%20Linguistics.ipynb)\n- [RDFlib Graphs](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/RDFlib_example.ipynb)\n- [Scikit-learn Logistic Regression](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Scikitlearn_logistic_regression.ipynb)\n- [Convert the Stanford Sentiment Treebank Data to CSV](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Stanford_Sentiment_Treebank_Converter.ipynb)\n- [TextRank Example](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/textrank_example.ipynb)\n\n\n### NLTK Notebooks\n\n- [NLTK: Texts and Frequencies - N-gram models and frequency profiles](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Python%20NLTK%20-%20Texts%20and%20Frequencies.ipynb)\n- [Parsing with NLTK](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Python%20Parsing%20with%20NLTK.ipynb)\n- [Parsing with NLTK and Foma](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Python%20Parsing%20with%20NLTK%20and%20Foma.ipynb)\n- [Categorial Grammar Parsing in NLTK](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Combinatory%20Categorial%20Grammar%20Parsing%20with%20NLTK.ipynb)\n- [Dependency Grammar in NLTK](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Dependency%20Grammar%20in%20NLTK.ipynb)\n- [Document Classification Tutorial 1 - Amazon Reviews](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Document%20Classification%20Tutorial.ipynb)\n- [WordNet using NLTK](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Python%20WordNet%20using%20NLTK.ipynb)\n- [WordNet and NLTK](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/WordNet%20and%20NLTK.ipynb)\n- [Framenet in NLTK](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/NLTK_Framenet.ipynb)\n- [FrameNet Examples using NLTK](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/FrameNet%20Examples%20using%20NLTK.ipynb)\n- [PropBank in NLTK](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/NLTK_Propbank.ipynb)\n- [Machine Translation in Python 3 with NLTK](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Machine%20Translation%20in%20Python%203%20with%20NLTK.ipynb)\n- [N-gram Models from Text for Language Models](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/N-gram%20Models%20for%20Language%20Models.ipynb)\n- [Probabilistic Context-free Grammar (PCFG) Parsing using NLTK](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/PCFG%20Parsing%20with%20NLTK.ipynb)\n- [Python for Text Similarities 1](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Python%20for%20Text%20Similarities.ipynb)\n\n\n\n### spaCy Notebooks\n\n- [spaCy Tutorial](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/spaCy%20Tutorial.ipynb)\n- [spaCy 3.x Tutorial: Transformers Spanish](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/spaCy%203.x%20Tutorial%20Transformers%20Spanish.ipynb)\n- [spaCy Model from CoNLL Data](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/spaCy_CoNLL_Training.ipynb)\n- [Train spaCy Model for Marathi (mr)](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Marathi/train_model.ipynb)\n- [Linear Algebra and Embeddings - spaCy](https://github.com/dcavar/python-tutorial-notebooks/blob/master/notebooks/Embeddings_and_Vectors.ipynb)\n\n\nSee the licensing details on the individual documents and in the [LICENSE] file in the code folder.\n\n\n## Introduction\n\nThe files in this folder are [Jupyter]-based tutorials for NLP, ML, AI in Python for classes I teach in Computational Linguistics, Natural Language Processing (NLP), Machine Learning (ML), and Artificial Intelligence (AI) at [Indiana University].\n\nIf you find this material useful, please cite the author and source (that is [Damir Cavar] and all the sources cited in the relevant notebooks). Please let me know if you have some suggestions on how to correct the notebooks, improve them, or add some material and explanations.\n\nThe instructions below are somewhat outdated. I use just [Jupyter-Lab](https://jupyter.org/) now. Follow [the instructions here](https://jupyter.org/install) to set it up on different machine types and operating systems.\n\n\n\nTo run this material in [Jupyter] you need to have Python 3.x and [Jupyter] installed. You can save yourself some trouble by using the [Anaconda Python 3.x distribution].\n\nClone the project folder using:\n\n\tgit clone https://github.com/dcavar/python-tutorial-for-ipython.git\n\nSome of the notebooks may contain code that requires various kinds of [Python] modules to be installed in specific versions. Some of the installations might be complicated and problematic. I am working on a more detailed description of installation procedures and dependencies for each notebook. Stay tuned, this is coming soon.\n\n\n### Installing Jupyter\n\n[Jupyter] is a great tool for computational publications, tutorials, and exercises. I set up my favorite components for [Jupyter] on Linux (for example [Ubuntu]) this way:\n\nAssuming that I have some of the development tools installed, as for example *gcc*, *make*, etc., I install the packages *python3-pip* and *python3-dev*:\n\n\tsudo apt install python3-pip python3-dev\n\nAfter that I update the global system version of *pip* to the newest version:\n\n\tsudo -H pip3 install -U pip\n\nThen I install the newest [Jupyter] and [Jupyterlab] modules globally, updating any previously installed version:\n\n\tsudo -H pip3 install -U jupyter jupyterlab\n\nThe module that we should not forget is [*plotly*](https://plot.ly/python/):\n\n\tsudo -H pip3 install -U plotly\n\n[Scala], [Clojure], and [Groovy] are extremely interesting languages as well, and I love working with [Apache Spark], thus I install [BeakerX] as well. This requires two other [Python] modules: [*py4j*](https://www.py4j.org/) and [*pandas*](https://pandas.pydata.org/). This presupposes that there is an existing Java JDK version 8 or newer already installed on the system. I install all the [BeakerX] related packages:\n\n\tsudo -H pip3 install -U py4j\n\tsudo -H pip3 install -U pandas\n\tsudo -H pip3 install -U beakerx\n\nTo configure and install all [BeakerX] components I run:\n\n\tsudo -H beakerx install\n\nSome of the components I like to use require [Node.js]. On [Ubuntu] I usually add the newest [Node.js] as a PPA and not via [Ubuntu Snap]. Some instructions how to achieve that can be found [here](https://tecadmin.net/install-latest-nodejs-npm-on-ubuntu/). To install [Node.js] on [Ubuntu] simply run:\n\n\tsudo apt install nodejs\n\nThe following commands will add plugins and extensions to [Jupyter] globally:\n\n\tsudo -H jupyter labextension install @jupyter-widgets/jupyterlab-manager\n\tsudo -H jupyter labextension install @jupyterlab/plotly-extension\n\tsudo -H jupyter labextension install beakerx-jupyterlab\n\nAnother useful package is [Voilà], which allows you to turn [Jupyter] notebooks into standalone web applications. I install it using:\n\n\tsudo -H pip3 install voila\n\nNow the initial version of the platform is ready to go.\n\nTo start the [Jupyter] notebook viewer/editor on your local machine change into the *notebooks* folder within the cloned project folder and run the following command:\n\n\tjupyter notebook\n\nA browser window should open up that allows you full access to the notebooks.\n\nAlternatively, check out the instructions how to launch [JupyterLab], [BeakerX], etc.\n\n\nEnjoy!\n\n[Damir]\n\n\n\n[Jupyter]: http://jupyter.org/ \"Jupyter\"\n[JupyterLab]: https://jupyter.org/install \"Jupyter\"\n[Damir Cavar]: http://damir.cavar.me/ \"Damir Cavar\"\n[Damir]: http://damir.cavar.me/ \"Damir Cavar\"\n[LICENSE]: https://github.com/dcavar/python-tutorial-for-ipython/blob/master/LICENSE \"License\"\n[Computational Linguistics Program]: http://cl.indiana.edu/programs.html \"IU Computational Linguistics\"\n[Department of Linguistics]: http://www.indiana.edu/~lingdept/ \"IU Department of Linguistics\"\n[Indiana University]: https://www.indiana.edu/ \"Indiana University\"\n[Anaconda Python 3.x distribution]: https://www.continuum.io/downloads \"Anaconda Python\"\n[BeakerX]: http://beakerx.com/ \"BeakerX\"\n[Scala]: https://www.scala-lang.org/ \"The Scala Programming Language\"\n[Clojure]: https://clojure.org/ \"Clojure\"\n[Groovy]: https://groovy-lang.org/ \"Apache Groovy\"\n[Apache Spark]: https://spark.apache.org/ \"Apache Spark\"\n[Node.js]: https://nodejs.org/en/ \"Node.js\"\n[Ubuntu]: https://ubuntu.com/ \"Ubuntu\"\n[Voilà]: https://voila.readthedocs.io/en/stable/install.html \"Voilà\"\n[Ubuntu Snap]: https://ubuntu.com/tutorials/basic-snap-usage#1-introduction \"Ubuntu Snap\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcavar%2Fpython-tutorial-notebooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcavar%2Fpython-tutorial-notebooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcavar%2Fpython-tutorial-notebooks/lists"}