https://github.com/shubham0204/glove-android
Power of GloVe word embeddings in Android
https://github.com/shubham0204/glove-android
android chaquopy context-understanding glove-embeddings kotlin natural-language-processing word-embeddings
Last synced: 3 months ago
JSON representation
Power of GloVe word embeddings in Android
- Host: GitHub
- URL: https://github.com/shubham0204/glove-android
- Owner: shubham0204
- License: gpl-3.0
- Created: 2023-04-14T01:29:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-12T05:17:28.000Z (over 1 year ago)
- Last Synced: 2025-07-15T04:16:31.026Z (3 months ago)
- Topics: android, chaquopy, context-understanding, glove-embeddings, kotlin, natural-language-processing, word-embeddings
- Language: Kotlin
- Homepage: https://shubham0204.github.io/glove-android/
- Size: 92.7 MB
- Stars: 16
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# `glove-android`: Using GloVe word embeddings in Android
`glove-android` is an Android library that provides an interface for using popular [GloVe](https://nlp.stanford.edu/projects/glove/)
word embeddings.
![]()
![]()
![]()
## Installation
1. Download `glove-android.aar` from the latest release. (See [Releases](https://github.com/shubham0204/glove-android/releases))
2. Move the AAR to `app/libs`.
3. In module-level `build.gradle`, add the dependency,```groovy
dependencies {
...
implementation files('libs/glove-android.aar')
...
}
```## Usage
To load the embeddings from storage, use the `GloVe.loadEmbeddings` method, which returns a `GloveEmbeddings`
object as a parameter in the given lambda function.```kotlin
val gloveEmbeddings: GloVeEmbeddingsGloVe.loadEmbeddings {
gloveEmbeddings = it
}
```Call the `gloveEmbeddings.getEmbedding` method providing a word as parameter. The resultant embedding
is returned as a `FloatArray` with `size=50` (indicating a 50-D embedding).```kotlin
val embedding = gloveEmbeddings.getEmbedding( "hello" )
println( embedding.contentToString() )
```> If no embedding is found for the given word, an empty `FloatArray` is returned
## Citation
```text
@inproceedings{pennington2014glove,
author = {Jeffrey Pennington and Richard Socher and Christopher D. Manning},
booktitle = {Empirical Methods in Natural Language Processing (EMNLP)},
title = {GloVe: Global Vectors for Word Representation},
year = {2014},
pages = {1532--1543},
url = {http://www.aclweb.org/anthology/D14-1162},
}
```## Useful Resources
* [Reddit discussion on `r/androiddev`](https://www.reddit.com/r/androiddev/comments/168u3h7/gloveandroid_an_android_library_providing_access/)