csabhay commited on
Commit
e35d9ea
Β·
1 Parent(s): a83d8b2

add HF Spaces config to README

Browse files
Files changed (1) hide show
  1. README.md +60 -0
README.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: DocChat Backend
3
+ emoji: πŸ“„
4
+ colorFrom: teal
5
+ colorTo: blue
6
+ sdk: docker
7
+ pinned: false
8
+ ---
9
+
10
+ # Document Ingestion System
11
+
12
+ Upload a `.txt` or `.pdf` file and extract its text content via a FastAPI backend + Streamlit frontend.
13
+
14
+ ## Folder Structure
15
+
16
+ ```
17
+ doc_ingestion/
18
+ β”œβ”€β”€ backend/
19
+ β”‚ β”œβ”€β”€ __init__.py
20
+ β”‚ β”œβ”€β”€ main.py # FastAPI app & routes
21
+ β”‚ β”œβ”€β”€ ingestion.py # File handling & metadata
22
+ β”‚ └── parser.py # Text extraction logic
23
+ β”œβ”€β”€ frontend/
24
+ β”‚ └── app.py # Streamlit UI
25
+ β”œβ”€β”€ requirements.txt
26
+ └── README.md
27
+ ```
28
+
29
+ ## Setup & Run
30
+
31
+ ### 1. Install dependencies
32
+
33
+ ```bash
34
+ cd doc_ingestion
35
+ pip install -r requirements.txt
36
+ ```
37
+
38
+ ### 2. Start the FastAPI backend (Terminal 1)
39
+
40
+ ```bash
41
+ cd doc_ingestion
42
+ uvicorn backend.main:app --reload --port 8000
43
+ ```
44
+
45
+ The API will be available at `http://localhost:8000`. You can also test it at `http://localhost:8000/docs`.
46
+
47
+ ### 3. Start the Streamlit frontend (Terminal 2)
48
+
49
+ ```bash
50
+ cd doc_ingestion
51
+ streamlit run frontend/app.py
52
+ ```
53
+
54
+ The UI will open at `http://localhost:8501`.
55
+
56
+ ### 4. Use it
57
+
58
+ 1. Open the Streamlit UI in your browser.
59
+ 2. Upload a `.txt` or `.pdf` file.
60
+ 3. View the extracted text and file metadata.