Machine learning lets an NLP system learn patterns from data instead of relying on a programmer to specify every rule. Natural language makes that useful: a regular expression can match a precise character pattern, but recognizing what varied statements mean calls for more than handcrafted matches. section 1.1 section 1.5.2
For a chatbot, the practical difference is how you provide the behavior:
- With handcrafted rules, you anticipate spellings, capitalization, and phrasing, then add patterns to handle them. This remains useful for precise, command-like input. section 1.5.2
- With machine learning, you supply labeled examples of user statements and desired responses. The resulting behavior depends heavily on the quality of those examples; you need not write a branch for every phrasing. section 1.10
From greeting rules to sentiment scores
A greeting matcher can grow from a simple regular expression into a collection of exceptions for names, typos, and alternative greetings. Sentiment analysis offers a second comparison: instead of manually assigning scores to keywords, train a model on statements or documents labeled with the sentiment to predict a numerical score for new text. Both approaches require care: even sophisticated NLP pipelines can be brittle when their datasets do not cover the text they encounter. section 1.5.2 section 2.6
Machine learning can support a chatbot pipeline that extracts features, finds information, searches documents, and generates responses. More domain data can improve what such a pipeline can handle, but plausible generated responses are not necessarily correct or helpful. Evaluate responses against the chatbot’s goals rather than treating fluent output as proof of understanding. section 1.10 section 1.8









































