A library for extracting emotion from AI embeddings
APACHE-2.0 License
Extract emotional information from embeddings.
When working with LLMs, various embedding models capture emotional information that might be useful to work with (or without!).
An emopoint is a simplified embedding with interpretable dimensions:
So, for example OpenAI's text-embedding-3-small
returns embeddings with 1536
dimensions. This library will convert those into 3 dimensions, losing most
information except for what directly relates to emotion.
This library enables two modes:
Install using your language's package manager:
npm i emopoint
and then use it
const { MODELS } = require('emopoint');
console.log(MODELS.ADA_2);
pip install emopoint
and then use it
from emopoint import MODELS
embedding = get_embeddings("James was maaaaaad")
emopoint = MODELS.ADA_3_SMALL.emb_to_emo(embedding)
go get github.com/tkellogg/emopoint/go/emopoint
and then use it
import (
emo "github.com/tkellogg/emopoint/go/emopoint"
)
func main() {
var embeding []float32 = getEmbeddings("James was maaaaaad")
var emopoint []float32 = emo.ADA_3_SMALL.EmbeddingToEmopoint(embedding)
}
All 3 languages have these capabilities:
text-embedding-3-small
) to 3-dimensional space,emopoint
space that represents only emotion and nothing else.From these operations, there's a lot more you can do:
1.0
) and subtractremove_emotion(embedding)
. The result is a scalar float
that represents the portion of theemopoint
space and run a K-Means clustering algorithmemopoint
space and store in a vector database. This matches text based only on theremove_emotion(embedding)
. This removes noise introduced