Skip to main content

Automatic Narratives

Automatic Narratives is a Python module for predicting agency or communion codes from natural language text using transformer-based embeddings (RoBERTa) and ridge regression.

Features

  • Uses roberta-base to generate contextual embeddings
  • Predicts codes for either agency or communion using pretrained ridge regression models
  • Fully compatible with scikit-learn pipelines

Installation

Clone the repository and install dependencies:

from automatic_narratives import AutomaticNarratives
import pandas as pd

# Example texts
texts = pd.Series([
    "She took charge of the situation and led the team with confidence.",
    "He cared deeply for others and always made time to listen."
])

# Choose device: "cpu" or "cuda" (if available)
device = "cpu"

# Initialize predictor for agency
agency_predictor = AutomaticNarratives(rating_domain="agency", device=device)

# Predict agency scores
agency_scores = agency_predictor.predict(texts)

Metadata

Release files for automatic-narratives 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for automatic-narratives 0.0.6
File Size Uploaded Provenance
automatic_narratives-0.0.6.tar.gz 3.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for automatic-narratives 0.0.6
File Interpreter ABI Platform
automatic_narratives-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 kB

Release files / automatic_narratives-0.0.6.tar.gz

Download URL automatic_narratives-0.0.6.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5192c7da239285643e80ca27235af122956c5c83c1b45d3e68bdfa1ee4896de1
BLAKE2b-256 checksum
How to use checksums
e9679cf9b1a030f45f64a60cc796afb61815610a5fcce41f2579b3bbeae55c2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release files / automatic_narratives-0.0.6-py3-none-any.whl

Download URL automatic_narratives-0.0.6-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cfbca89b8bd2c096db6fb8c308efe27169bfd60cb82b508062d6de7b110422d
BLAKE2b-256 checksum
How to use checksums
6cee98306a68ebba6255ba9f5c2c48a335f9abf278f28484d7a4dd7be0c33eda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Security for automatic-narratives 0.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page