Update language to English - model accepts English input and provides English output
Browse files
README.md
CHANGED
|
@@ -4,73 +4,68 @@ pipeline_tag: text-generation
|
|
| 4 |
tags:
|
| 5 |
- transformers
|
| 6 |
- text-generation
|
| 7 |
-
-
|
| 8 |
- quran
|
| 9 |
- islamic
|
|
|
|
|
|
|
| 10 |
- safetensors
|
|
|
|
| 11 |
language:
|
| 12 |
-
-
|
| 13 |
library_name: transformers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
---
|
| 15 |
|
| 16 |
-
# QuranPlus
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
## Model
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
## Usage
|
| 25 |
|
| 26 |
-
|
| 27 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 28 |
-
|
| 29 |
-
# Load model and tokenizer
|
| 30 |
-
tokenizer = AutoTokenizer.from_pretrained("justdeen/QuranPlus")
|
| 31 |
-
model = AutoModelForCausalLM.from_pretrained("justdeen/QuranPlus")
|
| 32 |
-
|
| 33 |
-
# Generate text
|
| 34 |
-
input_text = "ما هو الإسلام؟"
|
| 35 |
-
inputs = tokenizer(input_text, return_tensors="pt")
|
| 36 |
-
|
| 37 |
-
with torch.no_grad():
|
| 38 |
-
outputs = model.generate(**inputs, max_length=100, do_sample=True)
|
| 39 |
-
|
| 40 |
-
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 41 |
-
print(generated_text)
|
| 42 |
-
```
|
| 43 |
-
|
| 44 |
-
## Inference API
|
| 45 |
-
|
| 46 |
-
You can also use this model via the Hugging Face Inference API:
|
| 47 |
|
| 48 |
```python
|
| 49 |
-
import
|
| 50 |
|
| 51 |
-
|
| 52 |
-
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
})
|
| 61 |
```
|
| 62 |
|
| 63 |
-
##
|
| 64 |
-
|
| 65 |
-
This model was trained on Islamic and Quranic texts to provide accurate and contextually appropriate responses about Islamic teachings.
|
| 66 |
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
-
|
| 70 |
-
- Responses should be verified by Islamic scholars for religious accuracy
|
| 71 |
-
- May not perform well on non-Islamic topics
|
| 72 |
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
-
|
| 76 |
-
<!-- Last updated: 2025-08-03T10:43:18.421892 -->
|
|
|
|
| 4 |
tags:
|
| 5 |
- transformers
|
| 6 |
- text-generation
|
| 7 |
+
- english
|
| 8 |
- quran
|
| 9 |
- islamic
|
| 10 |
+
- religious-texts
|
| 11 |
+
- question-answering
|
| 12 |
- safetensors
|
| 13 |
+
- t5
|
| 14 |
language:
|
| 15 |
+
- en
|
| 16 |
library_name: transformers
|
| 17 |
+
widget:
|
| 18 |
+
- text: "What is Islam?"
|
| 19 |
+
example_title: "Basic Question"
|
| 20 |
+
- text: "Tell me about the five pillars of Islam"
|
| 21 |
+
example_title: "Islamic Concepts"
|
| 22 |
+
- text: "Explain the significance of prayer in Islam"
|
| 23 |
+
example_title: "Religious Practice"
|
| 24 |
---
|
| 25 |
|
| 26 |
+
# QuranPlus - English Language Islamic Q&A Model
|
| 27 |
|
| 28 |
+
This model is fine-tuned to answer questions about Islam and the Quran in **English**. While it has knowledge of Arabic religious texts and can reference them, it primarily operates in English for both input and output.
|
| 29 |
|
| 30 |
+
## Model Details
|
| 31 |
|
| 32 |
+
- **Primary Language**: English
|
| 33 |
+
- **Model Type**: T5 (Text-to-Text Transfer Transformer)
|
| 34 |
+
- **Task**: Question Answering about Islamic topics
|
| 35 |
+
- **Input**: English questions about Islam, Quran, and Islamic teachings
|
| 36 |
+
- **Output**: English responses with references to Islamic texts
|
| 37 |
|
| 38 |
## Usage
|
| 39 |
|
| 40 |
+
You can ask questions in English and receive answers in English:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
```python
|
| 43 |
+
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
| 44 |
|
| 45 |
+
model = T5ForConditionalGeneration.from_pretrained("justdeen/QuranPlus")
|
| 46 |
+
tokenizer = T5Tokenizer.from_pretrained("justdeen/QuranPlus")
|
| 47 |
|
| 48 |
+
# Ask questions in English
|
| 49 |
+
question = "What is the importance of charity in Islam?"
|
| 50 |
+
inputs = tokenizer(question, return_tensors="pt", max_length=512, truncation=True)
|
| 51 |
+
outputs = model.generate(**inputs, max_length=150)
|
| 52 |
+
answer = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 53 |
+
print(answer)
|
|
|
|
| 54 |
```
|
| 55 |
|
| 56 |
+
## Example Questions
|
|
|
|
|
|
|
| 57 |
|
| 58 |
+
- "What is Islam?"
|
| 59 |
+
- "Tell me about the five pillars of Islam"
|
| 60 |
+
- "What does the Quran say about kindness?"
|
| 61 |
+
- "Explain the concept of Tawheed"
|
| 62 |
+
- "What is the significance of Ramadan?"
|
| 63 |
|
| 64 |
+
## Note
|
|
|
|
|
|
|
| 65 |
|
| 66 |
+
While this model may reference Arabic terms and texts, it is designed to:
|
| 67 |
+
- Accept questions in English
|
| 68 |
+
- Provide responses in English
|
| 69 |
+
- Explain Islamic concepts in English
|
| 70 |
|
| 71 |
+
The model has been trained to make Islamic knowledge accessible to English speakers.
|
|
|