- Merged training corpus script into a function