[KongchangAI]
· 1 min read· 925 words

Trallie: Zero-Shot Structured Data Extraction with LLMs

Trallie: Zero-Shot Structured Data Extraction with LLMs

Trallie uses LLM zero-shot/few-shot capabilities to extract information from multi-format documents at low annotation cost.

Trallie is an open-source information extraction framework that reduces reliance on large annotated datasets. It uses LLM zero-shot and few-shot prompting to extract structured data from free text and supports HTML, PDF, TXT, and JSON. Its core feature is automatically inducing an extraction schema from document collections, enabling non-expert users to get started without predefining fields and refine results with minimal adjustments. Evaluated on FDA 510(k) documents and the SWDE dataset, it outperforms prior systems when attributes are known and remains competitive when attributes must be discovered. The project is open-sourced and suited for small organizations or individual developers seeking quick structured extraction from unstructured text.

Information extraction (IE) has long been a time-consuming and labor-intensive task—either you have to annotate large amounts of data, or you have to train a separate model for each domain. The open-source framework Trallie aims to take a different approach: directly leveraging the zero-shot and few-shot capabilities of large language models (LLMs) to turn free text into structured data, with almost no manual annotation required.

Trallie project screenshot

Why Trallie?

Traditional information extraction pipelines typically rely on supervised learning, which means a large number of annotated samples are needed. For non-expert users, this is an almost insurmountable barrier. Trallie's design goals are clear: reduce the cost of manual annotation, flexibly parse documents in multiple formats, and enable non-technical users to automatically generate extraction schemas.

Specifically, it does three things: first, it leverages the prompting capabilities of modern LLMs to achieve zero-shot or few-shot extraction, reducing annotation work; second, it supports parsing documents in multiple formats such as HTML, PDF, TXT, and JSON; third, it can automatically induce a schema from a collection of documents, which users only need to fine-tune before using it for extraction.

Zero-shot and few-shot extraction: Zero-shot means the model performs a task directly without having seen any annotated samples, relying on the general language understanding it accumulated during pre-training; few-shot means providing a small number (usually a few) of examples in the prompt so that the model can imitate the examples through in-context learning to complete the extraction. Neither requires updating model parameters, so they can greatly reduce annotation and training costs.

Schema (extraction schema): In information extraction, a schema defines which fields (attributes) to extract from text and the meaning and type of each field. For example, extracting "application number," "device name," and "applicant" from FDA documents. Traditional pipelines require manually designing the schema in advance, whereas Trallie attempts to let the LLM automatically induce candidate fields from a collection of documents, which users then fine-tune, thereby reducing dependence on domain knowledge.

Technical Approach and Evaluation

Trallie was evaluated on FDA 510(k) documents and on movie and university websites in the SWDE dataset, using open-weight LLMs. The results show that when the target attributes are known, Trallie outperforms previously reported systems on text extraction tasks; when attributes need to be automatically discovered to build a schema, its performance is also competitive.

This means that when attributes are clearly defined, Trallie can be deployed quickly and achieve good results; in scenarios where attributes are unknown, although it is not perfect, it can already provide a usable starting point, and users can optimize the extraction results with a small amount of adjustment.

FDA 510(k) documents: The U.S. Food and Drug Administration (FDA)'s "510(k) premarket notification" documents for medical devices prior to marketing, containing large amounts of semi-structured text such as device descriptions, indications, and technical parameters—a typical real-world scenario for information extraction.

SWDE dataset: The Structured Web Data Extraction dataset, commonly used to evaluate systems that extract structured fields (such as movie titles, directors, and university names) from web pages. It contains website pages from multiple vertical domains and is one of the benchmarks in the information extraction field.

Open-weight LLMs: Large language models whose parameters can be publicly downloaded and deployed locally (such as the Llama series), as opposed to closed-source models that can only be accessed via API. Using open-weight models facilitates research reproducibility and deployment in privacy-sensitive scenarios, but performance is usually limited by model size and training data.

Significance for Non-Expert Users

The most noteworthy aspect of Trallie is its friendliness to non-expert users. The ability to automatically induce a schema means users do not need to define all fields in advance; instead, they can "learn" a possible structure from the documents and then adjust it manually. This greatly lowers the barrier to use, making it especially suitable for small organizations or individual developers who do not have a data annotation team.

The project is open-sourced on GitHub (https://github.com/PiSchool/trallie), so those interested can try it out for themselves.

Limitations and Outlook

Trallie currently relies on open-weight LLMs, which means performance is limited by the capabilities of the chosen model. In addition, automatically induced schemas may not be precise enough and require manual intervention. In the future, if it can be combined with more powerful closed-source models or improved schema induction algorithms, its practicality is expected to improve further.

Overall, Trallie provides a lightweight and flexible solution for information extraction, particularly suited to scenarios where users want to quickly extract structured data from unstructured text.

One-line Summary

Trallie leverages LLM zero-shot/few-shot capabilities to achieve multi-format document information extraction at low annotation cost.

Paragraph Summary

Trallie is an open-source information extraction framework designed to reduce the reliance of traditional supervised learning on large amounts of annotated data. It leverages the zero-shot and few-shot prompting capabilities of large language models to extract structured data from free text, and supports multiple document formats including HTML, PDF, TXT, and JSON. Its core feature is the ability to automatically induce an extraction schema from a collection of documents, allowing non-expert users to get started without predefining fields and then optimize results with a small amount of adjustment. Evaluations on FDA 510(k) documents and the SWDE dataset show that when target attributes are known, Trallie outperforms previously reported systems on text extraction tasks; it is also competitive in scenarios where attributes need to be automatically discovered. The project is open-sourced and is suitable for small organizations or individual developers who want to quickly extract structured data from unstructured text.

#Trallie#information extraction#LLM#zero-shot#schema induction
Share:

Related articles