Implementation of a parser in Python using Artificial Intelligence
A common task in natural language processing is parsing, the process of determining the structure of a sentence. This is useful for a number of reasons: knowing the structure of a sentence can help a computer to better understand the meaning of the sentence, and it can also help the computer extract information out of a sentence. In particular, it’s often useful to extract noun phrases out of a sentence to get an understanding for what the sentence is about.
Here, we’ll use the context-free grammar formalism to parse English sentences to determine their structure.
The main aim is to start with a nonterminal symbol S
(representing a sentence) and repeatedly apply context-free grammar rules until we generate a complete sentence of terminal symbols (i.e., words).
Source code of the project demonstration : https://github.com/diesel707/Knights/tree/parser
Comments
Post a Comment
If you have any doubts, please let me know