Giter VIP home page Giter VIP logo

cwwdaniel / invoice-text-classification Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 70 KB

Semantic Enrichment, Data Augmentation and Deep Learning for Boosting Invoice Text Classification Performance: A Novel Natural Language Processing Strategy

deep-learning multi-class-classification semantic-enrichment text-classification text-cleaning text-data-augmentation bert bert-embeddings bi-lstm glove-embeddings

invoice-text-classification's Introduction

Semantic Enrichment, Data Augmentation and Deep Learning for Boosting Invoice Text Classification Performance: A Novel Natural Language Processing Strategy

This repository contains the Python codes used for text cleaning, semantic enrichment, text augmentation and text classification and evaluation for invoice classification task. This is a combination of semantic enrichment and data augmentation with deep learning approaches to solve the invoice classsification task. Different augmentation size and approach paired with different classifiers will render different results. A key evaluation metric to consider is the accuracy and the macro-f1 score, given the multi-class labels which introduces severe class imbalance within the invoice text data class distribution.

Data Source

Due to data privacy and large volume size of encoded dataset, there are no datasets in this repository. However, it is straightforward to create a sample dataset. A dataset with two columns - 'description' which contains the invoice text, and 'label' which contains the invoice category is required to be used together with the codes below.

Text Cleaning

For text cleaning, refer to 'invoice-text-classification/text_cleaning'. Text cleaning includes removal of digits, stopwords, symbols, single character, multiple spaces, lowering case of text and retaining only English words.

Depending on the dataset type, more cleaning tasks may be required to improve the information retention within the short text, which in itself is a challenge given the limited semantic information.

For train-test split codes, refer to 'invoice-text-classification/train_test_split'

Semantic Enrichment

For semantic enrichment, refer to 'invoice-text-classification/semantic_enrichment'. Semantic enrichment of the text is based on auxiliary information from the label text.

Text Augmentation

There are three data augmentation techniques in this repository, namely lexical synonym replacement (WordNet), Word Embedding similar word replacement (GloVe), and Contextual Word Embedding word replacement (BERT). All three methods could be used to generate synthetic training data.

Refer to the links below for the codes:
'invoice-text-classification/wordnet_aug'
'invoice-text-classification/glove_aug'
'invoice-text-classification/bert_aug'

Text Classification

There are three classifiers in this repository, namely LSVM, Bi-LSTM and BERT. Bi-LSTM and BERT are deep learning classifiers and considered state of the art while LSVM is a traditional text classifier.

Refer to the links below for the codes:
'invoice-text-classification/lsvm'
'invoice-text-classification/bi-lstm'
'invoice-text-classification/bert'

invoice-text-classification's People

Contributors

cwwdaniel avatar

Stargazers

 avatar

Watchers

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