A newer version of the Gradio SDK is available:
6.5.1
title: Part 1
emoji: 🚀
colorFrom: indigo
colorTo: indigo
sdk: gradio
sdk_version: 5.18.0
app_file: app.py
pinned: false
license: apache-2.0
short_description: Fainal Project , Part 1
AI Study Summary
This is a simple text summarization tool built using the mT5 multilingual model for summarizing text in both Arabic and English. It uses the Hugging Face transformers library and Gradio to create an interactive web interface for summarizing text input.
Features
- Summarize text in multiple languages, including Arabic and English.
- Use a pre-trained multilingual summarization model (
csebuetnlp/mT5_multilingual_XLSum). - Simple, user-friendly Gradio interface to input text and receive summaries.
How It Works
The application uses a pre-trained model called mT5_multilingual_XLSum for text summarization. The user can enter text in Arabic or English, and the model will generate a concise summary of the input.
Example Texts
Arabic:
"الذكاء الاصطناعي هو فرع من علوم الكمبيوتر يهدف إلى إنشاء آلات ذكية تعمل وتتفاعل مثل البشر. بعض الأنشطة التي صممت أجهزة الكمبيوتر الذكية للقيام بها تشمل: التعرف على الصوت، التعلم، التخطيط، وحل المشاكل."
English:
"Artificial intelligence is a branch of computer science that aims to create intelligent machines that work and react like humans. Some of the activities computers with artificial intelligence are designed for include: Speech recognition, learning, planning, and problem-solving."
Requirements
To run this project locally, you need Python 3.7 or higher. Additionally, you need to install the following Python libraries:
- pip install gradio.
- pip install transformers.
- Gradio: Provides a simple interface for building and sharing machine learning demos.
- Transformers: Hugging Face's library for pre-trained models, in this case, for multilingual text summarization.
- Torch: PyTorch is used as the backend for the model.
How to Run Locally
Clone the repository or download the app.py and requirements.txt files.
Create a virtual environment and activate it (optional but recommended).
Install the required libraries by running:
pip install -r requirements.txt
- Run the application:
- python app.py
How It Works
- The Gradio interface allows you to input text and select the language (Arabic or English).
- The model will generate a summary of the text based on the language selected.
- You can also use pre-defined example texts to quickly test the summarization feature.
Input:
- Text: "Artificial intelligence is a branch of computer science that aims to create intelligent machines that work and react like humans."
- Language: English
Output:
- Summary: "AI is a branch of computer science aimed at creating intelligent machines that mimic human behavior."
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
The summarization model used in this application is based on the mT5 Multilingual XLSum model by Hugging Face and is fine-tuned on the XLSum dataset for summarization in multiple languages. Gradio is used to build the web interface, making it easy to interact with the model.