惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
Last Week in AI
Last Week in AI
V
V2EX
博客园_首页
IT之家
IT之家
Jina AI
Jina AI
博客园 - 叶小钗
The Cloudflare Blog
T
Tailwind CSS Blog
腾讯CDC
B
Blog
D
Docker
L
LangChain Blog
博客园 - 司徒正美
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
美团技术团队
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Building a Financial Named Entity Recognition Pipeline fo...
Irvan Gerhana Septiyana · 2026-06-25 · via DEV Community

Part 3 of the Building Enterprise AI Automation Systems Series


Introduction

Named Entity Recognition (NER) is one of the oldest problems in Natural Language Processing.

Most tutorials introduce NER using examples like:

  • Person
  • Organization
  • Location
  • Date

A sentence such as:

Elon Musk founded SpaceX in California.

becomes

PERSON
ORGANIZATION
LOCATION

While this is useful for learning NLP fundamentals, it has very little relevance to enterprise software.

Businesses do not automate biographies.

They automate operations.

Enterprise documents contain an entirely different language.

Invoices.

Contracts.

Purchase Orders.

Bank Statements.

Remittance Advice.

Payment Narratives.

ERP Exports.

The entities that matter inside these documents are not "PERSON" or "LOCATION".

Instead, they are business concepts such as:

  • Customer
  • Contract
  • Invoice
  • Purchase Order
  • Payment Type

Understanding these entities is the first step toward intelligent automation.

In this article, we'll build a Financial Named Entity Recognition pipeline capable of transforming raw enterprise transaction narratives into structured business knowledge.


The Difference Between Generic NER and Enterprise NER

Traditional NER focuses on linguistic entities.

Enterprise NER focuses on operational entities.

Consider the following sentence.

PART PMT ALPHABRIDGE SOLUTIONS MFG-INV-000157

A generic language model may identify:

Organization

and ignore everything else.

From a business perspective, this is almost useless.

What we actually need is:

PAYMENT_TYPE
COMPANY
INVOICE

The objective is not language understanding.

The objective is business understanding.


Step 1 — Designing the Business Taxonomy

Before training any model, define what the model should learn.

This is one of the most overlooked stages in machine learning projects.

Many teams immediately begin annotation without first defining a taxonomy.

As a result, annotations become inconsistent.

Models become confused.

Evaluation becomes unreliable.

For our transaction intelligence system, we defined the following entities:

COMPANY

INVOICE

CONTRACT

PURCHASE_ORDER

PAYMENT_TYPE

Notice that these entities correspond to business concepts rather than grammatical concepts.

Every downstream component in the pipeline depends on this taxonomy.


Step 2 — Canonical Data Before Annotation

One mistake frequently made in annotation projects is labeling raw operational files directly.

Instead, we first transformed MT950 statements into a canonical JSON structure.

Original transaction:

:61:240226C3979,85NTRFNONREF

:86:PART PMT ALPHABRIDGE SOLUTIONS MFG-INV-000157

Canonical representation:

{
    "transaction_id": "TXN-000001",
    "amount": 3979.85,
    "currency": "EUR",
    "narrative": "PART PMT ALPHABRIDGE SOLUTIONS MFG-INV-000157"
}

This separation provides several benefits.

The parser understands MT950.

The NER model understands narratives.

Neither component needs knowledge of the other.

This separation significantly improves maintainability.


Step 3 — Building an Annotation Strategy

Annotation is not simply highlighting text.

It is defining business semantics.

For example:

PART PMT ALPHABRIDGE SOLUTIONS MFG-INV-000157

becomes

PART PMT
────────
PAYMENT_TYPE

ALPHABRIDGE SOLUTIONS
────────────────────
COMPANY

MFG-INV-000157
──────────────
INVOICE

Each annotation represents an operational concept.

The objective is consistency rather than quantity.

A smaller, high-quality dataset almost always outperforms a massive inconsistent dataset.


Step 4 — Why We Built an Automatic Pre-Labeling Engine

Manual annotation is expensive.

Labeling several thousand transaction narratives can require days or even weeks.

Instead of starting from scratch, we created a rule-based pre-labeling engine.

The workflow becomes:

MT950 Narrative
        │
        ▼
Regex Rules
        │
        ▼
Master Data Lookup
        │
        ▼
Automatic Labels
        │
        ▼
Human Review

