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

issue calling radtext.Pipeline() #3

Open
zakaria47fs opened this issue Oct 13, 2022 · 1 comment
Open

issue calling radtext.Pipeline() #3

zakaria47fs opened this issue Oct 13, 2022 · 1 comment

Comments

@zakaria47fs
Copy link

zakaria47fs commented Oct 13, 2022

I am using last commit on master branch,
calling the pipeline from radtext with this code,
import radtext
nlp = radtext.Pipeline()

falling to the following error:

loading model /Users/zakaria/.radtext/bllipparser/BLLIP-GENIA-PubMed ...
Traceback (most recent call last):
File "test.py", line 5, in
nlp = radtext.Pipeline()
File "../radtext/src/radtext/models/pipeline.py", line 98, in init
regex_actor.load_yml2(argv['--regex_patterns'])
File "../radtext/src/radtext/models/neg/match_regex.py", line 70, in load_yml2
for obj in objs['negation']:
KeyError: 'negation'

@Marshall-mk
Copy link

I am using last commit on master branch, calling the pipeline from radtext with this code, import radtext nlp = radtext.Pipeline()

falling to the following error:

loading model /Users/zakaria/.radtext/bllipparser/BLLIP-GENIA-PubMed ... Traceback (most recent call last): File "test.py", line 5, in nlp = radtext.Pipeline() File "../radtext/src/radtext/models/pipeline.py", line 98, in init regex_actor.load_yml2(argv['--regex_patterns']) File "../radtext/src/radtext/models/neg/match_regex.py", line 70, in load_yml2 for obj in objs['negation']: KeyError: 'negation'

I had a similar issue when I first installed the package. I then looked closely into the regex_pattern.yml file that --regex_patterns points to which is located inside $Home/.radtext/resources/patterns and discovered that it wasn't containing the correct text. It was in fact containing an error 404 code.

Here is what I did to solve the problem:

  1. I cloned the repository in to my downloads folder and navigated in to C:\Users\HI\Downloads\radtext\resources\patterns.
  2. I then copied two files regex_pattern.yml and ngrex_pattern.yml from 1 into $Home/.radtext/resources/patterns . It asked me to replace the existing ones which I did, and that resolved the issue.

NB: I use wsl on my pc so the location of $Home/.radtext/resources/patterns might be different from yours. However, you should just try to locate the directory where --regex_patterns points to and make the changes.

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

No branches or pull requests

2 participants