GithubHelp home page GithubHelp logo

erolozkan- / language-modelling Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 2.0 3.92 MB

N-gram Language Model

Python 100.00%
linear-interpolation discounting good-turing-smoothing laplace-smoothing mle-probability perplexity ngram language-model text-mining natural-language-processing nlp

language-modelling's Introduction

run python3 ___________

src/Runner_First.py -- Basic example with basic dataset (data/train.txt)
    A simple dataset with three sentences is used.
    Ngram models for these sentences are calculated. (Unigram, Bigram, Trigram, Add-one smoothing, good-turing smoothing)
    Models are tested using some unigram, bigram, trigram word units.
    New sentences are generated and perpexility score calculated.

src/Runner_Second.py -- Real dataset
    Ngram models are built using Brown corpus.
    Brown test dataset perpexility score calculated.
    New sentences are generated and perpexility score calculated.

src/Runner_Interpolation.py -- Real dataset - Interpolation
    Interplation model implemented.
    Different lambda values are testted on validation dataset. (using brute-force approach - manually selected)
    New perpexility scoring function using interpolated model is implemented.
    Finally, best lambda value is used for Brown test dataset. (perpexility)

src/Runner_Discounting_Simple.py  -- Basic example discounting
    Discounting method is implemented.
    For β = 0.5, new bigram and trigram models are calculated.
    New perpexility scoring using discounted models are implemented. (Bigram and Trigram)

language-modelling's People

Contributors

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