Skip to content

Commit 13e17d9

Browse files
author
David G. Simmons
committed
wip [skip actions]
1 parent 5145ad9 commit 13e17d9

File tree

9 files changed

+65
-55
lines changed

9 files changed

+65
-55
lines changed
377 KB
Loading
55.4 KB
Loading
42.2 KB
Loading
233 KB
Loading
250 KB
Loading
71.8 KB
Loading

content/posts/category/open-source/a-fresh-ui-for-docling/index.en.md

Lines changed: 65 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -217,16 +217,7 @@ I have similar rules for various languages, and for making sure things like unit
217217
218218
## So let's get to the UI already!! {#fancy-ui}
219219
220-
Let me start by saying that I searched the web for a docling UI and my searches came up empty. Only _after_ I had built this thing did I find out that [docling-serve](https://github.com/docling/docling-serve) existed. So I went and looked at it. I'm not going to throw shade on another project, but I didn't much like the UI.
221-
222-
Here's the UI for converting documents:
223-
{{< img src="images/docling-serve-file.png" alt="an antiquated User interface for docling" align="center" >}}
224-
And it's the same for converting URLs:
225-
{{< img src="images/docling-serve-url.png" alt="The same antiquated user interface for docling" >}}
226-
227-
Does it work? Of course. Is it pretty? Well, I don't really think so, but again, I'm not going to throw shade on someone else's hard work.
228-
229-
Anyway, as I said, I didn't know of the existence of `docling-serve` until _after_ I had built this, so ...
220+
Wait, not so fast! Before we can have a nice fancy UI in front of docling, we have to have a way to _serve_ dockling! So
230221
231222
### A backend server
232223
@@ -236,4 +227,67 @@ Here is a short list of things I wanted to be able to do:
236227
237228
- Have the docling and duckling docs available in the UI itself
238229
- Make the various OCR engines available (and installable if they weren't installed at startup)
239-
- Keep a history of documents we've loaded previously
230+
- Keep a history of documents we've loaded previously
231+
- Be able to quickly load previously-parsed documents from history
232+
- Be able to see the output of the docling process in various formats (Markdown, HTML, JSON, etc.)
233+
- Have the full set of docling options available in the UI
234+
- Be able to save the output of docling in various formats
235+
236+
Easy, right? Not really.
237+
238+
I used Flask to build the backend server. I won't go into the details of how I built it, but it basically exposes a REST API that the frontend can call to perform various actions. The entire API is documented in the documentation, which is available at both [duckling-ui.org](https://duckling-ui.org) and internally in the application.
239+
240+
{{< alert type="info" >}}
241+
The docs for docling are pulled directly from the [docling project](https://docling-project.github.io/docling/) but only a subset of those documents are included. Links to the full docling docs are included though.
242+
{{< /alert >}}
243+
244+
{{< alert type="warning" >}}
245+
Including those documents is for convenience only and while the duckling application will always try to pull the latest documentation from docling, you should always reference the project documentation just in case.
246+
{{< /alert >}}
247+
248+
The backend server also starts the complete docling process, and is able to install (or pre-install) various OCR and other plugins for more advanced uses. I wanted to make this possible so that users didn't have to re-start the server process every time they wanted to enable a new feature. Additionally, since the backend server process can run anywhere, the end user doesn't need to have direct access to the server hardware in order to use the more advanced features of docling from just about anywhere.
249+
250+
Even more useful for remote deployments, you can adjust -- from the GUI -- the amount of memory and the number of threads to run docling on.
251+
252+
253+
{{< img src="images/performance.png" align="center" >}}
254+
255+
You can even select the kind of hardware you want to run on.
256+
257+
{{< img src="images/performance-cpu.png" align="center" >}}
258+
259+
There are still some things to be aware of if you're going to run on remote hardware. Ignore them at your peril.
260+
261+
{{< alert type="danger" >}}
262+
There is currently no system for user authentication built into the duckling server process, nor is there a mechanism for loading SSL certificates. I **strongly** discourage anyone from simply starting this application on an unprotected server. At this time, if you want to deploy it on a remote server, I recommend putting it behind a protected proxy.
263+
{{< /alert >}}
264+
265+
### The front end
266+
267+
_Finally_ we get to the actual GUI! I gave you a small taste of it in the previous section, but here's where I'll go through it in more detail. When you load it in your web browser, you'll see the main interface.
268+
269+
{{< img src="images/duckling.png" align="center" >}}
270+
271+
Clean, simple, and easy to understand. Simply drag a document into the drop zone to process it.
272+
273+
{{< img src="images/drop-english.png" align="center" >}}
274+
275+
> **Note**: I have provided auto-translated versions of the entire UI for English, French, Spanish, and German.
276+
>
277+
> {{< img src="images/drop-german.png" align="center" >}}
278+
279+
Once you drop a document in any of the supported formats, it is processed and the results displayed.
280+
281+
{{< img src="images/processing.png" align="center" >}}
282+
283+
The result is then displayed, along with some statistics about the conversion.
284+
285+
{{< img src="images/process-complete-md.png" align="center" >}}
286+
287+
Since I set my default output format to be Markdown, that's what is selected in the output. You can see either the rendered Markdown, or the raw Markdown.
288+
289+
The same is true for the other formats like HTML, etc.
290+
291+
{{< img src="images/process-complete-html.png" align="center" >}}
292+
293+
You can then download any of the rendered formats for use.

0 commit comments

Comments
 (0)