Code Monkey home page Code Monkey logo

bangla_neuro_lemmatizer's Introduction

A Dead Simple Neural Lemmatizer using AllenNLP

Getting Started

Install AllenNLP with the command

pip install allennlp

To train, run bash.sh, or

allennlp train config/small.json \
    --serialization-dir logs/main \
    --include-package library

All logs will be put in the logs/main directory. If you would like to train again, delete logs/main, otherwise there will be an error.

To predict a trained model, run predict.sh or

allennlp predict logs/main/model.tar.gz data/Bengali_Dataset.txt \
    --output-file data/predict.txt \
    --predictor simple \
    --include-package library \
    --use-dataset-reader

To evaluate a trained model, run evaluate.sh or

allennlp evaluate logs/main/model.tar.gz data/Bengali_Dataset.txt \
    --include-package library

This will output predictions to data/predict.txt.

Visualize Model Performance in TensorBoard

To view tensorboard logs, just run

tensorboard --logdir logs

Make sure tensorflow is installed to be able to run the tensorboard command.

Providing Your Own Data or Model

Prepare your data in the format

word <tab> lemma

with each sentence separated by an empty line. Then split your data into train, validation, and test sets.

Copy a config file in the config directory and change train_data_path, validation_data_path, and test_data_path, to be the paths of your train, validation, and test files respectively.

Then run training with your new config file

allennlp train path_to_config.json \
    --serialization-dir logs/main \
    --include-package library

Finally, output predictions with your new model using

allennlp predict logs/main/model.tar.gz path_to_input_file.txt \
    --output-file path_to_output_file.txt \
    --predictor simple \
    --include-package library \
    --use-dataset-reader

bangla_neuro_lemmatizer's People

Contributors

shaoncsecu 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.