nus-cs5647-team-5/Mandarin_Tone_Evaluation
(The above metadata is required for HuggingFace to run our app)
Project Team 5 | Mandarin Tone Evaluation
Online Demo
You can try our online demo here
Before you start
create a environment using the requirements.txt file
Training
Data Preparation
You can refer to the datalist folder, which contains three subfolders: aidatatang, aishell, thchs30. Each subfolder contains corresponding label for that dataset.
You should then download the corresponding dataset from the following links:
After downloading, you can unzip the dataset and put all files into data/speech_data/ folder. For example, for Thchs30 dataset, you should put all unzipped files into data/speech_data/data_thchs30/ folder.
Model Training
run python train.py to train the model using the datasets specified in the config.json file. A typical training process will have 50 epochs, and will take about 15 hours to finish (on our Mac M1Pro chip). The model will be saved in model/ folder. We've also provided two trained model in the model/ folder to serve as the checkpoint (one trained on single dataset(thchs30), and one trained on all 3 datasets), so you can skip the training process and directly use the pretrained model to do the inference (see Inferencing section).
Inferencing
Using GUI
- Run the app.py file using command
python app.py
Then you can open the given localhost link in your browser and use the GUI provided by Gradio to evaluate the tone of the given sentence.
Using CLI
- Modify the file path in
predict.pyto the path of the audio you want to evaluate
- Run the
predict.pyfile using commandpython predict.py
