Skip to main content

Analysis of N-gram in a set of messages

Project description

Take NGram

TakeNGram is a tool to provide analysis of n-grams in a dataset of messages.

The recommendation usage is with the InsightExtractor Cloud CSV output.

The analysis consists in creation of a dictionary with the n-grams of all messages and their respective frequency. Besides the creation of word cloud of the n-grams.

All analysis can be made in a group of sentences of a subject (most useful with the Insight Extractor output).

Overview

Installation

The take_ngram package cab be installed from PyPI.

pip install take_ngram

Usage

For usage the file must have to be a CSV file.

All the examples are based on the Insight Extractor output.

  1. Creating a BiGram of the sentences and get the WordCloud.
from take_ngram import NGram
bigram = NGram('file.csv',
               'Structured Message')
bigram.get_word_cloud()
  1. Creating a BiGram of the sentences and saving the WordCloud.
from take_ngram import NGram
bigram = NGram('teste.csv', 
               'Structured Message')
bigram.get_word_cloud(file_path='image.png')
  1. Adding stop words
from take_ngram import NGram
bigram = NGram('file.csv', 
               'Structured Message',
                stop_words = ['segunda'])
bigram.get_word_cloud(file_path='image.png')
  1. Removing prepositions from stop words
  • By default prepositions are added to the stop words
from take_ngram import NGram
bigram = NGram('file.csv', 
               'Structured Message', 
               remove_prepositions=False)
bigram.get_word_cloud(file_path='image.png')
  1. Making n-grams for some specific subjects.
from take_ngram import NGram
bigram = NGram('file.csv', 
                'Structured Message', 
                subject_column = 'Groups', 
                subject_list = ['fatura','plano'])
bigram.get_word_cloud(file_path='image.png')

Author

Take Blip Data&Analytics Research

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

take_ngram-0.1.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

take_ngram-0.1.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file take_ngram-0.1.1.tar.gz.

File metadata

  • Download URL: take_ngram-0.1.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for take_ngram-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9e11f959e93a99d9763dcd259fa9042c27954a09576978b24cae4c6895a49442
MD5 a8c999e9a3c3c01ca0c0e1e7e0468079
BLAKE2b-256 ce55a189dd915b6437640652233c3da4a160ed3f9983c865491ecede9621a786

See more details on using hashes here.

File details

Details for the file take_ngram-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: take_ngram-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for take_ngram-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 52e41f3d60c71fb00bca0121b0b20b47c8c1dff193b4f9dd201b82928dd36251
MD5 dc7c41c5dfa0e9ae7c9ca2205d3d9b7b
BLAKE2b-256 bbdcad3073a75ab06ea11be53c36321a12683a1b40d9999011bb49ca92de7c6d

See more details on using hashes here.

Supported by

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