Coder Social home page Coder Social logo

r4j4n / generating-laxmi-prasad-devkotas-poem-using-bidirectional-lstm Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 314 KB

Nepali Poem Generation

License: GNU General Public License v3.0

Jupyter Notebook 100.00%
lstm bidirectional-lstm poem-generator nepali nepali-poem

generating-laxmi-prasad-devkotas-poem-using-bidirectional-lstm's Introduction

Generating Laxmi Prasad Devkota's Poem Using Bidirectional LSTM

Made withJupyter
forthebadge

Result produced by model:

"  मनको व्यथा रहन्छ कहाँ मलाई बताऊ

   आमा कलेजा चिछ्र्यौ नि तर ती

   माया यो निशा द्यौ प्राण तिमी छ

   तिमी छौ पर भन्ने यो डर मलाई

   जुन हो वास केवल पहेँला फूल    "



Generating Sequence of N-gram Tokens :

Language modelling requires a sequence input data, as given a sequence (of words/tokens) the aim is the predict next word/token.

The next step is Tokenization. Tokenization is a process of extracting tokens (terms / words) from a corpus. Python’s library Keras has inbuilt model for tokenization which can be used to obtain the tokens and their index in the corpus. After this step, every text document in the dataset is converted into sequence of tokens.

Lets take a look at one of the input Sequence:

[[1337, 2623],
[1337, 2623, 12],
[1337, 2623, 12, 39],
[1337, 2623, 12, 39, 103]]

In the above output [1337, 2623], [1337, 2623, 12], [1337, 2623, 12, 39] and so on represents the ngram phrases generated from the input data, where every integer corresponds to the index of a particular word in the complete vocabulary of words present in the text. For example

Line: नछाडी जानोस् हे मेरा प्राण

Ngrams: | Sequence of Tokens

नछाडी जानोस् हे मेरा प्राण

Ngram Sequence of tokens
नछाडी जानोस् [1337, 2623]
नछाडी जानोस् हे [1337, 2623, 12]
नछाडी जानोस् हे मेरा [1337, 2623, 12, 39]
नछाडी जानोस् हे मेरा प्राण [1337, 2623, 12, 39, 103]

Bidirectional LSTM Model:

alt text

Dataset:

You can find the original dataset 📰📰HERE📰📰 Download pretrained weight from 📦📦HERE📦📦

generating-laxmi-prasad-devkotas-poem-using-bidirectional-lstm's People

Contributors

r4j4n avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

ghimiresunil

generating-laxmi-prasad-devkotas-poem-using-bidirectional-lstm's Issues

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.