Andrejus Baranovski

Subscribe to Andrejus Baranovski feed
Blog about Oracle, Full Stack, Machine Learning and Cloud
Updated: 4 hours 45 min ago

Document Querying with Qwen2-VL-7B and JSON Output

Sun, 2024-09-15 13:30
In this video, I demonstrate how to perform document queries using Qwen2-VL-7B. By simplifying field names, we streamline the prompts, making them more efficient and reusable across different documents. This approach is similar to running SQL queries on a database, but tailored for language models like Qwen2-VL-7B, with results returned in JSON format. 

 

Table Parsing with Qwen2-VL-7B

Sun, 2024-09-08 14:00
I show how to retrieve structured JSON output from table image using Qwen2-VL-7B. This VLLM performs OCR and data mapping tasks all out of the box, also it can return structured JSON output without use of intermediate frameworks. 

 

Sparrow Parse: Table Data Extraction with Table Transformer and OCR

Sun, 2024-08-18 08:03
I explain how we extract data with Sparrow Parse, using Table Transformer to identify table area and build table structure to be processed by OCR. Sparrow Parse implements additional logic to clear-up and improve (removing noise, merging columns, adjusting rows) table structure generated by Table Transformer.

 

Table Header Extraction with Table Transformer

Sun, 2024-08-11 13:58
Table Transformer model is able to provide table functional analysis. As result we can identify table header area and build cells to enclose each column header. In the next step with crop each cell and read data with OCR. Finally we get structured data for table header column names. 

 

Invoice Table Detection with Table Transformer

Sun, 2024-07-21 14:02
I show how an open-source transformer model from Microsoft for table detection and structure recognition works. The code is integrated into Sparrow Parse and runs on a local CPU. This approach helps to crop the table area first and then get coordinates for the table cells. Each cell can be cropped and text can be extracted with OCR. This allows retaining the original table structure and reporting the result in JSON or CSV formats. The data extraction part is not in this video; this will be the topic for the next video.

 

Sparrow OCR Service with PaddleOCR

Sun, 2024-07-14 01:29
In this video, I demonstrate the latest updates to the Sparrow OCR Service using PaddleOCR. I walk you through the OCR service workflow in Sparrow, showcasing its integration with FastAPI and highlighting the enhanced functionalities brought by the recent PaddleOCR update. Join me to see how you can leverage these powerful tools for efficient OCR processing! 

 

FastAPI Endpoint for Sparrow LLM Agent

Wed, 2024-07-03 03:10
FastAPI Endpoint for Sparrow LLM Agent. I show how FastAPI endpoint is used in Sparrow to run LLM agent functionality from API client. 

 

Sparrow Parse API for PDF Invoice Data Extraction

Sun, 2024-06-23 08:42
I explain how Sparrow Parse API is integrated into Sparrow for data extraction from PDF documents, such as invoices, receipts, etc. 

 

Avoid LLM Hallucinations: Use Sparrow Parse for Tabular PDF Data, Instructor LLM for Forms

Mon, 2024-06-17 07:06
LLMs tend to hallucinate and produce incorrect results for table data extraction. For this reason in Sparrow we are using Instructor structured output for LLM to query form data and Sparrow Parse to process tabular data within the same document in combined approach. 

 

Effective Table Data Extraction from PDF without LLM

Mon, 2024-06-10 00:56
Sparrow Parse helps to read tabular data from PDFs, relying on various libraries, such as Unstructured or PyMuPDF4LLM. This allows us to avoid data hallucination errors often produced by LLMs when processing complex data structures. 

 

Instructor and Ollama for Invoice Data Extraction in Sparrow [LLM, JSON]

Mon, 2024-06-03 07:11
Structured output from invoice document, running local LLM. This works well with Instructor and Ollama.

 

Hybrid RAG with Sparrow Parse

Mon, 2024-05-27 06:02
To process complex layout docs and improve data retrieval from invoices or bank statements, we are implementing Sparrow Parse. It works in combination with LLM for form data processing. Table data is converted either into HTML or Markdown formats and extracted directly by Sparrow Parse. I explain Hybrid RAG idea in this video. 

 

Sparrow Parse - Data Processing for LLM

Mon, 2024-05-20 02:01
Data processing in LLM RAG is very important, it helps to improve data extraction results, especially for complex layout documents, with large tables. This is why I build open source Sparrow Parse library, it helps to balance between LLM and standard Python data extraction methods. 

 

Invoice Data Preprocessing for LLM

Mon, 2024-05-13 06:52
Data preprocessing is important step for LLM pipeline. I show various approaches to preprocess invoice data, before feeding it to LLM. This is quite challenging step, especially to preprocess tables. 

 

You Don't Need RAG to Extract Invoice Data

Mon, 2024-05-06 02:49
Documents like invoices or receipts can be processed by LLM directly, without RAG. I explain how you can do this locally with Ollama and Instructor. Thanks to Instructor, structured output from LLM can be validated with your own Pydantic class. 

 

LLM JSON Output with Instructor RAG and WizardLM-2

Mon, 2024-04-29 02:18
With Instructor library you can implement simple RAG without Vector DB or dependencies to other LLM libraries. The key RAG components - good data pre-processing and cleaning, powerful local LLM (such as WizardLM-2, Nous Hermes 2 PRO or Llama3) and Ollama or MLX backend.

Local RAG Explained with Unstructured and LangChain

Mon, 2024-04-22 03:01
In this tutorial, I do a code walkthrough and demonstrate how to implement the RAG pipeline using Unstructured, LangChain, and Pydantic for processing invoice data and extracting structured JSON data.

 

Local LLM RAG with Unstructured and LangChain [Structured JSON]

Mon, 2024-04-15 07:22
Using unstructured library to pre-process PDF document content, to be in a cleaner format. This helps LLM to produce more accurate response. JSON response is generated thanks to Nous Hermes 2 PRO LLM. Without any additional post-processing. Using Pydantic dynamic class to validate response to make sure it matches request. 

 

LlamaIndex Upgrade to 0.10.x Experience

Sun, 2024-03-31 09:11
I explain key points you should keep in mind when upgrading to LlamaIndex 0.10.x. 

 

LLM Structured Output for Function Calling with Ollama

Mon, 2024-03-25 09:40
I explain how function calling works with LLM. This is often confused concept, LLM doesn't call a function - LLM retuns JSON response with values to be used for function call from your environment. In this example I'm using Sparrow agent, to call a function. 

 

Pages