renamed the interface to UltraForKnowledgeGraphReasoning
Browse files- README.md +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
|
43 |
from ultra.datasets import CoDExSmall
|
44 |
from ultra.eval import test
|
45 |
-
model =
|
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
|
43 |
|
44 |
config_class = UltraConfig
|
45 |
|
@@ -59,7 +59,7 @@ class UltraLinkPrediction(PreTrainedModel):
|
|
59 |
|
60 |
if __name__ == "__main__":
|
61 |
|
62 |
-
model =
|
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
|