Skip to content

Narasimhag/SequenceLabelingWithCRF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sequence Labeling using CRF

Description

Sequence Labeling is very useful in many NLP applications, including conversational assistants like Alexa. I built two sequence label taggers using Conditional Random Fields and trained them on the Switchboard DMSL data. The difference between the two taggers being improved feature set. I saw a jump in performance from 71% to 78%, using bi-grams of text.

Built With

Getting Started

To get a local copy up and running follow these simple example steps.

Pre-requisites

  • Install Python. Detailed instructions for installation can be found here.
  • Mac users, with homebrew can run the following command in their terminal.
brew install python3
  • While I can give the command for conda users to install python, if you're running conda, you'd probably have it. You can check the version to make sure it is Python 3.
python --version
  • Install pycrfsuite from here

Installation

  • Clone this project using the following command.
git clone https://github.com/Narasimhag/SequenceLabelingWithCRF

Usage

  1. Download the data from the DAMSL link above and extract it to the project directory, created after running the clone command, typically named 'SequenceLabelingWithCRF'.
  2. Divide the data into training and testing sets.
  3. Run the baseline_tagger.py as follows.
python3 path/to/baseline_tagger.py /path/to/training/data /path/to/output/data /path/to/outputfile
  1. Run the advanced_tagger.py as follows.
python3 path/to/advanced_tagger.py /path/to/training/data /path/to/output/data /path/to/outputfile
  1. A small accuracy check code prints the accuracies to the terminal. You can observe advanced_tagger outperforms the baseline_tagger.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contact

If you have some criticism or want to say some nice things about the project, please feel free to tweet me. @raogundavarapu or email me at raonarasimha050@gmail.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages