Skip to content
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

subconcepts is now recursive #482

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

LckyLke
Copy link
Collaborator

@LckyLke LckyLke commented Nov 8, 2024

subconcepts is now recursive to retrieve subconcepts from the whole class hierarchy

@LckyLke LckyLke requested a review from Demirrr November 8, 2024 11:30
@github-actions github-actions bot temporarily deployed to pull request November 8, 2024 11:36 Inactive
@LckyLke
Copy link
Collaborator Author

LckyLke commented Nov 8, 2024

test_example_concept_learning_neural_evaluation.py seems to have problems with the way we compute the subconcepts.
retrieval_eval.py works perfectly.
I noticed that test_example_concept_learning_neural_evaluation.py give an individual as a class:
Subconcept: OWLClass(IRI('http://www.benchmark.org/family#', 'F10M173'))

@Demirrr
Copy link
Member

Demirrr commented Nov 8, 2024

This can happen because a neural network assigns scores to all possible entities e.i. every subject or object found in a triple

@LckyLke
Copy link
Collaborator Author

LckyLke commented Nov 8, 2024

should we check than if the current subconcept is in the classes in signature?

@LckyLke
Copy link
Collaborator Author

LckyLke commented Nov 8, 2024

should we check than if the current subconcept is in the classes in signature?

that seems to fix the issue

i.e.

    def subconcepts(self, named_concept: OWLClass) -> List[OWLClass]:
        all_subconcepts = []
        for subconcept in self.direct_subconcepts(named_concept):
            if subconcept not in self.classes_in_signature():
                return []
            all_subconcepts.append(subconcept)
            all_subconcepts.extend(self.subconcepts(subconcept))
        return all_subconcepts

@Demirrr
Copy link
Member

Demirrr commented Nov 8, 2024

Yes we can do it. Yet, this checking would increase the runtimes. Therefore, please add comments in the code indicating the importance of such checking

@LckyLke
Copy link
Collaborator Author

LckyLke commented Nov 8, 2024

Yes we can do it. Yet, this checking would increase the runtimes. Therefore, please add comments in the code indicating the importance of such checking

now it would be better to have the classes in signature as a set for avg. O(1) runtime for this check 🤔

@github-actions github-actions bot temporarily deployed to pull request November 8, 2024 12:51 Inactive
@Demirrr
Copy link
Member

Demirrr commented Nov 8, 2024

Absolutely. This should be a to-do for the next next release:)

@LckyLke
Copy link
Collaborator Author

LckyLke commented Nov 8, 2024

somehow this failed again but locally it did not :/

@Demirrr
Copy link
Member

Demirrr commented Nov 8, 2024

Please disable all_subconcepts for the time being. If the disabling doesn't solve it, I will take a look at it.

@LckyLke
Copy link
Collaborator Author

LckyLke commented Nov 8, 2024

Please disable all_subconcepts for the time being. If the disabling doesn't solve it, I will take a look at it.

I re-ran the checks and weirdly now everything passed

locally i ran pytest like 20 times and never had a fail

@Demirrr Demirrr merged commit 9c75a07 into develop Nov 8, 2024
4 checks passed
@github-actions github-actions bot temporarily deployed to pull request November 8, 2024 13:40 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants