MohammedNasser commited on
Commit
3e58c9a
โ€ข
1 Parent(s): b56c065

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +40 -64
README.md CHANGED
@@ -4,57 +4,52 @@ emoji: ๐Ÿ’ฌ
4
  colorFrom: yellow
5
  colorTo: purple
6
  sdk: gradio
7
- sdk_version: 4.36.1
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
11
  short_description: 'AI-powered system to interact with Arabic-language PDF doc '
12
  ---
13
 
 
14
 
15
- # Arabic PDF Chat Assistant
16
 
17
- **Arabic PDF Chat Assistant** is an advanced, fine-tuned AI-powered system designed to interact with Arabic-language PDF documents. The system enables users to upload PDF files and engage in natural language conversations, asking questions in Arabic. The assistant provides precise and relevant answers based on the content of the uploaded document, making it a powerful tool for querying Arabic texts in a streamlined and user-friendly way.
 
 
 
 
 
 
 
18
 
19
- ## Table of Contents
20
- - [Overview](#overview)
21
- - [Features](#features)
22
- - [Model](#model)
23
- - [Installation](#installation)
24
- - [Usage](#usage)
25
- - [Fine-Tuning](#fine-tuning)
26
- - [Gradio Interface](#gradio-interface)
27
- - [License](#license)
28
 
29
- ## Overview
30
- The **Arabic PDF Chat Assistant** is specialized for analyzing Arabic-language PDF documents. The assistant is fine-tuned to handle a variety of complex queries, ensuring that responses reflect the content accurately, with a focus on professionalism and clarity.
31
 
32
- The system employs advanced natural language processing techniques to extract and present key information from PDFs. It is particularly useful for professionals, researchers, students, and organizations dealing with Arabic-language documents who need fast and precise answers.
 
 
 
 
 
 
33
 
34
- ## Features
35
- - **Arabic Language Support**: Fully supports queries and responses in Modern Standard Arabic (ุงู„ูุตุญู‰).
36
- - **PDF Querying**: Upload any Arabic PDF document and ask natural language questions. The assistant will analyze and respond based on the content.
37
- - **Fine-tuned Model**: The model is fine-tuned on Arabic question-answering datasets to provide high accuracy and relevance in responses.
38
- - **Multimodal Outputs**: In addition to text-based responses, the assistant can generate audio responses in Arabic using text-to-speech (TTS) technology.
39
- - **Interactive Gradio Interface**: Intuitive and easy-to-use interface, allowing users to chat, upload files, and listen to audio responses directly from their browser.
40
- - **Customizable**: The system is built to be flexible, with room for expansion and improvements based on specific use cases.
41
-
42
- ## Model
43
- The assistant uses a fine-tuned transformer-based model specialized in Arabic question-answering tasks. The model has been trained to:
44
- - Understand Arabic syntax and semantics.
45
- - Analyze and extract relevant information from PDF documents.
46
- - Provide clear and concise answers in Arabic while avoiding informal or colloquial language.
47
 
48
  ### Model Details
49
- - **Base Model**: Transformer-based architecture (e.g., BERT, GPT, etc.)
50
- - **Fine-Tuning**: The model has been fine-tuned using Arabic-language datasets focusing on question-answering, document comprehension, and professional tone communication.
51
- - **Training Dataset**: A mix of publicly available and custom-created Arabic datasets for Q&A tasks.
52
 
53
- ## Installation
54
 
55
  ### Clone the repository
56
  ```bash
57
- git clone https://huggingface.co/spaces/MohammedNasser/Arabic-PDF-Chat
58
  cd Arabic-PDF-Chat
59
  ```
60
 
@@ -65,45 +60,28 @@ pip install -r requirements.txt
65
  ```
66
 
67
  ### API Keys (Optional)
68
- If you're using any external services (e.g., Hugging Face Transformers, or any custom language model API), ensure you have the necessary API keys.
69
 
70
- ## Usage
71
 
72
- 1. **Launch the application:**
73
  Run the following command to launch the app in your browser:
74
  ```bash
75
  python app.py
76
  ```
77
 
78
- 2. **Upload PDF:**
79
  Upload your Arabic-language PDF document through the Gradio interface.
80
 
81
- 3. **Ask Questions:**
82
- After uploading the document, enter your question in Arabic. The chatbot will analyze the content of the PDF and return an answer.
83
-
84
- 4. **Listen to Audio Responses (Optional):**
85
- If enabled, you can listen to the assistant's response via audio generated using Text-to-Speech (TTS).
86
-
87
- ## Fine-Tuning
88
-
89
- The model is fine-tuned on a set of Arabic-language question-answering datasets. To fine-tune or modify the current model, follow these steps:
90
 
91
- ### Prerequisites
92
- - Ensure you have access to a powerful GPU (e.g., NVIDIA A100) for training.
93
- - Use a dataset that consists of Arabic-language documents paired with question-answer pairs.
94
- ```
95
-
96
- ## Gradio Interface
97
 
98
- The user interface is built using Gradio, making it intuitive and accessible via the web.
99
 
100
- ### Main Interface Components:
101
- - **PDF Upload**: A file uploader for Arabic PDFs.
102
- - **Chatbox**: A two-part chat component where users enter questions, and the assistant responds based on the documentโ€™s content.
103
- - **Audio Response**: A feature that plays the response using TTS in Arabic.
104
- - **Clear Chat**: A button to reset the chat history.
105
-
106
- Hereโ€™s a simplified look at the Gradio UI:
107
 
108
  ```python
109
  import gradio as gr
@@ -114,7 +92,7 @@ def chat(user_input):
114
 
115
  with gr.Blocks() as demo:
116
  with gr.Row():
117
- gr.Image("logo.png") # Display company logo
118
  with gr.Row():
119
  pdf_input = gr.File(label="ุงุฎุชุฑ ู…ู„ู PDF")
120
  with gr.Row():
@@ -127,7 +105,5 @@ with gr.Blocks() as demo:
127
  demo.launch()
128
  ```
129
 
130
- ## License
131
  This project is licensed under the MIT License. See the `LICENSE` file for more details.
132
-
133
- ---
 
4
  colorFrom: yellow
5
  colorTo: purple
6
  sdk: gradio
7
+ sdk_version: 4.44.0
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
11
  short_description: 'AI-powered system to interact with Arabic-language PDF doc '
12
  ---
13
 
14
+ # **Arabic PDF Chat Assistant ๐Ÿค–๐Ÿ“„**
15
 
16
+ **Arabic PDF Chat Assistant** is an AI-powered system that integrates **Retrieval-Augmented Generation (RAG)** to interact with Arabic-language PDF documents. Using **Gemma**, an advanced model from Google, the system allows users to upload PDF files and ask questions in Arabic. The assistant generates precise answers based on relevant document content, making it ideal for professionals, researchers, and students dealing with Arabic texts.
17
 
18
+ ## Table of Contents ๐Ÿ“‘
19
+ - [Overview](#overview) ๐ŸŒ
20
+ - [Features](#features) โœจ
21
+ - [Model](#model) ๐Ÿง 
22
+ - [Installation](#installation) ๐Ÿ”ง
23
+ - [Usage](#usage) ๐Ÿš€
24
+ - [Gradio Interface](#gradio-interface) ๐Ÿ’ป
25
+ - [License](#license) ๐Ÿ“œ
26
 
27
+ ## Overview ๐ŸŒ
28
+ The **Arabic PDF Chat Assistant** leverages **RAG (Retrieval-Augmented Generation)** technology to provide accurate answers by combining information retrieval and language generation capabilities. It is designed to analyze Arabic-language PDF documents and extract relevant content for natural language queries in Arabic.
 
 
 
 
 
 
 
29
 
30
+ The system is ideal for extracting key information from large, complex Arabic PDF documents and presenting it in a concise, professional manner.
 
31
 
32
+ ## Features โœจ
33
+ - **Arabic Language Support** ๐Ÿ“: Fully supports queries and responses in Modern Standard Arabic (ุงู„ูุตุญู‰).
34
+ - **Retrieval-Augmented Generation (RAG)** ๐Ÿ“š: Enhances the assistant's ability to fetch information from the document and generate answers based on the retrieved content.
35
+ - **PDF Querying** ๐Ÿ“„: Upload any Arabic PDF document and ask questions in Arabic. The assistant will retrieve relevant information from the document and generate a clear response.
36
+ - **Gemma-powered Responses** ๐Ÿง : Utilizes **Gemma** from Google, an advanced model tailored for Arabic-language understanding and question-answering.
37
+ - **Audio Responses** ๐Ÿ”Š: The assistant can generate audio responses in Arabic using Text-to-Speech (TTS) technology.
38
+ - **Interactive Gradio Interface** ๐Ÿ’ป: A simple and intuitive web interface for chatting, uploading PDFs, and listening to audio responses.
39
 
40
+ ## Model ๐Ÿง 
41
+ The **Arabic PDF Chat Assistant** uses a RAG architecture powered by **Gemma**, a state-of-the-art language model from Google, specialized in Arabic question-answering. The model integrates information retrieval with language generation, allowing it to respond effectively based on the contents of PDF documents.
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  ### Model Details
44
+ - **Base Model**: Gemma (Googleโ€™s advanced model for Arabic understanding).
45
+ - **Architecture**: **Retrieval-Augmented Generation (RAG)**, which combines a retriever to find relevant parts of the document and a generator to create well-formed responses.
46
+ - **Training Dataset**: Fine-tuned using Arabic-language datasets for document comprehension and question-answering.
47
 
48
+ ## Installation ๐Ÿ”ง
49
 
50
  ### Clone the repository
51
  ```bash
52
+ git clone https://github.com/your-repository/Arabic-PDF-Chat.git
53
  cd Arabic-PDF-Chat
54
  ```
55
 
 
60
  ```
61
 
62
  ### API Keys (Optional)
63
+ If you're using any external services (e.g., Hugging Face Transformers, Google Gemma API), ensure you have the necessary API keys.
64
 
65
+ ## Usage ๐Ÿš€
66
 
67
+ 1. **Launch the application**:
68
  Run the following command to launch the app in your browser:
69
  ```bash
70
  python app.py
71
  ```
72
 
73
+ 2. **Upload PDF**:
74
  Upload your Arabic-language PDF document through the Gradio interface.
75
 
76
+ 3. **Ask Questions**:
77
+ Enter your question in Arabic. The RAG system will retrieve relevant information from the PDF and generate a response based on the content.
 
 
 
 
 
 
 
78
 
79
+ 4. **Listen to Audio Responses (Optional)**:
80
+ If enabled, you can listen to the assistantโ€™s response via audio generated using Text-to-Speech (TTS).
 
 
 
 
81
 
82
+ ## Gradio Interface ๐Ÿ’ป
83
 
84
+ The user interface is built using **Gradio**, making it accessible and easy to use. Here's an example of the setup:
 
 
 
 
 
 
85
 
86
  ```python
87
  import gradio as gr
 
92
 
93
  with gr.Blocks() as demo:
94
  with gr.Row():
95
+ gr.Image("logo.png", label="Company Logo") # Display company logo
96
  with gr.Row():
97
  pdf_input = gr.File(label="ุงุฎุชุฑ ู…ู„ู PDF")
98
  with gr.Row():
 
105
  demo.launch()
106
  ```
107
 
108
+ ## License ๐Ÿ“œ
109
  This project is licensed under the MIT License. See the `LICENSE` file for more details.