We consider a broad family of quantum spin systems which includes as special cases the ferromagnetic XY model and ferromagnetic Ising model on any graph, with or without a transverse magnetic field. We prove that the partition function (and consequently the free energy or ground energy) of any model in this family can be efficiently approximated using a classical randomized algorithm. We first show how to approximate the partition function by the perfect matching sum of a finite graph with positive edge weights. Although the perfect matching sum is not known to be efficiently approximable in general, the graphs obtained by our method have a special structure which facilitates efficient approximation via a randomized algorithm due to Jerrum and Sinclair. This is joint work with Sergey Bravyi (arXiv:1612.05602).