Steve, a carpet cleaning pro should be able to help a lot on this. There are a lot of services out there and the rates usually seem to be pretty reasonable. With the equipment and knowledge that a well equipped pro will have, versus the trouble and mess of do-it-yourself carpet cleaning, this would be a good place to start.
If that is not totally successful, one tip is to lightly sprinkle baking soda on the carpet and leave it there for 12-24 hours, then vacuum. Be sure that your carpet is totally dry from the cleaning before you try this, if you have to. Vacuum the baking soda up is supposed to take a lot of the smell with it. Be sure that your vacuum has a good filter and a shop vacuum might be a good choice. A carpet vacuum will be better.
This is the same idea as leaving an open box of baking soda in your refrigerator to pick up odors there. That seems to work well.