Code Monkey home page Code Monkey logo

corrsim's Introduction

Note This repository is no longer actively maintained by Babylon Health. For further assistance, reach out to the paper authors.

CorrSim

CorrSim is an evaluation framework and a collection of statistical similarity measures for word vectors described in

Vitalii Zhelezniak, Aleksandar Savkov, April Shen, and Nils Y. Hammerla. Correlation Coefficients and Semantic Textual Similarity, NAACL-HLT 2019.

CorrSet is a a collection of multivariate statistical similarity measures for word vectors described in

Vitalii Zhelezniak, April Shen, Daniel Busbridge, Aleksandar Savkov, and Nils Y. Hammerla. Correlations between Word Vector Sets, EMNLP-IJCNLP 2019.

InfoSim is a collection of mutual information similarity measures for word vectors described in

Vitalii Zhelezniak, Aleksandar Savkov, and Nils Y. Hammerla. Estimating Mutual Information Between Dense Word Embeddings, ACL 2020.

Dependencies

This code is written in Python 3. The requirements are listed in requirements.txt.

pip3 install -r requirements.txt

Evaluation tasks

The experimental framework derived from SentEval evaluates the similarity measures on the following datasets:

| STS 2012 | STS 2013 | STS 2014 | STS 2015 | STS 2016 |

To get all the datasets, run (in data/downstream/):

./get_sts_data.bash

This will automatically download and preprocess the downstream datasets, and store them in data/downstream (warning: for MacOS users, you may have to use p7zip instead of unzip).

Experiments

Word vectors files must be in a word2vec txt format and are placed in data/word_vectors/. The mapping from word vector model name to filename is found in evaluation/utils.py.

WORD_VEC_MAP = {
    'glove': 'glove.840B.300d.w2vformat.txt',
    'word2vec': 'GoogleNews-vectors-negative300.txt',
    'fasttext': 'fasttext-crawl-300d-2M.txt'
}

All the experiments are located in evaluation. They include

  1. conf_intervals.py - evaluates rank correlation similarities against cosine similarity on STS and computes 95% BCa confidence intervals for the delta in performance.
  2. corrsim_eval.py - evaluates rank correlation similarities against cosine similarity on STS and computes fractions of non-normal word and sentence embeddings.
  3. wordsim_eval.py - evaluates rank correlation similarities against cosine similarity and Pearson correlation on word-level tasks.
  4. corrset_eval.py - evaluates multivariate correlations on STS (EMNLP-IJCNLP 2019).
  5. infosim_eval.py - evaluates the KSG estimator of mutual information on STS (ACL 2020).

Feedback and Contact:

If this code is useful to your research, please consider citing

Vitalii Zhelezniak, Aleksandar Savkov, April Shen, and Nils Y. Hammerla. Correlation Coefficients and Semantic Textual Similarity, NAACL-HLT 2019.

and/or

Vitalii Zhelezniak, April Shen, Daniel Busbridge, Aleksandar Savkov, and Nils Y. Hammerla. Correlations between Word Vector Sets, EMNLP-IJCNLP 2019.

and/or

Vitalii Zhelezniak, Aleksandar Savkov, and Nils Y. Hammerla. Estimating Mutual Information Between Dense Word Embeddings, ACL 2020.

Contact: Vitalii Zhelezniak [email protected]

Related work

corrsim's People

Contributors

aconneau avatar amaurysabran avatar bodak avatar cifkao avatar douwekiela avatar jegou avatar kahne avatar oroszgy avatar sojvai avatar tscheepers avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.