A text Preprocessing & Feature extraction package for NLP applications
Project description
ProText makes your Text Preprocessing & Feature extraction tasks easy for NLP applications
A Helper pip package for text prepocessing & feature extraction.
This pip package helps you execute text cleaning like
- General cleaning (Removal of URL, @username, addtional whitespaces, Hashtags, punctuations..etc)
- Stopword removal
- Adding more stop words to "stopwords.words" library list
- Stemming,
- lemmatiing,
- Removal of single or two character word,
- Converting to lower case,
- Removal of digits
- Spell correction
- Creating of Wordcloud & line graph
All of these can be executed in a single line of command sequentially in any prefered order or can be executed in multiline.
Also feature extrations like CountVectorizer & TfidfVectorizer
Package can be executed on both panda DataFrames and single line of text
This tool can be really helpful and No one neither needs to rememebr various syntax associated with processing nor packages.
This packages reuses functions from nltk, Textblob and wordcloud for the above operations.
Assumptions:
- Assuming python is installed on your system.
- nltk, Textblob and wordcloud installed on your system
Install ProText on your system using :
pip install ProText
Text Preprocessing user guide on df or text
-
Importing library
from ProText import *or
from ProText import gen, low, dig,stopw, lemma, stem, spell, clean_len, WCloud, countvec, tfidf -
Execution of single preprocessing property on dataframe
dfcleaned['tweets'] = dfcleaned['tweets'].apply(gen) -
Adding more stop words to "stopwords.words" library list
stopadd = ['sample', 'much', 'thank'] df['tweet']= df['tweet'].apply(stopw, args=(stopadd,)) or df['tweet']= df['tweet'].apply(stopw, args=(['sample', 'much', 'thank'],))
If there are multiple lines, better convert to Dataframe
Sequential operation in a single line of command
dfcleaned['tweets'] = dfcleaned['tweets'].apply(gen).apply(low).apply(low).apply(stopw).apply(lemma)
Finally WordCloud
WCloud(dfcleaned.tweets)
Feature extraction user guide on df or list
- For CountVectorizer
cv_vect, cv_feature, cvdf = countvec(dfcleaned)
- For TfidfVectorizer
tfidf_vect, tfidf_feature, tfidfdf = tfidf(dfcleaned)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ProText-0.0.4.tar.gz.
File metadata
- Download URL: ProText-0.0.4.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
735799855261bc7f89652c99e684cbe6bc305ae86ffc57526b6a8f3ecfb4bb19
|
|
| MD5 |
59465273ee48d47abb6ec87b9c2e48e8
|
|
| BLAKE2b-256 |
33170dc606b758d5220f3b823119efd20bbc61b4f7c24b9c4ec7f3c87a658690
|
File details
Details for the file ProText-0.0.4-py3-none-any.whl.
File metadata
- Download URL: ProText-0.0.4-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02ea250276d75b05f832bbef47f7d1ae8990e2e0de84f671d7422f6b3d0ebd54
|
|
| MD5 |
a0655fb3354254568d14137ef1e71ceb
|
|
| BLAKE2b-256 |
e3f72aa7afb76c5600efcd5193d3ea18eea3c192fc884c8893d51a550f24683f
|