Logo Lanfrica

chibokocl/kiswahili

Domaine:

natural language processing

Type de record:

software
Créateur:
chi
Hôte:
# Kiswahili NLP Toolkit A comprehensive Swahili language processing toolkit that provides intelligent text analysis, spell checking, word prediction, and grammatical analysis based on actual corpus data. ## Features ### ✅ Working Features (v0.1.0) 1. **Spell Checking** - Intelligent spell correction with context awareness 2. **Word Prediction** - Autocomplete suggestions based on partial input 3. **Context Analysis** - Analyze word relationships and usage patterns 4. **Sentence Completion** - Context-aware sentence completion suggestions 5. **Grammatical Analysis** - Check grammatical correctness of Swahili sentences ### 🔧 Core Components - **SwahiliContextAnalyzer** - Main analysis engine for context and grammar - **SwahiliSpellChecker** - Spell checking and correction - **SwahiliPredictor** - Word prediction and autocomplete - **SwahiliGrammarEngine** - Grammar analysis and validation ## Installation ### From Source ```bash git clone github.com cd kiswahili pip install -e . ``` ### Dependencies The package requires: - Python 3.8+ - PyPDF2>=3.0.0 - pdfplumber>=0.9.0 - nltk>=3.8 - regex>=2023.0.0 ## Quick Start ### Interactive Demo Run the interactive demo to explore all features: ```bash python swahili_terminal_demo.py ``` Or after installation: ```bash kiswahili-demo ``` ### Programmatic Usage ```python from kiswahili import SwahiliContextAnalyzer, SwahiliSpellChecker, SwahiliPredictor # Initialize analyzers analyzer = SwahiliContextAnalyzer() spell_checker = SwahiliSpellChecker() predictor = SwahiliPredictor() # Spell checking corrected = spell_checker.correction("karieni") # Returns "kazini" # Word prediction suggestions = predictor.predict_word("na") # Returns suggestions starting with "na" # Grammatical analysis analysis = analyzer.analyze_grammatical_correctness("Juma na Assha wanachekeleana na pembeni") print(f"Grammar score: {analysis['grammar_score']}") print(f"Issues: {analysis['issues']}") # Co …