title | emoji | colorFrom | colorTo | sdk | sdk_version | app_file | pinned | license | short_description |
---|---|---|---|---|---|---|---|---|---|
Aristotle |
🏆 |
gray |
green |
gradio |
5.1.0 |
app.py |
false |
apache-2.0 |
Ancient Greek text to audio |
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.
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.
git clone git@github.com: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
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.
This could be caused by one's proxy. Simply turn-off or switch proxy should work
The use and distribution terms for aristotle are covered by the Apache License, Version 2.0.