This repository contains the code and setup used to reproduce the experiments from the paper on semantic change detection using average self-embedding distances (SED) and Spearman correlation metrics. The study evaluates the effectiveness of pre-trained models like BERT and XLM-Roberta in detecting artificial semantic change over multiple layers.
project_folder/
├── asc-lr-main/
│ ├── bert/
│ │ ├── cosine_distances/
│ │ ├── target_index/
│ │ ├── special_token_mask/
│ ├── xlmr/
│ ├── src/
│ │ ├── wic.py # Embedding extraction and evaluation logic
│ │ ├── __init__.py
│ ├── sed_plots.py # Visualization script for metrics
│ ├── wic_stats.py # Main script for evaluation
│ ├── README.md
├── WiC/
│ ├── wic_en/ # Dataset folder
│ │ ├── train.txt
│ │ ├── dev.txt
│ │ ├── test.txt
│ ├── target_embeddings/
torchnumpyscipypandassklearnmatplotlibClone this repository:
git clone <repository_url>
cd project_folder
Install dependencies:
pip install -r requirements.txt
(Optional) Set up a GPU environment for faster computation.
train.txt, dev.txt, test.txt) in the folder WiC/wic_en/.WiC/wic_en/target_embeddings/bert/ and WiC/wic_en/target_embeddings/xlmr/.Run the script to extract embeddings for BERT:
python asc-lr-main/src/wic.py -d WiC/wic_en -m bert-base-uncased --test_set --train_set --dev_set
Evaluate SED and Spearman correlation for semantic change detection:
python asc-lr-main/sed_plots.py
Generate plots for average SED and Spearman correlation:
python asc-lr-main/sed_plots.py
Output plots will be saved in the folder:
/asc-lr-main/bert/cosine_distances/bert_sed_plot.png.
Generated plots:
7 commits
2 commits
Jupyter Notebook
68.0%
Python
31.5%
This repository contains the code and setup used to reproduce the experiments from the paper on semantic change detection using average self-embedding distances (SED) and Spearman correlation metrics. The study evaluates the effectiveness of pre-trained models like BERT and XLM-Roberta in detecting artificial semantic change over multiple layers.
project_folder/
├── asc-lr-main/
│ ├── bert/
│ │ ├── cosine_distances/
│ │ ├── target_index/
│ │ ├── special_token_mask/
│ ├── xlmr/
│ ├── src/
│ │ ├── wic.py # Embedding extraction and evaluation logic
│ │ ├── __init__.py
│ ├── sed_plots.py # Visualization script for metrics
│ ├── wic_stats.py # Main script for evaluation
│ ├── README.md
├── WiC/
│ ├── wic_en/ # Dataset folder
│ │ ├── train.txt
│ │ ├── dev.txt
│ │ ├── test.txt
│ ├── target_embeddings/
torchnumpyscipypandassklearnmatplotlibClone this repository:
git clone <repository_url>
cd project_folder
Install dependencies:
pip install -r requirements.txt
(Optional) Set up a GPU environment for faster computation.
train.txt, dev.txt, test.txt) in the folder WiC/wic_en/.WiC/wic_en/target_embeddings/bert/ and WiC/wic_en/target_embeddings/xlmr/.Run the script to extract embeddings for BERT:
python asc-lr-main/src/wic.py -d WiC/wic_en -m bert-base-uncased --test_set --train_set --dev_set
Evaluate SED and Spearman correlation for semantic change detection:
python asc-lr-main/sed_plots.py
Generate plots for average SED and Spearman correlation:
python asc-lr-main/sed_plots.py
Output plots will be saved in the folder:
/asc-lr-main/bert/cosine_distances/bert_sed_plot.png.
Generated plots:
7 commits
2 commits
Jupyter Notebook
68.0%
Python
31.5%