Rule-Based Techniques
Rule-based techniques are a very important and useful tool in natural language processing (NLP). Rules are used to examine text and decide how it should be analyzed in an all-or-none fashion, as opposed to the statistical techniques we will be reviewing in later chapters. In this chapter, we will discuss how to apply rule-based techniques to NLP. We will look at examples such as regular expressions, syntactic parsing, and semantic role assignment. We will primarily use the NLTK and spaCy libraries, which we have seen in earlier chapters.
In this chapter, we will cover the following topics:
- Rule-based techniques
- Why use rules?
- Exploring regular expressions
- Sentence-level analysis – syntactic parsing and semantic role assignment