Statistical Inference for Pairwise Graphical Models Using Score Matching