One-click generation of English-Chinese Excel word lists and audio files of articles composed of words.
中文介绍|English Introduce
I recently found a post on v2ex introducing English improvement techniques. Besides getting familiar with the words by sight, I believe it's also important to get familiar with them by sound. I came across New Oriental's 100 sentences for IELTS vocabulary, and decided to use ChatGPT to generate articles based on the words, then create audio files to listen to during commutes.
The feature of generating Excel files came about because I found that exporting words in List required an additional fee. So I added this feature. Initially, I planned to use a dictionary to write the meanings of the words, but later I felt it would be better to use Google Translate SQLite3 for queries. The translation utilizes the Query existing data, and if not found, generate using ChatGPT/Google/Youdao Translate.translate.py
file. Of course, to use Google Translate, a proper network environment is necessary
- English-Chinese Excel word list generation: Organizes words, translations, and phonetic symbols into Excel format for easy memorization and review.
- Article text and audio generation: Generates English articles based on given words and converts them to audio files (openai/pyttsx3/gTTS) for listening practice.
- Install Python 3.11
- Install necessary Python libraries with
pip install -r requirements.txt
- Place the word file into
words.txt
(words separated by spaces) - Fill in your OpenAI token in
config.py
- Run the
generate_article.py
file to generate articles and audio
requests
: For handling requestspandas
: For generating Excel filesepitran
: For generating word pronunciations (not recommended)sqlite3
: For storing word pronunciations (recommended)pyttsx3
: For generating audio files, use openai/gTTS for non-Windows platformsjson_repair
: For handling JSON format errors- Other dependencies can be found in the
requirements.txt
file
- Optimize word phonetics
- Collect more phonetic data
- Obtain phonetics through ChatGPT
- Optimize word translations
- Collect more word data
- Obtain translations through ChatGPT
- If you encounter issues during installation or execution, please check if your Python version is 3.11
- Ensure all dependencies are correctly installed via
requirements.txt
- If you face network connection issues, check your network settings and proxy configuration
Successfully used on Linux, failed on Windows
Linux installation tutorial reference: Installation of Flite
Preprocessing and result handling reference: Preprocessors and postprocessors
Approximately 40,000 word phonetic translations were obtained and stored in SQLite3, with queries used to retrieve word phonetics.