rahimizadeh commited on
Commit
88390ff
Β·
verified Β·
1 Parent(s): 1dcb483

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +81 -0
README.md CHANGED
@@ -10,5 +10,86 @@ pinned: false
10
  license: mit
11
  short_description: πŸ“ Text & PDF Summarizer UI
12
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
10
  license: mit
11
  short_description: πŸ“ Text & PDF Summarizer UI
12
  ---
13
+ # πŸ“ Text & PDF Summarizer UI
14
+
15
+ A lightweight web application that allows users to paste text or upload a PDF document, then summarizes the content using a HuggingFace transformer model integrated with LangChain and displayed via a Gradio interface.
16
+
17
+ ## πŸš€ Key Features
18
+
19
+ - Input text manually or via PDF upload
20
+ - Extracts and summarizes PDF text using NLP
21
+ - User-friendly Gradio interface
22
+ - Uses pre-trained `facebook/bart-large-cnn` summarization model
23
+
24
+ ## πŸ—οΈ Project Architecture
25
+
26
+ - **Gradio**: Frontend interface to interact with the app
27
+ - **PyPDF2**: Extracts text from PDF files
28
+ - **LangChain**: Framework for managing LLM-based workflows
29
+ - **HuggingFace**: Provides transformer models like BART for summarization
30
+
31
+ ## πŸ”§ Getting Started
32
+
33
+ **1- Clone the repo**
34
+ ```bash
35
+ git clone https://github.com/yourusername/text-pdf-summarizer-ui.git
36
+ cd text-pdf-summarizer-ui
37
+ ```
38
+
39
+    πŸ“**Project Structure**
40
+
41
+       β”œβ”€β”€ text-pdf-summarizer-ui/
42
+             β”œβ”€β”€ app.py    # Application
43
+             β””── requirements.txt
44
+             β””── README.md
45
+
46
+ **2- Create a virtual environment (optional)**
47
+ ``` python -m venv venv
48
+ source venv/bin/activate # On Windows: venv\\Scripts\\activate
49
+ ```
50
+
51
+ **3- Install dependencies**
52
+
53
+ ```bash
54
+ pip install -r requirements.txt
55
+ ```
56
+
57
+ **4- Run the app**
58
+ ```bash
59
+ python app.py
60
+ ```
61
+
62
+
63
+ ## 🧠 About the Tools
64
+
65
+  **LangChain**: provides a modular framework for building applications with language models. Here, it's used to manage prompting and model output formatting.
66
+
67
+  **HuggingFace Transformers**: We use the facebook/bart-large-cnn model, a powerful encoder-decoder model ideal for summarization.
68
+
69
+  **Gradio**: lets us quickly build and share user-friendly web interfaces for Machine Learning apps.
70
+
71
+
72
+ ## πŸ” Implementation Details
73
+
74
+    1- Model Initialization: Using HuggingFacePipeline via LangChain
75
+
76
+    2- PromptTemplate: Wraps text for inference
77
+
78
+    3- PDF Handling: Reads uploaded file as bytes and extracts text using PyPDF2
79
+
80
+    4- UI Logic: Built with Gradio Blocks to control layout, input, and output
81
+
82
+
83
+ ## βœ… Example Usage
84
+ - Upload a PDF or paste article text
85
+ - Cick β€œConvert PDF to Text” (if PDF)-
86
+ - Click β€œSummarize Text”
87
+ - View summary below the input
88
+
89
+ ## πŸ“ License
90
+ MIT
91
+
92
+ ## 🀝 Contributions
93
+ Pull requests and suggestions welcome!
94
 
95
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference