How would you distinguish polyatomic ions from molecules by their chemical formulas?
Think of what atoms tend to be cations.
Look at 1st and 2nd group of periodic table. Elements there are willing to give their electrons away to reach the configuration of noble gas, so they become cations. For example:
Same goes for
#CH_3COO_H -> CH3COO^− + H^+#
#K_2Cr_2O_7 -> CrO_7^(2-) + 2K^(+)#
There are comon polyatomic ions that you just remember through practice.