Top 6 NLP Python Library


NLTK - It is a leading platform for building Python programs to work with human language data. It provides easy-to-use interfaces to over 50 corpora and lexical resources such as WordNet, along with a suite of text processing libraries for classification, tokenization, stemming, tagging, parsing, and semantic reasoning, wrappers for industrial-strength NLP libraries, and an active discussion forum.

TextBlob - It is a Python (2 and 3) library for processing textual data. It provides a simple API for diving into common natural language processing (NLP) tasks such as part-of-speech tagging, noun phrase extraction, sentiment analysis, classification, translation, and more.

Stanford CoreNLP -  It provides a set of human language technology tools. It can give the base forms of words, their parts of speech, whether they are names of companies, people, etc., normalize dates, times, and numeric quantities, mark up the structure of sentences in terms of phrases and syntactic dependencies, indicate which noun phrases refer to the same entities, indicate sentiment, extract particular or open-class relations between entity mentions

spaCy – The spaCy excels at large-scale information extraction tasks. It's written from the ground up in carefully memory-managed Cython. spaCy is the best way to prepare text for deep learning. It interoperates seamlessly with TensorFlow, PyTorch, scikit-learn, Gensim and the rest of Python's awesome AI ecosystem.

Gensim started off as a collection of Scalable statistical semantics and can analyze plain-text documents for semantic structure, retrieve semantically similar documents

Polyglot is a natural language pipeline that supports massive multilingual applications.

Python program to find day of birth

import datetime
y = input("Enter year of Birth: ");
m = input("Enter month of Birth: ");
d = input("Enter date of Birth: ");
mydate = datetime.date(int(y),int(m),int(d))
print(mydate.strftime("%A"))

Python program to shutdown and restart computer

import os;
check = input("Want to shutdown your computer ? (y/n): ");
if check == 'n':
    check = input("Want to restart your computer ? (y/n): ");
    if check == 'y':
        os.system("shutdown /r /t 1");
    else:
        exit();
else:
    os.system("shutdown /s /t 1");

Python program for reading an excel file

import xlrd
loc=("your own excel path with double slash at drive name like C:\\")
wb = xlrd.open_workbook(loc)
sheet = wb.sheet_by_index(0)
print ("The value of Row 0 and Column 0 is", sheet.cell_value(0, 0))
print("No of Rows in the current sheet is",sheet.nrows)
print("No of Columns in the current sheet is",sheet.ncols)
print("Extracting all columns name in the current sheet")
for i in range(sheet.ncols):
    print(sheet.cell_value(0, i))
print("Extracting first column in the current sheet")
for i in range(sheet.nrows):
    print(sheet.cell_value(i, 0))
print("Extracting rowwise content in the current sheet")
for i in range(sheet.nrows):
    print(sheet.row_values(i))

Python programt for finding ports opened in the website domain


import socket;
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('www.example.com', port number))
if result == 0:
   print ("Port is open")
else:
   print ("Port is not open")