Downloads · 30 days
32
16% of all-time downloads
marksverdhei/wordnet-sense-embedding
wordnet-sense-embedding is a sentence similarity model from marksverdhei. Use it when you need a score for how close two texts are. It is set up for sentence-transformers. The card lists the license as apache-2.0.
This is a sentence-transformers model trained to embed word senses using definitions from WordNet. It maps a word in context (e.g., "I sat on the bank") to the same vector space as its definition.
Downloads · 30 days
32
16% of all-time downloads
All-time downloads
201
Public
Parameters
66.4M
265 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors531 MB · 100%
From the Hugging Face model README
This is a sentence-transformers model trained to embed word senses using definitions from WordNet. It maps a word in context (e.g., "I sat on the bank") to the same vector space as its definition.
distilbert-base-uncasedmarksverdhei/wordnet-definitions-en-2021Because this model uses a custom pooling layer and tokenization logic (to identify the target word), you must use the provided word_pooling.py code to load it.
pip install sentence-transformers
word_pooling.py from this repository.WordSenseTransformer class.from word_pooling import WordSenseTransformer
# Load from Hugging Face Hub
model = WordSenseTransformer("marksverdhei/wordnet-sense-embedding")
# Define inputs with the format: "'<word>': <context>"
sentences = [
"'bank': I sat on the river bank.",
"'bank': I deposited money at the bank."
]
embeddings = model.encode(sentences)
# Compare with definitions
definitions = [
"'bank': A sloping land (especially the slope beside a body of water).",
"'bank': A financial institution that accepts deposits."
]
def_embeddings = model.encode(definitions)
# Compute similarity...