Generation of polarization-entangled photon pairs through cavity-assisted interaction