Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
datasets:
|
| 4 |
+
- ZeynepAltundal/w
|
| 5 |
+
language:
|
| 6 |
+
- tr
|
| 7 |
+
base_model:
|
| 8 |
+
- ytu-ce-cosmos/turkish-gpt2-medium-350m-instruct-v0.1
|
| 9 |
+
pipeline_tag: text-generation
|
| 10 |
+
library_name: transformers
|
| 11 |
+
tags:
|
| 12 |
+
- Turkish
|
| 13 |
+
- Fine-tuned
|
| 14 |
+
- Question-Answering
|
| 15 |
+
- GPT-2
|
| 16 |
+
---
|
| 17 |
+
# Model Overview:
|
| 18 |
+
This model is a fine-tuned version of the "ytu-ce-cosmos/turkish-gpt2-medium-350m-instruct-v0.1", designed specifically for Turkish Question-Answering (Q&A). The fine-tuning process utilized a custom dataset generated from Turkish Wikipedia articles, focusing on factual knowledge.
|
| 19 |
+
|
| 20 |
+
**Base Model:** ytu-ce-cosmos/turkish-gpt2-medium-350m-instruct-v0.1
|
| 21 |
+
**Fine-Tuned Dataset:** Custom Turkish Q&A dataset
|
| 22 |
+
**Evaluation Loss:** 2.1461 (on the validation dataset)
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
## Quick Start
|
| 26 |
+
```python
|
| 27 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
model_name = "./fine_tuned_model" # Replace with your Hugging Face model path if uploaded
|
| 31 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 32 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
question = "Kamu sosyolojisi nedir?"
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
input_ids = tokenizer(question, return_tensors="pt").input_ids
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
output = model.generate(
|
| 42 |
+
input_ids=input_ids,
|
| 43 |
+
max_length=50,
|
| 44 |
+
num_return_sequences=1,
|
| 45 |
+
temperature=0.7
|
| 46 |
+
)
|
| 47 |
+
|
| 48 |
+
response = tokenizer.decode(output[0], skip_special_tokens=True)
|
| 49 |
+
print(f"Question: {question}")
|
| 50 |
+
print(f"Answer: {response}")
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
## Training Details:
|
| 54 |
+
**Dataset Source:** Custom dataset generated from Turkish Wikipedia
|
| 55 |
+
**Number of Training Examples:** 2,606
|
| 56 |
+
**Training Dataset Size:** 2,084 (80%)
|
| 57 |
+
**Validation Dataset Size:** 522 (20%)
|
| 58 |
+
**Number of Epochs:** 3
|
| 59 |
+
**Batch Size:** 8
|
| 60 |
+
**Learning Rate:** 5e-5
|
| 61 |
+
**Evaluation Loss:** 2.1461
|