Skip to content

weblineindia/AIML-NLP-Text-Scoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentence scoring using NLTK bleu score

A Python based NLP package for generating the best matching text from a paragraph for a given keyword/sentence. A user can pass a keyword and a paragraph/text content throught the terminal and the paragraph undergoes cleaning process by eliminating special characters from the text, then preprocessing technique is applied to each sentences by removing stopwords and tokenizing it.

The sentence score is calculated by applying bleu_score. Here a cumulative bleu score is calculated for the each sentences.The code helps in calculatuing the score of each sentences with reference to the input keyword and top scored 3 sentences are displayed as output.

Regex used for removing special characters from text.
NLTK stopwords for removing stopwords from sentence.
NLTK word_tokenize used for tokenization of sentence.
NLTK WordNetLemmatizer used for lemmatization of words.
NLTK sentence_bleu used for sentence scoring.

Table of contents

Getting started

Prerequisites for running the code are:

Python = 3.6.8

nltk = 3.6.7

or

pip install nltk

We have tested our program in above version, however you can use it in other versions as well.

Features

  • Performs text cleaning
  • Uses nltk's sentence_bleu score for text scoring.

Usage

Inside the project's directory run:

python app.py

Enter keyword and a paragraph. It will display sentences with most relavent text to the keyword entered.

Output:

Want to Contribute?

  • Created something awesome, made this code better, added some functionality, or whatever (this is the hardest part).
  • Fork it.
  • Create new branch to contribute your changes.
  • Commit all your changes to your branch.
  • Submit a pull request.

Need Help?

We also provide a free, basic support for all users who want to use this AI ML based NLP text scoring technique for their projects. In case you want to customize this text scoring technique for your development needs, then feel free to contact our AI ML developers.


Collection of Components

We have built many other components and free resources for software development in various programming languages. Kindly click here to view our Free Resources for Software Development.


Changelog

Detailed changes for each release are documented in CHANGELOG.md.

Credits

Refered NLTK bleu score for evaluating sentence match. NLTK.

License

MIT

Keywords

nlp, nltk, sentence-bleu, text-scoring, keyword-match, similar-sentence, keyword-match-text, sent-tokenize, artificial-intelligence, machine-learning, ai-ml,tokenization, stopwords removal