Identify the most distinctive words when comparing text across different groups.
Project description
Wordiff
Wordiff is designed to identify the most distinctive words when comparing text across different groups. Each word will only appear in one group's wordcloud. It generates unique word clouds for each group, enabling the exploration of the distinct words used in each group individually.
Example
In the example provided below, a DataFrame is grouped by branch, and the review column is selected to identify the differences in words used across each branch. The words are sorted (and can be analyzed), generating a list of the most frequently used words for each group. This list is then utilized to create unique word clouds for each group, in this case, for each branch.
In this example, the word cloud images will not be saved (save_jpg = False), and the threshold is manually set. It is advisable to experiment with different threshold values, and it is recommended to create a column where all stopwords are removed for more accurate results.
from wordiff import wordiff
grouped = df.groupby('Branch')['review']
sorted_words = wordiff.create_sorted_words(grouped)
wordiff.create_word_clouds(sorted_words, False, threshold=0.001)
Installation
If you have pip, you can download and install from the PyPI repository:
pip install wordiff
Version
0.0.1
License
MIT
Dependencies
This package uses:
- pandas
- wordcloud: WordCloud
- nltk: FreqDist
- sklearn.feature_extraction.text: CountVectorizer
- atplotlib.pyplot: plt
Project details
Release history Release notifications | RSS feed
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 wordiff-0.0.1.tar.gz.
File metadata
- Download URL: wordiff-0.0.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12ed23cae5d396723c0e17443eac19dbeb16a588c49ab0117cefdd7cecbdb2ba
|
|
| MD5 |
f08384ab25542378db55f099f14013cf
|
|
| BLAKE2b-256 |
0a913c375de56af5d8259a85c39e4563a02b2f29ddf3c57f9b87d82f3d268d7e
|
File details
Details for the file wordiff-0.0.1-py3-none-any.whl.
File metadata
- Download URL: wordiff-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71e37d3458f036d0347a0f6c70be8f3ebadd5de5884a5574ae58e1b5a42c67c2
|
|
| MD5 |
1157da9a1cbcd31540a69258fd3df357
|
|
| BLAKE2b-256 |
45d65691cf9f8d8b8ac8bee3d941915f8094470579a0136665e0cba304adb548
|