Skip to content

NLPaladins/rinehartAnalysis

Repository files navigation

Rinehart Analysis

GitHub license

Table of Contents

About

Rinehart Analysis for NLP (ECE-617) Project 1.

TODO

Read the TODO to see the current task list.

Libraries Overview

All the libraries are located under "<project root>/nlp_libs"

  • ProcessedBook: Loc: books/processed_book.py, Desc: Book Pre-processor
  • Configuration: Loc: configuration/configuration.py, Desc: Configuration Loader
  • ColorizedLogger: Loc: fancy_logger/colorized_logger.py, Desc: Logger with formatted text capabilities

Prerequisites

You need to have a machine with Python >= 3.9 and any Bash based shell (e.g. zsh) installed. Having installed conda is also recommended.

$ python3.9 -V
Python 3.9.7

$ echo $SHELL
/usr/bin/zsh

Bootstrap Project

All the installation steps are being handled by the Makefile.

If you want to use conda run:

$ make install

If you want to use venv run:

$ make install env=venv

Running the code from main.py

In order to run the code, you will only need to configure the yml file, and either run its file directly or invoke its console script.

Modifying the Configuration

You may need to configure the yml file. There is an already configured yml file under confs/proj_1.yml.

Execution

First, make sure you are in the correct virtual environment:

$ conda activate rinehartAnalysis

$ which python
/home/<your user>/anaconda3/envs/rinehartAnalysis/bin/python

Show help:

$ python main.py --help
usage: main.py -c CONFIG_FILE -l LOG [-d] [-h]

Rinehart Analysis for NLP (ECE-617) Project 1

Required Arguments:
  -c CONFIG_FILE, --config-file CONFIG_FILE
                        The configuration yml file
  -l LOG, --log LOG     Name of the output log file

Optional Arguments:
  -d, --debug           Enables the debug log messages
  -h, --help            Show this help message and exit

Execute the code:

$ python main.py -c confs/proj_1.yml -l logs/proj_1.log

Using Jupyter

In order to run the code, you will only need to configure the yml file, and either run its file directly or invoke its console script. Refer to Configuration Section.

Local Jupyter

First, make sure you are in the correct virtual environment:

$ conda activate rinehartAnalysis

$ which python
/home/<your user>/anaconda3/envs/rinehartAnalysis/bin/python

To use jupyter, first run jupyter:

jupyter notebook

And open the main.ipynb.

Google Collab

Just Open this Google Collab Link.

Adding New Libraries

If you want to add a new library (e.g. a Class) in the project you need to follow these steps:

  1. Create a new folder under "<project root>/nlp_libs" with a name like my_lib
  2. Create a new python file inside it with a name like my_module.py
  3. Paste your code inside it
  4. Create a new file name init.py
  5. Paste the follwing code inside it:
     """<Library name> sub-package."""
     
     from .<Module name> import <Class Name>
     
     __email__ = "jmerlet@vols.utk.edu, kgeorgio.vols.utk.edu, mlane42@vols.utk.edu"
     __author__ = "jeanmerlet, drkostas, LaneMatthewJ"
     __version__ = "0.1.0"
  6. Open <project root>/nlp_libs/__init__.py
  7. Add the following line: from nlp_libs.<Module name> import <Class Name>
  8. (Optional) Rerun make install or python setup.py install

License

This project is licensed under the MIT License - see the LICENSE file for details.