Python: Let’s create Philosopher Conversations Using a Generative LSTM Network ver. 4

Last Updated on June 5, 2022 by shibatau

I. What will we learn?

Let’s create Philosopher Conversations using a Generative LSTM Network. We can learn how to create them with Python from the post:

Creating Philosopher Conversations Using a Generative LSTM Network

II. Clone the repository on GitHub

If you have an account for GitHub and GitHub Desktop installed on your computer, the easiest way to create the philosophers’ conversations is to clone the repository with GiHub Desktop.

https://github.com/jackbodine/Drunk-Philosophers

III. The data

Please download the data of the sentences taken from 59 texts spanning the history of philosophy from here:

Kourosh Alizadeh, History of Philosophy

You can handle the data on Jpyter Notebook on Kaggle:

https://www.kaggle.com/code/shibatau/philosopher

Let me show you all the authors and the titles:

	author	title
0	Aristotle	Aristotle - Complete Works
1	Beauvoir	The Second Sex
2	Berkeley	A Treatise Concerning The Principles Of Human Knowledge
3	Berkeley	Three Dialogues
4	Davis	Women, Race, And Class
5	Deleuze	Anti-Oedipus
6	Deleuze	Difference And Repetition
7	Derrida	Writing And Difference
8	Descartes	Discourse On Method
9	Descartes	Meditations On First Philosophy
10	Epictetus	Enchiridion
11	Fichte	The System Of Ethics
12	Foucault	The Order Of Things
13	Foucault	History Of Madness
14	Foucault	The Birth Of The Clinic
15	Hegel	Elements Of The Philosophy Of Right
16	Hegel	The Phenomenology Of Spirit
17	Hegel	Science Of Logic
18	Heidegger	Off The Beaten Track
19	Heidegger	Being And Time
20	Hume	A Treatise Of Human Nature
21	Hume	Dialogues Concerning Natural Religion
22	Husserl	The Idea Of Phenomenology
23	Husserl	The Crisis Of The European Sciences And Phenomenology
24	Kant	Critique Of Pure Reason
25	Kant	Critique Of Judgement
26	Kant	Critique Of Practical Reason
27	Keynes	A General Theory Of Employment, Interest, And Money
28	Kripke	Naming And Necessity
29	Kripke	Philosophical Troubles
30	Leibniz	Theodicy
31	Lenin	Essential Works Of Lenin
32	Lewis	Lewis - Papers
33	Locke	Second Treatise On Government
34	Locke	Essay Concerning Human Understanding
35	Malebranche	The Search After Truth
36	Marcus Aurelius	Meditations
37	Marx	The Communist Manifesto
38	Marx	Capital
39	Merleau-Ponty	The Phenomenology Of Perception
40	Moore	Philosophical Studies
41	Nietzsche	Ecce Homo
42	Nietzsche	Beyond Good And Evil
43	Nietzsche	The Antichrist
44	Nietzsche	Twilight Of The Idols
45	Nietzsche	Thus Spake Zarathustra
46	Plato	Plato - Complete Works
47	Popper	The Logic Of Scientific Discovery
48	Quine	Quintessence
49	Ricardo	On The Principles Of Political Economy And Taxation
50	Russell	The Analysis Of Mind
51	Russell	The Problems Of Philosophy
52	Smith	The Wealth Of Nations
53	Spinoza	On The Improvement Of Understanding
54	Spinoza	Ethics
55	Wittgenstein	Philosophical Investigations
56	Wittgenstein	Tractatus Logico-Philosophicus
57	Wittgenstein	On Certainty
58	Wollstonecraft	Vindication Of The Rights Of Woman

Please download philosophy_data.csv on you computer and make a new directory called data in the directory where main.py is and save the downloaded file in the data directory.

IV. Creating conversations

You have to create an account for OpenAI and get an API key beforehand. Also you need to replace openai.api_key = os.getenv(“YOUR_OPENAI_API_KEY”) with openai.api_key = “YOUR_OPENAI_API_KEY” (remove os.getenv( )) on the main.py file. That code of the openai library seems to have been changed.

Please select philosophers on the browser opened and press the Generate!, and you will get the results like this:

About shibatau

I was born and grown up in Kyoto. I studied western philosophy at the University and specialized in analytic philosophy, especially Ludwig Wittgenstein at the postgraduate school. I'm interested in new technology, especially machine learning and have been learning R language for two years and began to learn Python last summer. Listening toParamore, Sia, Amazarashi and MIyuki Nakajima. Favorite movies I've recently seen: "FREEHELD". Favorite actors and actresses: Anthony Hopkins, Denzel Washington, Ellen Page, Meryl Streep, Mia Wasikowska and Robert DeNiro. Favorite books: Fyodor Mikhailovich Dostoyevsky, "The Karamazov Brothers", Shinran, "Lamentations of Divergences". Favorite phrase: Salvation by Faith. Twitter: @shibatau

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.