Coding our rule and generating a prototype and result

This example gives you the practical essence of the rule making process. This is our first step so we are not focusing on accuracy very much. I know, this is not the only way of solving this problem and this is not the most efficient way. There are also other efficient ways to implement the same problem, but I'm using this one because I felt this solution is the simplest one and easiest to understand.

This example can help you to understand how rules can be coded and, after getting the result of the first prototype, what next steps you can take to improve your output.

See the code snippet in Figure 7.11:

Figure 7.11: Code for implementation of rule logic for extracting programming language ...

Get Python Natural Language Processing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.