Since August , Pakistan 's military has been locked in ongoing battles against Taliban and al-Qaida militants in parts of the country 's rural northwest .