Git Product home page Git Product logo

5l1v3r1 / mmid-cnn-analysis Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nikzadkhani/mmid-cnn-analysis

0.0 1.0 0.0 260.84 MB

Python 1.06% Cycript 7.57% JavaScript 8.95% Shell 4.94% Smalltalk 3.09% Emacs Lisp 6.51% Fancy 2.65% Hy 1.05% Io 0.02% Modula-3 0.06% Makefile 7.09% Standard ML 10.69% MAXScript 4.14% Nearley 8.59% NewLisp 9.07% Perl 5.02% PostScript 0.16% Slash 3.19% SystemVerilog 8.61% Jupyter Notebook 7.51%

mmid-cnn-analysis's Introduction

MMID-CNN-Analysis

Downloading the data

The CNN image matrices can be downloaded using the scripts in the download folder in batches or via the MMID website directly:

https://multilingual-images.org/downloads.html

Dictionaries

The dictionaries were processed from the dictionaries found here. For each language pair, a new dictionary was created with the name {source_language}_to_{target_language}.tsv. The source language's dictionary with the name dict.{source_language} was translated to the target language with the Google Translate API. Note that translation was done one word at a time as not to provide context that may skew the translation. When processing the scores, if a the Google Translated word was not found, the score will be replaced with Nan.

Homogeneity Scores

The calculation for the homogeneity scores is contained in homogeneity.py. You will need to have downloaded the CNN matrices for both of the languages in any language pair you run, except for English, where you will only need to have downloaded one package for the non-English language. The result will be written to a TSV in the Score-Results folder. The paths for the language package folder and Score-Results folder must be defined in PATHS.py. For example, to get scores between Italian and German, you can execute the following command:

python3 homogeneity.py it de

Note that Italian to German vs. German to Italian, may yield different scores as it is not guaranteed the translation mappings work forward and backward.

If the file it_to_de_homogeneity_scores.tsv already exists, then the script will print that the file already exists and will stop execution; however, if it doesn't then the file will be created. To overwrite the file you can add y to the input arguments as so

python3 homogeneity.py it de y

Median Max Cosine Similarity

The calculation for median max cosine similarities can be found in med_max_cosine.py. As with the homogeneity scores, make sure to have downloaded the CNN matrices for the language and also have defined the proper paths in PATHS.py. An example execution would be

python3 med_max_cosine.py tr

Again you can choose to overwrite the file if it exists by adding y.

python3 med_max_cosine.py tr y

The result will be written to tr_med_max_cosine.tsv.

Available Scores and Dictionaries

The following languages have already been processed:

  • English
  • French
  • Arabic
  • Azerbaijani
  • Spanish
  • Indonesian
  • German
  • Turkish
  • Hindi
  • Italian
  • Vietnamese
  • Thai
  • Welsh

mmid-cnn-analysis's People

Contributors

nikzadkhani avatar

Watchers

 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.