brightmart / text_classification

all kinds of text classification models and more with deep learning
MIT License
7.83k stars 2.57k forks source link

Refactoring code for better vectorization #149

Closed maldil closed 2 years ago

maldil commented 2 years ago

Thank you very much for your excellent work in brightmart/text_classification.

I am a graduate student at the University of Colorado, studying the best practices of evolving ML codes. From our research, one of the most common evolution best practice in ML code is the migration of loop-based computations to vectorization, since it improves performance and code quality. We made the following changes in brightmart/text_classification, which remove the FOR loop and use NumPy APIs. I carefully checked the modification to ensure that it does not break the code. I will gladly contribute. Please help me to merge this.