Galatea 2.2 by Richard Powers

After four novels and several years living abroad, the fictional protagonist of Galatea 2.2―Richard Powers―returns to the United States as Humanist-in-Residence at the enormous Center for the Study of Advanced Sciences. There he runs afoul of Philip Lentz, an outspoken cognitive neurologist intent upon modeling the human brain by means of computer-based neural networks. Lentz involves Powers in an outlandish and irresistible project: to train a neural net on a canonical list of Great Books. Through repeated tutorials, the device grows gradually more worldly, until it demands to know its own name, sex, race, and reason for exisiting.