some helper functions for NLP operations