-
Notifications
You must be signed in to change notification settings - Fork 62
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
position returned by pymetamap #47
Comments
Hi ShoRit, Can you provide some examples? This is going to be an issue with MetaMap, not with the wrapper. But, if you share an example, I can look into it. |
Metamap positions are not 0-indexed, that must be why it appears off |
@ShoRit @yuliaoh
Here's the output using MetaMap 2020 release version:
Another example: As you can see, its 0-indexed. I have passed the same input arguments as used by pymetamap. Then why does pymetamap output is 1-indexed?Its the way pymetamap passes input text which is the reason it appears to be 1-indexed.
Looking into the code why it appears to become 1-indexed in pymetamap's output: https://github.com/AnthonyMRios/pymetamap/blob/master/pymetamap/SubprocessBackend.py#L174
Have a look at the difference between the two strings:
This has been nicely explained by mgilson in https://stackoverflow.com/a/38418132/282155 using example as well as the python documentation. |
Nice catch @kaushikacharya. I will look into creating a fix for this, it seems reasonably easy. |
Hi Anthony,
Firstly, thank you for the wonderful implementation of metamap.
However, I was running into some issues while extracting the keywords using pymetamap.
For example, in the sentence itself "John had a huge heart-attack", could you please direct me to how to extract the exact position of the keyword identified by pymetamap. It shows position = 17:12, but in several cases, I see the exact character position is off by 1-2 characters.
Could you provide some insight into this?
The text was updated successfully, but these errors were encountered: