Package: ignis-tm
Ignis: Iterative Topic Modelling Platformignisis an extensible platform that provides a common interface for creating and visualising topic models.By default, it supports creating LDA models using Tomotopy (https://bab2min.github.io/tomotopy/) and visualising them using pyLDAvis (https://github.com/bmabey/pyLDAvis), but support for other models and frameworks can be written in as necessary.InstallationThe library package is namedignis-tmon PyPI, so to use it in a project, first install theignis-tmpackage:pipinstallignis-tmAfter installation, import and use the library asignisin your code:importignisDemonstration/Development Environment WalkthroughA full demonstration/development environment can be easily set up using Python 3.7 andpipenv.Clone the repositoryStart by cloning the repository and navigating to the root folder of the codebase:gitclonehttps://github.com/ZechyW/ignis-tm.gitcdignis-tmInstall the project dependenciesInstallpipenvand use it to install the other dependencies:pipinstallpipenv
pipenvinstall--devThepipenvenvironment can then be activated from the codebase root:pipenvshellThepipenvenvironment will always need to be activated before the demo Jupyter notebooks can be used.Perform post-installation stepsThe full demonstration setup includes a number of Jupyter plugins under its dev dependencies that could be useful for working with the sample notebooks.With the demo environment activated, install and configure the plugins:jupytercontribnbextensioninstall--user
jupyternbextensions_configuratorenable--userYou can then configure the Jupyter notebook extensions directly from the web-based Jupyter UI.  In particular, seehttps://neuralcoder.science/Black-Jupyter/for a guide to setting up the Code Prettify extension usingblack.  The ExecuteTime extension is also useful for tracking cell execution times.You will also need to download the Spacyen_core_web_smpackage if you intend to perform lemmatisation on your data:python-mspacydownloaden_core_web_smRun the sample notebooksOnce the installation is complete, you can spin up a jupyter notebook instance (be sure to activate thepipenvenvironment if necessary):jupyternotebookThen go through the self-documentedIgnis CorpusandIgnis LDAnotebooks to explore the BBC news dataset.Other NotesRandom seeds and indeterminacyN.B.: The behaviour described below should be fixed in Tomotopy >= 0.9.1, which uses a different random number generation scheme.  Note that models created with Tomotopy < 0.9.1 might therefore differ from newer models even if the same seed is set.Some dependencies that perform non-deterministic operations (e.g., Tomotopy, Gensim) may needPYTHONHASHSEEDto be set in order to consistently reproduce results.  To be safe,PYTHONHASHSEEDshould be explicitly set where necessary.If using a Conda environment, this can be done with:condaenvconfigvarssetPYTHONHASHSEED=<seed>For direct invocation:PYTHONHASHSEED=<seed>pythonscript.pyFor Jupyter notebooks in a non-Conda environment, edit the Jupyterkernel.jsonto add an appropriateenvkey.Miscellaneous notes on dependenciesTheipythonandjedipackages are pinned to specific versions in the demopipenvenvironment to ensure their compatibility with extensions and code completion within Jupyter notebooks; unfortunately, they break with later versions due to a lack of upstream updates.Changes1.5.0 (1 June 2021)General functionality update to match development version; enhancements and improvements across the board.Updated demo walkthrough notebooks.