Ethical artificial intelligence framework for a good AI society: principles, opportunities and perils