Intelligent document processing for legal