Named entity recognition and relation extraction for EMR documents