Tag inference framework