Been thinking about this one, Liamsmum. We've had the same thing (dd now a bit older though-27mnths) on and off since she was about 24 months. I've found it happens in 'phases' too - she'll go through a phase of slapping/biting me, then stop for a while, and a few months later try it on again. I've found the best way to deal with it is to try to convince her that this particular attention-seeking exercise isn't going to do her any favours, and certainly isn't going to get her much good quality attention. I see it very much as seeking some response from a parent, and also as her way of expressing frustration when she's tired or has just been stopped from engaging in some fascinating toddler activity like trying to drop her smaller toys down the toilet. It certainly seems to happen more often in our house when she's shattered.
I don't smack back, or go into 'ballistic parent' mode because I've found this exacerbates the situation - dd giggles, hits out again, I shout, start to get frustrated, and before we know it, we're stuck in a vicious circle and having a massive row. When she first started doing it, I did try the immediate action 'time out' thing, to see if it would clear up the problem quickly, but that didn't work too well either - she just got het up, I felt guilty, went to collect her, tried to explain why she'd been put in cot, she didn't really get it, and lashed out again. Think she thought it was a sort of weird game. Soooo, what I now do is, whenever she hits me, or bites, for whatever reason, like you, I simply say either something like: 'hitting hurts Mummy, it's really horrid to hit people - remember when you fell over, and your leg hurt - well, it's like that' in as low-key tone as possible. Or I fix her with a beady stare, and say 'Well, doing that isn't going to get you what you want, is it!', and carry on with whatever I'm doing. This may sound like an awfully weak/ mild way to deal with it, but it has, eventually seemed to work for us. She certainly has now realised that it isn't a good way to behave - her periods of slapping me are now shorter (she tries, realises it isn't going to wash, then gives up for a couple of months) and she usually trots off, has a little strop, then comes back in tears and kisses Mummy better. It's a frustrating way to deal with it, in a way, and I have to do quite a few deft 'pulling arm out of way quickly' actions to stop being bitten, but at least I'm avoiding doing what she wants, which is physical confrontation, and so keeping the situation under control (my control, not hers!)
She's not tried it on with anyone but me, so far, and I'd have to rethink if she ever tried it with another tot - but what I'm hoping is that if I can teach her that it isn't a good way to behave at home, then she'll understand other ways of dealing with frustrating situations when she's at playgroup/nursery. I'd rather she got this particular trait out of the way with me, in house, than started using it then. So not sure if this will help - but it's the only way I've found to deal with it that doesn't get both myself and dd all het up and pink-faced!