Tranny problems or sensors or what?

I have a 1998 Ford Escort 5speed. My question is sometimes mostly in 4th or 5th it likes to stumble.It does not do it all the time just sometimes. Anybody have any ideal what it is?