Git Product home page Git Product logo

eventepi's Introduction

This repo contains the work of EventEpi. EventEpi is a framework to allow event-based surveillance. The framework contains three parts that build up the workflow of EventEpi:

  • event_db_preprocessing which contains exemplary preprocessing steps that might be necessary to utilize an epidemiological database.

  • scraper which contains a scraper for

    Furthermore, it contains text extraction functionality to extrect relevant text from raw HTML or PDFs

  • classifer which contains the modules to extract key named entities out of epidemiological texts and determine the relevance of articles given a codebase.

Installation

pip install -r requirements.txt pip install didyoumean.py pip install boilerpipe3

  • NLTK needs corpora
  • EpiTator needs data

Functionality

Preprocessing

Has the goal to translate German country and disease names to be comparable to EpiTators output. This is important for the classifer, since they operate on EpiTator's output and require labels that are comparable to EpiTator's output. The translation requires the Wikidata and Wikipedia scrape since they are used as a translation dictionary. Also, it contains functions to correct spelling using Levensthein Distance and formatting errors such as wrong types.

Scraper

You can use the WHO and ProMed scraper like so which returns a list of articles. Look into the documentation for more options.

from nlp_surveillance.scraper import promed_scraper, who_scraper

year_range = (2012, 2018)
proxy = {"http": "you_http_proxy", "https": "your_https_proxy"}
promed_articles = promed_scraper.scrape(year_range, proxy=proxy)

list_of_years = [2012, 2013, 2017]
who_articles = who_scraper.scrape(list_of_years, proxy=proxy)

and for the translation of German disease and country names into English we used the following Wikidata and Wikipedia tables:

from nlp_surveillance.scraper import wikidata_diseases, wikipedia_countries

proxy = {"http_proxy": "you_http_proxy", "https_proxy": "your_https_proxy"}

df_of_sovereign_states = wikipedia_countries.scrape_wikipedia_countries()
df_of_ger_and_eng_disease_names = wikidata_diseases.disease_name_query(proxy)

Classifer

The classifier are trained using an annotated epidemiological database. One classification task is to find the key entity out of all entities (disease, country, confirmed case numbers) that EpiTator detects. We use either an modal-approach or a naive Bayes classfier on senteces that contain an entity. If the entity of a text is also in the database, we give it a positive label.

Also, we learn to determine the relevance of an article using a database. For this, we compared several classifier using the bag-of-words approach on whole epidemiological articles given a label whether they are interesting or not or on the document embedding. Our API looks like this:

from nlp_surveillance.classfier import summarize

article = """As of May 5 there five confirmed cases of Ebola disease virus in the Democratic Republic Congo
"""

# You need to have trained your own key entity and relevance classifier
summary = summarize.annotate_and_summarize(article, key_date_classifer, key_count_classifer)

print(summary)
>>{"geoname": "Democratic Republic Congo", "disease": "Ebola disease virus", "counts": 5, "date": "2019-05-05"}

eventepi's People

Contributors

aauss avatar

Watchers

James Cloos avatar

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.