Abstract
<title>Abstract</title> <p>This study presents a comparative analysis of NLTK, TextBlob, and Spacy in handling syntactically complex sentences known as "garden path" sentences which is a product of functional shift in grammar. A total of 56 sentences were analyzed, with each library assessed for its accuracy in tagging various syntactic structures. The findings reveal that while NLTK and TextBlob demonstrate limitations in accurately tagging syntactic structures, Spacy showcases superior performance, tagging a significantly higher number of sentences correctly. Specifically, Spacy (32/56) outperforms NLTK (21/56) and TextBlob (21/56) in accurately identifying the parts of speech for words within syntactically complex sentences, highlighting its efficacy in handling linguistic phenomena such as garden path sentences. These findings underscore the importance of accurate syntactic analysis in NLP applications and emphasize the potential of Spacy as a robust tool for such tasks. Further research and development efforts are warranted to enhance the accuracy and efficiency of syntactic analysis in NLP, with a focus on leveraging the capabilities of advanced NLP libraries like Spacy. The study offers valuable insights for educators and researchers in computational linguistics and NLP, serving as a basis for curriculum development, research projects, and practical exercises aimed at understanding the challenges of syntactic analysis and POS tagging in real-world applications. This might help libraries that are trained in African languages such as AfriBerta, KINYaBert and Serengeti to improve on their functionalities.</p>