UDPipe Flutter
NLP tokenization, POS tagging and dependency parsing using UDPipe 1 UDPipe 1 github, built with Flutter.
Native FFI on desktop and mobile. WebAssembly via Emscripten on the web.
Platforms
| Platform | Status |
|---|---|
| Android | β |
| Web | β |
| Windows | β |
| Linux | β |
| macOS | π§ Built but untested |
| iOS | π§ Built but untested |
Features
- Tokenization, lemmatization, POS tagging and dependency parsing
- Runs fully on-device (no server required)
- Separable verb detection for German
- 50+ pre-trained language models available from ΓFAL
- Async batch processing keeps the UI thread free
Live Demo
https://konyshevgmbh.github.io/udpipe_flutter/
pub.dev
https://pub.dev/packages/udpipe_flutter
Getting Started
git clone --recursive https://github.com/konyshevgmbh/udpipe_flutter.git
flutter pub get
flutter run -d windows # Windows desktop
flutter run -d linux # Linux desktop
flutter run -d macos # macOS desktop
flutter run # Android (device or emulator)
Web (WASM)
Build the WebAssembly module first, then run on Chrome:
make run-web # builds WASM via Docker, then launches Chrome
Requires Docker Desktop.
Model files
Download models from ufal.mff.cuni.cz/udpipe/1/models
and place the .udpipe file in assets/models/ (or any path inside your Flutter assets).
All ~94 models from UDPipe 1 (UD 2.5) are listed in kUdpipeModels
and in assets/models/README.md.
A few popular ones:
| Model ID | Language | File |
|---|---|---|
german-gsd |
German | german-gsd.udpipe (~20 MB) |
german-hdt |
German | german-hdt.udpipe (~60 MB) |
english-ewt |
English | english-ewt.udpipe |
russian-syntagrus |
Russian | russian-syntagrus.udpipe |
french-gsd |
French | french-gsd.udpipe |
Library API
import 'package:udpipe_flutter/udpipe_flutter.dart';
final svc = UDPipeService();
// 1. Load from kUdpipeModels catalog (file must be in assets/models/)
await svc.init(modelId: 'german-gsd');
// 2. Load from any asset path
await svc.initFromAsset('assets/models/russian-syntagrus.udpipe');
// 3. Load from bytes (e.g. downloaded at runtime)
final bytes = await downloadModel();
await svc.initFromBytes(bytes);
// Process text (synchronous, call from any isolate)
final result = svc.process('Er steigt aus dem Bus aus.');
for (final sentence in result.sentences) {
for (final token in sentence.tokens) {
print('${token.form} β ${token.lemma} [${token.upos}]');
// Er β er [PRON]
// steigt β steigen [VERB]
// Bus β Bus [NOUN]
}
for (final sv in sentence.sepVerbs) {
print('sep.verb: ${sv.particle}+${sv.verbForm} β ${sv.fullLemma}');
// sep.verb: aus+steigt β aussteigen
}
}
// Async batch β keeps UI thread free (background isolate on native, micro-tasks on web)
final results = await svc.processAllBlocksAsync(['First paragraph.', 'Second paragraph.']);
Architecture
lib/udpipe/
udpipe_flutter.dart β public API
src/
conllu_parser.dart β CoNLL-U parser (pure Dart)
udpipe_types.dart β data classes and result builders
udpipe_bindings.dart β dart:ffi bindings
udpipe_service.dart β conditional export (native vs web)
udpipe_service_native.dart β FFI service (Windows / Linux / macOS / Android)
udpipe_service_web.dart β WASM/JS service (web)
native/
CMakeLists.txt β builds udpipe_flutter.dll / .so / .dylib
udpipe_ffi.cpp β thin C wrapper around UDPipe
udpipe_src/ β git submodule: ufal/udpipe
build_web.sh β Emscripten build script
Tech Stack
| Component | Library |
|---|---|
| UI | Flutter 3.x + Material 3 |
| Native bindings | ffi |
| NLP engine | UDPipe 1 (C++, MPL 2.0) |
| Web engine | Emscripten WASM |
License
Wrapper code β MIT
UDPipe Β© ΓFAL MFF UK β MPL 2.0
Libraries
- udpipe/src/conllu_parser
- udpipe/src/udpipe_bindings
- udpipe/src/udpipe_service
- udpipe/src/udpipe_service_native
- udpipe/src/udpipe_service_web
- udpipe/src/udpipe_types
- udpipe_flutter
- UDPipe Flutter library β tokenization, POS tagging, dependency parsing.