A newer version of the Gradio SDK is available:
5.9.1
title: Aristotle
emoji: 🏆
colorFrom: gray
colorTo: green
sdk: gradio
sdk_version: 5.1.0
app_file: app.py
pinned: false
license: apache-2.0
short_description: Ancient Greek text to audio
Aristotle
Aristotle is an automatic text to speech application that takes an Ancient Greek excerpt as input and generates a downloadable audio for language learner for practice speaking in Ancient Greek. Aristotle generates speech using the OpenAI's text-to-speech API.
The app is available on 🤗 Hugging Face space. Please check it out.
A Docker image is also available:
docker run -d --name aristotle -p 7860:7860 jack20191124/aristotle
When container is up and running, visit app at http://localhost:7860.
How Does It Work
Ancient Greek is a phonetically-lost language, because no one knows the correct pronunciation of such an ancient language. A lack of audio content is a major hurdle to learning Ancient Greek. So I decided to tackle this problem with NLP.
OpenAI will read Ancient Greek text with a modern Greek pronunciation. What's different about OpenAI from other Text-to-Speech tools is that OpenAI is unaffected by the different accents and breathing marks in Ancient Greek. It will simply read the Ancient Greek text in modern pronunciation with the accents in the right places. Studying Ancient Greeek with modern pronunciation is simply not satisfactory for me, though, so I started messing around with the text to see if I could get the pronunciation closer to Erasmian/Attic/whatever we want to call it. We can simply replace letters in the Greek words with Latin letters to try and get what we want.
Here is an example sentence.
This is the original text, which OpenAI will read in Modern Greek with no problem:
Σόλων ἦν συνετώτατος πάντων τῶν Ἀθηναίων, τὴν γὰρ σοφίαν αὐτοῦ οὐ μόνον οἱ πολῖται ἐθαύμαζον, ἀλλὰ καὶ οἱ ἂλλοι Ἓλληνες πάντες, πολλοὶ δὲ καὶ τῶν βαρβάρων.
And here is the same but with letters replaced to try and get OpenAI to read in an "Attic" pronunciation:
sόλωn en sunetώtαtος πάntωn tón aθenáiωn, tén γáρ sοφίan autu u μόnon hoi πολítαi eθáuμαζon, aλλá kái hoi áλλοi Héλλeneς πάnteς, πολλói δé kái tón βαρβάρωn.
A huge list of letter replacements has been made to try and imitate Attic pronunciation as closely as possible. The result is pretty solid and is close enough to be useful for creating audio files for texts where we don't have any audio recordings.
Development
Running Locally
git clone [email protected]:QubitPi/aristotle.git
cd aristotle
virtualenv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
To start the app:
export SERVER_NAME=127.0.0.1
python3 app.py
The app will be available at http://localhost:7860 and the API docs at http://localhost:7860/?view=api
Docker
To build a Docker container of Aristotle, follow these steps:
Make sure Docker has been installed
Open a terminal and navigate to the project directory.
Run the following command to build the Docker image:
docker build -t jack20191124/aristotle .
Wait for the build process to complete.
Once the build is finished, we can run the Docker container using the following command:
docker run -it --name aristotle -p 7860:7860 jack20191124/aristotle
Open up browser and navigate to http://localhost:7860 to access the space.
Toubleshooting
No matching distribution found for fastapi
While Executing pip3 install -r requirements.txt
This could be caused by one's proxy. Simply turn-off or switch proxy should work
License
The use and distribution terms for aristotle are covered by the Apache License, Version 2.0.