Emoji Math
Because why not? I put a minimal effort into this project, so please have low expectations.
pip install emath@git+git://github.com/whitead/emoji-math.git
Usage
emoji-math
computes the given python expression and returns either the value or the nearest 5 emojis as measured by cosine similarity.
>emoji-math π - πΉ + πΊ
Best Matches:
π-πΉ+πΊ = πΈ
π-πΉ+πΊ = π
π-πΉ+πΊ = π€΄
>emoji-math πΉ @ πΊ
πΉ @ πΊ = 0.32784234338655205
>emoji-math np.sin(π°)
Best Matches:
np.sin(π°) = π―
np.sin(π°) = π°
np.sin(π°) = πΈ
>emoji-math πΉ + πΊ
Best Matches:
πΉ+πΊ = π»
πΉ+πΊ = πΊ
πΉ+πΊ = πΉ
Options
You can choose between using the Euclidean distance or cosine similarity for reporting results. Cosine works better for multiplication/division because it only cares about direction. Default is Euclidean.
>emoji-math --cosine πΉ + πΊ
Best Matches:
πΉ+πΊ = π
πΉ+πΊ = πΊ
πΉ+πΊ = πΉ
Google Colab
Credit
Made by @andrewwhite01
Vector embeddings from emoji2vec as described in
@misc{eisner2016emoji2vec,
title={emoji2vec: Learning Emoji Representations from their Description},
author={Ben Eisner and Tim RocktΓ€schel and Isabelle Augenstein and Matko BoΕ‘njak and Sebastian Riedel},
year={2016},
eprint={1609.08359},
archivePrefix={arXiv},
primaryClass={cs.CL}
}