Code Monkey home page Code Monkey logo

ner's Introduction

BiLSTM-CRF

Implementation of BiLSTM-CRF model for Sequence Tagging

BiLSTM-CRF is a simple Deep Learning model for Sequence Tagging and Name Entity Recognition.

BiLSTM-CRF Network

Repo structure

  • README.md
  • models - folder to store trained models for latter use
  • logs - folder of training, validation, and testing loggings
  • resources - folder to store training data
  • notebooks - list of Jupyter Notebooks for tutorials
  • bilstm_crf - folder to store utils, data loader, and model
  • requirements.txt - list of dependencies
  • train.py - main file to execute training task
  • predict.py - tutorial script for makeing predictions locally

Data & Word Embeddings

Instructions

Installation & Setup

git clone https://github.com/quocdat32461997/NER
pip install -r requirements.txt

Text processing

  • Step 1:

    • For above datasets, please look at /notebooks/Train_Dsta_Processing.ipynb
    • In production: all text and labels are stored in a signle file (each for training, validation, and testing) that each line is a raw sentence and a sequence of tag labels. The raw sentence and the sequence of tag labels are separated by tab \t.
     Input format sample: I am Eric. \t O O PER
    
  • Step 2: Tensorflow Dataset pipeline embedded in Dataset class of bilstm_crf/data.py accepts the text input format in step 1 and auto-processes text.

Training:

  • Deveopment: run SequenceTagger.ipynb either locally or on Google Colab for development
  • Training: run train.py to train BiLSTM-CRF on NER dataset & WNut 2017 dataset or your dcustom ataset. Example:
# need to modify path to data and word-embedding files
python3 train.py

Inference

The trained model is saved in the SavedFormat mode that the trained model could be loaded for:

  • Fine-tuning

  • Deployment in:

    • Local server
     # run predict.py
     python3 predict.py
    
    • Tensorflow Serving - TBD
     To be added
    

Dependencies

  • Tensorflow >= 2.3.1
  • Python >= 3.8

References

  • Depends of the definition
  • Annotated Corpus for Named Entity Recognition
  • Jeffrey Pennington, Richard Socher, and Christopher D. Manning. 2014. GloVe: Global Vectors for Word Representation
  • @inproceedings{derczynski-etal-2017-results, title = "Results of the {WNUT}2017 Shared Task on Novel and Emerging Entity Recognition", author = "Derczynski, Leon and Nichols, Eric and van Erp, Marieke and Limsopatham, Nut", booktitle = "Proceedings of the 3rd Workshop on Noisy User-generated Text", month = sep, year = "2017", address = "Copenhagen, Denmark", publisher = "Association for Computational Linguistics", url = "https://www.aclweb.org/anthology/W17-4418", doi = "10.18653/v1/W17-4418", pages = "140--147", abstract = "This shared task focuses on identifying unusual, previously-unseen entities in the context of emerging discussions. Named entities form the basis of many modern approaches to other tasks (like event clustering and summarization), but recall on them is a real problem in noisy text - even among annotators. This drop tends to be due to novel entities and surface forms. Take for example the tweet {``}so.. kktny in 30 mins?!{''} {--} even human experts find the entity {`}kktny{'} hard to detect and resolve. The goal of this task is to provide a definition of emerging and of rare entities, and based on that, also datasets for detecting these entities. The task as described in this paper evaluated the ability of participating entries to detect and classify novel and emerging named entities in noisy text.", }

ner's People

Contributors

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