part 1 of document tagger