Giter Club home page Giter Club logo

legalner's Introduction

LEGALNER - Named Entity Recognition in Turkish Legal Text

Data Format

Follow the [data/train_and_test]

  1. For name in {train, test}, create files {name}.words.txt and {name}.tags.txt that contain one sentence per line, each word / tag separated by space using IOBES tagging scheme.

  2. Create files vocab.words.txt, vocab.tags.txt and vocab.chars.txt that contain one token per line. This can be automized using the corresponding function in [src/preprocessing.py] and altering the fields DATASET_DIR to point to the locations of the file in Step 1 where DATA_DIR pointing to the output directory.

  3. Create a glove.*.npz file containing one array embeddings of shape (size_vocab_words, 300) using GloVe 840B vectors. This can be built by using the corresponding function in [src/preprocessing.py] after completing Step 2 and altering the field VECTOR_DIR to point desired output directory.

Get Started

Tensorflow 1.15 should be used, other versions are untested. Remaining packages should be operational wihout a specified version.

Once produced all the required data files, use the main.py with specifying correct parameters. These are:

  1. model (-m): Three base architectures; lcfor LSTM-CRF, llc for LSTM-LSTM-CRF and lcc for LSTM-CRF-CRF.
  2. embeddings (-e): Three embeddings to pair with a base architecture; glove for GloVe, m2v for Morph2Vec and hybrid for their combination. Make sure that correct .npz files are present in the data folder and call preprocessing each time a different embedding is used.
  3. preprocessing (-p): Flag to use preprocessing scripts, non-mandatory. Must be called in between new embedding selections.
  4. mode (-a): Four modes, directories are used as stated in [src/data.json]; train to train a model from scratch, k_fold to perform cross-validation (default=5), test for testing and validating a specific input (default=None) and use for generating an output from a specified file using a trained model (default=None).
main.py -m <model> -e <embed> -p (preprocess flag) -a <mode>

If multiple tests are aimed to be performed with slight changes on the parameters, check out [src/multiple_run.sh] script.

legalner's People

Contributors

berkayyazicioglu avatar

Watchers

 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.