-
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
Running error #9
Comments
pymetamap currently does not support Windows because of my use of NamedTemporaryFile in the SubprocessBackend. It will work on Linux and Mac systems. |
Thank you for answering the question, I will use it in Linux systems. |
I have installed the pymetamap in Mac OS, when I run Could you help me please to solve this problem? |
Hi Civiano, When initializing the api: mm = MetaMap.get_instance('/opt/public_mm/bin/metamap12') For example, if you installed metamp 16 in your home directory, then you would use the following: mm = MetaMap.get_instance('/Users/changsu/public_mm/bin/metamap16') |
thanks, Could you help me please to solve this problem? Thanks! |
Hi Civiano, Can you give me all the code you are trying to run? Assuming the path is correct and everything is installed, then you should check that you started skrmedpostctl and wsdserverctl. |
thank you very much! |
I am also facing the same error after executing below line concepts,error = mm.extract_concepts(sents,[1,2]) concepts,error = mm.extract_concepts(sents,[1,2])Traceback (most recent call last): |
Hi Nishal, The issue you are having is different. Can you create a new issue specific to your problem? Anyways, did you install metamap? Also, do you have read permissions to use metamap assuming it is installed? |
yes , I have installed metamap. will try again and let you know |
I had tried again after reinstalling java in my Linux machine. I made sure that metamap is working correctly. Now it is working fine. Thanks |
@AnthonyMRios
I think in the README file under the Example Usage section, you should mention this in bold. Also I feel in the code its better to check if the MetaMap path is absolute or not.
If its not absolute, just exit with appropriate message. |
Hi @kaushikacharya, I'm sorry for the issues you had running the code. I agree with your suggestions. I'm currently working on other projects. I have noted the suggestion and I will try to add them sometime within the next couple weeks. |
Hi Anthony,
If you are ok then I can also make changes and create a pull request.
Regards,
Kaushik
…On Fri, Jul 20, 2018 at 8:18 PM, Anthony Rios ***@***.***> wrote:
Hi @kaushikacharya <https://github.com/kaushikacharya>, I'm sorry for the
issues you had running the code.
I agree with your suggestions. I'm currently working on other projects. I
have noted the suggestion and I will try to add them sometime within the
next couple weeks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEWfs_JFxUCpz2j3L7LtFmk_KfUsxnczks5uIe3FgaJpZM4MIno9>
.
|
Sure. That would be great. |
* 1. Mentioned in bold that Metamap binary path should be absolute. 2. spelling correction * asserting if Metamap binary path is not absolute. This handles issue #9 * Update MetaMap.py modify error message
how you fixed this problem ? |
Hi @kibamin, Do you have MetaMap installed on the Ubuntu machine? If not, you will need to get it from here: https://metamap.nlm.nih.gov/MetaMap.shtml |
Yes, i installed that on ubuntu and run WSD server and work with that without problem. File "pymetamap/SubprocessBackend.py", line 117, in extract_concepts how to fix this ? thank you |
Hi kibamin, from the looks of things, it looks like you are not pointing to the location where you installed everything. I will need to see more of your code and know the file path to help more. |
Hi Anthony thank you for everything. thank you |
@AnthonyMRios,
We should probably put a check for existence of MetaMap path just after
assigning self.metamap_filename
https://github.com/AnthonyMRios/pymetamap/blob/master/pymetamap/MetaMap.py#L30
something like this:
assert os.path.exists(mm.metamap_filename), "Incorrect MetaMap filename path"
Regards,
Kaushik
…On Mon, Apr 29, 2019 at 11:25 AM Amin Abbasi ***@***.***> wrote:
Hi kibamin,
from the looks of things, it looks like you are not pointing to the
location where you installed everything. I will need to see more of your
code and know the file path to help more.
Hi Anthony
thank you for everything.
I found my mistake, i made a mistake in pulbic_mm file path.
thank you
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABCZ7M4QU5ZH7WJMXTW2PY3PS2EUFANCNFSM4DBCPI6Q>
.
|
Yeah, I agree. That would help clear up many of the issues posted here. |
Hi, And the concepts are empty. |
@lediona https://metamap.nlm.nih.gov/Docs/README.html#Starting%20the%20MetaMap%20Servers |
@kaushikacharya thank you so much for your prompt reply. It is working like a charm now !!! |
Hi, I am using pymetamap but seems like its output is not that accurate: it does not make sense. I getting the same output from different sentences: preferred name: Iodides or Blood group antibody . In the sentence it is not mentioned any blood or antibody. |
@lediona Note the difference between your and mine input. Have a look at the function: More details are available here: Also note the trigger, pos_info fields in the output. (Read https://metamap.nlm.nih.gov/Docs/MMI_Output.pdf for detail). They show which part of the text is used to create the UMLS concept. |
TypeError Traceback (most recent call last) ~/pyte/pymetamap/SubprocessBackend.py in extract_concepts(self, sentences, ids, composite_phrase, filename, file_format, allow_acronym_variants, word_sense_disambiguation, allow_large_n, strict_model, relaxed_model, allow_overmatches, allow_concept_gaps, term_processing, no_derivational_variants, derivational_variants, ignore_word_order, unique_acronym_variants, prefer_multiple_concepts, ignore_stop_phrases, compute_all_mappings, mm_data_version, exclude_sources, restrict_to_sources, restrict_to_sts, exclude_sts) TypeError: can only concatenate str (not "bytes") to str I tried running the example and this is what I get |
@itSammycodethngy https://stackoverflow.com/questions/55033372/can-only-concatenate-str-not-bytes-to-str
whereas in python 2 it works smoothly: Solution: Edit: |
thanks
…On Fri, Dec 6, 2019 at 4:29 PM Kaushik Acharya ***@***.***> wrote:
@itSammycodethngy <https://github.com/itSammycodethngy>
Ii seems you are running in Python 3.
https://stackoverflow.com/questions/55033372/can-only-concatenate-str-not-bytes-to-str
chepner's answer explains the difference between Python 2 and Python 3:
Python 3 made the distinction between the two very clear and does not
allow you to combine them implicitly.
In python 3:
[image: image]
<https://user-images.githubusercontent.com/4562867/70307767-e7d13b00-182f-11ea-8c2b-803a1b15ad08.png>
whereas in python 2 it works smoothly:
[image: image]
<https://user-images.githubusercontent.com/4562867/70307844-0800fa00-1830-11ea-9d05-3aa1a995589c.png>
Solution:
https://github.com/AnthonyMRios/pymetamap/blob/master/pymetamap/SubprocessBackend.py#L151
Replace input_text = ""
by input_text = bytes()
Hopefully this change will work. In case you get similar error elsewhere,
try making similar changes.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9?email_source=notifications&email_token=AHDPLR72W724Q3HGMP573TTQXIEM5A5CNFSM4DBCPI62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGDMNKY#issuecomment-562480811>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHDPLR42YVKLG2NYFPD5URLQXIEM5ANCNFSM4DBCPI6Q>
.
|
I made a quick update. I believe it should be consistent now. |
will pull the latest then
…On Fri, Dec 6, 2019 at 10:28 PM Anthony Rios ***@***.***> wrote:
I made a quick update. I believe it should be consistent now.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9?email_source=notifications&email_token=AHDPLR4ZYHFPZG3Z6FUWZG3QXJOSDA5CNFSM4DBCPI62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGEHVCY#issuecomment-562592395>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHDPLRYGSM7RIGLJVBSDWK3QXJOSDANCNFSM4DBCPI6Q>
.
|
TypeError Traceback (most recent call last) ~/pyte/pymetamap/SubprocessBackend.py in extract_concepts(self, sentences, ids, composite_phrase, filename, file_format, allow_acronym_variants, word_sense_disambiguation, allow_large_n, strict_model, relaxed_model, allow_overmatches, allow_concept_gaps, term_processing, no_derivational_variants, derivational_variants, ignore_word_order, unique_acronym_variants, prefer_multiple_concepts, ignore_stop_phrases, compute_all_mappings, mm_data_version, exclude_sources, restrict_to_sources, restrict_to_sts, exclude_sts) TypeError: argument should be integer or bytes-like object, not 'str' |
…g of python 2 and python 3. Resolves issue AnthonyMRios#9 raised on 11th Dec 2019.
I ran your code on my Mac laptop and it worked perfectly. But I need to set the whole thing on my station with Windows 10 operating system too. I would really appreciate it if you provide us a setup code which works well on windows too. |
Though haven't tested on Windows, but I feel pymetamap should now run in Windows too if you have passed input parameter: "sentences" as its not using NamedTemporaryFile. If you are still facing any issue, we can discuss on the thread: #10 But first do check if you are able to run the commands as mentioned in https://metamap.nlm.nih.gov/Installation.shtml |
@AnthonyMRios the pymetamap wrapper works like a charm, much appreciated. I am using it to analyze large amounts of medical related data and have noticed that execution halts after 100 calls, I am unable to get passed article 99 in my dataset. Is there a way around this? |
I have metamap 2014 running on Windows, and I hit similar issues. I hit an update where the input and output files couldn't be opened for read/write. I made the following updates to resolve on my end:
|
I have already installed the metamap13 and when i run the example under windows 7, i get the following error:
I have also already import the pymetamp and replace the address in the metamap.get_instance method:
I just don't know what to do, please help me ^^
The text was updated successfully, but these errors were encountered: