NyashaK commited on
Commit
6727bf7
·
verified ·
1 Parent(s): 4eb2e9f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +1 -50
README.md CHANGED
@@ -11,7 +11,6 @@ license: mit
11
  ---
12
 
13
  # Zim Docs OCR-to-JSON Extractor
14
-
15
  ## Overview
16
 
17
  Welcome to the **Zim Docs OCR-to-JSON Extractor**! This is a powerful and user-friendly web application built with Gradio, designed to help you upload scanned documents (PDFs) or images (PNG, JPG, etc.). It then uses a vision AI model to perform Optical Character Recognition (OCR) and extract structured information into a JSON format. This tool aims to streamline your process of digitizing and organizing data from various document types, such as **driver's licenses, passports, national ID cards, invoices, receipts, and more.**
@@ -19,7 +18,6 @@ Welcome to the **Zim Docs OCR-to-JSON Extractor**! This is a powerful and user-f
19
  ## Requirements
20
 
21
  To use this application, you'll need:
22
-
23
  * Python 3.7+
24
  * Gradio
25
  * Gradio-PDF (`gradio_pdf`)
@@ -29,51 +27,4 @@ To use this application, you'll need:
29
  * You should set this key as an environment variable named `API_KEY`. The Python script uses `os.getenv("API_KEY")` to retrieve this key. If you're using Hugging Face Spaces, you can set this as a "Secret".
30
 
31
  ## Running the Application
32
-
33
- **On Hugging Face Spaces:**
34
-
35
- This application is designed for deployment on Hugging Face Spaces.
36
- 1. Ensure your `requirements.txt` file in your Hugging Face Space repository lists all necessary dependencies (e.g., `gradio`, `gradio_pdf`, `requests`, `PyMuPDF`).
37
- 2. You should configure your `API_KEY` as a "Secret" in your Hugging Face Space settings. The application will then retrieve it using `os.getenv("API_KEY")`.
38
- 3. Once deployed, you can access the application via the URL provided by your Hugging Face Space.
39
- * **Live Demo:** You can try out a live demo of this application at: [Demo](https://huggingface.co/spaces/NyashaK/DocOCR2JSON)
40
-
41
- **For Local Development/Testing (Optional):**
42
-
43
- If you wish to run the application on your local machine:
44
- 1. Make sure you have all dependencies listed under "Requirements" installed in your local Python environment (e.g., by running `pip install gradio gradio_pdf requests PyMuPDF`).
45
- 2. Set the `API_KEY` environment variable on your local system.
46
- 3. You can then run the application using the command:
47
- ```bash
48
- python app.py
49
- ```
50
- Your Python file should be named `app.py` (or update this command if it's different). It will typically be available at `http://127.0.0.1:7860`.
51
-
52
- ## How to Use
53
-
54
- 1. **Access the Application:** Open the URL of your Hugging Face Space where the application is deployed (see Live Demo link above), or your local URL if running it locally.
55
- 2. **Upload Your Document:**
56
- * Drag and drop a supported file (PDF, PNG, JPG, etc.) into the designated upload area.
57
- * Alternatively, click on the upload area to open your file browser and select the document.
58
- 3. **View Preview:**
59
- * Once you've uploaded a file, the "Document Preview" tab will attempt to display the image or the first page of your PDF.
60
- 4. **Check Extracted Data:**
61
- * The application will automatically process your document.
62
- * Switch to the "Extracted Data (JSON)" tab to view the structured information extracted by the AI model.
63
- * If any errors occur during processing (e.g., unsupported file type, API issue), an error message will be displayed in the JSON output area.
64
-
65
- ## Troubleshooting
66
-
67
- Here are some common issues you might encounter and how to resolve them:
68
-
69
- * **API Key Issues:** Ensure your `API_KEY` is correctly set as a Secret on Hugging Face Spaces (or as an environment variable for local testing). Also, verify that your key is valid and has sufficient credits/access for the chosen model.
70
- * **Dependency Errors:** If you're on Hugging Face, double-check your `requirements.txt` file. For local use, ensure all libraries are installed in your environment.
71
- * **File Conversion Failures:** For PDFs, `PyMuPDF (fitz)` needs to be available. Corrupted PDF files might also cause issues with conversion.
72
- * **Model Output/JSON Errors:**
73
- * If the model doesn't return valid JSON, the application will attempt to report an error.
74
- * The quality of the extracted JSON heavily depends on the clarity of your input document, the capabilities of the chosen vision model, and the effectiveness of the prompt used to guide the AI.
75
- * **Network Errors:** You'll need a stable internet connection for the application to make external API calls. These can fail due to network issues or timeouts. If you're on Hugging Face, this might relate to the Space's network access or API endpoint reachability.
76
-
77
- ---
78
-
79
- This README provides you with a concise guide to understanding, setting up, and using the Zim Docs OCR-to-JSON Extractor.
 
11
  ---
12
 
13
  # Zim Docs OCR-to-JSON Extractor
 
14
  ## Overview
15
 
16
  Welcome to the **Zim Docs OCR-to-JSON Extractor**! This is a powerful and user-friendly web application built with Gradio, designed to help you upload scanned documents (PDFs) or images (PNG, JPG, etc.). It then uses a vision AI model to perform Optical Character Recognition (OCR) and extract structured information into a JSON format. This tool aims to streamline your process of digitizing and organizing data from various document types, such as **driver's licenses, passports, national ID cards, invoices, receipts, and more.**
 
18
  ## Requirements
19
 
20
  To use this application, you'll need:
 
21
  * Python 3.7+
22
  * Gradio
23
  * Gradio-PDF (`gradio_pdf`)
 
27
  * You should set this key as an environment variable named `API_KEY`. The Python script uses `os.getenv("API_KEY")` to retrieve this key. If you're using Hugging Face Spaces, you can set this as a "Secret".
28
 
29
  ## Running the Application
30
+ * **Live Demo:** You can try out a live demo of this application at: [Demo](https://huggingface.co/spaces/NyashaK/DocOCR2JSON)