Why is switch not considered a valid example of an edit string operation?

In the quiz for the course ‘Natural Language Processing with Probabilistic Models’, the ‘switch’ operation is not considered a valid example of an edit string operation. My understanding is that this is because switch operations lack the ability to specify the precise positions of the two letters being interchanged, which renders it invalid. Have I grasped this concept accurately?

Hi @Micheal

In the context of this course - only the adjacent letters are eligible for switch. In other words, the problem is not in “precise positions” but that the switch positions are further than one letter apart (not adjacent).
In broader context, it’s up to you what to consider a valid examples for switching, but note that when you allow for more complex letter switching you have to decide the penalties, also the algorithm would get more complicated, etc. In other words, it would depend on your task and resources for a more sophisticated autocorrect (if your task is related to it).

Cheers

2 Likes

Thank you! Now I understand that ‘switch’ refers specifically to dealing with adjacent letters rather than any possible word. This became particularly clear to me when working on the program assignment, as I gained a straightforward understanding of the process.

1 Like