Refining neural network predictions using background knowledge