mt5 base turkish question paraphrase generator
secometoIntroduction
The mT5-Base-Turkish-Question-Paraphrase-Generator is a pre-trained model designed to generate paraphrased questions in the Turkish language. Developed as part of a computer project at Yildiz Technical University, it aims to explore under-researched areas of Turkish language processing.
Architecture
The model is based on the mT5 architecture, a multilingual version of the T5 model, which is optimized for text-to-text transformations. It uses the PyTorch library and is compatible with Hugging Face's Transformers for inference.
Training
The model was trained on 50,994 manually created question sentence pairs. These sentences were extracted from popular Turkish forum discussions and expanded through data augmentation by the project team. This dataset was instrumental in training the model to understand and generate high-quality paraphrases.
Guide: Running Locally
To run the model locally, follow these steps:
- Install the necessary libraries:
pip install transformers sentencepiece
- Use the following Python script to generate paraphrases:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("secometo/mt5-base-turkish-question-paraphrase-generator") model = AutoModelForSeq2SeqLM.from_pretrained("secometo/mt5-base-turkish-question-paraphrase-generator") original_sentence = tokenizer.encode_plus("Ülke genelinde bisiklet kullanımının artması hakkında ne düşünüyorsun?", return_tensors='pt') paraphrased_sentences = model.generate(original_sentence['input_ids'], max_length=150, num_return_sequences=5, num_beams=5) print(tokenizer.batch_decode(paraphrased_sentences, skip_special_tokens=True))
- Consider using cloud GPU services like AWS, Google Cloud, or Azure for better performance.
License
The model's license details are not explicitly mentioned in the provided information. Users should check the model card on Hugging Face's platform for any licensing information or restrictions before use.