ml_text_summarizer 1.0.0
ml_text_summarizer: ^1.0.0 copied to clipboard
A lightweight and multilingual extractive text summarizer written in pure Dart. Supports English and Turkish out of the box. Easily extendable to any language.
π ml_text_summarizer #
A lightweight, multilingual extractive text summarizer written in pure Dart.
It supports English πΊπΈ and Turkish πΉπ· by default and is easily extensible to other languages.
β¨ Features #
- β Extractive text summarization
- π Multilingual stopword support (English & Turkish included)
- βοΈ Pure Dart implementation β no native dependencies
- π§© Easily extensible stopword manager
- π§ͺ Unit tested
- π pub.dev-ready
π¦ Installation #
Add the following to your pubspec.yaml
:
dependencies:
ml_text_summarizer: ^1.0.0
Then run:
dart pub get
π Usage #
import 'package:ml_text_summarizer/ml_text_summarizer.dart';
void main() {
final summarizer = TextSummarizer(
maxSentences: 2,
language: 'en', // or 'tr' for Turkish
);
const text = '''
Artificial Intelligence is transforming the world by enabling machines to learn from data.
It helps automate tasks, speed up decision-making, and improve productivity.
AI is used in healthcare, finance, education, and more.
''';
final summary = summarizer.summarize(text);
print('Summary:');
print(summary);
}
π§ͺ Running Tests #
dart test
π Example Output #
Input:
"Artificial Intelligence is transforming industries. It enables automation and intelligent decision-making. AI is used in healthcare, finance, and robotics."
Summary:
"Artificial Intelligence is transforming industries. It enables automation and intelligent decision-making."
π§ Extending to Other Languages #
You can register your own stopword list:
StopwordManager().addLanguage('es', {'el', 'la', 'de', 'que', 'y'});
π License #
MIT Β© 2025 Mehmet Γelik