Ants in your compost would indicate that the pile is no longer heating up. It has ceased to be an "active" pile. I subscribe to the multi-stage philosophy of composting though and do not believe the pile needs to be hot for its entire life.
If the ants are in your compost it means that there is some food in there for them. The ants will eat that food and then turn it into ant manure (and small dead ant bodies) over time, which is simply part of the composting process. You would see this on a forest floor if you dropped a dead possum or squirrel and covered it up with leaves. The ants would move in and consume it too.
Almost anything you do to get rid of the ants would disrupt the balance of your pile (at least in the short term). If you get out there with a shovel and keep turning it then it'll annoy the ants
enough so that they'll leave. You could also add a lot of water to it frequently until it is saturated and becomes thermophillic again. An internal temperature of 140 degrees would make the ants leave as well.
Because I live in Texas, I have fire ants in my newer piles. I consider that to be the only use of fire ants ... protecting the pile from raccoons and other nuisance critters. We compost
humanure here on the farm and it seems to attract the ants pretty frequently. Before we had ants though we had problems with flies. Now the ants eat the fly larva and there's no problem. The compost bins are not located up against my house and we don't dig around in there. By the time we crack open the piles to move the compost to the garden, the ants are gone.
My advice is to learn to love ants. They are helping you.