Wiki: FormatAI: Structuring Unstructured Text using generative AI
For agents: Markdown version · Wiki index · Explore
- Speaker: Oren Matar
- Event: Reversim Summit 2024
- Video: https://www.youtube.com/watch?v=kpqYcjoVmoI
- Transcript: /transcripts/2024/47-kpqYcjoVmoI.md
- Language: Hebrew · Type: talk · Level: advanced
- Topics: Machine Learning, AI and LLMs, Data Science, Architecture
Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.
Summary
The speaker shares a project focused on extracting time ranges from natural language queries to support self-service business analytics. Instead of relying purely on large language models or rigid regular expressions, the team developed a custom structured language and trained a small encoder-decoder model. By separating natural language understanding from business logic and constraining the model generation, they achieved high accuracy and flexibility. The audience learns a practical paradigm for structuring unstructured text efficiently using small machine learning models.
Key points
- 2:16 The goal is to enable self-service analytics where users can query complex business data using natural language.
- 4:32 Using general-purpose language models for complex logical reasoning about dates proved unreliable, slow, and expensive.
- 6:39 The first core principle is separating language extraction from logical operations by introducing a dedicated Structured Time Language.
- 8:52 The architecture uses an encoder-decoder model combined with a classifier for named entity recognition to extract and tag time expressions.
- 11:14 The second principle involves rapidly generating a large synthetic dataset using programmatic rules and data augmentation.
- 17:46 The third principle is structural generation, constraining the decoder’s logits to ensure outputs always follow the strict rules of the target language.
- 21:00 Careful attention to tokenization ensures that symbols map consistently to single meanings without confusing the classifier.
Takeaways
- Separate language understanding from business logic when parsing unstructured text into structured formats.
- Build synthetic datasets programmatically to quickly scale training data and iterate on edge cases.
- Use logits processors to constrain small language models and guarantee syntactically valid outputs.
Questions this talk answers
- How can I extract structured data from natural language without relying solely on expensive large language models?
- What is the best way to guarantee that a sequence-to-sequence model only outputs syntactically valid domain-specific language?
- How can I programmatically generate a robust training dataset for time range extraction?
Technologies
Python, PyCharm, Hugging Face, SQL, Jira
Tags
analytics, architecture, data extraction, generative ai, machine learning, nlp, transformers