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.
- Getting started
- Features
- Usage
- Want to Contribute?
- Need Help / Support?
- Collection of Other Components
- Changelog
- Credits
- License
- Keywords
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.
- Performs text cleaning
- Uses nltk's sentence_bleu score for text scoring.
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:
- 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.
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.
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.
Detailed changes for each release are documented in CHANGELOG.md.
Refered NLTK bleu score for evaluating sentence match. NLTK.
nlp, nltk, sentence-bleu, text-scoring, keyword-match, similar-sentence, keyword-match-text, sent-tokenize, artificial-intelligence, machine-learning, ai-ml,tokenization, stopwords removal