Okay. Biting is a serious problem, but pecking on the back of the leg to get your attention may not be. So, can you distinguish between the two?
I had a Buff Brahma roo named Penrod several years back when I was pretty new to chickens still. He had a hair trigger when it came to sudden movement in his immediate space. He would drill me with his beak like a high speed electric driver, producing a nasty, painful, deep hole in my hide.
On the other hand, I have a few hens that compete for my attention by coming up to me when I'm cuddling one of their mates, and they peck me on my knee or arm, usually with a sliding beak action that mostly is painless.
Chickens communicate with each other and with us by using their beaks to get across a point. They use their beaks to discipline younger chickens and to convey displeasure with their peers. And also with us. And that leads me back to Penrod.
If it's biting, and not pecking, that's at issue, discipline is definitely called for. Biting is serious and can do great harm. So you need to be very consistent when this happens. It took me an entire year to break Penrod of his biting, and that long to train myself not to contribute to this awful habit of his.
As with a lot of chicken bad behavior, we chicken keepers play a role in it. We need to recognize what we are doing to contribute and stop it. In my and Penrod's case, I was always in high gear and made a lot of jerky, sudden, quick movements. I had to discipline myself to slow down as I entered his space.
On Penrod's side, each time he bit me, I would grab his beak and hang on until he relaxed and submitted. This is how a senior rooster disciplines a younger one. Disciplining a chicken using their language is the most effective method. It's very simple and straight forward, and they "get it".
Your hen may calm down after she begins to lay. Hens usually get wound up as they come into lay, and as the hormones settle down, the problem does, too.