Comments (23)
Yes, there's a dilemma here. Maybe we should simply use Label
because` that's the way it's displayed on the website as well?
Or do something like NLMCategory - Label:
and reduce it to just one of them in case of repetitions like OBJECTIVE - OBJECTIVE:
What do you think?
from pubmed_parser.
The check for UNASSIGNED is still failing. Replacing 'is not' by != fixes it. Also, we want to remove the content under UNASSIGNED section right? In which case, we may want to put abstract_list.append(stringify_children(abstract).strip())
inside the if condition.
No problem! Thanks for being so prompt on this. Let me know if I can contribute in any other way.
from pubmed_parser.
Okay, that works too :)
from pubmed_parser.
Thanks for reporting @RudrakshTuwani! Is there anyway that you can upload XML somewhere so that I can try to fix the parser?
from pubmed_parser.
See the updated description.
from pubmed_parser.
That's perfect. I'll fix that by the weekend. Bug me if I forget tho!
from pubmed_parser.
No problem, thanks a lot!
Do you think this is the case for all structured abstracts or it's specific to a few?
from pubmed_parser.
There are a lot of abstract like this. I haven't calculated the exact number. I guess it should be roughly a million from full Medline dataset.
from pubmed_parser.
Okay, thanks!
from pubmed_parser.
I seem to have found the bug.
if article.find('Abstract/AbstractText') is not None:
abstract = stringify_children(article.find('Abstract/AbstractText')).strip() or ''
elif article.find('Abstract') is not None:
abstract = stringify_children(article.find('Abstract')).strip() or ''
else:
abstract = ''
So, the first if block matches the first tag under structured abstract and returns it. This can be solved by removing the condition for matching "AbstractText". Can you tell me why we are even matching AbstractText? Since, just matching on Abstract also returns all the relevant information.
from pubmed_parser.
Yes @RudrakshTuwani, you're right. I'm fixing that part now.
from pubmed_parser.
I fix it in commit b59e150, let me know if it works for you!
from pubmed_parser.
Yes, this seems to be working. Thanks a lot!
One suggestion for future, maybe we can add the corresponding field for the structured abstract in the beginning of the sentence. If you want, I can work on it and send a PR later.
from pubmed_parser.
Haha, you read my mind! I did that add just push it, see commit 34dae58
from pubmed_parser.
Haha, yes this seems to be working perfectly! Thanks a lot, man!
from pubmed_parser.
@RudrakshTuwani, sorry, I still see the problem in my parser atftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/medline17n0843.xml.gz
. I'll fix it and close the issue soon.
from pubmed_parser.
Oh, can you send me the PMID? I'll have a look as well.
from pubmed_parser.
This is 26368793
, so now I parsed at got multiple METHODS
section as
OBJECTIVE
To examine interleukin-12 (IL-12), IL-18, IFN-γ, intracellular adhesion molecule-1 (ICAM-1), leukemia inhibitory factor (LIF), and migration inhibitory factor (MIF) levels in precisely-timed blood and endometrial tissue samples from women with idiopathic recurrent pregnancy loss (RPL).
METHODS
Case-control study.
METHODS
University hospital.
It should be a better way to concatenate all the same section in one long string.
from pubmed_parser.
We are actually doing it correctly, you can see at: https://www.ncbi.nlm.nih.gov/pubmed/?term=26368793. However, I chose to get abstract.attrib.get('NlmCategory', '')
instead of says Label="BACKGROUND"
. Still thinking what is the best way to do that. Label
will be good for someone who wants to display the abstract. However, NlmCategory
is also good if you want to make each sections consistent.
from pubmed_parser.
So I fixed it in f3fe97f as
dicts_out = pp.parse_medline_xml('data/medline16n0902.xml.gz', year_info_only=False, nlm_category=False)
If you set nlm_category=True
, it will give result using NLM category instead.
from pubmed_parser.
Okay, I fixed it in a slightly different way. The output I get is the following:
OBJECTIVE: Unusual presentation of unknown etiology, Rare disease, Mistake in diagnosis.
BACKGROUND: Müllerian anomalies encompass a wide variety of malformations in the female
genital tract, usually associated with renal and anorectal malformations. Of these anomalies,
approximately 11% are uterus didelphys, which occurs when midline fusion of the müllerian ducts is
arrested to a variable extent.
METHODS "CASE REPORT": We report the case of a 16-year-old female with uterine didelphys,
jejunal malrotation, hematometra, hematosalpinx, and bilateral subcentimeter homogenous circular
cystic-like renal lesions, who initially presented with left lower quadrant abdominal pain, non-bloody
vomiting, and a history of irregular menstrual periods. Initial CT was confusing for an adnexal cystic
mass, but further imaging disclosed the above müllerian anomalies.
CONCLUSIONS: Müllerian anomalies may mimic other, more common, adnexal lesions; thus,
adequate evaluation of suspicious cystic adnexal masses with multiple and advanced imaging
modalities such as MRI is essential for adequate diagnosis and management.
Label if not equal to NLM category are added in quotation marks in front of the NLMCategory.
I guess we can close this now.
from pubmed_parser.
Definitely, we can close it for now. I'll discuss with @daniel-acuna a bit more about this issue. Let me know there is any use cases that you want output to be in particular format. Thanks again for the issue tho!
from pubmed_parser.
Fixed is not
to !=
, I amend the commit!
I think putting abstract_list.append(stringify_children(abstract).strip())
outside is correct cause we always add text into the list. However, if section is UNASSIGNED
, I just skip it :)
from pubmed_parser.
Related Issues (20)
- Example of processing in dask rather than pyspark HOT 2
- medline_parser has syntax error: `"is not" with a literal` HOT 1
- Is there a reason why PubMed/MEDLINE extracted list elements are joined with ";" instead of keeping them as lists ? HOT 1
- All of PubMed XML was updated to follow the MEDLINE XML format.
- PMC OA: tags in the <journal-title> field break parse_pubmed_xml HOT 1
- parse_pubmed_paragraph() function seems to miss some paragraphs sometimes.
- physical & electronic publication dates can be mixed into erroneous dates HOT 1
- Error: parse_medline_xml() is unable to parse the file even though the provided path is correct HOT 11
- AttributeError: 'NoneType' object has no attribute 'find' HOT 2
- Table parsing issues with parse_pubmed_table HOT 2
- parse_pubmed_table() and parse_pubmed_references() returning None HOT 1
- Question for extracting text HOT 1
- Question: Abstract with Mesh Tag HOT 3
- question using pp.parese_medline HOT 2
- Question: parsing error first line expecting '<' not found
- parse_pubmed_caption() failing on some papers
- ValueError when attempting to parse OA XML HOT 3
- Bug report - XML citations from website HOT 1
- CALL FOR MAINTAINER/CONTRIBUTOR FOR PUBMED_PARSER HOT 7
- Parse language in `parse_xml_web()` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pubmed_parser.