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

Ctakes ytex conceptgraph #13

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

jlpainter
Copy link

This patch makes the following code cleanup and mathematical corrections to the kernel metrics as well as the max-depth calculation for a concept graph:

Correct the construction of the initial concept graph whereby the dummy root node has a depth value of zero which was creating wildly unreasonable max-depths for individual graphs.

IntrinsicLCHMetric contained a mathematical error where the formula misinterpreted that it should be -1 times the log and instead had an implementation that was 1 minus the log. In addition, the way the concept graph is computed, there is a dummy root node created which inflated the depth of the nodes by (2) - this is now corrected and the output matches exactly to values computed by the Perl UMLS::Similarity LCH computation

LCHMetric contained a mathematical error where the formula misinterpreted that it should be -1 times the log and instead had an implementation that was 1 minus the log. The LCH metric also contained the same depth error as LCH intrinsic and this has been corrected.

JaccardMetric could have had a divide by zero if the ic1 + ic2 was equal to the lcsIC. Added a check to insure this does not happen.

The LinMetric code has been cleaned up to be more readable

Wu-Palmer Metric also suffered from a mis-calculation of node depth due to the dummy node. This code was also cleaned up to be more readable and to more accurately reflect the computations in the Perl UMLS::Similarity wup.pm module.

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.

None yet

1 participant