Spaces:
Sleeping
Sleeping
Upload README.md
Browse files
README.md
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: DocSummarizer_Jimmy
|
3 |
+
emoji: 📝
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: green
|
6 |
+
sdk: gradio
|
7 |
+
sdk_version: "4.16.0"
|
8 |
+
app_file: app.py
|
9 |
+
pinned: true
|
10 |
+
---
|
11 |
+
|
12 |
+
# DocSummarizer_Jimmy
|
13 |
+
|
14 |
+
這是一個簡易的文件摘要工具,支援以下功能:
|
15 |
+
|
16 |
+
- ✅ 輸入純文字進行摘要
|
17 |
+
- 📄 上傳 PDF,自動擷取文字並產生摘要
|
18 |
+
- 🧠 使用 `pszemraj/bart-large-summary-map-reduce` 模型
|
19 |
+
- 📁 支援範例檔案(放在 `examples/` 資料夾)
|
20 |
+
- 🚀 Gradio 網頁介面即時輸出摘要結果
|
21 |
+
|
22 |
+
---
|
23 |
+
|
24 |
+
## 🔧 使用方式
|
25 |
+
|
26 |
+
### 本地端執行(建議使用 Python 3.10+)
|
27 |
+
|
28 |
+
```bash
|
29 |
+
pip install -r requirements.txt
|
30 |
+
python app.py
|
31 |
+
```
|
32 |
+
|
33 |
+
### 📁 範例檔案
|
34 |
+
|
35 |
+
將 `.txt` 文件放置於 `examples/` 資料夾,Gradio 介面會自動載入並顯示。
|
36 |
+
|
37 |
+
你也可以上傳 PDF 或直接輸入文字。
|
38 |
+
|
39 |
+
---
|
40 |
+
|
41 |
+
## 📦 檔案結構
|
42 |
+
|
43 |
+
```bash
|
44 |
+
.
|
45 |
+
├── app.py # 主應用程式(Gradio UI)
|
46 |
+
├── aggregate.py # 多段摘要彙整模組
|
47 |
+
├── summarize.py # 單段文字摘要處理
|
48 |
+
├── pdf2text.py # PDF OCR / 文字擷取處理
|
49 |
+
├── utils.py # 工具函式
|
50 |
+
├── requirements.txt # 所需套件列表
|
51 |
+
├── examples/
|
52 |
+
│ └── example1.txt # 範例檔案
|
53 |
+
└── README.md # 說明文件
|
54 |
+
```
|
55 |
+
|
56 |
+
---
|
57 |
+
|
58 |
+
## ✨ Credits
|
59 |
+
|
60 |
+
- 🤖 模型:`pszemraj/bart-large-summary-map-reduce`
|
61 |
+
- 📦 前端:Gradio Blocks
|
62 |
+
- 👨💻 Author: Jimmy
|