thejeswi / BobGoesToJail

A semantic law interpreter for the English translations for the German criminal law (StGB)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bob goes to jail?

A semantic Law Interpreter

BobGoesToJail is a semantic law interpreter for the English translations for the German criminal law. Corpus downloaded from: http://www.gesetze-im-internet.de/englisch_stgb/englisch_stgb.html

Installation Requirements:

  1. Clone BobGoesToJail using git clone git@code.fg-tech.de:thejeswi/BobGoesToJail.git

  2. Mongo server running on 'localhost', port: 27017

  3. coreNLP server running on 'localhost', port: 3456

    • Use these commands:
      • pip install pexpect unidecode
      • git clone git://github.com/dasmith/stanford-corenlp-python.git
      • cd stanford-corenlp-python
      • wget http://nlp.stanford.edu/software/stanford-corenlp-full-2014-08-27.zip
      • unzip stanford-corenlp-full-2014-08-27.zip
    • Run: python corenlp.py
  4. Word2Vec server running 'localhost', port: 9090

  5. Python libraries required are listed on requirements.txt

    • Use pip install -r requirements.txt to install them.
  6. Use python import NLTK and use nltk.download() to download WordNet.

  7. Other package requirements: python-dev, curl

Run instructions:

  • To run the judging program, use python run.py, use a browser to go to localhost:7070
  • For obtaining the Psuedo Logical form of the law for your own corpus, follow these steps:
    1. Get the law corpus as txt files into BobGoesToJail/corpus/lawTexts_en
    2. Run python BobGoesToJail/lawSplitter.py
    3. Run python BobGoesToJail/filters/text2parse/run.py
    4. Run python BobGoesToJail/filters/parse2predicate/run.py insert
    5. Run python BobGoesToJail/filters/simpleLawFinder/run.py
  • To generate the synonyms list required for Judging, run python BobGoesToJail/judge/synList.py.

Major Modules:

Filters

Things which convert one data format to another.

It includes different filter which convert german law text files to a pseudo semantic form, one step a time. Modules which do it are:

  • corpus2db: Inserts content pf splitted law text file to database. Also stores the Law number of the law and other attributes. This module is now decaprecated. Use python lawSplitter.py in the project root folder.
  • text2parse: Use law texts to get parse trees of each sentence. To use run: python run.py
  • parse2predicate: Extracts predicates from parse trees of laws in the database. To insert to database, use: python run.py insert
  • simpleLawFinder: Finds simple laws which has no sublaws and store them to text files. To use run: python run.py

Database

Schema related things

Has schema files which are used by different modules. It is used to enforce uniformity in the database.

Corpus

The raw law texts

Nothing to run here. Contains all the text files extracted for the source law text file.

Judge

The judging process

Contains all the scripts which are used for running the judging framework. Nothing to directly run here. Use runJudger in the project root to use the judger.

About

A semantic law interpreter for the English translations for the German criminal law (StGB)

License:MIT License


Languages

Language:HTML 56.9%Language:Jupyter Notebook 39.7%Language:Python 3.2%Language:JavaScript 0.1%Language:CSS 0.1%Language:Shell 0.0%Language:Prolog 0.0%