Skip to main content

GloVe-Word-Embeddings

Library to quickly validate words and get them embedded for academic research. Design is based on Wang et al., 2026 (Nature Human Behaviour) and Olson et al., 2021 (PNAS).

This package has four parts:

  1. pre — clean and normalize words
  2. val — validate against Olson’s list and WordNet nouns
  3. cat — assign semantic / proper-noun categories (SI Rules 1–3)
  4. mod — load embeddings and turn words or phrases into vectors

Helpers list_models and clean_up live at module level. Embeddings are hosted on an AWS S3 bucket and downloaded automatically on first use.

Install

pip install glove-word-embeddings

NLTK WordNet and names data are downloaded automatically on first use of the category or noun helpers (a message appears only when data is actually missing).

1. Preprocessing (pre)

Clean raw text before validation or embedding.

from glove_word_embeddings import pre

pre.return_lowercase("  Cat! ")          # "  cat! "
pre.strip_marks("  Cat! ")               # "  Cat  "
pre.strip_stopword("The Cat")            # "Cat"
pre.strip_space("jar of jam")            # "jarofjam"
pre.remove_stopwords("jar of jam")       # ['jar', 'jam']
pre.space_check("cat")                   # True   (single token)
pre.space_check("jar of jam")            # False

# Full clean (defaults: lower + drop stopwords + strip marks + strip space)
pre.clean_word("  The Cat! ")            # "cat"
pre.clean_word("jar of jam")             # "jarjam"
pre.clean_word("jar of jam", strip_space_bool=False)  # "jar jam"
pre.clean_word("the", strip_stopword_bool=False)      # "the"

2. Validation (val)

Check words against Olson’s validated list and WordNet.

from glove_word_embeddings import mod, val

val.word("telescope")    # True  (in Olson list, single token)
val.word("jar of jam")   # False (fails space check after cleaning)
val.noun("telescope")    # True  (has a WordNet noun synset)
val.noun("quickly")      # False

m = mod.load("glove-olson-validated")
v = m.vocab_set()
val.vocab("telescope", v)   # True
val.vocab("ice cream", v)   # True if "ice_cream" / "ice-cream" / "ice cream" is in v
val.vocab("", v)            # False

3. Categorization (cat)

Flag responses that lean too heavily on one semantic group, room objects, or pure proper nouns (SI Rules 1–3).

from glove_word_embeddings import cat

# Ordinary common word? (ignores WordNet proper-noun instances)
cat.check_common("apple")   # True
cat.check_common("nike")    # False
cat.check_common("aaron")   # False

# Which categories does one word belong to?
cat.check("dog")                           # {"animals"}
cat.check("paris", check_common=False)     # {"places"}
cat.check("apple", check_common=True)      # {"fruits"}  (not brands)

# Count across a response
cat.count(words)  # Rule 2: any category ≥ 5
cat.count(words, name="environment")  # Rule 1
cat.count(words, name="places", number_of_words=1, check_common=False)  # Rule 3 places
cat.count(words, name="names",  number_of_words=1, check_common=True)   # Rule 3 names
cat.count(words, name="brands", number_of_words=1, check_common=True)   # Rule 3 brands

check_common=False trusts the seed list (places, environment, semantic groups).
check_common=True drops a seed hit when the word is an ordinary common word (names / brands).

Unknown name= values raise ValueError.

4. Embedding (mod)

Load a vector model and embed single words or short phrases.

import glove_word_embeddings as gwe
from glove_word_embeddings import mod

gwe.__version__                   # installed package version
gwe.list_models()                 # {key: filename, ...}

m = mod.load("glove-6b-300d")     # downloads on first use, caches locally
m.embed_exact("cat")              # exact match only -> np.ndarray or None
m.vocab_set()                     # -> set of all words in the model

# Multi-word phrases
m.embed_phrase("jar of jam")      # tries "jar of jam" / "jar_of_jam" / "jar-of-jam",
                                  # otherwise averages the non-stopword parts

gwe.clean_up()                    # deletes all cached files

Files are cached in ~/.cache/glove-word-embeddings.

Citations

Wang et al., (2026)

Wang, D., Huang, D., Shen, H., & Uzzi, B. (2026). A large-scale comparison of
divergent creativity in humans and large language models. Nature Human
Behaviour, 10(3), 531–540. https://doi.org/10.1038/s41562-025-02331-1

Olson et al., (2021)

Olson, J. A., Nahas, J., Chmoulevitch, D., Cropper, S. J., & Webb, M. E.
(2021). Naming unrelated words predicts creativity. Proceedings of the
National Academy of Sciences, 118(25), e2022340118.
https://doi.org/10.1073/pnas.2022340118

Metadata

Release files for glove-word-embeddings 0.1.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for glove-word-embeddings 0.1.12
File Size Uploaded
glove_word_embeddings-0.1.12.tar.gz 12.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for glove-word-embeddings 0.1.12
File Interpreter ABI Platform
glove_word_embeddings-0.1.12-py3-none-any.whl Python 3 none any Details

Total release size: 24.4 kB

Release files / glove_word_embeddings-0.1.12.tar.gz

Download URL glove_word_embeddings-0.1.12.tar.gz
Size 12.1 kB
Tags Source
SHA-256 checksum
How to use checksums
36b782c0d24df6d19e74153ed09167310242d9b9529f99f0d81cd1021d4402e0
BLAKE2b-256 checksum
How to use checksums
5badc3d381794aa2befab0c34583148b3e7a5954605ecdc6b591447d3b16b94e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.16

Release files / glove_word_embeddings-0.1.12-py3-none-any.whl

Download URL glove_word_embeddings-0.1.12-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3bb95023797d6b15374bd56347b9f6e817ea6a71e381bc43229abff878bd6f16
BLAKE2b-256 checksum
How to use checksums
5843339141890fd9422f22801ca176562386cda1fbbdb2c72a06ab97c5368c6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.16

Release history Release notifications | RSS feed

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

This release

0.1.12 This release

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page