# Qalqul: classical NLP/NLU engines

Source: https://www.alouaniyoussef.com/projects/qalqul-nlu

- Kind: employer
- Status: shipped
- Company: Qalqul Engine
- Updated: 2026-11-19

Intent classification and entity extraction on language servers and Duckling, tuned per client, before LLMs made it the default.

## Problem

A banking bot has to know that "I want to block my card" and "my card was stolen" are the same intent, and pull out the amount, the date and the account from a sentence written in a mix of Arabic, French and Darija. In 2021 that meant classical NLP: tokenisation, classifiers and entity extractors, built and tuned for each client.

## Constraints

- **Little training data**: each client starts with a few examples per intent.
- **Mixed languages and scripts**: Arabic, Latin-script Darija and French in the same message.
- **Structured entities**: dates, amounts and numbers must come out normalised.
- **Fast**: understanding runs on every message, in real time.

## Architecture

<LayerDiagram
  title="Qalqul NLU pipeline"
  desc="A message goes through normalisation and language detection, then in parallel to an intent classifier trained per client, to entity extractors, and to Duckling for dates, amounts and numbers. The results are merged into one understanding that bots and routing use."
  layers={[
    { caption: 'Input', nodes: [{ label: 'Message', sub: 'widget · SDK · channel' }] },
    { caption: 'Pre-processing', nodes: [{ label: 'Normalisation', sub: 'scripts · spelling' }, { label: 'Language detection' }] },
    { caption: 'Understanding', nodes: [{ label: 'Intent classifier', sub: 'per client', accent: true }, { label: 'Entity extraction' }, { label: 'Duckling', sub: 'dates · amounts · numbers' }] },
    { caption: 'Consumers', nodes: [{ label: 'Botpress bots' }, { label: 'Routing & tickets' }] },
  ]}
/>

## Key decisions

1. **Language servers behind one API.** Each language model runs as its own server, and bots call one understanding API.
2. **Duckling for structured entities.** Dates and amounts are a solved problem; Duckling normalises them instead of custom regexes.
3. **Per-client models.** Each client's intents are trained and versioned separately, so one client's changes never affect another.

## Results

Numbers to come.

## Stack and links

Python, Duckling, TypeScript, Node.js