Rather than replacing human annotators, pre-labeling reduces repetitive work.

Annotators validate labels instead of creating them.

This dramatically improves annotation speed.


Step 5 — Annotation with Doccano

After pre-labeling, the dataset is imported into Doccano.

Each record already contains suggested labels.

Instead of manually searching for entities, reviewers simply verify:

  • Company names
  • Invoice numbers
  • Contract identifiers
  • Purchase orders
  • Payment types

This process improves both consistency and annotation throughput.

Doccano becomes a quality assurance tool rather than a manual labeling tool.


Step 6 — Preparing Data for Training

Machine learning models require token-level labels.

Therefore annotated spans are converted into BIO format.

Example:

PART        B-PAYMENT_TYPE
PMT         I-PAYMENT_TYPE
ALPHABRIDGE B-COMPANY
SOLUTIONS   I-COMPANY
MFG-INV-000157 B-INVOICE

BIO encoding allows transformer models to learn entity boundaries rather than isolated words.

This is particularly important for company names consisting of multiple tokens.


Step 7 — Fine-Tuning a Domain-Specific Transformer

Rather than training from scratch, we fine-tuned a pretrained language model.

The workflow becomes:

Synthetic Dataset
        │
        ▼
Doccano
        │
        ▼
BIO Conversion
        │
        ▼
Transformer Fine-Tuning
        │
        ▼
Inference

Because the model already understands language, it only needs to learn business concepts.

This dramatically reduces training requirements.


Step 8 — Evaluating Beyond Accuracy

Accuracy alone provides little insight for NER systems.

Instead, we evaluated:

Precision

How many predicted entities were correct?


Recall

How many true entities were discovered?


F1 Score

The balance between precision and recall.

We also evaluated each entity independently.

For example:

Entity             Precision    Recall    F1

COMPANY              94.2%      91.8%    93.0%

INVOICE              98.7%      97.9%    98.3%

CONTRACT             92.1%      90.5%    91.3%

PURCHASE_ORDER       95.4%      94.1%    94.7%

This provides much more actionable feedback than overall accuracy.


Step 9 — NER Is Only the Beginning

Many tutorials stop after entity extraction.

Enterprise systems cannot.

Suppose the model predicts:

COMPANY

ALPHABRIDGE

Extraction alone is insufficient.

The system must still determine:

Customer ID

CUS-00002

Similarly,

Invoice

MFG-INV-000157

must resolve to:

Contract

CNT-2024-587

This process is called Entity Resolution.

Without it, extracted entities remain isolated pieces of text.

Business understanding has not yet occurred.


Architecture Overview

The Financial NER pipeline ultimately looks like this:

Synthetic Dataset
        │
        ▼
Canonical Transformation
        │
        ▼
Pre-label Engine
        │
        ▼
Doccano Annotation
        │
        ▼
BIO Conversion
        │
        ▼
Fine-Tuned Transformer
        │
        ▼
Entity Resolution
        │
        ▼
Reconciliation Engine

Each stage has a single responsibility.

This modular architecture makes the entire system easier to extend and maintain.


Lessons Learned

The biggest lesson from this project was unexpected.

Training the transformer was not the hardest task.

Designing the taxonomy was.

Building high-quality synthetic data was.

Creating consistent annotations was.

The model simply learned from those foundations.

Enterprise AI systems rarely fail because of neural networks.

They fail because the underlying business knowledge is poorly defined.


Conclusion

Named Entity Recognition is often introduced as a natural language processing problem.

In enterprise software, it is much more than that.

NER becomes the bridge between unstructured documents and structured business intelligence.

By combining canonical data, business taxonomies, automated pre-labeling, human validation, and domain-specific transformers, organizations can build systems capable of understanding operational language at scale.

This understanding becomes the foundation for entity resolution, reconciliation, intelligent automation, and eventually autonomous enterprise operations.


Next Article

Part 4 — Why Entity Resolution Is Harder Than Named Entity Recognition

In the next article we'll explore why extracting entities is only half of the problem.

We'll design a production-grade Entity Resolution Engine capable of matching customers, invoices, contracts, and purchase orders using:

  • Exact Matching
  • Alias Matching
  • Fuzzy Matching
  • Embedding Similarity
  • Confidence Scoring
  • Hybrid Resolution Strategies

to transform extracted entities into actionable business knowledge.