neph0s / lmke Goto Github PK
View Code? Open in Web Editor NEWCode for the paper 'Language Models as Knowledge Embeddings'
Code for the paper 'Language Models as Knowledge Embeddings'
In Dataloader.py , it means h/r/t is encoded by [CLS] token, but same token equals same representation, so i'm so confuse about it.
I actually don't quite understand your way of triplet encoding. Comparing with recent work of SimKGC, it seems there is no need to have Mask_T masked since there is already a KeyEncoder in right side of Figure3.
Could you kindly share your code for testing a trained model?
你好,我想问一下在一个新数据集上为什么预测头得分很低而预测尾效果很好呢?
MR 22515.76220 MRR 0.00831 hits 1 0.00180 3 0.00520 10 0.01660, Setting: raw Target: head
MR 21534.04280 MRR 0.01027 hits 1 0.00220 3 0.00700 10 0.02340, Setting: filter Target: head
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5000/5000 [01:58<00:00, 42.20it/s]
MR 146.70980 MRR 0.75092 hits 1 0.64540 3 0.83660 10 0.93000, Setting: raw Target: tail
MR 146.70980 MRR 0.75092 hits 1 0.64540 3 0.83660 10 0.93000, Setting: filter Target: tail
Hi, thanks for your great work. I want to know how many epochs you need to get the reported results of fb1k5237 and wn18nn on your paper?
As you mentioned that training on a single 3090 GPU takes 2-3 days, it seems unlikely that the default 500 epochs in the main.py file are necessary. Perhaps the number of epochs could be reduced to improve training time without sacrificing the model's performance.
From the code below, when matching, the degree of the matching entity should be entered, but the predicted entity degree is entered.
sim[it] = self.sim_classifier(torch.cat([target_pred, target_encoded, target_pred - target_encoded, target_pred * target_encoded, deg_feature], dim=-1)).T
print(deg_feature)
tensor([[3.2581, 4.0943],
[3.2581, 4.0943],
[3.2581, 4.0943],
...,
[3.2581, 4.0943],
[3.2581, 4.0943],
[3.2581, 4.0943]], device='cuda:1')
I don't know if my understanding is correct, please correct me, thank you.
Hello. I have questions about what are the GPUs used for training in your experiment? And how long did you train the model for WN18RR and FB15K237? Can you give me the answer? Because I want to follow your work but don't know whether my resource can support me or not.
I ran the program on the V100 using the script below, but it takes 42 minutes to run one epoch, I want to ask how long it took you to run the model?
python main.py --batch_size 16 --plm bert --contrastive --self_adversarial --data wn18rr --task LP
Hi. I'm trying to reproduce your result for BERT base in the paper. The training takes so long that I cannot spend that much time on grid searching the hyper-parameters. Could you provide the best hyper-parameters (model_lr, bert_lr, epoch) for link prediction on WN18RR and FB15k-237? Thanks!
Traceback (most recent call last):
File "/root/LMKE-main/main.py", line 213, in
trainer.run()
File "/root/LMKE-main/trainer.py", line 96, in run
self.train()
File "/root/LMKE-main/trainer.py", line 396, in train
self.triple_classification(epc)
File "/root/LMKE-main/trainer.py", line 449, in triple_classification
preds = model(inputs, positions, mode, triple_degrees)
File "/opt/conda/envs/pytorch1.8/lib/python3.9/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
TypeError: forward() takes 4 positional arguments but 5 were given
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.