Coder Social home page Coder Social logo

objectpropertycommonsense's Introduction

Description

This project reproduces the results from the paper Extracting Commonsense Properties from Embeddings with Limited Human Guidance. The final summary of this project is summarized in this report.

Contents

  • data/: Contains data files
  • figs/: Contains output plots, also added in the report
  • output_dumps/: The results of all runs for reference

Code Walkthrough

Scripts

Main Script: script.py

Argument Description
--data data/ : The folder containng the data files
--test verb_physics_test_5 : Test Data File
--devtest : {"true", "false"}, Whether to evaluate on dev data or not
--dev : Dev Data File
--train verb_physics_train_5 : Training Data File
--embtype lstm : {word2vec, glove, lstm} 
--embeddingSize 1024 : Embedding size; give 1024 for lstm and 300 for other two
--test_relation all : {big, heavy, rigid, strong, fast, all} These are the options for verb physics
--zero False : {"true", "false"}, Whether you want zero shot learning on the given test_relation
--reverse true : {"true", "false"}, Whether you want to consider reverse tuples while evaluation
--poleSensitivity False : {"true", "false"}: If you want to test on poleWord1 and poleWord2.
--poleWord1 slow : Relation for R<
--poleWord2 speedy : Relation for R>
--onepole : {"true", "false"}: To use PCE(one-pole)
--four : {"true", "false"}: To use 4 way model

# To Run the script with default configuration
python script.py

# To Run one configuration of 3 way model(Example Configuration)
python script.py --train verb_physics_train_5 --dev verb_physics_dev_5 --test verb_physics_test_5 --devtest true --four false --reverse true --onepole false

# To Run one configuration of 4 way model(Example Configuration)
python script.py --train train_data --test test_data --devtest false --four true --reverse true --onepole false

Other Scripts:

datautil.py: Contains functions for creating dictionary, preprocessing and filtering data

models.py: Contains Emb_Similarity and Model(the main one)

train_evaluate.py: Train, Evaluate and active learning utilities(find_LC_query, find_EMC_query, find_uncertain_synthesis_query)

Embedding Similarity Baseline

python emb_similarity.py

Majority Baseline

python majority.py

Active Learning Experiments

Runs 4 active approaches(Random, LC, EMC and Synthesis Based) and Plots the training examples vs Accuracy Plot. For details, please refer the report. python active_learning.py

Score Analysis

Trains the model on verb physics dataset usign same parameters and calculates a proxy score of relatedness and plots the relative size and weights of some objects python score_analysis.py

Shell script that runs all configurations in Table1 10 times

sh run_table1.sh > table1_result sh run_table2.sh > table2_result sh run_table3.sh > table3_result

Shell scripts for statistics and plots

Python script uses the results from the table1_result, table1_result and table3_result files, calculates mean, std and plots and save figures in figs folder python stats_table1.py python stats_table2.py python stats_table3.py

Significance Test File

python mcnemar.py

objectpropertycommonsense's People

Contributors

dishajindal avatar

Watchers

James Cloos avatar  avatar paper2code - bot 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.