Skip to main content

Textagon is a powerful tool for text data analysis, providing a means to visualize parallel representations of your data and gain insight into the impact of various lexicons on two classes of text data.

Project description

Python 3.11+ License: PSF

Textagon

Textagon is a powerful tool for text data analysis, providing a means to visualize parallel representations of your data and gain insight into the impact of various lexicons on two classes of text data.

  • Parallel Representations
  • Graph-based Feature Weighting

Installation

Prereqs

Installation

  • Package versions needed (execution will stop via a check; will add requirements.txt in the future):

    • wn 0.0.23
  • For the spellchecker (which defaults to aspell):

Initial Setup

pip install textagon 

Upgrading Textagon

pip install --upgrade textagon 

Running Textagon

  1. Generate representations
import pandas as pd
from textagon.textagon import Textagon
from textagon.tGBS import tGBS

### Test cases ###

df = pd.read_csv(
    './sample_data/dvd.txt', 
    sep='\t', 
    header=None, 
    names=["classLabels", "corpus"]
)

tgon = Textagon(
    inputFile=df, 
    outputFileName="dvd"
)

tgon.RunFeatureConstruction()
tgon.RunPostFeatureConstruction()
  1. Unzip stored representations
import zipfile
import os

# Specify the path to the zip file
zip_file_path = './output/distress_representations.zip'

# Specify the directory to extract files to
extract_to_directory = './output/distress_representations'

# Ensure the directory exists
os.makedirs(extract_to_directory, exist_ok=True)

# Open the zip file
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
    # Extract all the contents
    zip_ref.extractall(extract_to_directory)

print(f"Files extracted to {extract_to_directory}")
  1. Score and rank representations with tGBS.
featuresFile = './output/distress_key.txt'
trainFile = './output/distress.csv'
weightFile = './output/distress_weights.txt'


ranker=tGBS(
	featuresFile=featuresFile,
	trainFile=trainFile,
	weightFile=weightFile
)

ranker.RankRepresentations()

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

textagon-0.3.0.tar.gz (18.7 MB view details)

Uploaded Source

Built Distribution

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

textagon-0.3.0-py3-none-any.whl (19.0 MB view details)

Uploaded Python 3

File details

Details for the file textagon-0.3.0.tar.gz.

File metadata

  • Download URL: textagon-0.3.0.tar.gz
  • Upload date:
  • Size: 18.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.9 Linux/6.11.0-21-generic

File hashes

Hashes for textagon-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b7bf18d009cbe04f5823b494ff811f1dd06a146669c76d5fb31f373f2662713c
MD5 473f17f4da7b840ed60e20cb01badc05
BLAKE2b-256 7c299854e3cc0d548739f0115eed12eb7e56d0c023846f2d8e2faa259fd6fe08

See more details on using hashes here.

File details

Details for the file textagon-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: textagon-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 19.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.9 Linux/6.11.0-21-generic

File hashes

Hashes for textagon-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b59ce2a5550aed634fb64a67a44d98c604c83e34f16aa1d212d0e40de2d64571
MD5 daebb5d58404e15142031586f6c04080
BLAKE2b-256 96acc9c6338c6a52dbc4daa2f29f3729786b5ad7fc2cb0fdbfe0fa4fe372a461

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