-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate NCES in ontolearn-web service and fix dllearner binding script in examples #450
Conversation
…o ontolearn-webservice
@@ -1572,7 +1572,7 @@ def best_hypotheses(self, n=1) -> Union[OWLClassExpression, Iterable[OWLClassExp | |||
elif len(self.best_predictions) == 1 or n == 1: | |||
return self.best_predictions[0].concept | |||
else: | |||
return self.best_predictions[:n] | |||
return [best.concept for best in self.best_predictions[:n]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this converation ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, other concept learners, including Drill output a list of concepts, not nodes. This is why I am converting. Moreover, NCES uses its own node class for the moment. In the future, if necessary, we might investigate the use of OENode which is currently tailored towards search-based approaches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot return OENode. Since we learn OWL Class expressions, return results must fulfill Union[OWLClassExpression, Iterable[OWLClassExpression]]
.
Could you please ensure that no fixed paths are being used?
Ontolearn/ontolearn/scripts/run.py Line 195 in 49427ed
|
…ghts do not exist
Note:If I completely remove the possibility to download embeddings for NCES, the user will have to download them manually in case he does not have any emeddings and still needs to test NCES. As it currently is, the user can provide any embeddings and they will be used. But feel free to request that I remove any possibility to download data. |
Another NoteNCES is trained from scratch if the provided path for pretained models does not contain any files |
Can you please follow the enumeration ? and fix the each point individually.
What does this enumeration mean ? Can you please nextime explicitly state whether the required is done or not? This function is still in the script. This needs to be removed.
Please follow the same structure of preparting an owl reasoner as we have done for DRILL and TDL |
|
You are probably looking at an old commit. New link here: https://github.com/dice-group/Ontolearn/blob/nces_web_and_fix_dllearner_binder/ontolearn/scripts/run.py#L55 |
I replied for 1., 2., 3., 4. They have been resolved but with notes awaiting for your confirmation. I will write notes down here again.
owl_learner must follow the same interface. This has been fixed. No check whether it is an NCES instance. NCES takes PosNegLPStandard as the other learners now. Note 1:If I completely remove the possibility to download embeddings for NCES, the user will have to download them manually in case he does not have any emeddings and still needs to test NCES. As it currently is, the user can provide any embeddings and they will be used. But feel free to request that I remove any possibility to download data. Note 2:NCES is trained from scratch if the provided path for pretained models does not contain any files |
If they have been resolved, please push them. |
ontolearn/scripts/run.py
Outdated
num_predictions=64 | ||
) | ||
# (2) Either load the weights of NCES or train it. | ||
if data.get("path_to_pretrained_nces", None) and os.path.isdir(data["path_to_pretrained_nces"]) and glob.glob("*.pt"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not use glob.plot with ** * **. Input items must be fixed
@Jean-KOUAGOU if it makes the integration easier, we can ask a user to provide the paths of csv file containing embeddings and pretrained NCES weights. Without these two arguments at the start, NCES would return Top concept for any learning problem |
…rovided path does not contain any embeddings. ontolearn-webservice will now require path to existing embeddings for NCES to run
Hi. If a comma or import is missing, it must have been a typo. Please feel
free to add them.
…On Wed, Oct 23, 2024, 07:13 Luke Friedrichs ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In examples/dl_learner.py
<#450 (comment)>:
> @@ -36,9 +38,14 @@
p = examples['positive_examples']
n = examples['negative_examples']
- best_pred_celoe = celoe.fit(pos=p, neg=n, max_runtime=1).best_hypothesis()
+ positives = {OWLNamedIndividual(IRI.create(i)) for i in p}
+ negatives = {OWLNamedIndividual(IRI.create(i)) for i in n}
+
+ lp = PosNegLPStandard(pos=positives, neg=positives)
Import for this is missing
—
Reply to this email directly, view it on GitHub
<#450 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK4X4ETCP32LHK4MAXPQ3YTZ44V67AVCNFSM6AAAAABP7JIJI2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDGOBXGE3DKMJXHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This pull request addresses the issue#408: #408, and updates the dllearner binder script such that positive and negative examples initially given here: https://github.com/dice-group/Ontolearn/blob/develop/examples/dl_learner.py#L39 are first sent to the PosNegLPStandard class as required by the binder and most class expression learners, inc. Drill, EvoLearner, CELOE, CLIP, etc
Please review and merge