{"id":17046496,"url":"https://github.com/tkellogg/emopoint","last_synced_at":"2026-01-20T22:35:44.437Z","repository":{"id":244810212,"uuid":"816336028","full_name":"tkellogg/emopoint","owner":"tkellogg","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-25T21:01:07.000Z","size":638,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-27T02:57:00.029Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tkellogg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-17T14:31:54.000Z","updated_at":"2024-07-27T19:01:30.000Z","dependencies_parsed_at":"2024-06-17T16:27:25.184Z","dependency_job_id":"146c880f-6ed5-4778-a8db-287eae78864f","html_url":"https://github.com/tkellogg/emopoint","commit_stats":null,"previous_names":["tkellogg/emopoint"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/tkellogg/emopoint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkellogg%2Femopoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkellogg%2Femopoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkellogg%2Femopoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkellogg%2Femopoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tkellogg","download_url":"https://codeload.github.com/tkellogg/emopoint/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkellogg%2Femopoint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28616991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T22:24:05.405Z","status":"ssl_error","status_checked_at":"2026-01-20T22:20:31.342Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T09:46:28.547Z","updated_at":"2026-01-20T22:35:44.420Z","avatar_url":"https://github.com/tkellogg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Extract emotional information from embeddings.\n\nWhen working with LLMs, various embedding models capture emotional information \nthat might be useful to work with (or without!). \n\nAn emopoint is a simplified embedding with interpretable dimensions:\n 1. joy vs sadness\n 2. anger vs fear\n 3. disgust vs surprise\n\nSo, for example OpenAI's `text-embedding-3-small` returns embeddings with 1536\ndimensions. This library will convert those into 3 dimensions, losing most\ninformation except for what directly relates to emotion.\n\nThis library enables two modes:\n 1. Isolate emotion, converting it into 3D emopoint vectors\n 2. Remove emotion, stay in original dimensionality\n\n# Install\nInstall using your language's package manager:\n\n## [JavaScript/TypeScript via NPM](https://www.npmjs.com/package/emopoint)\n```bash\nnpm i emopoint\n```\n\nand then use it\n\n```javascript\nconst { MODELS } = require('emopoint');\n\nconsole.log(MODELS.ADA_2);\n```\n\n## [Python via PyPi](https://pypi.org/project/emopoint/)\n```bash\npip install emopoint\n```\nand then use it\n\n```python\nfrom emopoint import MODELS\n\nembedding = get_embeddings(\"James was maaaaaad\")\nemopoint = MODELS.ADA_3_SMALL.emb_to_emo(embedding)\n```\n\n## Go\n```bash\ngo get github.com/tkellogg/emopoint/go/emopoint\n```\n\nand then use it\n\n```go\nimport (\n\temo \"github.com/tkellogg/emopoint/go/emopoint\"\n)\n\nfunc main() {\n\tvar embeding []float32 = getEmbeddings(\"James was maaaaaad\")\n\tvar emopoint []float32 = emo.ADA_3_SMALL.EmbeddingToEmopoint(embedding)\n}\n```\n\n\n# Functions\nAll 3 languages have these capabilities:\n* Convert embedding to emopoint — Convert an embedding (e.g. 1536 dimensions for `text-embedding-3-small`) to 3-dimensional space,\n  called `emopoint` space that represents only emotion and nothing else.\n* Remove emotion — Take an embedding and keep it in the same dimensionality, but subtract emotional information\n\nFrom these operations, there's a lot more you can do:\n* Get the portion of emotional information in text — Calculate the magnitude of the embedding (should be always `1.0`) and subtract\n  the magnitude of the result of `remove_emotion(embedding)`. The result is a scalar `float` that represents the portion of the\n  meaning of the text that was dedicated to emotion, as the embedding model understood it.\n* Cluster on emotion — Convert to `emopoint` space and run a K-Means clustering algorithm\n* Semantic search on emotion only — Convert to `emopoint` space and store in a vector database. This matches text based only on the\n  emotional content, ignoring all factual and subjective information.\n* Semantic search without emotion — Same as before, but store the result of `remove_emotion(embedding)`. This removes noise introduced\n  by emotion, creating closer matches and potentially enhancing the search accuracy.\n* Analytics \u0026 visualizations on emotional magnitude — Calculate the magnitudes of emopoints for several texts, e.g. sections of a speech \n  or tweets, and create visualizations on just the magnitude (portion of information dedicated to emotion).\n* Analytics \u0026 visualizations on emotions — Same as before, but instead of calculating the magnitude, visualize the points in 3D emopoint\n  space. Observe how some texts lean toward anger or joy. Analyze how emotions ebb \u0026 flow throughout a speech, and contrast that to\n  the informational content (maybe use K-Means clustering on original content to classify the content and display those classifications\n  as colors in a [3D scatter plot](https://plotly.com/python/3d-scatter-plots/)).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkellogg%2Femopoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftkellogg%2Femopoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkellogg%2Femopoint/lists"}