ryandt commited on
Commit
2656c14
·
verified ·
1 Parent(s): 0075741

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +34 -2
README.md CHANGED
@@ -5,11 +5,43 @@ colorFrom: blue
5
  colorTo: purple
6
  sdk: gradio
7
  sdk_version: 6.4.0
8
- python_version: '3.12'
9
  app_file: app.py
10
  pinned: false
11
  license: mit
12
  short_description: Calculating the probabilities and entropy of OCR output
13
  ---
14
 
15
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  colorTo: purple
6
  sdk: gradio
7
  sdk_version: 6.4.0
8
+ python_version: "3.10"
9
  app_file: app.py
10
  pinned: false
11
  license: mit
12
  short_description: Calculating the probabilities and entropy of OCR output
13
  ---
14
 
15
+ # OCR Confidence Visualization
16
+
17
+ Extract text from document images with token-level confidence visualization.
18
+
19
+ ## Features
20
+
21
+ - **Token Streaming**: Watch text appear token-by-token as the model generates
22
+ - **Confidence Colors**: Each token is colored based on model confidence:
23
+ - Blue (>99%): Very high confidence
24
+ - Dark Green (>95%): High confidence
25
+ - Light Green (>85%): Good confidence
26
+ - Amber (>70%): Moderate confidence
27
+ - Red (>50%): Low confidence
28
+ - Purple (<=50%): Very low confidence
29
+ - **Token Alternatives**: Click any token to see top alternative predictions with probabilities
30
+
31
+ ## Model
32
+
33
+ Uses [Nanonets-OCR2-3B](https://huggingface.co/nanonets/Nanonets-OCR2-3B), a Qwen2.5-VL-3B fine-tune optimized for document OCR.
34
+
35
+ ## Usage
36
+
37
+ 1. Upload a document image (JPG, PNG, etc.)
38
+ 2. Click "Transcribe"
39
+ 3. Watch tokens stream with confidence coloring
40
+ 4. Click any token to see alternative predictions
41
+
42
+ ## Technical Details
43
+
44
+ - Extracts logprobs from each generated token
45
+ - Converts logprobs to probabilities via softmax
46
+ - Top-k alternatives stored for each token (k=20)
47
+ - ZeroGPU compatible for HuggingFace Spaces deployment