Our service is designed to perform two core tasks Text Summarization and Question Answering. This document provides an overview of both features and how to use them effectively.
The service can generate concise and meaningful summaries of given text. This is useful for extracting key points from long documents, articles, or reports.
- Input : A passage.
- Output : A short, coherent summary that captures the main ideas.
- Summarizing news articles.
- Condensing research papers.
- Extracting key points from business reports.
The service can answer questions based on a given text. This allows users to interact with the content more effectively.
- Input : A csv or exel format file.
- Output : A precise answer derived from the given text.
- Extracting specific details from a document.
- Automating customer support queries.
- Analyzing and interpreting content for research purposes.
i don't know yet 😅(complete next)
is designed to improve efficiency in handling large volumes of text by simplifying content and providing accurate answers to relevant queries and can support both English and Persion language . if we want to be more deeper on the model we use can demonstrate on the sub models :
for english we use flan - T5 for both Summarization and Question Answering . if you want more detail about this model click on bellow collapsible section :
✅ Click to expand
Flan-T5 (Fine-tuned Language Net T5) is an advanced version of Google's T5 (Text-To-Text Transfer Transformer) model, fine-tuned on instruction-following tasks to enhance its ability to understand and generate natural language.
- Instruction-Tuned: Trained on a diverse set of tasks to improve performance in real-world applications.
- Text-to-Text Framework: Accepts input text and generates output text, making it highly flexible.
- Multi-Task Learning: Excels in summarization, translation, question answering, and more.
- Scalable Variants: Available in different sizes (small, base, large, XL, and XXL) to balance performance and efficiency.
Flan-T5 follows the encoder-decoder (transformer) architecture:
1️⃣ Encoder: Processes the input text.
2️⃣ Decoder: Generates the output text based on learned patterns and instructions.
Unlike traditional models, Flan-T5 is pre-trained on a mixture of tasks before fine-tuning on instruction datasets, making it more adaptable to various applications.
✅ Text Summarization – Compressing long articles into concise summaries.
✅ Question Answering – Extracting or generating answers from given contexts.
✅ Text Generation – Writing creative or informative content based on prompts.
✅ Code Generation – Assisting in programming by generating code snippets.
✅ Translation – Converting text between multiple languages.
Flan-T5 comes in several versions, offering a trade-off between speed and accuracy:
| Model Variant | Parameters | Use Case |
|---|---|---|
| Flan-T5 Small | ~80M | Lightweight, suitable for simple tasks |
| Flan-T5 Base | ~250M | Balanced for general use |
| Flan-T5 Large | ~780M | Improved accuracy for complex tasks |
| Flan-T5 XL | ~3B | Stronger reasoning and comprehension |
| Flan-T5 XXL | ~11B | Best performance, requires more resources |
You can use Flan-T5 via Hugging Face's Transformers library:
from transformers import T5Tokenizer, T5ForConditionalGeneration
# Load the model and tokenizer
model_name = "google/flan-t5-large"
tokenizer = T5Tokenizer.from_pretrained(model_name)
model = T5ForConditionalGeneration.from_pretrained(model_name)
# Define input text
input_text = "Summarize: The history of artificial intelligence is fascinating..."
inputs = tokenizer(input_text, return_tensors="pt")
# Generate output
output = model.generate(**inputs)
print(tokenizer.decode(output[0], skip_special_tokens=True))and for Persian language for Summarization we use HooshvareLab/pn-summary-mt5-small if you want more detail about this model click on bellow collapsible section
✅ Click to expand
The HooshvareLab/pn-summary-mt5-small is a Persian-focused text summarization model based on mT5-small, a multilingual version of Google's T5 (Text-To-Text Transfer Transformer). This model is fine-tuned specifically for Persian text summarization, making it highly effective for compressing Persian-language articles, news, and documents.
- 🌍 Multilingual T5 (mT5) Base: Built on mT5-small, which supports multiple languages.
- 🏆 Persian-Specific Fine-Tuning: Trained on Persian-language datasets for accurate summaries.
- 📝 Text-to-Text Format: Takes a Persian input text and generates a summarized version in Persian.
- ⚡ Lightweight & Efficient: Small model size for faster processing and deployment.
Like T5, the HooshvareLab/pn-summary-mt5-small follows an encoder-decoder structure:
1️⃣ Encoder: Processes the input Persian text.
2️⃣ Decoder: Generates a summarized output in Persian.
This model has been fine-tuned using Persian summarization datasets, improving its accuracy and fluency in Persian-language content.
✅ News Summarization – Condensing Persian news articles into key points.
✅ Document Summarization – Extracting key information from lengthy Persian texts.
✅ Content Simplification – Helping users understand Persian texts faster.
✅ AI-Powered Persian NLP – Enhancing Persian text applications and research.
You can use HooshvareLab/pn-summary-mt5-small via Hugging Face’s Transformers library:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
# Load model and tokenizer
model_name = "HooshvareLab/pn-summary-mt5-small"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
# Define Persian input text
persian_text = "متن بلند برای خلاصهسازی اینجا قرار میگیرد."
inputs = tokenizer("summarize: " + persian_text, return_tensors="pt", max_length=512, truncation=True)
# Generate summary
output = model.generate(**inputs, max_length=150, num_beams=5, early_stopping=True)
print(tokenizer.decode(output[0], skip_special_tokens=True))and in Persian language for Question Answering we use mansoorhamidzadeh/parsbert-persian-QA if you want more detail about this model click on bellow collapsible section
✅ Click to expand
The ParsBERT-Persian-QA model, developed by Mansoor Hamidzadeh, is a question-answering (QA) model fine-tuned on Persian texts. It is based on ParsBERT, a powerful Persian-language variant of BERT, optimized for extracting answers from Persian documents.
- 🇮🇷 Persian-Specific Training: Fine-tuned on Persian-language datasets for QA tasks.
- 🏗 BERT-Based Architecture: Built on ParsBERT, a state-of-the-art Transformer-based Persian NLP model.
- ❓ Extractive Question Answering: Finds precise answers within a given Persian text.
- ⚡ Efficient & Accurate: Designed for fast inference and high accuracy in Persian QA tasks.
This model follows the extractive QA approach, meaning:
1️⃣ Input: A Persian passage + a Persian question.
2️⃣ Processing: The model analyzes the passage to find the most relevant answer.
3️⃣ Output: A specific part of the passage that answers the question.
It is trained on Persian QA datasets, ensuring accurate and fluent responses in Persian.
✅ Automated Q&A Systems – Powering Persian chatbots and virtual assistants.
✅ Document Search & Analysis – Extracting key answers from Persian texts.
✅ Customer Support Automation – Answering FAQs in Persian.
✅ Educational Tools – Helping students and researchers find information quickly.
You can use ParsBERT-Persian-QA with Hugging Face's Transformers library:
from transformers import AutoTokenizer, AutoModelForQuestionAnswering, pipeline
# Load the model and tokenizer
model_name = "mansoorhamidzadeh/parsbert-persian-QA"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForQuestionAnswering.from_pretrained(model_name)
# Define Persian context and question
persian_context = "تهران پایتخت ایران است. این شهر بزرگترین شهر ایران محسوب میشود."
persian_question = "پایتخت ایران کجاست؟"
# Use Hugging Face pipeline for easy inference
qa_pipeline = pipeline("question-answering", model=model, tokenizer=tokenizer)
result = qa_pipeline(question=persian_question, context=persian_context)
# Print the answer
print("Answer:", result["answer"])okay