pblop/tfm

Jupyter Notebook

0

1 commits

updated Jun 24, 2026

See the code

README

TFM — Word Sense Disambiguation in Spanish

Master's thesis code. It studies whether the different meanings of a Spanish word can be separated automatically from BERT contextual embeddings.

The idea: take an ambiguous word (e.g. mono = monkey / overalls / cute), collect many sentences using it, embed each occurrence with a Spanish BERT model, and check if the meanings form distinct clusters in embedding space.

What's where

FolderWhat it is
src/semantic_analysis/Core: embed sentences, extract the target word vector, plot/evaluate.
src/utils/Shared helpers: embeddings, clustering, metrics, datasets, plots.
src/experiments/Scripts for generating the results, as well as some exploratory analysis.
src/scrapers/Scrape example sentences (Reverso, SpanishDict).
src/latex/Generate the thesis figures and tables.
scripts/Data extraction (AnCora, XL-WSD) and sentence generation.
experiments/Notebooks used for exploratory analysis.
data/Datasets (scraped sentences, XL-WSD Spanish, AnCora anchors).
results/, visualizations/Output.

Setup

Needs Python 3.14 and uv.

uv sync

Run

uv run semantic-analysis        # core analysis (default: word "mono")

Most work lives in the notebooks under experiments/ and the scripts under src/experiments/.

pblop/tfm

Jupyter Notebook

0

1 commits

updated Jun 24, 2026

See the code

README

TFM — Word Sense Disambiguation in Spanish

Master's thesis code. It studies whether the different meanings of a Spanish word can be separated automatically from BERT contextual embeddings.

The idea: take an ambiguous word (e.g. mono = monkey / overalls / cute), collect many sentences using it, embed each occurrence with a Spanish BERT model, and check if the meanings form distinct clusters in embedding space.

What's where

FolderWhat it is
src/semantic_analysis/Core: embed sentences, extract the target word vector, plot/evaluate.
src/utils/Shared helpers: embeddings, clustering, metrics, datasets, plots.
src/experiments/Scripts for generating the results, as well as some exploratory analysis.
src/scrapers/Scrape example sentences (Reverso, SpanishDict).
src/latex/Generate the thesis figures and tables.
scripts/Data extraction (AnCora, XL-WSD) and sentence generation.
experiments/Notebooks used for exploratory analysis.
data/Datasets (scraped sentences, XL-WSD Spanish, AnCora anchors).
results/, visualizations/Output.

Setup

Needs Python 3.14 and uv.

uv sync

Run

uv run semantic-analysis        # core analysis (default: word "mono")

Most work lives in the notebooks under experiments/ and the scripts under src/experiments/.