Skip to content

Code for "Investigating the Contextualised Word Embedding Dimensions Responsible for Contextual and Temporal Semantic Changes"

Notifications You must be signed in to change notification settings

LivNLP/svp-dims

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

svp-dims

Code for "Investigating the Contextualised Word Embedding Dimensions Specified for Contextual and Temporal Semantic Changes"

Data

Setup

pip3 install -r requirements.txt

git clone https://github.com/pierluigic/xl-lexeme.git
cd xl-lexeme
pip3 install .

Calcualte vectors

Contextual

bash process_wic.sh

cd src
python3 preprocess_wic_testset.py \
    --wic_test_data PATH_TO_TEST_DATA \
    --wic_test_gold PATH_TO_TEST_GOLD

python3 datavecloader.py \
    --path_contextual_scd PATH_TO_PROCESSED_DATA

Temporal

cd src
python3 prepare_temporal_vecs.py \
    --file_path PATH_TO_SEMEVAL_TOKEN \
    --lemma_path PATH_TO_SEMEVAL_LEMMA \
    --target_words_list PATH_TO_TARGET_WORDS \
    --lang en/la/de/sw \
    --output_name PATH_TO_RESULT_PKL

Visualise

python3 main_cont.py \
    --path_contextual_finetuned PATH_DVL_FINETUNED \
    --path_contextual_pretrained PATH_DVL_PRETRAINED \
    --output OUTPUT_NAME # e.g. DATA_LANG

python3 main_temp.py \
    --path_temporal_word2label PATH_WORD2LABEL \
    --path_temporal_word2grade PATH_WORD2GRADE \
    --path_temporal_finetuned_t1 PATH_FINETUNED_t1 \
    --path_temporal_finetuned_t2 PATH_FINETUNED_t2 \
    --path_temporal_pretrained_t1 PATH_PRETRAINED_t1 \
    --path_temporal_pretrained_t2 PATH_PRETRAINED_t2 \
    --output OUTPUT_NAME # e.g. LANG

About

Code for "Investigating the Contextualised Word Embedding Dimensions Responsible for Contextual and Temporal Semantic Changes"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published