lividwo / perturbed-masking Goto Github PK
View Code? Open in Web Editor NEWCode for ACL 2020 paper "Perturbed Masking: Parameter-free Probing for Analyzing and Interpreting BERT"
License: MIT License
Code for ACL 2020 paper "Perturbed Masking: Parameter-free Probing for Analyzing and Interpreting BERT"
License: MIT License
Thanks for the code publishing. Here comes a issue when I am trying to repro the ABSC part in paper.
For the ABSC part, the paper use PWCN model and compare the induced tree with the left/right chain additionally. And the left/right get different performance results. However, based on the data pre-processing in PWCN, the left and the right chain should be same. So I am wondering why they two have different output results? or there is some trick missing in the paper?
Expect the reply for this issue, really Thanks.
This error occurs for constituency probe:
parsing.py: error: argument --decoder: invalid choice: 'mart' (choose from 'eisner', 'cle', 'right_chain', 'top_down', 'right_branching', 'left_branching')
after running:
python parsing.py --probe constituency \
--matrix [the generated impact matrix file] \
--decoder mart
Thank you for your interesting and impressive work on interpreting BERT in unsupervised linguistic tasks. I have a small question about Figure 1 in the paper, just as below:
What is the meaning of each cell, does it mean the distance or the impact? I understand it should be impact since the following sections address that the higher impact represents the closer correlation. However, the right-side color bar ranging from 0 to 5 makes me very confused. So, I'm wondering how to compute the cell using Dist or Prob?
Looking forward to your response, thanks :)
Hi, @LividWo , thanks for your great work.
I visualized some samples' impact matrix on PUD and found that usually, the "CLS" row has very high values. Any ideas about this phenomenon? Thanks again!
Reading the paper (section 2.2), I see the two difference functions
However, looking at the code, I see the options for the --metric
flag are
dist
(which subtracts and takes norm to get Euclidean distance), Perturbed-Masking/dependency/get_matrix_for_dep_probe.py
Lines 78 to 79 in f578592
cos
(which gets cosine similarity) Perturbed-Masking/dependency/get_matrix_for_dep_probe.py
Lines 80 to 82 in f578592
Is the metric cos
the "Prob" of the paper?
Thanks for publishing your code.
I am trying to reproduce the results of the ABSC tasks. I used bert-base-uncased to generate the distance of Laptops, but got different distances from your Laptops_Test_Gold.xlm.seg.dist. Since the distance generation does not include random factors (BERT in evaluation mode should always give the same prediction), could you help to achieve the distance as you got in the ABSC folder ? Which layer was you using and metric, etc. ?
when calculating the impact of x_i+1 to x_i, is there a must to mask x_i? I have done a test on sentence segment without masking x_i , and it achieved a comparatively better result with less matrix calculation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.