Giter Site home page Giter Site logo

udrasht / neural-pos-tagger Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 5.19 MB

This repository includes an implementation of a neural sequence model, such as FFNN or LSTM, designed to tag words in sentences with the correct part-of-speech (POS) tags.

Jupyter Notebook 96.21% Python 3.79%
ffnn lstm nlp pos-tagging python

neural-pos-tagger's Introduction

Neural-POS-Tagger

Explanation:

  • 2022201020_assignment2_report.pdf: This file contains the report for the assignment.
  • INLP_Assignment.pdf: This file contains problem statement.
  • README.md: This file provides instructions and explanations for running the code.
  • UD_English-Atis: This directory contains the dataset files in CoNLL-U format.
  • pos_tagger.py: The main Python script implementing the POS tagger using FFNN and LSTM models.
  • trained_model: This folder contain .pt file for lstm and ffnn model.
  • requirements.txt: File listing the Python dependencies required to run the code.
  • Notebook_files: folder contain Notebook(.ipynb) file for both the models(FFNN, LSTM(RNN)) with the help of these file i create pos_tagger.py file .

Requirements

  • Python 3
  • PyTorch
  • scikit-learn
  • pandas
  • seaborn

Usage

  1. Install the required dependencies:

    $ pip install -r requirements.txt
    
  2. Execute the pos_tagger.py script:

    $ python pos_tagger.py <model_type>
    

    Replace <model_type> with -f for FFNN or -r for LSTM.

    Example:

  • To run the POS tagger with the Feed Forward Neural Network (FFNN) model, use the following command:

    $ python pos_tagger.py -f
    

    This command will prompt you to enter a sentence for POS tagging.

  • To run the POS tagger with the Recurrent Neural Network (RNN) model, use the following command:

    $ python pos_tagger.py -r
    

    This command will prompt you to enter a sentence for POS tagging.

  1. Follow the prompts to input sentences for POS tagging. Press q exit the program.

Notes

  • Ensure that the dataset files and the saved model file (lstm_model1.pt,ffnn_model_best.pt) are placed in the specified directories as mentioned in the directory structure.
  • The model type (-f for FFNN, -r for LSTM) must be specified as a command-line argument.
  • The paths to the dataset files and the saved model file are hardcoded in the script and should be adjusted if necessary.

neural-pos-tagger's People

Contributors

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