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):
- MacOS: brew install enchant
- Windows: pyenchant includes hunspell out of the box
- Linux: install libenchant via package manager
- For general notes, see: https://pyenchant.github.io/pyenchant/install.html
Initial Setup
pip install textagon
Upgrading Textagon
pip install --upgrade textagon
Running Textagon
- 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()
- 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}")
- 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()
Metadata
Release files for textagon 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| textagon-0.3.0.tar.gz | 18.7 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| textagon-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.6 MB
Release files / textagon-0.3.0.tar.gz
| Download URL | textagon-0.3.0.tar.gz |
|---|---|
| Size | 18.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b7bf18d009cbe04f5823b494ff811f1dd06a146669c76d5fb31f373f2662713c
|
|
BLAKE2b-256 checksum How to use checksums |
7c299854e3cc0d548739f0115eed12eb7e56d0c023846f2d8e2faa259fd6fe08
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.12.9 Linux/6.11.0-21-generic
|
Release files / textagon-0.3.0-py3-none-any.whl
| Download URL | textagon-0.3.0-py3-none-any.whl |
|---|---|
| Size | 19.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b59ce2a5550aed634fb64a67a44d98c604c83e34f16aa1d212d0e40de2d64571
|
|
BLAKE2b-256 checksum How to use checksums |
96acc9c6338c6a52dbc4daa2f29f3729786b5ad7fc2cb0fdbfe0fa4fe372a461
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.12.9 Linux/6.11.0-21-generic
|