Giter Site home page Giter Site logo

Conversion scripts not working about huner HOT 12 CLOSED

hu-ner avatar hu-ner commented on September 15, 2024
Conversion scripts not working

from huner.

Comments (12)

yetinam avatar yetinam commented on September 15, 2024

Hey @nakumgaurav,
thanks for reporting the issue. I tried reproducing the issue, but the command runs successfully on my machine. Can you give more detail on your version of python, pexpect, opennlp and java?
@leonweber : Could you check, if you can reproduce the issue on mac? It seems to be an encoding related bug. I'm genuinely suprised to see the Bell character \x07 here.

from huner.

leonweber avatar leonweber commented on September 15, 2024

@nakumgaurav I have just pushed a commit that should fix this issue: https://github.com/hu-ner/huner/tree/docker_for_ner_scripts . Conversion is handled by the docker container and not the system python on that branch. Could you please verify that this fixes your issue? Then, I'll merge it into master.

from huner.

nakumgaurav avatar nakumgaurav commented on September 15, 2024

Hi, the bc2gm conversion works but I am facing an error in Biosemantics:

Converting Biosemantics 0%| | 2/4693 [00:00<36:18, 2.15it/s] Traceback (most recent call last): File "scripts/biosemantics_to_conll.py", line 35, in <module> tmp_sentences = sentence_splitter.split(text) File "/usr/ner_scripts/scripts/opennlp_wrapper.py", line 65, in split result, err = p.communicate(text.encode('utf-8')) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 83: ordinal not in range(128) 0%| | 2/4693 [00:00<36:04, 2.17it/s] Traceback (most recent call last): File "scripts/biosemantics_to_conll.py", line 35, in <module> tmp_sentences = sentence_splitter.split(text) File "/usr/ner_scripts/scripts/opennlp_wrapper.py", line 65, in split result, err = p.communicate(text.encode('utf-8')) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 83: ordinal not in range(128)

Also to make Bioinfer work, I had to update the Dockerfile and add lxml since it resulted in the error "No module named lxml". See the new pull request

from huner.

nakumgaurav avatar nakumgaurav commented on September 15, 2024

Hi @leonweber, it seems lxml and tqdm are still missing from the Docker container. Could you please fix that?

Error on CDR data:
Traceback (most recent call last): File "scripts/cdr_to_conll.py", line 3, in <module> import extractors File "/usr/ner_scripts/scripts/extractors.py", line 2, in <module> from lxml import etree ImportError: No module named lxml
Additionally, I am not sure if we are running python3 in the image, since running the following command:
docker run -t -i huner/huner:dev /bin/bash -c "python --version"
yields
Python 2.7.17

EDIT: Yup, I think that's the issue. The use of python in convert_corpora.sh should be replaced by python3. I will run this on all datasets and let you know

from huner.

leonweber avatar leonweber commented on September 15, 2024

Hey @nakumgaurav. Could you please verify that you are on the latest commit of https://github.com/hu-ner/huner/tree/docker_for_ner_scripts? convert_corpora.sh should only use python3 now.

from huner.

nakumgaurav avatar nakumgaurav commented on September 15, 2024

Hi @leonweber , yes I can now see the latest commit has python3. I am able to convert almost all datasets (still running a few). Also, for LocText could you maybe specify the directory structure in the downloads file. I think it requires all json files in the data/LocText directory, since I am facing this error on running covert_corpora.sh:

Converting Loctext 0%| | 0/2 [00:00<?, ?it/s] Traceback (most recent call last): File "scripts/loctext_gene_to_conll.py", line 27, in <module> with open(os.path.join(args.input_dir, file), 'r') as f_in: IsADirectoryError: [Errno 21] Is a directory: 'data/LocText/ann.json' 0%| | 0/2 [00:00<?, ?it/s] Traceback (most recent call last): File "scripts/loctext_gene_to_conll.py", line 27, in <module> with open(os.path.join(args.input_dir, file), 'r') as f_in: IsADirectoryError: [Errno 21] Is a directory: 'data/LocText/ann.json'

Thanks a lot for your constant help!

from huner.

leonweber avatar leonweber commented on September 15, 2024

Hi @nakumgaurav . I will check this on Monday, thanks for reporting!

from huner.

leonweber avatar leonweber commented on September 15, 2024

@nakumgaurav LocText can now be downloaded automatically again. Does that resolve the issue for you? And did you convert the other corpora successfully?

from huner.

nakumgaurav avatar nakumgaurav commented on September 15, 2024

Hi @leonweber, thanks a lot for fixing LocText. I am still having an issue with Variome disease conversion:

Disease 30%|████████████████████████████████████████████████▊ | 116/392 [00:54<02:20, 1.97it/s]Traceback (most recent call last): File "scripts/variome_to_conll.py", line 20, in <module> sentences, entities, document_ids = extractors.extract_from_biocreative(f_in, types, split_sentences=True) File "/usr/ner_scripts/scripts/extractors.py", line 69, in extract_from_biocreative assert annotated_entity == true_entity AssertionError 30%|████████████████████████████████████████████████▊ | 116/392 [00:54<02:10, 2.11it/s]

I have been able to convert all other datasets

from huner.

yetinam avatar yetinam commented on September 15, 2024

Hey @nakumgaurav ,
thanks for reporting. We didn't get to reproduce and debug the issue yet, but will look at it in the next days.

from huner.

yetinam avatar yetinam commented on September 15, 2024

Hey @nakumgaurav ,
the issue should be fixed in 850da3b. It resulted from incorrect annotations in Variome, annotating a lowercase "cancer" as the entity, while having an uppercase "Cancer" in the text.
Could you please verify this solves the issue? I'll merge the branches afterwards.

from huner.

nakumgaurav avatar nakumgaurav commented on September 15, 2024

Wonderful! I am now able to convert Variome disease. Many thanks for your constant help!

from huner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.