A walkthrough of an NLP character-level Recurrent Neural Network (RNN) and translation with a sequence-to-sequence network and attention provided by the PyTorch community that is available here: https://docs.pytorch.org/tutorials/intermediate/char_rnn_classification_tutorial.
- Python 3 should be installed (I'm using Python 3.11 at the start of this project), which you can download here: https://www.python.org/downloads/
- A virtual environment created with a tool such as
venv
(I'm using it for this project), which you can learn how to set up here: https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/
If you'd like to quickly see the results from a pretrained RNN model, run the following command with a first or last name as the argument the RNN model already "pretrained
", replacing "<First or Last Name>
".
python main.py <First or Last Name> pretrained=true
If you have Python installed and are using a macOS or Linux machine, you can run the following script to create a .venv
folder for your local virtual environment with the following command:
source scripts/setup.sh
Once you create a venv
virtual environment with the guide, available here, inside a clone of this repo, run the following command:
pip install -r requirements.txt
The requirements.txt
file may be used to create an environment using the following command:
conda create --name your_env_name_here --file requirements.txt
I'm using a Makefile to defined all of my CI commands at every step of the pipeline of the neural network model created for this project.
Here are some useful commands you can run at different stages of the pipeline:
make download
make run
source scripts/make.sh
Note: A Shell script is needed since new files are added to the system on the make download
step and the process will only detect these changes during make run
with a script like Shell not Make.
make clean
make clean-data
make clean-all
Make is more challenging to install on Windows. I recommend using Chocolately guide here: https://earthly.dev/blog/makefiles-on-windows/