This project is conducted for my bachelor thesis in the winter semester 2022/2023.
The aim of this project is to conduct classification and translation experiments on Japanese Simplified Corpus SNOW T15: γγγγζ₯ζ¬θͺγ³γΌγγΉ.
The goal of the two tasks are to answer the questions:
For this project, Python 3.10.9 is used.
Use requirements.txt to install necessary libraries. e.g. run pip install -r requirements.txt
(β οΈ As requirements.txt is created using the conda environment I used locally for this project, it includes a large number of libraries)
A fine-tuned model is available for each task. Fine-tuned Models
|--dataset_analysis
| |--criteria.py
| |--create_vocab.py
| |--data_analysis.py
| |--data_analysis.ipynb
| |--resources
| |--analysed
|--classification
| |--create_data_classification.py
| |--train_classify.py
| |--param_tune.py
| |--train_param_tune.py
| |--resources
| |--df_test2.csv
| |--df_train2.csv
| |--df_valid2.csv
|--translation
| |--create_data_translate.py
| |--train_translate.py
| |--test_translate.py
| |--evaluate_simplified.py
| |--resources
| |--train_test_valid_dataset
| |--sample_generated.txt
| |--scores
| |--base_scores.csv
| |--large_scores.csv
| |--summary_scores.ipynb
|--.gitignore
|--README.md
|--index.xml
Some important directories and files are:
analysis: code of dataset analysis and results (the results themselves are in analyzed and data_analysis_results.ipynb contains the visualisation).classification: code of classification experiment.translation: code of translation experiment. score contains results.resources: dataset for classification and translation experiments. Both same dataset, but processed differently. df_*2.csv is named like this because they are datasets that don't contain duplicates. (See create_data_*.py for further details.)README.me: this fileUse GPU to run all the scripts, except for the evaluation of generated simplification (evaluate_simplified.py). Activate the neccessary virtual environment for the metric.
For fine-tuning or test models:
python train_classify.py with the appropriate parameterse.g.
python train_classify.py --mode train --checkpoint ku-nlp/roberta-base-japanese-char-wwm --output models/roberta_base to train a roberta base model and save the model in models/roberta_base.
python train_classify.py --mode test --checkpoint /home/students/udaka/bachelorarbeit/classification/models/roberta_base --tokenizer ku-nlp/roberta-base-japanese-char-wwm to test a fine-tuned roberta base model using bert base tokenizer. (replace checkpoint path with the path in which you save fine-tuned models. See Fine-tuned models section for available fine-tuned models)
For conducting hyperparameter tuning:
python param_tune.py with the appropriate parameterse.g. python param_tune.py --checkpoint ku-nlp/roberta-base-japanese-char-wwm to do hyperparameter tuning on a roberta base model.
For fine-tuning or test models:
python train_translate.py with the appropriate parameterse.g.
python train_translate.py --checkpoint Formzu/bart-base-japanese --output models/bart_base to train a bart base model and save the model in models/bart_base.
python test_translate.py --checkpoint /home/students/udaka/bachelorarbeit/translation/models/bart_base --tokenizer Formzu/bart-large-japanese --output bart_base.txt to test a bart base model and output the generated test in bart_base.txt. (replace checkpoint path with the path in which you save fine-tuned models. See Fine-tuned models section for available fine-tuned models)
e.g. python evaluate_simplified.py --generated bart_base.txt to evaluate bart_base.txt.
This project is conducted for my bachelor thesis in the winter semester 2022/2023.
The aim of this project is to conduct classification and translation experiments on Japanese Simplified Corpus SNOW T15: γγγγζ₯ζ¬θͺγ³γΌγγΉ.
The goal of the two tasks are to answer the questions:
For this project, Python 3.10.9 is used.
Use requirements.txt to install necessary libraries. e.g. run pip install -r requirements.txt
(β οΈ As requirements.txt is created using the conda environment I used locally for this project, it includes a large number of libraries)
A fine-tuned model is available for each task. Fine-tuned Models
|--dataset_analysis
| |--criteria.py
| |--create_vocab.py
| |--data_analysis.py
| |--data_analysis.ipynb
| |--resources
| |--analysed
|--classification
| |--create_data_classification.py
| |--train_classify.py
| |--param_tune.py
| |--train_param_tune.py
| |--resources
| |--df_test2.csv
| |--df_train2.csv
| |--df_valid2.csv
|--translation
| |--create_data_translate.py
| |--train_translate.py
| |--test_translate.py
| |--evaluate_simplified.py
| |--resources
| |--train_test_valid_dataset
| |--sample_generated.txt
| |--scores
| |--base_scores.csv
| |--large_scores.csv
| |--summary_scores.ipynb
|--.gitignore
|--README.md
|--index.xml
Some important directories and files are:
analysis: code of dataset analysis and results (the results themselves are in analyzed and data_analysis_results.ipynb contains the visualisation).classification: code of classification experiment.translation: code of translation experiment. score contains results.resources: dataset for classification and translation experiments. Both same dataset, but processed differently. df_*2.csv is named like this because they are datasets that don't contain duplicates. (See create_data_*.py for further details.)README.me: this fileUse GPU to run all the scripts, except for the evaluation of generated simplification (evaluate_simplified.py). Activate the neccessary virtual environment for the metric.
For fine-tuning or test models:
python train_classify.py with the appropriate parameterse.g.
python train_classify.py --mode train --checkpoint ku-nlp/roberta-base-japanese-char-wwm --output models/roberta_base to train a roberta base model and save the model in models/roberta_base.
python train_classify.py --mode test --checkpoint /home/students/udaka/bachelorarbeit/classification/models/roberta_base --tokenizer ku-nlp/roberta-base-japanese-char-wwm to test a fine-tuned roberta base model using bert base tokenizer. (replace checkpoint path with the path in which you save fine-tuned models. See Fine-tuned models section for available fine-tuned models)
For conducting hyperparameter tuning:
python param_tune.py with the appropriate parameterse.g. python param_tune.py --checkpoint ku-nlp/roberta-base-japanese-char-wwm to do hyperparameter tuning on a roberta base model.
For fine-tuning or test models:
python train_translate.py with the appropriate parameterse.g.
python train_translate.py --checkpoint Formzu/bart-base-japanese --output models/bart_base to train a bart base model and save the model in models/bart_base.
python test_translate.py --checkpoint /home/students/udaka/bachelorarbeit/translation/models/bart_base --tokenizer Formzu/bart-large-japanese --output bart_base.txt to test a bart base model and output the generated test in bart_base.txt. (replace checkpoint path with the path in which you save fine-tuned models. See Fine-tuned models section for available fine-tuned models)
e.g. python evaluate_simplified.py --generated bart_base.txt to evaluate bart_base.txt.