https://github.com/palnavneet/sheep
A android library for running Nlp models.
https://github.com/palnavneet/sheep
android distilbert kotlin nlp onnx
Last synced: 6 months ago
JSON representation
A android library for running Nlp models.
- Host: GitHub
- URL: https://github.com/palnavneet/sheep
- Owner: palnavneet
- License: mit
- Created: 2025-04-06T15:16:23.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2025-04-12T05:50:18.000Z (6 months ago)
- Last Synced: 2025-04-12T12:04:24.248Z (6 months ago)
- Topics: android, distilbert, kotlin, nlp, onnx
- Language: Kotlin
- Homepage:
- Size: 178 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
๐ Sheep: An Android Library for Running NLP Models
๐ง Under Development
![]()
Sheep lets you run popular NLP models like DistilBERT directly on Android using ONNX Runtime.
It comes with built-in tokenizers (like WordPiece) and also supports custom pipelines and tokenizers out of the box.
---
| ๐ง Model | โ๏ธ Type | ๐งฉ Pipelines Supported | ๐ค Tokenizer Support | ๐ Status |
|---------------|------------------|-------------------------------|------------------------------|-----------------|
| [DistilBERT](https://huggingface.co/distilbert/distilbert-base-uncased) | Transformer | TextSimilarity, Custom | WordPiece, Custom | โ Working |
| [BERT (Planned)](https://huggingface.co/bert-base-uncased) | Classifier | TextClassification | WordPiece, SentencePiece | ๐ง Planned |
| [RoBERTa (Planned)](https://huggingface.co/roberta-base) | QA Model | QuestionAnswering | WordPiece | ๐ง Planned |
| [GPT-2 (Planned)](https://huggingface.co/gpt2) | Decoder | TextGeneration, Summarizer | BPE | ๐งช In Design |---
## โ๏ธ Basic Usage
```kotlin
val sheep = Sheep(
context = context,
pipeline = PipelineType.TextSimilarity("Hello", "World"),
tokenizer = TokenizerType.WordPiece
)sheep.run(
assetModelFileName = "distilbert.onnx",
assetVocabFileName = "vocab.txt"
)
```
### ๐ง 3. **Roadmap**
```md
## ๐ง Roadmap- [x] DistilBERT support
- [x] Text similarity pipeline
- [x] WordPiece tokenizer
- [ ] Add text classification pipeline
- [ ] Add GPT-style decoder model support
- [ ] SentencePiece / BPE tokenizer
- [ ] Upload to Maven Central
```
## ๐ License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.