Skip to main content

a python library to clean textual data fetched from API's

Project description

CleanTweet version 2.1.0

CleanTweet is a python library created for cleaning textual data fetched from API. In the second version of the cleantweet library, there are 6 new classes that have been introduced. They include the DiagramTweet

PredictionTweet, SaveTweet, SentimentTweet, StatsTweet, and SyntheticTweet. Each of these classes have different methods specific

to each class and most of them inherit the clean() method from the CleanTweet class which was the only class present in the version

0.1.1.

You can find more detailed documentation about the various classes, their implementation and their various methods (close to 50) in

cleantweet's permanent home: https://cleantweet.org/

Installation

pip install cleantweet

Get Started

How to clean your Twitter Object:

Example 1: If the text file containing the Twitter/X JSON Data is in the same directory as project files.

!pip install cleantweet

import cleantweet as clt

Instantiate the CleanTwitter Object

data = clt.CleanTweet('sample_text.txt')

Call the clean method

data = data.clean())

Print the data object

print(data)

Various Implementations for the new classes

Draw a Wordcloud from your textual data

import cleantweet as clt

diagram = clt.DiagramTweet('sample_text.txt')

diagram.word_cloud()

Amount of Plural Proper Nouns in your text

import cleantweet as clt

text = clt.StatsTweet('sample_text.txt')

text = text.amount_of_proper_nouns(plural=True)

print(text)

Sentiment Analysis

import cleantweet as clt

sentiments = clt.SentimentTweet('sample_text.txt')

sentiments = sentiments.vader()

print(sentiments)

Synthetic Data

import cleantweet as clt

synths = clt.SyntheticTweet('sample_text.txt')

synths = synths.rule_based()

print(synths)

Update

For version 2.1.0, a new class was created called the ClassificationTweet class; the implementation is the same with the other classes - create an instance of the class while passing the document as a .txt file, then using that class instance to have access to the different methods in the class.

New methods have been added to the DiagramTweet class like pie_chart() and the lexicon_chart().

InferenceTweet class has been enhanced with frequency-based and TextRank summarization methods.

Named Entity Recognition (NER) has been implemented in the StatsTweet class for extracting named entities from text.

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

cleantweet-2.1.1.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cleantweet-2.1.1-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file cleantweet-2.1.1.tar.gz.

File metadata

  • Download URL: cleantweet-2.1.1.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for cleantweet-2.1.1.tar.gz
Algorithm Hash digest
SHA256 5cdba79f283aba3d45fe72346fb50aa3b98adafd00f8dcdeb0b3d2adf81a8738
MD5 79f0ebd29c8bf9d88fc10936027d5a4d
BLAKE2b-256 6c808bcb5e46408075af7b0b791a66b882ecdb7e2336acc47722328f0219bd42

See more details on using hashes here.

File details

Details for the file cleantweet-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: cleantweet-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for cleantweet-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0fd59249a794bf53f04cfdebf55996badf1fb7f53d21a3b707d56af39509e189
MD5 eabaec4b807f0b72dc2af84d2461fe45
BLAKE2b-256 0e79281c3833181747a83b14de4cf5d7560a22d745a1295ff65c759b1f5e1582

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page