https://github.com/acdh-oeaw/mara_nlp_suite

Unified NLP research platform for the project MARA: MEDIA REPORTING ON ALGORITHMS, ROBOTICS AND ARTIFICIAL INTELLIGENCE

https://github.com/acdh-oeaw/mara_nlp_suite

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.3%) to scientific vocabulary

Keywords

data-science linguistic-analysis newspaper newspaper-texts nlp nlp-models nlp-training
Last synced: 10 months ago · JSON representation

Repository

Unified NLP research platform for the project MARA: MEDIA REPORTING ON ALGORITHMS, ROBOTICS AND ARTIFICIAL INTELLIGENCE

Basic Info
  • Host: GitHub
  • Owner: acdh-oeaw
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 1.54 MB
Statistics
  • Stars: 0
  • Watchers: 5
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
data-science linguistic-analysis newspaper newspaper-texts nlp nlp-models nlp-training
Created over 5 years ago · Last pushed almost 4 years ago
Metadata Files
Readme License

README.md

maranlpsuite

This repository encompasses the unified NLP research platform for the project MARA: MEDIA REPORTING ON ALGORITHMS, ROBOTICS AND ARTIFICIAL INTELLIGENCE funded by the Austrian Academy of Sciences’ go!digital Next Generation program for excellent research in digital humanities.

In this repo almost all code and (soon) nlp models are stored and published in a transparent and reproducible way.

final report

The final report of this project with in-depth qualitative analysis can be found here.

About this repository

Here all the technical implementations are aggretated and all the produced data can be traced throughout their lifecycles.

However no original newspaper texts are stored here due to coypright agreements with the AMC.

External dependencies / sources and tools:

Architecture and Overview

Rough outline of architecture

+----------------------------+ | data flow registry |-----------+ | * central reference hub | | references functions / classes | * machine usable | | | * human readable | | +----------------------------+ | ^ | | references config details | | | +----------------------------+ | | pipes | | | * high abstraction overview| | | * collection of processes | | +----------------------------+ | | | | calls | v | +------------------+ | | main | | | * code hub | | +------------------+ | | | | delegates | | | | +-----------------------+ | +----->| ETL |<-------+ | | * fetch raw data | | | | * transform and clean | | | | * persist clean data | | | +-----------------------+ | | | | +-----------------------+ | +----->| Annotation |<-------+ | | * human labeling | | | | * human verification | | | +-----------------------+ | | | | +-----------------------+ | +----->| NLP |<-------+ | | * ML training | | | | * ML classification | | | +-----------------------+ | | | | +-----------------------+ | +----->| Evaluation |<-------+ | * statistical analysis| | * presentation | +-----------------------+

The major modules in this research context can be separated into:

  • pipes & data flow registry: encapsulating configurations and processes with high degree of abstraction
  • ETL: Responsible for all tasks relating to fetching and transforming data from various sources
  • Annotation: providing accessible means for humans to annotate and verify data
  • NLP Training: using supervised machine learning on topic modelling and classification
  • Evaluation: of trained nlp models and human verification of them

Pipeline architecture

Since the research task is an iterative process with continous feedback, the technical requirements can change rapidly. Thus the platform needs to be able to adapt to changes, while being reusable as well. For this, we implemented a pipeline architecture, which means that major tasks are encapsulated in various modules and can be called and chained together in various pipes. For example a pipe could first define to fetch data, transform it to pre defined rules, and then run a training on it. All of such pipes are defined under src/pipelining/pipes.

data flow registry

This registry in src/pipelining/dataflowregistry.py serves as the single source of truth to define and preserve which data was processed by which computation with which parameters.

The registry is used both by: * machines: pipes use references from the registry to fetch data and call registered functions * humans: to document and reconstruct data flows for transparancy and reproducibility

Everything that is persisted or fetched is registered there.

