A system for determining whether to approve a target document (e.g., advertisement) is provided. The system trains a classifier using tuples of words from appropriate documents and tuples of words from inappropriate documents. To approve a target document, the system identifies tuples of words of the target document. The system then applies the classifier to the identified tuples to classify the document as being appropriate or inappropriate. If the document is classified as appropriate, the system automatically approves the document.