NLP foundations