The Islamic State group and other militant organizations are experimenting with artificial intelligence as a tool to boost recruitment and refine their operations.