Exploring Functional Shifts in Pos Tagging Across Various NLP Libraries: A Study of NLTK, spaCy and Textblob
This study compares the performance of NLTK, TextBlob, and spaCy in handling garden path sentences caused by functional shifts, finding that spaCy significantly outperforms the other two libraries in syntactic accuracy and offering insights for improving NLP tools, including those for African languages.
Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are teaching a robot to read a storybook. You want it to understand not just the words, but how those words are behaving in a sentence. Is "run" a command to move fast, or is it a noun describing a long period of time? In the world of computer science, this job is called Part-of-Speech (POS) tagging. It's like a digital highlighter that colors every word in a sentence to show if it's a noun, a verb, an adjective, or something else. This seems easy for us humans, but for computers, it gets tricky when words change their costumes mid-sentence. This is called a functional shift. Think of it like an actor who starts a play as a king, then suddenly puts on a chef's hat and starts cooking, all without changing their name. The computer has to guess the new role based on the other words around them.
Even trickier are garden path sentences. These are sentences that lead you down a "garden path" of thinking one thing, only to trip you up at the end. For example, "The old man the boat." Your brain wants to read "old man" as a person, but the sentence actually means "The old people operate the boat." Here, "man" is a verb, not a noun! If a computer gets confused by these twists, it might misunderstand the whole story, which is a big problem for things like translation apps or search engines. So, scientists are always testing different computer programs to see which one is the best at spotting these sneaky word changes.
In this study, a researcher named Kayode Victor Amusan decided to put three popular computer programs—NLTK, TextBlob, and SpaCy—to the test. Imagine these three as different students in a language class. The teacher (the researcher) handed them a stack of 56 tricky sentences designed to confuse them. These sentences included garden path puzzles, words that had been turned into nouns (like "singing" becoming a thing you do), and words that changed their position to change their meaning. The goal was simple: see which student could correctly identify what role each word was playing in the sentence.
The results were a bit like a race where one runner clearly pulled ahead. Out of the 56 tricky sentences, SpaCy got 32 of them right. NLTK and TextBlob tied for second place, but they only got 21 sentences correct each. This means SpaCy was significantly better at figuring out the "costume changes" of words in complex sentences.
The study looked closely at specific examples to see where the programs stumbled. For instance, take the word "round." It can be a circle (noun), a shape (adjective), a verb meaning to turn, or an adverb meaning to move in a circle. In sentences like "The earth turns round once," SpaCy correctly identified "round" as an adverb. However, NLTK and TextBlob got confused and labeled it as a noun. Similarly, for the word "that," which can be a pronoun, a conjunction, or an adjective, SpaCy showed it could tell the difference in almost every context, while the other two libraries often missed the mark.
The researcher found that while all three programs struggled with the most confusing garden path sentences (like "The complex houses married and single students"), SpaCy still managed to get more of them right than the others. For example, in a sentence where "houses" is actually a verb (meaning "to provide shelter"), SpaCy was more likely to catch that it wasn't a building. The study suggests that while NLTK and TextBlob are good for general tasks, SpaCy is the stronger tool when the language gets complicated and words start shifting roles.
The paper doesn't claim that SpaCy is perfect or that the problem is solved. In fact, it points out that even SpaCy got 24 sentences wrong out of 56. It simply suggests that if you need a computer to handle tricky, twisty sentences, SpaCy is currently the most reliable choice among the three. The researcher hopes this information helps teachers, students, and other scientists build better tools for understanding human language, and maybe even helps future programs learn to speak African languages with the same ease.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.