Git Product home page Git Product logo

one-shot-relational-learning's Introduction

Hi there 👋

I am a research scientist at Facebook AI. I work on Natural Language Processing and Deep Learning for most of the time.

xwhan's github stats

one-shot-relational-learning's People

Contributors

xwhan 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

one-shot-relational-learning's Issues

Incorrect relations in the training set

Hello,

I am currently trying to reuse your dataset, and I am currently finding a few relations in the training set that appear strange.

For the NELL dataset, the following relations exists in the train_tasks.json

"concept:stateorprovince:new_york", "concept:stateorprovinceoforganizationheadquarters", "concept:sportsteam:oakland_raiders"
"concept:stateorprovince:new_york", "concept:stateorprovinceoforganizationheadquarters", "concept:sportsteam:white_sox"
"concept:stateorprovince:new_york", "concept:stateorprovinceoforganizationheadquarters", "concept:sportsteam:pittsburgh_penguins"
"concept:stateorprovince:new_york", "concept:stateorprovinceoforganizationheadquarters", "concept:continent:africa"
"concept:stateorprovince:new_york", "concept:stateorprovinceoforganizationheadquarters", "concept:sportsteam:red_bulls"

If I understand how the datasets are structured, the train_tasks.json-file is supposed to consist of relations that are correct. In other words, the White Sox (situated in Chicago) should not be said to have its headquarters New York, as an example. Or does the train_tasks.json also consist of wrong relations? Please excuse me if I have misunderstood things.

Thank you!

what is the“our model handles each example individually and ignores their interactions”in the paper

As a student who is new to the field of knowledge graph completion, I found your paper "one-shot relation learning" to be incredibly helpful. However, there are certain aspects of the paper that I am having trouble comprehending. I was hoping you could answer some questions for me.

In your paper, you mentioned, "our model handles each example individually and ignores their interactions" means,what is the interactions and why it is necessary to model these interactions?Could you provide a simple example to help me understand this concept better?

Thank you for taking the time to read my message. I appreciate any insights you can provide and look forward to hearing back from you.

About dataset download

Hi,
The posted links of dataset and pre-trained embeddings seems to be unconnected.
May I ask that it is the server's problem?
Or it is my networks issue?

Thanks~

How is file rel2candidates.json created

For function of wiki_candidate() in data.py, rel2candidates.json is created by a file named 'instance_of' which was read to find some entities, but I was wondering how does the file 'instance_of' come?
Thanks!

About experiment's result higher than that in paper

Hi Wenhan,
I ran this code, and used the default hyper-parameter. Then I found that the results on my machine is much higher than the results you reported in the paper. Is it correct or I made something wrong?
I would appreciate it if you could answer my confusion.

Here's the setting and my results.

COMMENDS:
train:
CUDA_VISIBLE_DEVICES=0 python trainer.py --max_neighbor 50 --fine_tune --random_embed --prefix totally
test:
CUDA_VISIBLE_DEVICES=0 python trainer.py --max_neighbor 50 --fine_tune --random_embed --prefix totally_bestHits10 --test

RESULTS:
DEV: experiments/paper
2019-11-07 20:41:03 CRITICAL: - HITS10: 0.295/0.211
2019-11-07 20:41:03 CRITICAL: - HITS5: 0.224/0.135
2019-11-07 20:41:03 CRITICAL: - HITS1: 0.078/0.024
2019-11-07 20:41:03 CRITICAL: - MAP: 0.149/0.083
TEST: experiments/paper
2019-11-07 20:44:58 CRITICAL: - HITS10: 0.269/0.252
2019-11-07 20:44:58 CRITICAL: - HITS5: 0.210/0.186
2019-11-07 20:44:58 CRITICAL: - HITS1: 0.104/0.103
2019-11-07 20:44:58 CRITICAL: - MAP: 0.158/0.151

Dataset unavailable

Great Work!
The links of datasets Wiki-One and NELL-One are 403 forbidden. I can't download the datasets. Thanks for your great help!

Low performance when testing with saved models

Hello,

I noticed that when I ran the code in the test mode, I get almost zero performance, as if the model is not trained at all, but I was getting high scores when I ran the code end to end.

I did a little bit of debugging and found out that when you run in test mode, you make "symbol2id" from the scratch which is different with the symbol2id used during the training. "symbol2id" is then used in the build_connection function, resulting in wrong meta information.

I added the following line to the end of the load_embed() function to save symbol2id during the training:
with open(self.dataset + '/symbol2ids', 'w') as fp:
json.dump(symbol_id, fp)

and changed the load_symbol2id functions:
def load_symbol2id(self):
symbol_id = json.load(open(self.dataset + '/symbol2ids'))
self.symbol2id = symbol_id
self.symbol2vec = None

This solved the problem for me.

Finding Wikipedia entities

Hi, I am trying to link the pretraining entity embeddings to their corresponding Wikipedia entities. However, in the Wiki.tar.gz file, the ent2ids file only includes entity names such as "Q15140126". How do I map these names to their actual entity in Wikipedia?

the method of limiting the candidate entities

Hello, Wenhan

Can you help me understand the method of limiting the candidate entities, in "One-Shot Relational Learning for Knowledge Graphs". Many people cited your paper, but they have not given a specific parameters.

How did you make specific restrictions in your experiment? Can you show your code for generating the candidate set?

Looking forward to your reply!

Figure1

How to draw figure 1. how to count relation frequency. Which dataset did you use?

Missing file

Hi Wenhan,

When I tried running NELL dataset with random initialized embeddings command, I got following error:
/ OSError: NELL/entity2vec.ComplEx not found.

I also found the same error when I use With pretrained embeddings command.

Could you provide this entity2vec.ComplEx file? Since I can not find it in this link http://nlp.cs.ucsb.edu/data/nell.tar.gz

Thank you very much,
Kem

why do you use k steps of LSTM processor?

Hi wenhan,

Thanks for your great work. I am a little confused and wondering why you use K processing steps of the same query and support entity pair? It seems that they are not sequential data.

Thank you!
Yan

About dataset

Hi wenhan,

I'm reading your program. But I have a question about your dataset. May I ask you what role does file e1rel_e2 play? It seems that there are not 67 relationships in it, and the total number of triples is less than the sum of the other three files, train, Dev and test. I want to know if the e1rel_e2 is related to the other three files, and if not, how they are generated.

Appreciate for your response.
Thanks

The problem of datasets

Hi, Wenhan:
Why the number of relations contained in Nell dataset (582) is not consistent with the number paper reported (358)?

About QueryEncoder.forward()

HI @xwhan ,
I'm reading your program.But I have a question about it.I don't understand that why QueryEncoder.forward() has two step of torch.matmul(),so I want to post a question to you.
Appreciate for your response.
Thanks

entity candidate of Wiki data

Hi Wenhan,

May I ask how do you generate entity candidate of Wiki data?
Where is the instance_of file in data?
Thanks.

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.