Additionally in this registry we define and document: * all data inter-dependencies: e.g. which texts were used for which models, which data sets came from where, which models evaluated what texts, et cetera * transformations on data: e.g. what classifications were changed and bundled into others or discarded completely * code logic: which functions were used for processing what data

How to set up

DISCLAIMER: There are no models and texts yet, which sadly renders this repo to little use for the public. Work is under way to mitigate this and to provide useful data and models.

First, clone this repo and change into it.

git clone https://github.com/acdh-oeaw/mara_nlp_suite.git cd mara_nlp_suite

Then there are two ways of running this suite: docker or native python (where virtual environments are recommended).

Building and running with docker

A pre-built docker image is yet to be published on docker hub. Until then, a local image can be built by changing into the root directory and build with: docker build . -t image_mara_nlp_suite # will take a while, since pre-learned nlp models are downloaded docker run -it image_mara_nlp_suite bash # run and enter container

Setting up with native python (tested only under linux)

While it can be set up with bare metal python, we recommend to use python virtual environemnts for the sake of system hygiene. Assuming virtualenv is installed, then do in the root directory of this repo: virtualenv -p python3.8 venv # create virtual environment source venv/bin/activate # activate it pip install -r requirements.txt # install python dependencies, will take a while, since pre-learned nlp models are downloaded

How to run

Either inside the docker container or on your machine with a python virtual environment, change to the src directory and run an arbitrary pipe from src/pipelining/pipes. To run an interactive shell, use the pre-defined pipe_shell: cd src python main.py --pipe pipe_shell # replace the pipe argument with the name of any module in `pipes`.

TODO: Add examples once useful data is made public

non-functional components / dependencies:

The following components of this repo will remain non-functional to the public for the foreseeable future (unless you own the respective licenses / have credentials):

Owner

  • Name: Austrian Centre for Digital Humanities & Cultural Heritage
  • Login: acdh-oeaw
  • Kind: organization
  • Email: acdh@oeaw.ac.at
  • Location: Vienna, Austria

GitHub Events

Total
Last Year

Committers

Last synced: 12 months ago

All Time
  • Total Commits: 34
  • Total Committers: 2
  • Avg Commits per committer: 17.0
  • Development Distribution Score (DDS): 0.206
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
steff-vm s****h@o****t 27
steffres 3****s 7
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

Dockerfile docker
  • python 3.7 build
requirements.txt pypi
  • PyJWT ==1.7.1
  • aiofiles ==0.5.0
  • blis ==0.4.1
  • cachetools ==4.1.0
  • catalogue ==1.0.0
  • certifi ==2020.4.5.1
  • chardet ==3.0.4
  • click ==7.1.2
  • cymem ==2.0.3
  • dataclasses ==0.6
  • de_core_news_lg *
  • de_core_news_sm *
  • fastapi ==0.44.1
  • h11 ==0.9.0
  • httptools ==0.1.1
  • idna ==2.9
  • importlib-metadata ==1.6.0
  • ipython ==7.15.0
  • ipython-genutils ==0.2.0
  • jedi ==0.17.2
  • murmurhash ==1.0.2
  • numpy ==1.18.4
  • pandas ==1.0.4
  • peewee ==3.13.3
  • plac ==1.1.3
  • preshed ==3.0.2
  • progress ==1.5
  • psycopg2-binary ==2.8.6
  • pydantic ==1.5.1
  • python-dateutil ==2.8.1
  • pytz ==2020.1
  • requests ==2.23.0
  • six ==1.15.0
  • spacy ==2.3
  • sqlalchemy ==1.3.19
  • srsly ==1.0.2
  • starlette ==0.12.9
  • thinc ==7.4.1
  • toolz ==0.10.0
  • tqdm ==4.46.1
  • urllib3 ==1.25.9
  • uvicorn ==0.11.5
  • uvloop ==0.14.0
  • wasabi ==0.6.0
  • websockets ==8.1
  • xlrd ==1.2.0
  • zipp ==3.1.0