This repo is inteded for a web app service that summarizes, reports events, etc.. based on the input you provide
Python
1
37 commits
updated May 1, 2025
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.
1. Text Summarization 📃
The service can generate concise and meaningful summaries of given text. This is useful for extracting key points from long documents, articles, or reports.
2. Question Answering on Processed Text ❓
The service can answer questions based on a given text. This allows users to interact with the content more effectively.
i don't know yet 😅(complete next)
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.
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))
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.
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))
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.
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
This repo is inteded for a web app service that summarizes, reports events, etc.. based on the input you provide
Python
1
37 commits
updated May 1, 2025
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.
1. Text Summarization 📃
The service can generate concise and meaningful summaries of given text. This is useful for extracting key points from long documents, articles, or reports.
2. Question Answering on Processed Text ❓
The service can answer questions based on a given text. This allows users to interact with the content more effectively.
i don't know yet 😅(complete next)
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.
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))
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.
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))
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.
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