Repository for digital forest project
List down all the components
Responsible for downloading the full text articles from a csv.
Input - CSV with article names, DOIs, publisher names and so on.
Output - List of Full Text articles. (These articles can be either xml, html or pdf).
Refer to download.py and download.ipynb for examples.
Strategy for downloading articles
-
If we can download the xml/html through APIs or scraping the web, we would choose this option.
-
If xml/html is not possible, then we would try to download the PDF files. In this case, we would use a JAVA library called CERMINE (https://github.com/CeON/CERMINE) to convert PDF files to cermxml file before further analyzing with beautiful soup.
- Elsevier - xml files, API is provided by publisher
- MDPI - html files, this data has been web scraped
- Wiley -
- Taylor & Francis - No access with purdue credentials, some articles are open access (IJRS)
- Springer -
- IEEE -
Responsible for extracting the textual information from the downloaded articles.
Input - Article (xml, html)
Output - Text (string)
The conversion is different for every article publisher. We have to consider every case
- Different file format
- Different article foramtting
- Different non text patterns
PDFtoXML conversion module
Note: PDF files are converted to xml.
To do for each publisher.
- Get the article files
- Analyse the files and try to figure out in which sections include the text that we need.
- Implement a program that takes the article input and then remove unnecessary information and output the full text string.
Notes on processing
- Using xml, we can identify the sections that have useful information.
- Using regular expressions - We can define patterns that match the not useful text. google search example - regular expression to remove all html tags in python.
- Use beautiful soup / other advanced packages that could do it automatically.
def process_elsevier(article_xml): useful_sections = ["introduction" .. ] result_text = "" for section in article_xml: result_text += extract_text_from_section(section) return result.
Input - raw full text from each article
Output - simplified text
Strategy
- Convert all words to lowercase characters
- Remove all numbers Optional
- Stemming (happy happiest -> happ)
- Lemmatization (play playing -> play)
Input - corpus (list of all articles )
Output - Word vector for each word in the corpus.
Example python notebook - https://colab.research.google.com/drive/1B24afRkZf9irUTSbDceCeysb1q0jnhOb?usp=sharing
Steps
- Generate dictionary from the corpus
- Use glove pretrained embeddings
- A ML model that is finetuned for new words.
Study the embeddings and decide if the model learned useful information.