Coder Social home page Coder Social logo

pytorch_graph-rel's Introduction

Tsu-Jui (Ray) Fu

I am a research scientist at Apple AI/ML. My research lies in vision+language and text-guided visual editing. I obtained my Ph.D. in computer science from UC Santa Barbara, advised by William Yang Wang. I am also interested in video summarization and information extraction. My goal is to bridge the gap between multiple modalities via the AI system.

pytorch_graph-rel's People

Contributors

tsujuifu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pytorch_graph-rel's Issues

about some details

Hi,
How can I express it by ans_rel / wgt_rel for the case of entity pairs overlapping?

code

可以提供这篇论文的源代码吗,多谢了

Dataset format

Hello, I want to reproduce the code but I encounter a problem. What's the meaning of the parameter idx, inp, pos, etc. in the following code

for idx, inp, pos, dep_fw, dep_bw, ans_ne, wgt_ne, ans_rel, wgt_rel in ld_ts:
print(idx.shape)
print(inp.shape, pos.shape, dep_fw.shape, dep_bw.shape)
print(ans_ne.shape, wgt_ne.shape)
print(ans_rel.shape, wgt_rel.shape)

i reproduced the data preprocessing

I reproduced the data preprocessing, but the loss cannot be reduced, and the model could only predict "O" about entities and "No relation" about relations. The preprocessing and framework of the model have been written, and the forward propagation of the model used the source code in ipynb given by Fu. Welcome to my repository to discuss with me.
https://github.com/ShayneCheng/GraphRel

数据集下载

你好呀,我是关系抽取领域的新人,请问数据集NYT和WebNLG有相应的下载链接咩~谢谢

pkl dataset

Can you provide the dataset from json format to pkl? I couldn't find the relevant codes.
Thanks a lot!

pretrain process

Hi, guys. Can anyone process the dataset from json format to pkl? I couldn't find the relevant codes.

data processing

Thank you very much for publishing the paper code. Can you update the code of the data processing module?

Original Dataset

Hello! Can you share nyt and webnlg original dataset containing train, dev, test ? Thanks a lot !

about dataset

hello!
I'm reproducing your code but I cannot get the loss convergence. I'm wondering if the dataset was preprocess in a wrong way. So I want to know the format of "pre_train.pkl".

[2021/12/20 Update] Reimplementation by Author

[2021/12/20 Update]
Thanks to everyone's interest in this project and sorry for missing the original preprocessed data.
It got lost in my previous lab, and I finally had time to reimplement it 😂.
I also want to appreciate @LuoXukun for his nice reply about reproducing.

NYT Precision Recall F1
GraphRel1p (Paper) 62.9 57.3 60.0
GraphRel1p (Reimplementation) 60.9 59.2 60.1
GraphRel2p (Paper) 63.9 60.0 61.9
GraphRel2p (Reimplementation) 63.1 60.2 61.6

There is a small BUG in the construction of the dep_bw(backward dependency parse tree)

dep_fw[i], dep_bw[i] = dep_fw[i]/sum(dep_fw[i]), dep_bw[i]/sum(dep_bw[i])

The above regularization method does not regularize dep_bw on a per line basis, I think it would make more sense to change it to the following:

        for i, w in enumerate(res):
            inp_sent[i], inp_pos[i] = w.vector, self.POS[w.tag_]
            
            dep_fw[i][i], dep_bw[i][i] = 1, 1
            for c in res[i].children:
                for j, t in enumerate(res):
                    if c==t:
                        dep_fw[i][j], dep_bw[j][i] = 1, 1
            # dep_fw[i], dep_bw[i] = dep_fw[i]/sum(dep_fw[i]), dep_bw[i]/sum(dep_bw[i])
        dep_fw[:i+1] = dep_fw[:i+1] / dep_fw[:i+1].sum(axis=-1, keepdims=True)
        dep_bw[:i+1] = dep_bw[:i+1] / dep_bw[:i+1].sum(axis=-1, keepdims=True)

entity pair overlapping

How do you deal with the entity pair overlapping cases when using 'softmax' in your model ?

Equations and Code Matching Issue

Hi,

First, i cannot figure out what is the real meaning of h_w1 and h_w2 in the paper. author never gives a description of them based on the below equation.
image

then, I start to search them in code, and I find they are totally same. please correct me if I'm wrong. the calculation of S(w1, r, w2) uses the below code.

image

however, both trs0_rel and trs1_rel are linear functions with same dimension. same input are passed to them and i think the output should be also same.

self.trs0_rel = nn.Linear(self.hid_size2, self.hid_size)
self.trs1_rel = nn.Linear(self.hid_size
2, self.hid_size)

so my question is, if one linear function is enough, why two are listed with different notations?

any explanations are greatly appreciated. thank you

code details

I didn't get the data in pkl format, so I want to ask some details in the code:
1.dataloader:
for idx, inp, pos, dep_fw, dep_bw, ans_ne, wgt_ne, ans_rel, wgt_rel in ld_ts
what are the meanings of these variables?
2. pos is or not pre-characterized to the sentence.Is this part of speech tagging?
3. The adjacency matrix in the GCN should obtain the dependency of the related words. Is this the syntax dependency obtained by using the spacy?

code

可以提供这篇论文的源代码吗,多谢了

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.