Kebbie is designed to provide a cohesive and standardized approach to testing mobile keyboards. It facilitates evaluation of key functionalities like auto-correction and next-word prediction, helping you benchmark different keyboards easily through an intuitive CLI.
kebbie
is a compact yet powerful framework designed for testing and benchmarking mobile keyboards. This tool aims to provide developers with a standardized and cohesive method for evaluating the NLP capabilities of various mobile keyboards and comparing them effectively against existing alternatives.
Key Features
-
Comprehensive Evaluation:
kebbie
includes an intuitive evaluation function that allows for the testing of essential NLP functionalities of mobile keyboards, including:- Auto-Correction
- Auto-Completion
- Next-Word Prediction
- Swipe Gesture Recognition
-
User-Friendly Command-Line Interface: Execute evaluations on established keyboards easily within an emulator with a simple command.
Getting Started
To use kebbie
to assess your custom keyboard functionality, define an instance of Corrector
and invoke the evaluate()
method. Here’s an example that demonstrates how to evaluate the auto-correction feature using the pyspellchecker
:
import json
from typing import List
from spellchecker import SpellChecker
from kebbie import Corrector, evaluate
class ExampleCorrector(Corrector):
def __init__(self):
self.spellchecker = SpellChecker()
def auto_correct(self, context: str, keystrokes, word: str) -> List[str]:
cands = self.spellchecker.candidates(word)
return list(cands) if cands is not None else []
if __name__ == "__main__":
corrector = ExampleCorrector()
results = evaluate(corrector)
with open("results.json", "w") as f:
json.dump(results, f, ensure_ascii=False, indent=4)
💡 Tip: For a detailed explanation on how to implement and utilize the framework, refer to the full documentation.
If you're looking to evaluate an existing keyboard, simply start appium
, initiate your emulator, install your target keyboard, and execute:
# For GBoard on Android emulator
kebbie evaluate -K gboard --all_tasks
# For iOS keyboard on iOS emulator
kebbie evaluate -K ios --all_tasks
💡 Tip: Review the documentation for setup details on emulators and command line usage.
Contribution
Interested in contributing? Set up your environment locally, create a branch for your modifications, and submit a Pull Request once your code, tests, and documentation are ready.
Ensure the quality of your code meets standards with pre-commit hooks that validate your changes before committing. Install hooks using:
pip install -e .[hook]
pre-commit install
When writing tests, verify they pass by running:
pytest
🚧 Note: Tests are not included in the pre-commit hooks to ensure a swift commit process. You can manually verify coverage updates and integrate newly required tests as needed.
Documentation
Keep our documentation up-to-date! Visualize it locally by running:
mkdocs serve
Note: Ensure you have documentation dependencies installed before this command:
pip install -e .[docs]
Explore the comprehensive potential of mobile keyboard evaluation with kebbie
to ensure your applications stand out!