Instructions to use Omartificial-Intelligence-Space/AraScholar with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Omartificial-Intelligence-Space/AraScholar with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Omartificial-Intelligence-Space/AraScholar")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("Omartificial-Intelligence-Space/AraScholar") model = AutoModelForSeq2SeqLM.from_pretrained("Omartificial-Intelligence-Space/AraScholar", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Omartificial-Intelligence-Space/AraScholar with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Omartificial-Intelligence-Space/AraScholar" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Omartificial-Intelligence-Space/AraScholar", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Omartificial-Intelligence-Space/AraScholar
- SGLang
How to use Omartificial-Intelligence-Space/AraScholar with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Omartificial-Intelligence-Space/AraScholar" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Omartificial-Intelligence-Space/AraScholar", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Omartificial-Intelligence-Space/AraScholar" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Omartificial-Intelligence-Space/AraScholar", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Omartificial-Intelligence-Space/AraScholar with Docker Model Runner:
docker model run hf.co/Omartificial-Intelligence-Space/AraScholar
YAML Metadata Warning:The pipeline tag "text2text-generation" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other
AraScholar — Academic Paraphrasing in Modern Standard Arabic
AraScholar rewrites Modern Standard Arabic (MSA) sentences into a polished academic register while preserving meaning. It is an AraT5v2-base model fine-tuned on a manually curated corpus of expert academic rewrites.
It accompanies the paper "Reaching the Human Operating Point: Controlled Academic Paraphrasing in Modern Standard Arabic."
The idea: an operating point, not just fluency
Academic rewriting must balance two opposing goals: preserve the source meaning (fidelity) and genuinely rewrite it (novelty). The human gold rewrites sit at a narrow operating point — about 57% novelty at ~87 semantic preservation. Plain decoding of fine-tuned models tends to copy the input; large LLMs tend to over-rewrite and drift. AraScholar is designed to be steered to the human operating point at decoding time.
Usage
import torch
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
m = "Omartificial-Intelligence-Space/AraScholar"
tok = AutoTokenizer.from_pretrained(m) # see note below for transformers>=5
model = AutoModelForSeq2SeqLM.from_pretrained(m).eval()
src = "تعد القراءة من اهم وسائل اكتساب المعرفة لدى الطلاب في الجامعات"
ids = tok(f"paraphrase: {src}", return_tensors="pt", truncation=True, max_length=768)
out = model.generate(**ids, num_beams=5, no_repeat_ngram_size=3,
repetition_penalty=1.2, max_new_tokens=512)
print(tok.decode(out[0], skip_special_tokens=True))
Input format: paraphrase: {text} (optionally paraphrase: {domain}: {text}).
Text is used without orthographic normalization.
transformers >= 5 note: if the tokenizer fails to load, use the fast file directly:
from transformers import PreTrainedTokenizerFast; tok = PreTrainedTokenizerFast(tokenizer_file="tokenizer.json", pad_token="<pad>", eos_token="</s>", unk_token="<unk>").
Reaching the operating point (recommended)
Plain beam search copies (~26% novelty). To reach the human point, use one of:
- Copy-penalty decoding (cheap, single pass): subtract a constant from the logits of tokens that appear in the source.
- Operating-point reranking: sample K candidates and pick the most novel one whose semantic preservation (LaBSE/GATE vs. source) stays above a floor.
Reference implementations are released with the paper code.
Results (official blind test set, 2,000 sentences)
In-band = % of outputs within the human band (novelty 40–70%, preservation ≥85).
| System | In-band % | Novelty | Preservation |
|---|---|---|---|
| Human (gold) | — | 56.1 | 86.7 |
| AraScholar + operating-point reranking | 76.6 | 55.7 | 89.3 |
| AraScholar + copy-penalty | 55.9 | 58.2 | 87.0 |
| GPT-4o | 49.4 | 65.1 | 86.4 |
| Claude Sonnet 4.6 | 18.1 | 75.4 | 82.5 |
| AraScholar (plain beam) | 10.0 | 25.6 | 93.9 |
A ~300M open model with decoding-time control matches or exceeds frontier LLMs on calibration for this task.
Intended use & limitations
For research and legitimate academic writing support (clarity, register). It operates at the sentence level. Like any paraphraser it is dual-use; deploy with attribution/integrity safeguards. Outputs should be checked for rare hallucinations, especially under high-temperature sampling.
Citation
@inproceedings{arascholar,
title = {Reaching the Human Operating Point: Controlled Academic Paraphrasing in Modern Standard Arabic},
author = {Anonymous},
year = {2025}
}
- Downloads last month
- 8
Model tree for Omartificial-Intelligence-Space/AraScholar
Base model
UBC-NLP/AraT5v2-base-1024