The method I use is to park boat on a good incline so it drains well...vacuum the carpet ...then soak the carpet with a vinegar water mixture...one part vinegar to 4 parts water...I use a pump up sprayer to saturate the carpet with the mixture...I then use a soft brush to scrub any spots or dirty areas then use a garden hose to flood the carpet washing as much of the dirt/grime off into the drain...I then let it drain for about 30 minutes and use a wet vacuum to vacuum the carpet to remove as much of the moisture and dirt that I can...always had good results with this method..
This... with an emphasis on using the shop vac to remove the water!