Modified version of the code used in my bachelor's thesis titled "Der Einfluss von automatisch generierten Paraphrasen auf die NLU-Performance am Beispiel des Miele Alexa Skills" (2021). In this project, German paraphrases are generated using different methods at the lexical and syntactic levels. The resulting paraphrases can be used for NLU evaluations for example.
Paraphrases were automatically generated in the following ways:
- Word Substitution
- Pivot Translation
- T5 (Transformer Model)
- Clone project
git clone https://github.com/j0st/german-paraphraser
- Install requirements (Odenet needs to be installed directly from https://github.com/hdaSprachtechnologie/odenet)
pip install -r requirements.txt
pip install git+https://github.com/hdaSprachtechnologie/odenet
- Import
paraphraser.py
and create an instance of the paraphraser class
paraphraser = Paraphraser()
- Generate paraphrases from your text file (input sentences need punctuation for the paraphraser to work properly)
paraphraser.generate(YOUR_LIST_OF_INPUT_SENTENCES, OUTPUT_FILE)