Coder Social home page Coder Social logo

textprocess's Introduction

textprocess

a python module for text preprocessing.

Overview

text process performs 5 stage filtering viz. tokenisation, normalisation, stop word removal, stemming and lemmatisation which can be used as preprocessing step required in NLP,machine learning and other linguistic programming domains. Relevant for datasets used in data mining.

Features

  • Supports global filtering which performs all 5 filtering as well as separate filtering.
  • Accepts list as well as string as input.

Installation

pip install textprocess

Usage

Tokenization

from textprocess import tokenizer
input = 'this is a test string'
tokenized = tokenizer.tokenize(input)
tokenized
['this', 'is', 'a', 'test', 'string']

tokenize accepts string as well as file object to read from.For reading file pass readFile = true

from textprocess import tokenizer
input = open('input.txt')
tokenized = tokenizer.tokenize(input, readFile=True)

  • Following functions accepts string , list , multilist(pass multilist=True)
  • Tokenization is implicitely called in following functions

Normalization

from textprocess import normalizer
input = 'ThIs Is DiRTy TeXT'
normalized = normalizer.normalize(input)
normalized
['this', 'is', 'dirty', 'text']

Stop Word removal

from textprocess import stopwordremover
input = 'Hello i am Mayank Bhola. Do what you like, like what you do'
filtered = stopwordremover.remove_stop_word(input)
filtered
['hello', 'mayank', 'bhola']

Stemming/Lemmatization

Performs stemming as well as lemmatization

  • Tokenization and normalization are implicotely called
  • Pass cascade=False for skipping stop word removal
from textprocess import stemmer
input = 'Text containing lot of examples and forms is considered to be legitimate'
filtered = stemmer.lemmatize(input,cascade=False)
filtered
['text', 'contain', 'lot', 'of', 'examp', 'and', 'form', 'i', 'consid', 'to', 'be', 'legitim']

Licence

MIT

Live Demo

You can test the public api on cloud by visiting this URL textprocess

Flask app credits : Shivam Bansal

textprocess's People

Contributors

psych0der avatar

Stargazers

sharma2427 avatar Tweek avatar OneSlowPony avatar  avatar Ali Ayoubi avatar Pantelis Koukousoulas avatar Aman Srivastava avatar Amit Tripathi avatar Rizmal avatar Akarsh Satija avatar Shivam Bansal avatar Ankur Saxena avatar

Watchers

James Cloos avatar  avatar  avatar

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.