Skip to main content

A library for processing text features in a dataframe.

Project description

text-features

PyPi

A library for processing text features in a dataframe.

Dependencies :globe_with_meridians:

Python 3.11.6:

Raison D'être :thought_balloon:

textfeats transforms text into values that can be used by a model.

Architecture :triangular_ruler:

textfeats is a functional library, meaning that each phase of feature extraction gets put through a different function until the final output. The features its computes are as follows:

  1. Embeddings - A mean of all the embeddings from the text values in the row.
  2. Stemmer - A count of the keywords containing the stem from the text values in the row.
  3. Sentiment - A measure of the positive / negative sentiment from the text values in the row.
  4. Objectivity - A measure of the objectivity / subjectivity from the text values in the row.
  5. Count - The number of words from the text values in the row.

Installation :inbox_tray:

This is a python package hosted on pypi, so to install simply run the following command:

pip install textfeats

or install using this local repository:

python setup.py install --old-and-unmanageable

Usage example :eyes:

The use of textfeatures is entirely through code due to it being a library. It attempts to hide most of its complexity from the user, so it only has a few functions of relevance in its outward API.

Generating Features

To generate features:

import datetime

import pandas as pd

from textfeats.process import process

df = ... # Your timeseries dataframe
df = process(df, True, {"injuries"})

This will produce a dataframe that contains the new text related features.

License :memo:

The project is available under the MIT License.

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

textfeats-0.1.3.tar.gz (7.2 kB view details)

Uploaded Source

File details

Details for the file textfeats-0.1.3.tar.gz.

File metadata

  • Download URL: textfeats-0.1.3.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.6

File hashes

Hashes for textfeats-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a71105a65b0f1f0fca273228d8ec5ae6cdc228ad68f0104f1eaa52ff757c0c84
MD5 ac6e421d6d14e441bc91db542a8058d7
BLAKE2b-256 b8c24d72af3af7d34559f7e8faedfcacb342b03f8deb94a45ca5f85615aa6416

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