mgalkin commited on
Commit
c04ccc0
1 Parent(s): b65f0ec

renamed the interface to UltraForKnowledgeGraphReasoning

Browse files
Files changed (2) hide show
  1. README.md +2 -2
  2. modeling.py +2 -2
README.md CHANGED
@@ -39,10 +39,10 @@ ULTRA performs **link prediction** (KG completion): given a query `(head, relati
39
  * Run **zero-shot inference** on any graph:
40
 
41
  ```python
42
- from modeling import UltraLinkPrediction
43
  from ultra.datasets import CoDExSmall
44
  from ultra.eval import test
45
- model = UltraLinkPrediction.from_pretrained("mgalkin/ultra_3g")
46
  dataset = CoDExSmall(root="./datasets/")
47
  test(model, mode="test", dataset=dataset, gpus=None)
48
  # Expected results for ULTRA 50g
 
39
  * Run **zero-shot inference** on any graph:
40
 
41
  ```python
42
+ from modeling import UltraForKnowledgeGraphReasoning
43
  from ultra.datasets import CoDExSmall
44
  from ultra.eval import test
45
+ model = UltraForKnowledgeGraphReasoning.from_pretrained("mgalkin/ultra_50g")
46
  dataset = CoDExSmall(root="./datasets/")
47
  test(model, mode="test", dataset=dataset, gpus=None)
48
  # Expected results for ULTRA 50g
modeling.py CHANGED
@@ -39,7 +39,7 @@ class UltraConfig(PretrainedConfig):
39
 
40
  super().__init__(**kwargs)
41
 
42
- class UltraLinkPrediction(PreTrainedModel):
43
 
44
  config_class = UltraConfig
45
 
@@ -59,7 +59,7 @@ class UltraLinkPrediction(PreTrainedModel):
59
 
60
  if __name__ == "__main__":
61
 
62
- model = UltraLinkPrediction.from_pretrained("mgalkin/ultra_50g")
63
  dataset = CoDExSmall(root="./datasets/")
64
  test(model, mode="test", dataset=dataset, gpus=None)
65
  # mrr: 0.497697
 
39
 
40
  super().__init__(**kwargs)
41
 
42
+ class UltraForKnowledgeGraphReasoning(PreTrainedModel):
43
 
44
  config_class = UltraConfig
45
 
 
59
 
60
  if __name__ == "__main__":
61
 
62
+ model = UltraForKnowledgeGraphReasoning.from_pretrained("mgalkin/ultra_50g")
63
  dataset = CoDExSmall(root="./datasets/")
64
  test(model, mode="test", dataset=dataset, gpus=None)
65
  # mrr: 0.497697